미디어위키:Common.js: 두 판 사이의 차이
SKY's Kingshot
편집 요약 없음 |
편집 요약 없음 |
||
| 36번째 줄: | 36번째 줄: | ||
pageLanguage: 'ko', | pageLanguage: 'ko', | ||
// 🔥 글로벌 게임 킹샷에 맞춘 30개국 주요 언어 리스트 | // 🔥 글로벌 게임 킹샷에 맞춘 30개국 주요 언어 리스트 | ||
includedLanguages: 'ko,en,zh-CN,zh-TW,ja,vi,ru,es,fr,de,th,id,ar,pt,tr,it,nl,pl,ms,tl,hi,uk,ro,hu,cs,sv,el,da,fi,no', | includedLanguages: 'ko,en,zh-CN,zh-TW,ja,vi,ru,es,fr,de,th,id,ar,pt,tr,it,nl,pl,ms,tl,hi,uk,ro,hu,cs,sv,el,da,fi,no', | ||
layout: google.translate.TranslateElement.InlineLayout.SIMPLE, | layout: google.translate.TranslateElement.InlineLayout.SIMPLE, | ||
| 136번째 줄: | 135번째 줄: | ||
} | } | ||
// 🔥 리스트 출력 방식으로 교체된 계산 로직 🔥 | |||
function compareHeroes() { | function compareHeroes() { | ||
const levelIdx = parseInt($('#levelSelect').val(), 10); | const levelIdx = parseInt($('#levelSelect').val(), 10); | ||
| 148번째 줄: | 148번째 줄: | ||
} | } | ||
const | const hero1 = heroes[h1Idx]; | ||
const | const hero2 = heroes[h2Idx]; | ||
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>`; | ||
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 += `<ul style="text-align: left; font-size: 13px; color: #ccc; line-height: 1.8; margin-top: 10px; padding-left: 20px;">`; | |||
let found = false; | |||
// 교체할 영웅의 0레벨부터 Max레벨까지 쭉 돌면서 내 영웅 스탯보다 높은 구간만 뽑아냅니다. | |||
for(let i = 0; i < hero2.stats.length; i++) { | |||
if(hero2.stats[i] > stat1) { | |||
} | html += `<li><b>${levelNames[i]}</b> (스탯: +${hero2.stats[i]}%)</li>`; | ||
found = true; | |||
} | |||
} | |||
if(!found) { | |||
html += `<li style="color:#ff4444; list-style:none; margin-left:-20px;">❌ 모든 구간에서 현재 영웅이 더 강력합니다.</li>`; | |||
} | } | ||
html += `</ul>`; | |||
// 결과창 스타일 업데이트 및 출력 | |||
$resBox.css({ | |||
'color': '#d1d5db', | |||
'border-color': '#555', | |||
'background-color': '#111', | |||
'padding': '20px' | |||
}).html(html).show(); | |||
} | } | ||
2026년 5월 16일 (토) 23:39 판
/* =======================================
항상 떠 있는(플로팅) 구글 자동 번역기 (언어 확장판)
======================================= */
$(document).ready(function() {
// 중복 생성 방지
if(document.getElementById('google_translate_element')) return;
// 1. 번역기를 담을 박스 생성
var translateDiv = document.createElement('div');
translateDiv.id = 'google_translate_element';
// 2. CSS 스타일 (화면 우측 하단 고정, 게이밍 디자인)
translateDiv.style.position = 'fixed';
translateDiv.style.bottom = '20px';
translateDiv.style.right = '20px';
translateDiv.style.zIndex = '9999';
translateDiv.style.backgroundColor = '#121215';
translateDiv.style.border = '2px solid #FF8C00';
translateDiv.style.borderRadius = '8px';
translateDiv.style.padding = '5px 10px';
translateDiv.style.boxShadow = '0 0 15px rgba(255,140,0,0.4)';
// 3. 화면에 추가
document.body.appendChild(translateDiv);
// 4. 구글 번역 스크립트 불러오기
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';
document.head.appendChild(script);
});
// 5. 구글 번역기 실행 함수 (언어 대폭 추가)
window.googleTranslateElementInit = function() {
new google.translate.TranslateElement({
pageLanguage: 'ko',
// 🔥 글로벌 게임 킹샷에 맞춘 30개국 주요 언어 리스트
includedLanguages: 'ko,en,zh-CN,zh-TW,ja,vi,ru,es,fr,de,th,id,ar,pt,tr,it,nl,pl,ms,tl,hi,uk,ro,hu,cs,sv,el,da,fi,no',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
autoDisplay: false
}, 'google_translate_element');
};
/* =======================================
영웅 스탯 비교 계산기 구동 로직
======================================= */
$(document).ready(function() {
// 현재 열린 페이지에 'HeroBox'가 없으면 작동하지 않음 (다른 문서 속도 저하 방지)
if ($('#HeroBox').length === 0) return;
// 천화님이 추출하신 레벨 및 영웅 데이터
const levelNames = ["0-Star (T0)","0-Star (T1)","0-Star (T2)","0-Star (T3)","0-Star (T4)","0-Star (T5)","1-Star (T0)","1-Star (T1)","1-Star (T2)","1-Star (T3)","1-Star (T4)","1-Star (T5)","2-Star (T0)","2-Star (T1)","2-Star (T2)","2-Star (T3)","2-Star (T4)","2-Star (T5)","3-Star (T0)","3-Star (T1)","3-Star (T2)","3-Star (T3)","3-Star (T4)","3-Star (T5)","4-Star (T0)","4-Star (T1)","4-Star (T2)","4-Star (T3)","4-Star (T4)","4-Star (T5)","Max"];
const heroes = [
{"name": "Olive", "type": "Archer", "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": "Forrest", "type": "Infantry", "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": "Edwin", "type": "Cavalry", "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": "Seth", "type": "Infantry", "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": "Diana", "type": "Archer", "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": "Quinn", "type": "Archer", "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": "Chenko", "type": "Cavalry", "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": "Howard", "type": "Infantry", "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": "Gordon", "type": "Cavalry", "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": "Fahd", "type": "Cavalry", "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": "Amane", "type": "Archer", "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": "Yeonwoo", "type": "Archer", "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": "Jabel", "type": "Cavalry", "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": "Saul", "type": "Archer", "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": "Helga", "type": "Infantry", "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": "Amadeus", "type": "Infantry", "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": "Zoe", "type": "Infantry", "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": "Hilde", "type": "Cavalry", "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": "Marlin", "type": "Archer", "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": "Eric", "type": "Infantry", "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": "Jaeger", "type": "Archer", "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": "Petra", "type": "Cavalry", "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": "Alcar", "type": "Infantry", "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": "Rosa", "type": "Archer", "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": "Margot", "type": "Cavalry", "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": "Long Fei", "type": "Infantry", "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": "Vivian", "type": "Archer", "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": "Thrud", "type": "Cavalry", "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": "Triton", "type": "Infantry", "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": "Yang", "type": "Archer", "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": "Sophia", "type": "Cavalry", "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.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.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({'color': '#ff4444', 'border-color': '#ff4444'})
.html("❌ 비교할 상위 세대 영웅이 없습니다.");
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: #fff;"><b>${hero1.name}</b>의 <b>${levelNames[levelIdx]}</b> 스탯은 <span style="color:#00ff00;">+${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 += `<ul style="text-align: left; font-size: 13px; color: #ccc; line-height: 1.8; margin-top: 10px; padding-left: 20px;">`;
let found = false;
// 교체할 영웅의 0레벨부터 Max레벨까지 쭉 돌면서 내 영웅 스탯보다 높은 구간만 뽑아냅니다.
for(let i = 0; i < hero2.stats.length; i++) {
if(hero2.stats[i] > stat1) {
html += `<li><b>${levelNames[i]}</b> (스탯: +${hero2.stats[i]}%)</li>`;
found = true;
}
}
if(!found) {
html += `<li style="color:#ff4444; list-style:none; margin-left:-20px;">❌ 모든 구간에서 현재 영웅이 더 강력합니다.</li>`;
}
html += `</ul>`;
// 결과창 스타일 업데이트 및 출력
$resBox.css({
'color': '#d1d5db',
'border-color': '#555',
'background-color': '#111',
'padding': '20px'
}).html(html).show();
}
// jQuery를 이용해 시스템 레이어에서 이벤트를 안전하게 연결합니다.
$('#hero1Select').on('change', updateHero1Selection);
$('#hero2Select').on('change', function() { updateHeroImage('hero2'); });
$('#runCalcBtn').on('click', compareHeroes);
// 구동 시작
populateDropdowns();
});
