미디어위키:Common.js: 두 판 사이의 차이

SKY's 킹샷 위키
편집 요약 없음
편집 요약 없음
 
(같은 사용자의 중간 판 9개는 보이지 않습니다)
1번째 줄: 1번째 줄:
/* =======================================
/* =======================================
   영웅 스탯 비교 계산기 구동 로직 (한글판)
   1. 마우스 오른쪽 클릭 및 단축키 방지 (스마트 예외 처리 적용)
  ======================================= */
$(document).ready(function() {
    if (typeof mw !== 'undefined' && mw.config) {
        if (mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit') {
            return;
        }
    }
 
    document.addEventListener('contextmenu', function(e) {
        e.preventDefault();
    });
 
    document.addEventListener('keydown', function(e) {
        if (e.key === 'F12' || (e.ctrlKey && e.key === 'c') || (e.ctrlKey && e.shiftKey && e.key === 'I')) {
            e.preventDefault();
        }
    });
});
 
/* =======================================
  2. 최신 GTranslate 다국어 위젯 (전 세계 40개 주요 언어)
  ======================================= */
$(document).ready(function() {
    if ($('.gtranslate_wrapper').length > 0) return; // 중복 생성 방지
 
    var gtWrapper = $('<div class="gtranslate_wrapper" style="position:fixed; bottom:20px; right:20px; z-index:9999;"></div>');
    $('body').append(gtWrapper);
 
    window.gtranslateSettings = {
        "default_language": "ko",
        "languages": [
            "ko", "en", "zh-CN", "zh-TW", "ja", "es", "fr", "de", "ru", "ar",
            "pt", "it", "vi", "th", "id", "ms", "tl", "hi", "tr", "nl",
            "pl", "uk", "ro", "hu", "cs", "sv", "el", "da", "fi", "no",
            "bg", "hr", "sk", "sr", "he", "fa", "ur", "bn", "ta", "sw"
        ],
        "wrapper_selector": ".gtranslate_wrapper",
        "switcher_horizontal_position": "right",
        "switcher_vertical_position": "bottom"
    };
 
    var script = document.createElement('script');
    script.src = "https://cdn.gtranslate.net/widgets/latest/dropdown.js";
    script.defer = true;
    document.body.appendChild(script);
});
 
/* =======================================
  3. 킹샷 영웅 스탯 비교 계산기 (다크 테마 보호 패치)
   ======================================= */
   ======================================= */
