7 895
edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 1: | Linha 1: | ||
<!DOCTYPE html> | <!DOCTYPE html> | ||
<html lang="pt-BR"> | <html lang="pt-BR"> | ||
Linha 6: | Linha 5: | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Seleção de Hunts</title> | <title>Seleção de Hunts</title> | ||
<style> | <style> | ||
/* Estilos anteriores mantidos */ | |||
.borda-container { | .borda-container { | ||
display: flex; | display: flex; | ||
Linha 110: | Linha 110: | ||
pointer-events: none; | pointer-events: none; | ||
} | } | ||
.switch-container { | .switch-container { | ||
display: flex; | display: flex; | ||
Linha 138: | Linha 138: | ||
} | } | ||
.switch-button { | .switch-button { | ||
background-color: #f1f1f1; | |||
border: 1px solid #ccc; | |||
padding: 10px; | |||
border-radius: 5px; | |||
cursor: pointer; | |||
display: inline-flex; | |||
align-items: center; | |||
gap: 5px; | |||
} | } | ||
.switch-button.active { | .switch-button.active { | ||
background-color: #d586e1; | |||
border-color: #9d4cea; | |||
color: #050000; | |||
font-weight: bolder; | |||
} | } | ||
</style> | </style> | ||
</head> | </head> | ||
Linha 165: | Linha 165: | ||
<option value="NW">NW</option> | <option value="NW">NW</option> | ||
</select> | </select> | ||
</div> | </div> | ||
<div class="input-group"> | |||
<div class="input-group"> | |||
<label><b>Mostrar Hunts Neutras:</b></label> | |||
<div class="switch-button" id="toggleNeutro"> | |||
<span>Desativado</span> | |||
</div> | </div> | ||
</div> | |||
<div class="input-group"> | <div class="input-group"> | ||
<label for="difficulty"><b>Dificuldade:</b></label> | <label for="difficulty"><b>Dificuldade:</b></label> | ||
Linha 205: | Linha 207: | ||
<script> | <script> | ||
const hunts = { | const hunts = { | ||
"NW": [ | "NW": [ | ||
{ name: "Grimer", difficulty: "Baixa", local: "Cinnabar", classes: ["Orebound", "Psycraft"], imageUrl: "https://wiki.pokexgames.com/images/e/ee/Banner_Hunts_-_NW_Grimer.png", hasType: true, huntTypes: ["Poison"], huntTipo: "Elemental", link: "https://wiki.pokexgames.com/index.php/Cosmic_Quest_-_Boss_Solrock" }, | { name: "Grimer", difficulty: "Baixa", local: "Cinnabar", classes: ["Orebound", "Psycraft"], imageUrl: "https://wiki.pokexgames.com/images/e/ee/Banner_Hunts_-_NW_Grimer.png", hasType: true, huntTypes: ["Poison"], huntTipo: "Elemental", link: "https://wiki.pokexgames.com/index.php/Cosmic_Quest_-_Boss_Solrock" }, | ||
Linha 225: | Linha 227: | ||
}; | }; | ||
const typeIcons = { | const typeIcons = { | ||
"Steel": "https://wiki.pokexgames.com/images/c/c9/Steel.png", | |||
"Dragon": "https://wiki.pokexgames.com/images/c/c7/Dragon.png", | |||
"Fairy": "https://wiki.pokexgames.com/images/4/43/Fairy.png", | |||
"Psychic": "https://wiki.pokexgames.com/images/2/21/Psychic.png", | |||
"Fighting": "https://wiki.pokexgames.com/images/3/30/Fighting.png", | |||
"Ice": "https://wiki.pokexgames.com/images/7/77/Ice.png", | |||
"Fire": "https://wiki.pokexgames.com/images/3/30/Fire.png", | |||
"Rock": "https://wiki.pokexgames.com/images/0/0b/Rock.png", | |||
"Ground": "https://wiki.pokexgames.com/images/8/8f/Ground.png", | |||
"Poison": "https://wiki.pokexgames.com/images/0/03/Poison1.png", | |||
"Electric": "https://wiki.pokexgames.com/images/2/2f/Electric.png", | |||
"Water": "https://wiki.pokexgames.com/images/9/9d/Water.png", | |||
"Bug": "https://wiki.pokexgames.com/images/7/7d/Bug.png", | |||
"Grass": "https://wiki.pokexgames.com/images/c/c5/Grass.png", | |||
"Flying": "https://wiki.pokexgames.com/images/7/7f/Flying.png", | |||
"Normal": "https://wiki.pokexgames.com/images/e/e8/Normal1.png", | |||
"Ghost": "https://wiki.pokexgames.com/images/5/59/Ghost1.png", | |||
"Dark": "https://wiki.pokexgames.com/images/9/98/Dark1.png", | |||
"Neutral": "https://wiki.pokexgames.com/images/0/08/NeutralICON.png" | |||
}; | }; | ||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
const mapTypeSelect = document.getElementById("mapType"); | const mapTypeSelect = document.getElementById("mapType"); | ||
const difficultySelect = document.getElementById("difficulty"); | const difficultySelect = document.getElementById("difficulty"); | ||
const tagButtonsContainer = document.getElementById("tagButtons"); | const tagButtonsContainer = document.getElementById("tagButtons"); | ||
Linha 259: | Linha 259: | ||
const clanFilter = document.getElementById("clanFilter"); | const clanFilter = document.getElementById("clanFilter"); | ||
const typeFilter = document.getElementById("typeFilter"); | const typeFilter = document.getElementById("typeFilter"); | ||
const toggleNeutro = document.getElementById("toggleNeutro"); | |||
let selectedTags = []; | let selectedTags = []; | ||
let selectedTypes = []; | let selectedTypes = []; | ||
let showNeutro = false; | |||
// Inicializa os botões de clãs | // Inicializa os botões de clãs | ||
Linha 267: | Linha 269: | ||
const button = document.createElement("button"); | const button = document.createElement("button"); | ||
button.className = "tag-button"; | button.className = "tag-button"; | ||
button.innerHTML = `<img src="${icon}" alt="${cls}" class="class-icon" title="${cls}">`; | button.innerHTML = `<img src="${icon}" alt="${cls}" class="class-icon" title="${cls}">`; | ||
button.addEventListener("click", () => { | button.addEventListener("click", () => { | ||
button.classList.toggle("selected"); | button.classList.toggle("selected"); | ||
Linha 280: | Linha 282: | ||
const button = document.createElement("button"); | const button = document.createElement("button"); | ||
button.className = "tag-button"; | button.className = "tag-button"; | ||
button.innerHTML = `<img src="${icon}" alt="${type}" class="class-icon" title="${type}">`; | button.innerHTML = `<img src="${icon}" alt="${type}" class="class-icon" title="${type}">`; | ||
button.addEventListener("click", () => { | button.addEventListener("click", () => { | ||
button.classList.toggle("selected"); | button.classList.toggle("selected"); | ||
Linha 306: | Linha 308: | ||
}); | }); | ||
// Toggle para Hunts Neutras | |||
toggleNeutro.addEventListener("click", () => { | |||
showNeutro = !showNeutro; | |||
toggleNeutro.classList.toggle("active"); | |||
toggleNeutro.querySelector("span").textContent = showNeutro ? "Ativado" : "Desativado"; | |||
filterHunts(); | |||
}); | }); | ||
// Atualiza o dropdown de dificuldade com base no local selecionado | |||
mapTypeSelect.addEventListener("change", function () { | |||
const selectedMap = this.value; | |||
difficultySelect.innerHTML = '<option value="">Selecione uma Dificuldade</option>'; | |||
if (selectedMap && hunts[selectedMap]) { | |||
const difficulties = new Set(hunts[selectedMap].map(hunt => hunt.difficulty)); | |||
difficulties.forEach(difficulty => { | |||
const option = document.createElement("option"); | |||
option.value = difficulty; | |||
option.textContent = difficulty; | |||
difficultySelect.appendChild(option); | |||
}); | |||
} | } | ||
filterHunts(); | |||
}); | }); | ||
// | // Filtra as hunts com base nos critérios selecionados | ||
function filterHunts() { | |||
const selectedMap = mapTypeSelect.value; | |||
const selectedDifficulty = difficultySelect.value; | |||
imageContainer.innerHTML = ""; | |||
if (!selectedMap || !selectedDifficulty) return; | |||
const huntList = hunts[selectedMap]; | |||
huntList.forEach(hunt => { | |||
const matchesTags = selectedTags.length === 0 || selectedTags.some(tag => hunt.classes.includes(tag)); | |||
const matchesTypes = selectedTypes.length === 0 || selectedTypes.some(type => hunt.huntTypes.includes(type)); | |||
const matchesDifficulty = hunt.difficulty === selectedDifficulty; | |||
const matchesNeutro = !showNeutro || hunt.huntTipo === "Neutro"; | |||
if (matchesTags && matchesTypes && matchesDifficulty && matchesNeutro) { | |||
const imageItem = document.createElement("div"); | |||
imageItem.className = "image-item"; | |||
imageItem.innerHTML = ` | |||
<div class="image-content"> | |||
<a href="${hunt.link}" target="_blank"> | |||
<img src="${hunt.imageUrl}" alt="${hunt.name}"> | |||
</a> | |||
<div class="image-info"> | |||
<p><b>Nome do Local:</b> ${hunt.name}</p> | |||
<p><b>Localização:</b> ${hunt.local}</p> | |||
<p><b>Dificuldade:</b> ${hunt.difficulty}</p> | |||
${hunt.hasType ? `<p><b>Dano da Hunt:</b> ${hunt.huntTypes.join(", ")}</p>` : ""} | |||
<div class="class-container"> | |||
<p><b>Clãs:</b></p> | |||
<div class="class-icons"> | |||
${hunt.classes.map(cls => `<img src="${classIcons[cls]}" alt="${cls}" class="class-icon">`).join("")} | |||
</div> | |||
</div> | |||
</div> | |||
</div> | </div> | ||
`; | |||
imageContainer.appendChild(imageItem); | |||
} | |||
}); | |||
} | |||
} | |||
// Inicializa o dropdown de dificuldade ao carregar a página | |||
mapTypeSelect.dispatchEvent(new Event("change")); | |||
}) | }); | ||
</script> | |||
</script> | |||
</body> | </body> | ||
</html> | </html> |