7 895
edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 5: | 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> | ||
.borda-container { | .borda-container { | ||
display: flex; | display: flex; | ||
Linha 85: | Linha 15: | ||
border-image-repeat: round; | border-image-repeat: round; | ||
width: 100%; | width: 100%; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
min-height: 620px; | min-height: 620px; | ||
overflow: hidden; | overflow: hidden; | ||
} | } | ||
.hidden { | .hidden { | ||
display: none; | display: none; | ||
} | } | ||
.input-group { | .input-group { | ||
margin: 20px 0; | margin: 20px 0; | ||
} | } | ||
.maps__select { | .maps__select { | ||
width: 100%; | width: 100%; | ||
Linha 106: | Linha 38: | ||
box-sizing: border-box; | box-sizing: border-box; | ||
} | } | ||
.image-container { | .image-container { | ||
display: flex; | display: flex; | ||
Linha 112: | Linha 45: | ||
margin-top: 20px; | margin-top: 20px; | ||
} | } | ||
.image-item { | .image-item { | ||
flex: 1 0 30%; | flex: 1 0 30%; | ||
text-align: left; | text-align: left; | ||
} | } | ||
.image-item img { | .image-item img { | ||
max-width: 100%; | max-width: 100%; | ||
Linha 121: | Linha 56: | ||
cursor: pointer; | cursor: pointer; | ||
} | } | ||
.image-info p { | .image-info p { | ||
margin: 5px 0; | |||
} | |||
.image-item { | |||
display: flex; | |||
justify-content: center; | |||
width: 100%; | |||
} | |||
.image-content { | |||
text-align: left; | |||
max-width: 400px; | |||
width: 100%; | |||
} | } | ||
.tag-button { | .tag-button { | ||
display: inline-flex; | display: inline-flex; | ||
Linha 144: | Linha 82: | ||
font-size: 16px; | font-size: 16px; | ||
} | } | ||
.tag-button.selected { | .tag-button.selected { | ||
background-color: #d586e1; | background-color: #d586e1; | ||
Linha 150: | Linha 89: | ||
font-weight: bolder; | font-weight: bolder; | ||
} | } | ||
.class-icons { | .class-container { | ||
display: flex; | |||
align-items: center; | |||
} | gap: 10px; | ||
} | |||
.class-icons { | |||
display: flex; | |||
gap: 5px; | |||
} | |||
.type-dropdown { | .type-dropdown { | ||
margin-top: 10px; | margin-top: 10px; | ||
} | } | ||
.disabled { | .disabled { | ||
opacity: 0.5; | opacity: 0.5; | ||
pointer-events: none; | pointer-events: none; | ||
} | |||
.switch-container { | |||
display: flex; | |||
gap: 10px; | |||
margin: 20px 0; | |||
} | |||
.switch-button { | |||
background-color: #f1f1f1; | |||
border: 1px solid #ccc; | |||
padding: 10px; | |||
border-radius: 5px; | |||
cursor: pointer; | |||
display: flex; | |||
align-items: center; | |||
gap: 5px; | |||
} | |||
.switch-button.active { | |||
background-color: #d586e1; | |||
border-color: #9d4cea; | |||
} | |||
.icon-filter { | |||
width: 24px; | |||
height: 24px; | |||
} | } | ||
</style> | </style> | ||
</head> | </head> | ||
<body> | <body> | ||
<div class="borda-container"> | <div class="borda-container"> | ||
<div class="input-group"> | |||
<label for="mapType"><b>Local da Hunt:</b></label> | |||
<select id="mapType" class="maps__select"> | |||
<option value="">Selecione um local</option> | |||
<option value="NW">NW</option> | |||
</select> | </select> | ||
</div> | |||
<div class="input-group"> | |||
<label for="huntTipo"><b>Tipo de Hunt:</b></label> | |||
<select id="huntTipo" class="maps__select disabled"> | |||
<option value="">Selecione um tipo</option> | |||
</select> | |||
</div> | |||
<div class="input-group"> | |||
<label for="difficulty"><b>Dificuldade:</b></label> | |||
<select id="difficulty" class="maps__select"> | |||
<option value="">Selecione uma Dificuldade</option> | |||
</select> | |||
</div> | |||
<!-- Switch Button para alternar entre Clãs e Tipos --> | |||
<div class="switch-container"> | |||
<div class="switch-button" id="switchClans"> | |||
<img src="https://wiki.pokexgames.com/images/6/64/Volcanic1.png" alt="Clãs" class="icon-filter"> | |||
<span>Clãs</span> | |||
</div> | |||
<div class="switch-button" id="switchTypes"> | |||
<img src="https://via.placeholder.com/24" alt="Tipos" class="icon-filter"> | |||
<span>Tipos</span> | |||
</div> | |||
</div> | |||
<!-- Filtro de Clãs (ícones) --> | |||
<div id="clanFilter" class="input-group"> | |||
<label><b>Clãs:</b></label> | |||
<div id="tagButtons"></div> | |||
</div> | |||
<!-- Filtro de Tipos (ícones) --> | |||
<div id="typeFilter" class="input-group hidden"> | |||
<label><b>Tipos:</b></label> | |||
<div id="typeButtons"></div> | |||
</div> | |||
<div id="imageContainer" class="image-container"></div> | |||
</div> | </div> | ||
< | <script> | ||
const hunts = { | |||
"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: "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" } | |||
], | |||
}; | |||
const classIcons = { | |||
"Volcanic": "https://wiki.pokexgames.com/images/6/64/Volcanic1.png", | |||
"Raibolt": "https://wiki.pokexgames.com/images/b/b4/Raibol1t.png", | |||
"Orebound": "https://wiki.pokexgames.com/images/e/e2/Orebound1.png", | |||
"Naturia": "https://wiki.pokexgames.com/images/3/30/Naturia1.png", | |||
"Gardestrike": "https://wiki.pokexgames.com/images/3/39/Gardestrike1.png", | |||
"Ironhard": "https://wiki.pokexgames.com/images/9/9a/Ironhard1.png", | |||
"Wingeon": "https://wiki.pokexgames.com/images/0/0c/Wingeon1.png", | |||
"Psycraft": "https://wiki.pokexgames.com/images/5/59/Psycraft1.png", | |||
"Seavell": "https://wiki.pokexgames.com/images/2/2c/Seave1ll.png", | |||
"Malefic": "https://wiki.pokexgames.com/images/5/56/Malefi1c.png" | |||
}; | |||
const typeIcons = { | |||
"Poison": "https://via.placeholder.com/24", | |||
"Grass": "https://via.placeholder.com/24" | |||
}; | |||
document.addEventListener("DOMContentLoaded", function () { | |||
const mapTypeSelect = document.getElementById("mapType"); | |||
const huntTipoSelect = document.getElementById("huntTipo"); | |||
const difficultySelect = document.getElementById("difficulty"); | |||
const tagButtonsContainer = document.getElementById("tagButtons"); | |||
const typeButtonsContainer = document.getElementById("typeButtons"); | |||
const imageContainer = document.getElementById("imageContainer"); | |||
const switchClans = document.getElementById("switchClans"); | |||
const switchTypes = document.getElementById("switchTypes"); | |||
const clanFilter = document.getElementById("clanFilter"); | |||
const typeFilter = document.getElementById("typeFilter"); | |||
let selectedTags = []; | |||
let selectedTypes = []; | |||
// Inicializa os botões de clãs | |||
Object.entries(classIcons).forEach(([cls, icon]) => { | |||
const button = document.createElement("button"); | |||
button.className = "tag-button"; | |||
button.innerHTML = `<img src="${icon}" alt="${cls}" class="class-icon">`; | |||
button.addEventListener("click", () => { | |||
button.classList.toggle("selected"); | |||
selectedTags.includes(cls) ? selectedTags.splice(selectedTags.indexOf(cls), 1) : selectedTags.push(cls); | |||
filterHunts(); | |||
}); | |||
tagButtonsContainer.appendChild(button); | |||
}); | |||
// Inicializa os botões de tipos | |||
Object.entries(typeIcons).forEach(([type, icon]) => { | |||
const button = document.createElement("button"); | |||
button.className = "tag-button"; | |||
button.innerHTML = `<img src="${icon}" alt="${type}" class="class-icon">`; | |||
button.addEventListener("click", () => { | |||
button.classList.toggle("selected"); | |||
selectedTypes.includes(type) ? selectedTypes.splice(selectedTypes.indexOf(type), 1) : selectedTypes.push(type); | |||
filterHunts(); | |||
}); | |||
typeButtonsContainer.appendChild(button); | |||
}); | |||
// Alterna entre Clãs e Tipos | |||
switchClans.addEventListener("click", () => { | |||
switchClans.classList.add("active"); | |||
switchTypes.classList.remove("active"); | |||
clanFilter.classList.remove("hidden"); | |||
typeFilter.classList.add("hidden"); | |||
filterHunts(); | |||
}); | |||
switchTypes.addEventListener("click", () => { | |||
switchTypes.classList.add("active"); | |||
switchClans.classList.remove("active"); | |||
typeFilter.classList.remove("hidden"); | |||
clanFilter.classList.add("hidden"); | |||
filterHunts(); | |||
}); | |||
// Atualiza o dropdown de tipo de hunt com base no local selecionado | // Atualiza o dropdown de tipo de hunt com base no local selecionado | ||
Linha 315: | Linha 323: | ||
filterHunts(); // Filtra as hunts ao mudar o tipo | filterHunts(); // Filtra as hunts ao mudar o tipo | ||
}); | }); | ||
// Filtra e exibe as hunts | // Filtra e exibe as hunts |