$(document).ready(function() {
$(document).ready(function() {
    // 현재 열린 페이지에 'HeroBox'가 없으면 작동하지 않음
     if ($('#HeroBox').length === 0) return;
     if ($('#HeroBox').length === 0) return;


    // 한글화된 레벨/성급 데이터
     const levelNames = [
     const levelNames = [
         "0성 (T0)","0성 (T1)","0성 (T2)","0성 (T3)","0성 (T4)","0성 (T5)",
         "0성 (T0)","0성 (T1)","0성 (T2)","0성 (T3)","0성 (T4)","0성 (T5)",
15번째 줄: 62번째 줄:
     ];
     ];


    // 한글화된 영웅 데이터 (이름 및 병종 번역)
     const heroes = [
     const heroes = [
         {"name": "올리브", "type": "궁병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/olive-avatar.webp"},
         {"name": "올리브", "type": "궁병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/olive-avatar.webp"},
         {"name": "포레스트", "type": "보병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/forrest-avatar.webp"},
         {"name": "포스터", "type": "보병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/forrest-avatar.webp"},
         {"name": "에드윈", "type": "기병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/edwin-avatar.webp"},
         {"name": "에드윈", "type": "기병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/edwin-avatar.webp"},
         {"name": "세스", "type": "보병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/seth-avatar.webp"},
         {"name": "스미스", "type": "보병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/seth-avatar.webp"},
         {"name": "다이애나", "type": "궁병", "stats": [13.88, 15.18, 16.47, 17.76, 19.05, 20.35, 22.67, 24.48, 26.29, 28.1, 29.91, 31.72, 34.98, 37.51, 40.04, 42.58, 45.11, 47.64, 52.5, 55.75, 59.29, 62.84, 66.39, 69.93, 76.32, 81.28, 86.25, 91.21, 96.18, 101.15, 110.08], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/diana-avatar-icon.webp"},
         {"name": "다이애나", "type": "궁병", "stats": [13.88, 15.18, 16.47, 17.76, 19.05, 20.35, 22.67, 24.48, 26.29, 28.1, 29.91, 31.72, 34.98, 37.51, 40.04, 42.58, 45.11, 47.64, 52.5, 55.75, 59.29, 62.84, 66.39, 69.93, 76.32, 81.28, 86.25, 91.21, 96.18, 101.15, 110.08], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/diana-avatar-icon.webp"},
         {"name": "퀸", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/quinn-avatar.webp"},
         {"name": "퀸", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/quinn-avatar.webp"},
29번째 줄: 75번째 줄:
         {"name": "아마네", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/amane-avatar.webp"},
         {"name": "아마네", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/amane-avatar.webp"},
         {"name": "연우", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/yeonwoo-avatar.webp"},
         {"name": "연우", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/yeonwoo-avatar.webp"},
         {"name": "자벨", "type": "기병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/jabel.webp"},
         {"name": "제이벨", "type": "기병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/jabel.webp"},
         {"name": "사울", "type": "궁병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/saul-kingshot.webp"},
         {"name": "살로", "type": "궁병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/saul-kingshot.webp"},
         {"name": "헬가", "type": "보병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/helga-kingshot.webp"},
         {"name": "헬가", "type": "보병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/helga-kingshot.webp"},
         {"name": "아마데우스", "type": "보병", "stats": [32.82, 35.88, 38.93, 41.99, 45.04, 48.1, 53.59, 57.87, 62.15, 66.43, 70.7, 74.98, 82.68, 88.66, 94.65, 100.64, 106.62, 112.61, 123.39, 131.78, 140.15, 148.53, 156.92, 165.3, 180.4, 192.12, 203.86, 215.6, 227.34, 239.08, 260.2], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/amadeus.webp"},
         {"name": "아마데우스", "type": "보병", "stats": [32.82, 35.88, 38.93, 41.99, 45.04, 48.1, 53.59, 57.87, 62.15, 66.43, 70.7, 74.98, 82.68, 88.66, 94.65, 100.64, 106.62, 112.61, 123.39, 131.78, 140.15, 148.53, 156.92, 165.3, 180.4, 192.12, 203.86, 215.6, 227.34, 239.08, 260.2], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/amadeus.webp"},
         {"name": "조이", "type": "보병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/zoe-gen2-kingshot.webp"},
         {"name": "조이", "type": "보병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/zoe-gen2-kingshot.webp"},
         {"name": "힐데", "type": "기병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/hilde-kingshot.webp"},
         {"name": "힐데", "type": "기병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/hilde-kingshot.webp"},
         {"name": "마를린", "type": "궁병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/marlin-kingshot.webp"},
         {"name": "마린", "type": "궁병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/marlin-kingshot.webp"},
         {"name": "에릭", "type": "보병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/eric-avatar-icon.webp"},
         {"name": "에릭", "type": "보병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/eric-avatar-icon.webp"},
         {"name": "예거", "type": "궁병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/jaeger-icon-kingshot.webp"},
         {"name": "예거", "type": "궁병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/jaeger-icon-kingshot.webp"},
         {"name": "페트라", "type": "기병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/petra-avatar-icon.webp"},
         {"name": "리틀 페라", "type": "기병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/petra-avatar-icon.webp"},
         {"name": "알카르", "type": "보병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/alcar-avatar-image.webp"},
         {"name": "알카", "type": "보병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/alcar-avatar-image.webp"},
         {"name": "로사", "type": "궁병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/rosa-avatar-image.webp"},
         {"name": "로사", "type": "궁병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/rosa-avatar-image.webp"},
         {"name": "마고", "type": "기병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/margot-avatar.webp"},
         {"name": "마르고", "type": "기병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/margot-avatar.webp"},
         {"name": "롱페이", "type": "보병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/long-fei-avatar-icon.webp"},
         {"name": "롱페이", "type": "보병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/long-fei-avatar-icon.webp"},
         {"name": "비비안", "type": "궁병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/vivian-avatar-icon.webp"},
         {"name": "비비안", "type": "궁병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/vivian-avatar-icon.webp"},
         {"name": "트루드", "type": "기병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/thrud-avatar-icon.webp"},
         {"name": "스루드", "type": "기병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/thrud-avatar-icon.webp"},
         {"name": "트리톤", "type": "보병", "stats": [68.17, 74.52, 80.86, 87.21, 93.55, 99.9, 111.32, 120.2, 129.08, 137.97, 146.85, 155.73, 171.72, 184.14, 196.58, 209.03, 221.45, 233.9, 256.28, 273.69, 291.08, 308.5, 325.91, 343.33, 374.67, 399.03, 423.41, 447.79, 472.17, 496.55, 540.43], "image": "https://kingshotcalculator.com/wp-content/uploads/2026/03/triton-avatar-icon.webp"},
         {"name": "트리톤", "type": "보병", "stats": [68.17, 74.52, 80.86, 87.21, 93.55, 99.9, 111.32, 120.2, 129.08, 137.97, 146.85, 155.73, 171.72, 184.14, 196.58, 209.03, 221.45, 233.9, 256.28, 273.69, 291.08, 308.5, 325.91, 343.33, 374.67, 399.03, 423.41, 447.79, 472.17, 496.55, 540.43], "image": "https://kingshotcalculator.com/wp-content/uploads/2026/03/triton-avatar-icon.webp"},
         {"name": "양", "type": "궁병", "stats": [68.17, 74.52, 80.86, 87.21, 93.55, 99.9, 111.32, 120.2, 129.08, 137.97, 146.85, 155.73, 171.72, 184.14, 196.58, 209.03, 221.45, 233.9, 256.28, 273.69, 291.08, 308.5, 325.91, 343.33, 374.67, 399.03, 423.41, 447.79, 472.17, 496.55, 540.43], "image": "https://kingshotcalculator.com/wp-content/uploads/2026/03/yang-avatar-icon.webp"},
         {"name": "양", "type": "궁병", "stats": [68.17, 74.52, 80.86, 87.21, 93.55, 99.9, 111.32, 120.2, 129.08, 137.97, 146.85, 155.73, 171.72, 184.14, 196.58, 209.03, 221.45, 233.9, 256.28, 273.69, 291.08, 308.5, 325.91, 343.33, 374.67, 399.03, 423.41, 447.79, 472.17, 496.55, 540.43], "image": "https://kingshotcalculator.com/wp-content/uploads/2026/03/yang-avatar-icon.webp"},
76번째 줄: 122번째 줄:
         let hasHigher = false;
         let hasHigher = false;
         heroes.forEach(function(hero, index) {
         heroes.forEach(function(hero, index) {
            // 병종(type)이 같고, 뒷 세대인 영웅만 필터링
             if(hero.type === selectedHero.type && index > hero1Index) {
             if(hero.type === selectedHero.type && index > hero1Index) {
                 $hero2Select.append('<option value="' + index + '">[' + hero.type + '] ' + hero.name + '</option>');
                 $hero2Select.append('<option value="' + index + '">[' + hero.type + '] ' + hero.name + '</option>');
107번째 줄: 152번째 줄:


         if(h2Idx === "") {
         if(h2Idx === "") {
             $resBox.show().css({'color': '#ff4444', 'border-color': '#ff4444'})
             $resBox.show().css({'border-color': '#ff4444'})
                   .html("❌ 비교할 상위 세대 영웅이 없습니다.");
                   .html("<span style='color:#ff4444 !important; font-weight:bold;'>❌ 비교할 상위 세대 영웅이 없습니다.</span>");
             return;
             return;
         }
         }
116번째 줄: 161번째 줄:
         const stat1 = hero1.stats[levelIdx];
         const stat1 = hero1.stats[levelIdx];


         let html = `<div style="font-size: 15px; margin-bottom: 15px; color: #fff;"><b>${hero1.name}</b>의 <b>${levelNames[levelIdx]}</b> 스탯은 <span style="color:#00ff00;">+${stat1}%</span> 입니다.</div>`;
         let html = `<div style="font-size: 15px; margin-bottom: 15px; color: #ffffff !important;"><b style="color: #ffffff !important;">${hero1.name}</b>의 <b style="color: #ffffff !important;">${levelNames[levelIdx]}</b> 스탯은 <span style="color:#00ff00 !important; font-weight:bold;">+${stat1}%</span> 입니다.</div>`;
         html += `<div style="font-size: 14px; color: #ffaa00; margin-bottom: 10px; border-bottom: 1px solid #555; padding-bottom: 5px; text-align: left;">⚔️ <b>${hero2.name}</b>(이)가 더 강력해지는 교체 타이밍:</div>`;
         html += `<div style="font-size: 14px; color: #ffaa00 !important; margin-bottom: 10px; border-bottom: 1px solid #555; padding-bottom: 5px; text-align: left;">⚔️ <b style="color: #ffaa00 !important;">${hero2.name}</b>(이)가 더 강력해지는 교체 타이밍:</div>`;
         html += `<ul style="text-align: left; font-size: 13px; color: #ccc; line-height: 1.8; margin-top: 10px; padding-left: 20px;">`;
         html += `<ul style="text-align: left; font-size: 13px; line-height: 1.8; margin-top: 10px; padding-left: 20px;">`;


         let found = false;
         let found = false;
         for(let i = 0; i < hero2.stats.length; i++) {
         for(let i = 0; i < hero2.stats.length; i++) {
             if(hero2.stats[i] > stat1) {
             if(hero2.stats[i] > stat1) {
                 html += `<li><b>${levelNames[i]}</b> (스탯: +${hero2.stats[i]}%)</li>`;
                 html += `<li style="color:#cccccc !important;"><b style="color:#cccccc !important;">${levelNames[i]}</b> (스탯: +${hero2.stats[i]}%)</li>`;
                 found = true;
                 found = true;
             }
             }
129번째 줄: 174번째 줄:


         if(!found) {
         if(!found) {
             html += `<li style="color:#ff4444; list-style:none; margin-left:-20px;">❌ 모든 구간에서 현재 영웅이 더 강력합니다.</li>`;
             html += `<li style="color:#ff4444 !important; list-style:none; margin-left:-20px; font-weight:bold;">❌ 모든 구간에서 현재 영웅이 더 강력합니다.</li>`;
         }
         }
          
          
135번째 줄: 180번째 줄:


         $resBox.css({
         $resBox.css({
            'color': '#d1d5db',
             'border-color': '#555',  
             'border-color': '#555',  
             'background-color': '#111',
             'background-color': '#111',
             'padding': '20px'
             'padding': '20px'
         }).html(html).show();
         }).html(html).stop().hide().slideDown(300); // 위에서 아래로 스르륵 떨어지며 등장
     }
     }



2026년 5월 21일 (목) 15:02 기준 최신판

/* =======================================
   1. 마우스 오른쪽 클릭 및 단축키 방지 (스마트 예외 처리 적용)
   ======================================= */
$(document).ready(function() {
    if (typeof mw !== 'undefined' && mw.config) {
        if (mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit') {
            return; 
        }
    }

    document.addEventListener('contextmenu', function(e) {
        e.preventDefault();
    });

    document.addEventListener('keydown', function(e) {
        if (e.key === 'F12' || (e.ctrlKey && e.key === 'c') || (e.ctrlKey && e.shiftKey && e.key === 'I')) {
            e.preventDefault();
        }
    });
});

/* =======================================
   2. 최신 GTranslate 다국어 위젯 (전 세계 40개 주요 언어)
   ======================================= */
$(document).ready(function() {
    if ($('.gtranslate_wrapper').length > 0) return; // 중복 생성 방지

    var gtWrapper = $('<div class="gtranslate_wrapper" style="position:fixed; bottom:20px; right:20px; z-index:9999;"></div>');
    $('body').append(gtWrapper);

    window.gtranslateSettings = {
        "default_language": "ko",
        "languages": [
            "ko", "en", "zh-CN", "zh-TW", "ja", "es", "fr", "de", "ru", "ar",
            "pt", "it", "vi", "th", "id", "ms", "tl", "hi", "tr", "nl",
            "pl", "uk", "ro", "hu", "cs", "sv", "el", "da", "fi", "no",
            "bg", "hr", "sk", "sr", "he", "fa", "ur", "bn", "ta", "sw"
        ],
        "wrapper_selector": ".gtranslate_wrapper",
        "switcher_horizontal_position": "right",
        "switcher_vertical_position": "bottom"
    };

    var script = document.createElement('script');
    script.src = "https://cdn.gtranslate.net/widgets/latest/dropdown.js";
    script.defer = true;
    document.body.appendChild(script);
});

/* =======================================
   3. 킹샷 영웅 스탯 비교 계산기 (다크 테마 보호 패치)
   ======================================= */
$(document).ready(function() {
    if ($('#HeroBox').length === 0) return;

    const levelNames = [
        "0성 (T0)","0성 (T1)","0성 (T2)","0성 (T3)","0성 (T4)","0성 (T5)",
        "1성 (T0)","1성 (T1)","1성 (T2)","1성 (T3)","1성 (T4)","1성 (T5)",
        "2성 (T0)","2성 (T1)","2성 (T2)","2성 (T3)","2성 (T4)","2성 (T5)",
        "3성 (T0)","3성 (T1)","3성 (T2)","3성 (T3)","3성 (T4)","3성 (T5)",
        "4성 (T0)","4성 (T1)","4성 (T2)","4성 (T3)","4성 (T4)","4성 (T5)","최대 레벨(Max)"
    ];

    const heroes = [
        {"name": "올리브", "type": "궁병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/olive-avatar.webp"},
        {"name": "포스터", "type": "보병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/forrest-avatar.webp"},
        {"name": "에드윈", "type": "기병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/edwin-avatar.webp"},
        {"name": "스미스", "type": "보병", "stats": [11.36, 12.42, 13.47, 14.53, 15.59, 16.65, 18.55, 20.03, 21.51, 22.99, 24.47, 25.95, 28.62, 30.69, 32.76, 34.83, 36.9, 38.98, 42.71, 45.61, 48.51, 51.41, 54.31, 57.22, 62.44, 66.5, 70.56, 74.63, 78.69, 82.75, 90.07], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/seth-avatar.webp"},
        {"name": "다이애나", "type": "궁병", "stats": [13.88, 15.18, 16.47, 17.76, 19.05, 20.35, 22.67, 24.48, 26.29, 28.1, 29.91, 31.72, 34.98, 37.51, 40.04, 42.58, 45.11, 47.64, 52.5, 55.75, 59.29, 62.84, 66.39, 69.93, 76.32, 81.28, 86.25, 91.21, 96.18, 101.15, 110.08], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/diana-avatar-icon.webp"},
        {"name": "퀸", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/quinn-avatar.webp"},
        {"name": "첸코", "type": "기병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/chenko-avatar.webp"},
        {"name": "하워드", "type": "보병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/howard-avatar.webp"},
        {"name": "고든", "type": "기병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/gordon-avatar.webp"},
        {"name": "파드", "type": "기병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/fahd-avatar.webp"},
        {"name": "아마네", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/amane-avatar.webp"},
        {"name": "연우", "type": "궁병", "stats": [17.76, 19.32, 20.96, 22.61, 24.25, 25.9, 28.86, 31.16, 33.46, 35.77, 38.07, 40.37, 44.52, 47.74, 50.96, 54.19, 57.41, 60.64, 66.44, 70.95, 75.46, 79.98, 84.49, 89.01, 97.13, 103.45, 109.77, 116.09, 122.41, 128.73, 140.11], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/yeonwoo-avatar.webp"},
        {"name": "제이벨", "type": "기병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/jabel.webp"},
        {"name": "살로", "type": "궁병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/saul-kingshot.webp"},
        {"name": "헬가", "type": "보병", "stats": [25.25, 27.6, 29.95, 32.3, 34.65, 37, 41.23, 44.52, 47.81, 51.1, 54.39, 57.68, 63.6, 68.2, 72.81, 77.42, 82.02, 86.63, 94.92, 101.37, 107.81, 114.26, 120.71, 127.16, 138.77, 147.79, 156.82, 165.85, 174.88, 183.91, 200.16], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/helga-kingshot.webp"},
        {"name": "아마데우스", "type": "보병", "stats": [32.82, 35.88, 38.93, 41.99, 45.04, 48.1, 53.59, 57.87, 62.15, 66.43, 70.7, 74.98, 82.68, 88.66, 94.65, 100.64, 106.62, 112.61, 123.39, 131.78, 140.15, 148.53, 156.92, 165.3, 180.4, 192.12, 203.86, 215.6, 227.34, 239.08, 260.2], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/amadeus.webp"},
        {"name": "조이", "type": "보병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/zoe-gen2-kingshot.webp"},
        {"name": "힐데", "type": "기병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/hilde-kingshot.webp"},
        {"name": "마린", "type": "궁병", "stats": [30.3, 33.12, 35.94, 38.76, 41.58, 44.4, 49.47, 53.42, 57.37, 61.32, 65.26, 69.21, 76.32, 81.84, 87.37, 92.9, 98.42, 103.95, 113.9, 121.64, 129.37, 137.11, 144.85, 152.59, 166.52, 177.34, 188.18, 192.02, 209.85, 220.69, 240.1], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/marlin-kingshot.webp"},
        {"name": "에릭", "type": "보병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/eric-avatar-icon.webp"},
        {"name": "예거", "type": "궁병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/jaeger-icon-kingshot.webp"},
        {"name": "리틀 페라", "type": "기병", "stats": [36.61, 40.02, 43.42, 46.83, 50.24, 53.65, 59.78, 64.55, 69.32, 74.09, 78.86, 83.63, 92.22, 98.89, 105.57, 112.25, 118.92, 125.61, 137.63, 146.98, 156.32, 165.67, 175.02, 184.38, 201.21, 214.29, 227.38, 240.48, 253.57, 266.66, 290.23], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/07/petra-avatar-icon.webp"},
        {"name": "알카", "type": "보병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/alcar-avatar-image.webp"},
        {"name": "로사", "type": "궁병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/rosa-avatar-image.webp"},
        {"name": "마르고", "type": "기병", "stats": [46.71, 51.06, 55.4, 59.75, 64.1, 68.45, 76.27, 82.36, 88.44, 94.53, 100.62, 106.7, 117.66, 126.17, 134.69, 143.22, 151.73, 160.26, 175.6, 187.53, 199.44, 211.38, 223.31, 235.24, 256.72, 273.41, 290.11, 306.82, 323.52, 340.23, 370.29], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/09/margot-avatar.webp"},
        {"name": "롱페이", "type": "보병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/long-fei-avatar-icon.webp"},
        {"name": "비비안", "type": "궁병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/vivian-avatar-icon.webp"},
        {"name": "스루드", "type": "기병", "stats": [56.05, 61.27, 66.48, 71.7, 76.92, 82.14, 91.53, 98.83, 106.13, 113.44, 120.74, 128.04, 141.19, 151.4, 161.63, 171.87, 182.08, 192.31, 210.72, 225.04, 239.33, 253.65, 267.97, 282.29, 308.06, 328.09, 348.14, 368.18, 388.23, 408.28, 444.35], "image": "https://kingshotcalculator.com/wp-content/uploads/2025/12/thrud-avatar-icon.webp"},
        {"name": "트리톤", "type": "보병", "stats": [68.17, 74.52, 80.86, 87.21, 93.55, 99.9, 111.32, 120.2, 129.08, 137.97, 146.85, 155.73, 171.72, 184.14, 196.58, 209.03, 221.45, 233.9, 256.28, 273.69, 291.08, 308.5, 325.91, 343.33, 374.67, 399.03, 423.41, 447.79, 472.17, 496.55, 540.43], "image": "https://kingshotcalculator.com/wp-content/uploads/2026/03/triton-avatar-icon.webp"},
        {"name": "양", "type": "궁병", "stats": [68.17, 74.52, 80.86, 87.21, 93.55, 99.9, 111.32, 120.2, 129.08, 137.97, 146.85, 155.73, 171.72, 184.14, 196.58, 209.03, 221.45, 233.9, 256.28, 273.69, 291.08, 308.5, 325.91, 343.33, 374.67, 399.03, 423.41, 447.79, 472.17, 496.55, 540.43], "image": "https://kingshotcalculator.com/wp-content/uploads/2026/03/yang-avatar-icon.webp"},
        {"name": "소피아", "type": "기병", "stats": [68.17, 74.52, 80.86, 87.21, 93.55, 99.9, 111.32, 120.2, 129.08, 137.97, 146.85, 155.73, 171.72, 184.14, 196.58, 209.03, 221.45, 233.9, 256.28, 273.69, 291.08, 308.5, 325.91, 343.33, 374.67, 399.03, 423.41, 447.79, 472.17, 496.55, 540.43], "image": "https://kingshotcalculator.com/wp-content/uploads/2026/03/sophia-avatar-icon.webp"}
    ];

    function populateDropdowns() {
        const $levelSelect = $('#levelSelect');
        const $hero1Select = $('#hero1Select');
        
        levelNames.forEach(function(name, index) {
            $levelSelect.append('<option value="' + index + '">' + name + '</option>');
        });
        $levelSelect.val(30);

        heroes.forEach(function(hero, index) {
            $hero1Select.append('<option value="' + index + '">[' + hero.type + '] ' + hero.name + '</option>');
        });

        updateHero1Selection();
    }

    function updateHero1Selection() {
        const hero1Index = parseInt($('#hero1Select').val(), 10);
        const $hero2Select = $('#hero2Select');
        const selectedHero = heroes[hero1Index];
        
        $('#hero1Image').attr('src', selectedHero.image);
        $hero2Select.empty();
        
        let hasHigher = false;
        heroes.forEach(function(hero, index) {
            if(hero.type === selectedHero.type && index > hero1Index) {
                $hero2Select.append('<option value="' + index + '">[' + hero.type + '] ' + hero.name + '</option>');
                hasHigher = true;
            }
        });

        if(!hasHigher) {
            $hero2Select.append('<option value="">상위 영웅 없음</option>');
            $('#hero2Image').attr('src', 'https://via.placeholder.com/80/333333/ffffff?text=None');
        } else {
            updateHeroImage('hero2');
        }
    }

    function updateHeroImage(type) {
        if(type === 'hero2') {
            const h2Index = $('#hero2Select').val();
            if(h2Index !== "") {
                $('#hero2Image').attr('src', heroes[h2Index].image);
            }
        }
    }

    function compareHeroes() {
        const levelIdx = parseInt($('#levelSelect').val(), 10);
        const h1Idx = parseInt($('#hero1Select').val(), 10);
        const h2Idx = $('#hero2Select').val();
        const $resBox = $('#results');

        if(h2Idx === "") {
            $resBox.show().css({'border-color': '#ff4444'})
                   .html("<span style='color:#ff4444 !important; font-weight:bold;'>❌ 비교할 상위 세대 영웅이 없습니다.</span>");
            return;
        }

        const hero1 = heroes[h1Idx];
        const hero2 = heroes[h2Idx];
        const stat1 = hero1.stats[levelIdx];

        let html = `<div style="font-size: 15px; margin-bottom: 15px; color: #ffffff !important;"><b style="color: #ffffff !important;">${hero1.name}</b>의 <b style="color: #ffffff !important;">${levelNames[levelIdx]}</b> 스탯은 <span style="color:#00ff00 !important; font-weight:bold;">+${stat1}%</span> 입니다.</div>`;
        html += `<div style="font-size: 14px; color: #ffaa00 !important; margin-bottom: 10px; border-bottom: 1px solid #555; padding-bottom: 5px; text-align: left;">⚔️ <b style="color: #ffaa00 !important;">${hero2.name}</b>(이)가 더 강력해지는 교체 타이밍:</div>`;
        html += `<ul style="text-align: left; font-size: 13px; line-height: 1.8; margin-top: 10px; padding-left: 20px;">`;

        let found = false;
        for(let i = 0; i < hero2.stats.length; i++) {
            if(hero2.stats[i] > stat1) {
                html += `<li style="color:#cccccc !important;"><b style="color:#cccccc !important;">${levelNames[i]}</b> (스탯: +${hero2.stats[i]}%)</li>`;
                found = true;
            }
        }

        if(!found) {
            html += `<li style="color:#ff4444 !important; list-style:none; margin-left:-20px; font-weight:bold;">❌ 모든 구간에서 현재 영웅이 더 강력합니다.</li>`;
        }
        
        html += `</ul>`;

        $resBox.css({
            'border-color': '#555', 
            'background-color': '#111',
            'padding': '20px'
        }).html(html).stop().hide().slideDown(300); // 위에서 아래로 스르륵 떨어지며 등장
    }

    $('#hero1Select').on('change', updateHero1Selection);
    $('#hero2Select').on('change', function() { updateHeroImage('hero2'); });
    $('#runCalcBtn').on('click', compareHeroes);

    populateDropdowns();
});