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 136: | Linha 137: | ||
height: 24px; | height: 24px; | ||
} | } | ||
.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 { | |||
background-color: #d586e1; | |||
border-color: #9d4cea; | |||
color: #050000; | |||
font-weight: bolder; | |||
} | |||
</style> | </style> | ||
</head> | </head> | ||
Linha 147: | Linha 166: | ||
</select> | </select> | ||
</div> | </div> | ||
<div class="input-group"> | |||
<label><b>Mostrar Hunts Neutras:</b></label> | |||
<div class="switch-button" id="toggleNeutro"> | |||
<span>Desativado</span> | |||
</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 183: | Linha 207: | ||
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"], | { 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: "ssss", local: "Fuchsia", classes: ["Volcanic", "Naturia", "Malefic", "Seavell", "Wingeon"], imageUrl: "https://wiki.pokexgames.com/images/7/70/Nightmare_Hunt_Petilil.png", hasType: true, huntTypes: ["Grass"], link: "https://exemplo.com/hunt2" } | { name: "Petilil", difficulty: "ssss", 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 225: | Linha 249: | ||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
const mapTypeSelect = document.getElementById("mapType"); | const mapTypeSelect = document.getElementById("mapType"); | ||
const huntTipoSelect = document.getElementById("huntTipo"); | |||
const difficultySelect = document.getElementById("difficulty"); | const difficultySelect = document.getElementById("difficulty"); | ||
const tagButtonsContainer = document.getElementById("tagButtons"); | const tagButtonsContainer = document.getElementById("tagButtons"); | ||
Linha 280: | Linha 305: | ||
filterHunts(); | filterHunts(); | ||
}); | }); | ||
// Atualiza o dropdown de tipo de hunt com base no local selecionado | |||
function updateHuntTypeDropdown(location) { | |||
const huntList = hunts[location]; | |||
huntTipoSelect.innerHTML = '<option value="">Selecione um tipo</option>'; | |||
difficultySelect.innerHTML = '<option value="">Selecione uma Dificuldade</option>'; | |||
if (huntList) { | |||
const types = new Set(); | |||
huntList.forEach(hunt => { | |||
if (hunt.huntTipo) { | |||
types.add(hunt.huntTipo); // Pega "Elemental", "Legendary", etc. | |||
} | |||
}); | |||
types.forEach(type => { | |||
const option = document.createElement("option"); | |||
option.value = type; | |||
option.textContent = type; | |||
huntTipoSelect.appendChild(option); | |||
}); | |||
huntTipoSelect.classList.remove("disabled"); | |||
} else { | |||
huntTipoSelect.classList.add("disabled"); | |||
} | |||
} | |||
huntTipoSelect.addEventListener("change", function () { | |||
const selectedMap = mapTypeSelect.value; | const selectedMap = mapTypeSelect.value; | ||
const selectedHuntType = huntTipoSelect.value; | |||
const huntList = hunts[selectedMap]; | const huntList = hunts[selectedMap]; | ||
difficultySelect.innerHTML = '<option value="">Selecione uma Dificuldade</option>'; | difficultySelect.innerHTML = '<option value="">Selecione uma Dificuldade</option>'; | ||
if (huntList) { | if (huntList && selectedHuntType) { | ||
const difficulties = new Set(); | const difficulties = new Set(); | ||
huntList.forEach(hunt => { | huntList.forEach(hunt => { | ||
if (hunt. | if (hunt.huntTipo === selectedHuntType && hunt.difficulty) { | ||
difficulties.add(hunt.difficulty); // Pega "Baixa", "Média", etc. | difficulties.add(hunt.difficulty); // Pega "Baixa", "Média", etc. | ||
} | } | ||
Linha 306: | Linha 357: | ||
}); | }); | ||
// Variável para controlar o estado do toggle | |||
let showNeutro = false; | |||
// Seleciona o toggle button | |||
const toggleNeutro = document.getElementById("toggleNeutro"); | |||
// Adiciona um evento de clique ao toggle button | |||
toggleNeutro.addEventListener("click", () => { | |||
showNeutro = !showNeutro; // Alterna o estado | |||
toggleNeutro.classList.toggle("active"); // Adiciona/remove a classe "active" | |||
toggleNeutro.querySelector("span").textContent = showNeutro ? "Ativado" : "Desativado"; // Atualiza o texto | |||
filterHunts(); // Filtra as hunts | |||
}); | |||
// Função para filtrar as hunts | |||
function filterHunts() { | |||
const selectedMap = mapTypeSelect.value; | |||
const selectedDifficulty = difficultySelect.value; | |||
imageContainer.innerHTML = ""; | |||
if (!selectedMap || !selectedDifficulty) return; // Só exibe se Local e Dificuldade estiverem selecionados | |||
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"; // Filtra por "Neutro" se o toggle estiver ativado | |||
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); | |||
} | |||
}); | |||
} | |||
mapTypeSelect.addEventListener("change", function () { | |||
filterHunts(); | |||
}); | |||
difficultySelect.addEventListener("change", filterHunts); | |||
// Não exibe nada inicialmente | // Não exibe nada inicialmente | ||
imageContainer.innerHTML = ""; | imageContainer.innerHTML = ""; |