Widget:Test4: mudanças entre as edições

sem sumário de edição
Sem resumo de edição
Sem resumo de edição
Linha 114: Linha 114:
         </select>
         </select>
     </div>
     </div>
    <div class="input-group">
        <label for="difficulty"><b>Dificuldade:</b></label>
        <select id="difficulty">
            <option value="">Selecione uma Dificuldade</option>
        </select>
    </div>
    <div class="input-group">
        <label for="tagButtons"><b>Clãs:</b></label>
    </div>     


<div id="tagButtons">
<div id="tagButtons">
Linha 157: Linha 168:
         const mapTypeSelect = document.getElementById("mapType");
         const mapTypeSelect = document.getElementById("mapType");
         const huntTipoSelect = document.getElementById("huntTipo");
         const huntTipoSelect = document.getElementById("huntTipo");
        const difficultySelect = document.getElementById("difficulty");
         const tagButtons = document.querySelectorAll(".tag-button");
         const tagButtons = document.querySelectorAll(".tag-button");
         const imageContainer = document.getElementById("imageContainer");
         const imageContainer = document.getElementById("imageContainer");
Linha 189: Linha 201:
             const selectedMap = mapTypeSelect.value;
             const selectedMap = mapTypeSelect.value;
             const selectedHuntType = huntTipoSelect.value;
             const selectedHuntType = huntTipoSelect.value;
            const selectedDifficulty = difficultySelect.value;
             imageContainer.innerHTML = "";
             imageContainer.innerHTML = "";


Linha 197: Linha 210:
                 const matchesTags = selectedTags.length === 0 || selectedTags.some(tag => hunt.classes.includes(tag));
                 const matchesTags = selectedTags.length === 0 || selectedTags.some(tag => hunt.classes.includes(tag));
                 const matchesHuntType = !selectedHuntType || hunt.huntTipo === selectedHuntType;
                 const matchesHuntType = !selectedHuntType || hunt.huntTipo === selectedHuntType;
                const matchesDifficulty = !selectedDifficulty || hunt.difficulty === selectedDifficulty;


                 if (matchesTags && matchesHuntType) {
                 if (matchesTags && matchesHuntType && matchesDifficulty) {
const imageItem = document.createElement("div");
const imageItem = document.createElement("div");
imageItem.className = "image-item";
imageItem.className = "image-item";
Linha 232: Linha 246:


         huntTipoSelect.addEventListener("change", filterHunts);
         huntTipoSelect.addEventListener("change", filterHunts);
        difficultySelect.addEventListener("change", filterHunts);


         tagButtons.forEach(button => {
         tagButtons.forEach(button => {
7 895

edições