영웅 통계 비교 계산기: 두 판 사이의 차이
SKY's Kingshot
편집 요약 없음 |
편집 요약 없음 |
||
| 1번째 줄: | 1번째 줄: | ||
<html> | <html> | ||
< | <style> | ||
#HeroBox { max-width: 600px; margin: 30px auto; padding: 20px; background: #1a1a1d; border-radius: 10px; border: 2px solid #FF8C00; box-shadow: 0 10px 30px rgba(0,0,0,0.5); font-family: 'Segoe UI', sans-serif; font-size: 14px; box-sizing: border-box; color: #d1d5db; } | |||
#HeroBox h3 { text-align: center; margin-bottom: 20px; font-size: 20px; color: #FF8C00; font-weight: 900; } | |||
.level-selection-container { display: flex; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; } | |||
.level-selection-container .form-group { flex: 0 1 auto; width: auto; } | |||
.hero-selection-container { display: flex; justify-content: space-around; margin-bottom: 20px; flex-wrap: wrap; background: #121215; padding: 15px; border-radius: 8px; border: 1px solid #333; } | |||
.form-group { margin-bottom: 15px; text-align: center; } | |||
.form-group label { display: block; font-weight: bold; margin-bottom: 8px; color: #ccc; } | |||
.form-group select { width: 100%; padding: 8px; font-size: 14px; border-radius: 4px; border: 1px solid #555; background: #222; color: #fff; text-align: center; } | |||
.hero-selection-container .hero-display { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 150px; max-width: 45%; box-sizing: border-box; padding: 0 10px; } | |||
.hero-image { width: 80px; height: 80px; margin-top: 10px; border-radius: 8px; object-fit: cover; border: 2px solid #555; background: #000; } | |||
.calc-btn { width: 100%; padding: 12px; font-size: 16px; background: #FF8C00; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; transition: all 0.3s ease; } | |||
.calc-btn:hover { background: #ffaa00; box-shadow: 0 0 15px rgba(255,140,0,0.4); } | |||
#message { text-align: center; margin-top: 10px; font-size: 13px; color: #999; } | |||
#results { margin-top: 20px; font-size: 16px; font-weight: bold; color: #fff; text-align: center; padding: 15px; border: 1px dashed #FF8C00; border-radius: 5px; background-color: rgba(255, 140, 0, 0.1); display: none; } | |||
</style> | |||
<div id="HeroBox"> | |||
<h3>⚔️ 킹샷 영웅 스탯 정밀 비교기</h3> | |||
<div class="level-selection-container"> | |||
<div class="form-group"> | |||
<label for="levelSelect">⭐ 비교할 기준 성급/티어 선택:</label> | |||
<select id="levelSelect"></select> | |||
</div> | |||
</div> | |||
<div class="hero-selection-container"> | |||
<div class="form-group hero-display"> | |||
<label for="hero1Select">🛡️ 현재 사용 중인 영웅:</label> | |||
<select id="hero1Select" onchange="updateHero1Selection()"></select> | |||
<img id="hero1Image" src="https://via.placeholder.com/80/333333/ffffff?text=Hero+1" alt="Your Hero" class="hero-image"> | |||
</div> | |||
<div class="form-group hero-display"> | |||
<label for="hero2Select">⚔️ 교체 후보 영웅:</label> | |||
<select id="hero2Select" onchange="updateHeroImage('hero2')"></select> | |||
<img id="hero2Image" src="https://via.placeholder.com/80/333333/ffffff?text=Hero+2" alt="Compare Hero" class="hero-image"> | |||
</div> | </div> | ||
</div> | |||
<button class="calc-btn" onclick="compareHeroes()">영웅 교체 효율 분석하기</button> | |||
<p id="message">위 스탯은 기본 위력을 기준으로 하며, 위젯이나 장비는 별도 계산입니다.</p> | |||
<div id="results"></div> | |||
</div> | </div> | ||
<script> | <script> | ||
function | // 1. 레벨(성급/티어) 목록 정의 | ||
const levelNames = [ | |||
'0-Star (T0)', '1-Star (T0)', '2-Star (T0)', '3-Star (T0)', '4-Star (T0)', | |||
'1-Star (T1)', '2-Star (T1)', '3-Star (T1)', '4-Star (T1)', | |||
'1-Star (T2)', '2-Star (T2)', '3-Star (T2)', '4-Star (T2)', | |||
'1-Star (T3)', '2-Star (T3)', '3-Star (T3)', '4-Star (T3)', | |||
'1-Star (T4)', '2-Star (T4)', '3-Star (T4)', '4-Star (T4)', | |||
'1-Star (T5)', '2-Star (T5)', '3-Star (T5)', '4-Star (T5)', '5-Star (T5)' | |||
]; | |||
// 2. 영웅 데이터베이스 (암호화 해제됨 - 천화님이 원하시는 수치를 직접 기입하시면 됩니다) | |||
// stats 배열의 순서는 위 levelNames의 순서와 1:1로 일치합니다. | |||
const heroes = [ | |||
{ | |||
name: "1세대: 로사 (Rosa)", | |||
type: "Infantry", | |||
stats: [1000, 1200, 1500, 1800, 2200, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 11000, 12000, 13000, 14000, 15000], | |||
image: "https://via.placeholder.com/80/ff5e00/ffffff?text=Rosa" | |||
}, | |||
{ | |||
name: "2세대: 헬가 (Helga)", | |||
type: "Infantry", | |||
stats: [1500, 1800, 2250, 2700, 3300, 3750, 4500, 5250, 6000, 6750, 7500, 8250, 9000, 9750, 10500, 11250, 12000, 12750, 13500, 14250, 15000, 16500, 18000, 19500, 21000, 22500], | |||
image: "https://via.placeholder.com/80/0073aa/ffffff?text=Helga" | |||
}, | |||
{ | |||
name: "3세대: 아마네 (Amane)", | |||
type: "Cavalry", | |||
stats: [2250, 2700, 3375, 4050, 4950, 5625, 6750, 7875, 9000, 10125, 11250, 12375, 13500, 14625, 15750, 16875, 18000, 19125, 20250, 21375, 22500, 24750, 27000, 29250, 31500, 33750], | |||
image: "https://via.placeholder.com/80/28a745/ffffff?text=Amane" | |||
} | |||
]; | |||
// 3. 드롭다운 메뉴 초기화 세팅 | |||
function populateDropdowns() { | |||
const levelSelect = document.getElementById('levelSelect'); | |||
const hero1Select = document.getElementById('hero1Select'); | |||
// 레벨 추가 | |||
levelNames.forEach((name, index) => { | |||
levelSelect.innerHTML += `<option value="${index}">${name}</option>`; | |||
}); | |||
// 기본으로 4-Star (T5) 정도를 선택 상태로 두기 | |||
levelSelect.selectedIndex = 24; | |||
// 내 영웅 추가 | |||
heroes.forEach((hero, index) => { | |||
hero1Select.innerHTML += `<option value="${index}">${hero.name}</option>`; | |||
}); | |||
updateHero1Selection(); // 비교 영웅 드롭다운 연동 | |||
} | |||
// 4. 내 영웅 선택 시, 비교 영웅 목록 업데이트 및 이미지 변경 | |||
function updateHero1Selection() { | |||
const hero1Index = document.getElementById('hero1Select').value; | |||
const hero2Select = document.getElementById('hero2Select'); | |||
const selectedHero = heroes[hero1Index]; | |||
// | // 내 영웅 이미지 업데이트 | ||
document.getElementById('hero1Image').src = selectedHero.image; | |||
// 비교 영웅 드롭다운 초기화 | |||
hero2Select.innerHTML = ''; | |||
// 내 영웅과 같은 타입(보병, 기병 등)이면서 세대가 더 높은 영웅만 필터링해서 보여줌 | |||
heroes.forEach((hero, index) => { | |||
if(hero.type === selectedHero.type && index > hero1Index) { | |||
hero2Select.innerHTML += `<option value="${index}">${hero.name}</option>`; | |||
} | |||
}); | |||
if(hero2Select.options.length === 0) { | |||
hero2Select.innerHTML = `<option value="">상위 영웅 없음</option>`; | |||
document.getElementById('hero2Image').src = "https://via.placeholder.com/80/333333/ffffff?text=None"; | |||
} else { | |||
updateHeroImage('hero2'); | |||
} | |||
} | |||
// 5. 교체 영웅 이미지 업데이트 | |||
function updateHeroImage(type) { | |||
if(type === 'hero2') { | |||
const h2Index = document.getElementById('hero2Select').value; | |||
if(h2Index !== "") { | |||
document.getElementById('hero2Image').src = heroes[h2Index].image; | |||
} | |||
} | |||
} | |||
// 6. 🚀 대망의 비교 로직 | |||
function compareHeroes() { | |||
const levelIdx = document.getElementById('levelSelect').value; | |||
const h1Idx = document.getElementById('hero1Select').value; | |||
const h2Idx = document.getElementById('hero2Select').value; | |||
const resBox = document.getElementById('results'); | |||
if(h2Idx === "") { | |||
resBox.style.display = "block"; | |||
resBox.style.color = "#ff4444"; | |||
resBox.style.borderColor = "#ff4444"; | |||
resBox.innerHTML = "❌ 비교할 상위 영웅이 없습니다."; | |||
return; | |||
} | |||
const stat1 = heroes[h1Idx].stats[levelIdx]; | |||
const stat2 = heroes[h2Idx].stats[levelIdx]; | |||
resBox.style.display = "block"; | resBox.style.display = "block"; | ||
if ( | if(stat2 > stat1) { | ||
const diff = Math.round((stat2 / stat1 - 1) * 100); | |||
resBox.style.color = "#00ff00"; | resBox.style.color = "#00ff00"; | ||
resBox.style. | resBox.style.borderColor = "#00ff00"; | ||
resBox.innerHTML = | resBox.innerHTML = `✅ 교체를 강력히 추천합니다! <br> (효율 ${diff}% 상승)<br><span style='font-size:13px; color:#aaa;'>현재: ${stat1} vs 교체: ${stat2}</span>`; | ||
} else { | } else { | ||
resBox.style.color = "#ff4444"; | resBox.style.color = "#ff4444"; | ||
resBox.style. | resBox.style.borderColor = "#ff4444"; | ||
resBox.innerHTML = | resBox.innerHTML = `❌ 아직 교체할 타이밍이 아닙니다. <br><span style='font-size:13px; color:#aaa;'>현재: ${stat1} vs 교체: ${stat2}</span>`; | ||
} | } | ||
} | } | ||
// 스크립트 실행 | |||
window.onload = populateDropdowns; | |||
</script> | </script> | ||
</html> | </html> | ||
2026년 5월 16일 (토) 23:01 판
⚔️ 킹샷 영웅 스탯 정밀 비교기
위 스탯은 기본 위력을 기준으로 하며, 위젯이나 장비는 별도 계산입니다.
