7 894
edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 210: | Linha 210: | ||
"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" }, | ||
{ name: "Petilil", difficulty: " | { name: "Petilil", difficulty: "Baixa", local: "Fuchsia", classes: ["Volcanic", "Naturia", "Malefic", "Seavell", "Wingeon"], imageUrl: "https://wiki.pokexgames.com/images/7/70/Nightmare_Hunt_Petilil.png", hasType: true, huntTypes: ["Grass"], huntTipo: "Neutro", link: "https://exemplo.com/hunt2" } | ||
], | ], | ||
}; | }; | ||
Linha 255: | Linha 255: | ||
const typeButtonsContainer = document.getElementById("typeButtons"); | const typeButtonsContainer = document.getElementById("typeButtons"); | ||
const imageContainer = document.getElementById("imageContainer"); | const imageContainer = document.getElementById("imageContainer"); | ||
const toggleNeutro = document.getElementById("toggleNeutro"); | const toggleNeutro = document.getElementById("toggleNeutro"); | ||
Linha 289: | Linha 285: | ||
}); | }); | ||
typeButtonsContainer.appendChild(button); | typeButtonsContainer.appendChild(button); | ||
}); | }); | ||
Linha 346: | Linha 325: | ||
const matchesTypes = selectedTypes.length === 0 || selectedTypes.some(type => hunt.huntTypes.includes(type)); | const matchesTypes = selectedTypes.length === 0 || selectedTypes.some(type => hunt.huntTypes.includes(type)); | ||
const matchesDifficulty = hunt.difficulty === selectedDifficulty; | const matchesDifficulty = hunt.difficulty === selectedDifficulty; | ||
const | const isNeutro = hunt.huntTipo === "Neutro"; | ||
if (matchesTags && matchesTypes && matchesDifficulty && | // Exibe a hunt se: | ||
// 1. Corresponde à dificuldade selecionada E | |||
// 2. Não é neutra OU (é neutra E o toggle está ativado) | |||
if (matchesTags && matchesTypes && matchesDifficulty && (!isNeutro || (isNeutro && showNeutro))) { | |||
const imageItem = document.createElement("div"); | const imageItem = document.createElement("div"); | ||
imageItem.className = "image-item"; | imageItem.className = "image-item"; | ||
Linha 374: | Linha 356: | ||
}); | }); | ||
} | } | ||
// Event listeners para os dropdowns | |||
mapTypeSelect.addEventListener("change", filterHunts); | |||
difficultySelect.addEventListener("change", filterHunts); | |||
// Inicializa o dropdown de dificuldade ao carregar a página | // Inicializa o dropdown de dificuldade ao carregar a página |