7 895
edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 138: | Linha 138: | ||
} | } | ||
. | .toggle-button { | ||
display: flex; | |||
display: | |||
align-items: center; | align-items: center; | ||
gap: 5px; | gap: 5px; | ||
cursor: pointer; | |||
} | } | ||
. | .toggle-button img { | ||
width: 24px; | |||
height: 24px; | |||
} | } | ||
</style> | </style> | ||
Linha 159: | Linha 153: | ||
<body> | <body> | ||
<div class="borda-container"> | <div class="borda-container"> | ||
<!-- Filtro de Local --> | |||
<div class="input-group"> | <div class="input-group"> | ||
<label for="mapType"><b>Local da Hunt:</b></label> | <label for="mapType"><b>Local da Hunt:</b></label> | ||
Linha 167: | Linha 162: | ||
</div> | </div> | ||
<!-- Toggle Button para Hunts Neutras --> | |||
<div class="input-group"> | <div class="input-group"> | ||
<label><b>Mostrar Hunts Neutras:</b></label> | <label><b>Mostrar Hunts Neutras:</b></label> | ||
<div class=" | <div class="toggle-button" id="toggleNeutro"> | ||
<span>Desativado</span> | <img src="https://wiki.pokexgames.com/images/0/08/NeutralICON.png" alt="Desativado" id="toggleNeutroIcon"> | ||
<span id="toggleNeutroText">Desativado</span> | |||
</div> | </div> | ||
</div> | </div> | ||
<!-- Filtro de Dificuldade --> | |||
<div class="input-group"> | <div class="input-group"> | ||
<label for="difficulty"><b>Dificuldade:</b></label> | <label for="difficulty"><b>Dificuldade:</b></label> | ||
Linha 179: | Linha 177: | ||
<option value="">Selecione uma Dificuldade</option> | <option value="">Selecione uma Dificuldade</option> | ||
</select> | </select> | ||
</div> | |||
<!-- Barra de Busca --> | |||
<div class="input-group"> | |||
<label for="search"><b>Buscar por Nome:</b></label> | |||
<input type="text" id="search" class="maps__select" placeholder="Digite o nome do local..."> | |||
</div> | </div> | ||
Linha 184: | Linha 188: | ||
<div class="switch-container"> | <div class="switch-container"> | ||
<div class="switch-button" id="switchClans"> | <div class="switch-button" id="switchClans"> | ||
< | <img src="https://wiki.pokexgames.com/images/6/64/Volcanic1.png" alt="Clãs" class="icon-filter"> | ||
</div> | </div> | ||
<div class="switch-button" id="switchTypes"> | <div class="switch-button" id="switchTypes"> | ||
< | <img src="https://wiki.pokexgames.com/images/c/c9/Steel.png" alt="Dano Recebido" class="icon-filter"> | ||
</div> | </div> | ||
</div> | </div> | ||
Linha 203: | Linha 207: | ||
</div> | </div> | ||
<!-- Container das Hunts --> | |||
<div id="imageContainer" class="image-container"></div> | <div id="imageContainer" class="image-container"></div> | ||
</div> | </div> | ||
Linha 256: | Linha 261: | ||
const imageContainer = document.getElementById("imageContainer"); | const imageContainer = document.getElementById("imageContainer"); | ||
const toggleNeutro = document.getElementById("toggleNeutro"); | const toggleNeutro = document.getElementById("toggleNeutro"); | ||
const toggleNeutroIcon = document.getElementById("toggleNeutroIcon"); | |||
const toggleNeutroText = document.getElementById("toggleNeutroText"); | |||
const searchInput = document.getElementById("search"); | |||
let selectedTags = []; | let selectedTags = []; | ||
Linha 291: | Linha 299: | ||
showNeutro = !showNeutro; | showNeutro = !showNeutro; | ||
toggleNeutro.classList.toggle("active"); | toggleNeutro.classList.toggle("active"); | ||
toggleNeutroText.textContent = showNeutro ? "Ativado" : "Desativado"; | |||
toggleNeutroIcon.src = showNeutro ? "https://wiki.pokexgames.com/images/0/08/NeutralICON.png" : "https://wiki.pokexgames.com/images/0/08/NeutralICON.png"; // Altere a imagem para o estado ativado | |||
filterHunts(); | |||
}); | |||
// Barra de busca | |||
searchInput.addEventListener("input", () => { | |||
filterHunts(); | filterHunts(); | ||
}); | }); | ||
Linha 316: | Linha 330: | ||
const selectedMap = mapTypeSelect.value; | const selectedMap = mapTypeSelect.value; | ||
const selectedDifficulty = difficultySelect.value; | const selectedDifficulty = difficultySelect.value; | ||
const searchTerm = searchInput.value.toLowerCase(); | |||
imageContainer.innerHTML = ""; | imageContainer.innerHTML = ""; | ||
Linha 326: | Linha 341: | ||
const matchesDifficulty = hunt.difficulty === selectedDifficulty; | const matchesDifficulty = hunt.difficulty === selectedDifficulty; | ||
const isNeutro = hunt.huntTipo === "Neutro"; | const isNeutro = hunt.huntTipo === "Neutro"; | ||
const matchesSearch = hunt.name.toLowerCase().includes(searchTerm); | |||
if (matchesTags && matchesTypes && matchesDifficulty && (!isNeutro || (isNeutro && showNeutro)) && matchesSearch) { | |||
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"; |