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

De PokeXGames
Ir para navegação Ir para pesquisar
Sem resumo de edição
Etiqueta: Revertido
Sem resumo de edição
Etiqueta: Revertido
Linha 13: Linha 13:
             flex-direction: column;
             flex-direction: column;
             margin-top: -15px;
             margin-top: -15px;
            /* Ajuste este valor conforme necessário para subir o botão */
         }
         }


Linha 33: Linha 32:
         }
         }


.image-container img {
        .image-container img {
    object-fit: cover; /* Mantém a proporção da imagem, cortando se necessário */
            object-fit: cover;
    margin-bottom: 5px;
            margin-bottom: 5px;
}
        }


         .image-info {
         .image-info {
Linha 51: Linha 50:
         #searchButton {
         #searchButton {
             background: none;
             background: none;
            /* Remove o fundo do botão */
             border: none;
             border: none;
            /* Remove a borda do botão */
             padding: 0;
             padding: 0;
            /* Remove o padding do botão */
             cursor: pointer;
             cursor: pointer;
            /* Mostra o cursor de ponteiro ao passar sobre o botão */
             margin-top: 5px;
             margin-top: 5px;
            /* Ajuste a margem superior para subir o botão */
         }
         }


Linha 66: Linha 60:
             border-radius: 12px;
             border-radius: 12px;
             width: auto;
             width: auto;
            /* Garante que a largura se ajuste ao tamanho original da imagem */
             height: auto;
             height: auto;
            /* Garante que a altura se ajuste ao tamanho original da imagem */
         }
         }


Linha 83: Linha 75:
             min-width: 340px;
             min-width: 340px;
             min-height: 270px;
             min-height: 270px;
          }
        }


         .input-group {
         .input-group {
             position: relative;
             position: relative;
             margin: 20px 0;
             margin: 20px 0;
            /* Ajuste a margem para mover o campo para cima */
         }
         }


Linha 94: Linha 85:
             position: absolute;
             position: absolute;
             top: -18px;
             top: -18px;
            /* Eleva o texto para cima */
             background: none;
             background: none;
             padding: 0 5px;
             padding: 0 5px;
Linha 104: Linha 94:
         .maps__select {
         .maps__select {
             width: 100%;
             width: 100%;
            /* Mantém a largura total disponível */
             padding: 10px;
             padding: 10px;
             font-size: 16px;
             font-size: 16px;
Linha 111: Linha 100:
             appearance: none;
             appearance: none;
             background-color: #fff;
             background-color: #fff;
            /* Adiciona um fundo branco */
             box-sizing: border-box;
             box-sizing: border-box;
            /* Inclui o padding e a borda na largura total */
         }
         }


         .input-group input[type="text"] {
         .input-group input[type="text"] {
             width: 100%;
             width: 100%;
            /* Mantém a largura total disponível */
             padding: 10px;
             padding: 10px;
             font-size: 16px;
             font-size: 16px;
Linha 125: Linha 110:
             border: 1px solid #ccc;
             border: 1px solid #ccc;
             box-sizing: border-box;
             box-sizing: border-box;
            /* Inclui o padding e a borda na largura total */
         }
         }


Linha 131: Linha 115:
             position: absolute;
             position: absolute;
             top: -18px;
             top: -18px;
            /* Eleva o texto um pouco mais para cima */
             background: none;
             background: none;
             padding: 0 5px;
             padding: 0 5px;
             font-size: 14px;
             font-size: 14px;
             font-weight: bold;
             font-weight: bold;
            /* Deixa o texto em negrito */
             color: #0d0d0d;
             color: #0d0d0d;
         }
         }
Linha 142: Linha 124:
         .hover-minimize:hover {
         .hover-minimize:hover {
             transform: scale(0.95);
             transform: scale(0.95);
            /* Adiciona um efeito de minimizar ao passar o mouse */
         }
         }


Linha 148: Linha 129:
             display: flex;
             display: flex;
             align-items: center;
             align-items: center;
         }
         }


Linha 155: Linha 135:
             padding: 0;
             padding: 0;
             width: auto;
             width: auto;
            /* Ajusta o tamanho da checkbox conforme necessário */
             height: auto;
             height: auto;
            /* Ajusta o tamanho da checkbox conforme necessário */
            /* Alinha verticalmente a checkbox com o texto */
             vertical-align: middle;
             vertical-align: middle;
         }
         }
Linha 164: Linha 141:
         .filter-label {
         .filter-label {
             margin-left: 10px;
             margin-left: 10px;
            /* Espaço entre a checkbox e o texto */
             font-size: 14px;
             font-size: 14px;
             font-weight: bold;
             font-weight: bold;
             color: #0d0d0d;
             color: #0d0d0d;
             line-height: 1.5;
             line-height: 1.5;
            /* Ajusta a altura da linha para um alinhamento adequado */
         }
         }
     </style>
     </style>
Linha 207: Linha 182:
         <div id="filterSection" class="hidden">
         <div id="filterSection" class="hidden">
             <div id="filterById" class="input-group">
             <div id="filterById" class="input-group">
                 <label for="searchIds" class="mapsCalc__label">Buscar por Nº do Mapa:</label>
                 <label for="searchIds" class="maps__label">Buscar por Nº do Mapa:</label>
                 <input type="text" id="searchIds" placeholder="Digite os números separados por vírgula" class="mapsCalc__select">
                 <input type="text" id="searchIds" placeholder="Digite os números separados por vírgula" class="maps__select">
             </div>
             </div>


             <div id="filterByTag" class="hidden input-group">
             <div id="filterByTag" class="hidden input-group">
                 <label for="searchTag" class="mapsCalc__label">Buscar por Tag:</label>
                 <label for="searchTag" class="maps__label">Buscar por Tag:</label>
                 <input type="text" id="searchTag" placeholder="Digite a tag">
                 <input type="text" id="searchTag" placeholder="Digite a tag">
             </div>
             </div>


             <div class="d-flex justify-center align-center flex-column">
             <div class="d-flex">
                 <button type="button" id="filterButton" class="hover-minimize">
                 <button type="button" id="filterButton" class="hover-minimize">
                     <img src="https://wiki.pokexgames.com/images/8/82/Botao_Filtrar_Mapas_Adv.png" alt="Imagem botão filtrar">
                     <img src="https://wiki.pokexgames.com/images/8/82/Botao_Filtrar_Mapas_Adv.png" alt="Imagem botão filtrar">
Linha 225: Linha 200:
             <!-- As imagens e suas informações serão exibidas aqui -->
             <!-- As imagens e suas informações serão exibidas aqui -->
         </div>
         </div>
<div id="error-message" class="hidden" style="color: red; font-weight: bold; text-align: center;">
        <div id="error-message" class="hidden" style="color: red; font-weight: bold; text-align: center;">
    Por favor, selecione "Tipo de Mapa" e "Local do X" antes de buscar por tag.
            Por favor, selecione "Tipo de Mapa" e "Local do X" antes de buscar por tag.
</div>
        </div>
     </form>
     </form>
     <script>
     <script>
         const specificOptions = {
         const specificOptions = {
Linha 312: Linha 286:
             }
             }
         };
         };
document.getElementById('mapType').addEventListener('change', updateOptions);
        document.getElementById('specificOption').addEventListener('change', updateOptions);
        document.getElementById('enableFilter').addEventListener('change', toggleFilter);
        document.getElementById('filterButton').addEventListener('click', applyFilters);
        document.getElementById('searchTag').addEventListener('input', toggleFilter);


         document.getElementById('enableFilter').addEventListener('change', function () {
         function updateOptions() {
             const filterSection = document.getElementById('filterSection');
            const mapType = document.getElementById('mapType').value;
             if (this.checked) {
            const specificOption = document.getElementById('specificOption').value;
                 filterSection.classList.remove('hidden');
            const specificOptionsDiv = document.getElementById('specificOptions');
             const filterSectionDiv = document.getElementById('filterSection');
            const filterByTagDiv = document.getElementById('filterByTag');
           
             if (mapType) {
                 specificOptionsDiv.classList.remove('hidden');
             } else {
             } else {
                 filterSection.classList.add('hidden');
                 specificOptionsDiv.classList.add('hidden');
                filterSectionDiv.classList.add('hidden');
                document.getElementById('searchTag').value = '';
             }
             }
        });


 
            if (mapType && specificOption) {
        document.getElementById('searchIds').addEventListener('keypress', function (event) {
                filterSectionDiv.classList.remove('hidden');
             if (event.key === 'Enter') {
             } else {
                 event.preventDefault();
                 filterSectionDiv.classList.add('hidden');
                document.getElementById('filterButton').click();
             }
             }
         });
         }
        document.getElementById('mapType').addEventListener('change', function () {
            const selectedMapType = this.value;
            const specificOptionSelect = document.getElementById('specificOption');


            if (selectedMapType) {
        function toggleFilter() {
                specificOptionSelect.innerHTML = '<option value="">Selecione uma opção</option>';
            const isFilterEnabled = document.getElementById('enableFilter').checked;
                const options = Object.keys(specificOptions[selectedMapType]);
            const filterByTagDiv = document.getElementById('filterByTag');
                options.forEach(option => {
            const searchTagInput = document.getElementById('searchTag');
                    specificOptionSelect.innerHTML += `<option value="${option}">${option}</option>`;
           
                });
            if (isFilterEnabled) {
                document.getElementById('specificOptions').classList.remove('hidden');
                filterByTagDiv.classList.remove('hidden');
             } else {
             } else {
                 document.getElementById('specificOptions').classList.add('hidden');
                 filterByTagDiv.classList.add('hidden');
                searchTagInput.value = '';
             }
             }
         });
         }


document.addEventListener('DOMContentLoaded', () => {
        function applyFilters() {
    const filterButton = document.getElementById('filterButton');
            const mapType = document.getElementById('mapType').value;
    const mapTypeSelect = document.getElementById('mapType');
            const specificOption = document.getElementById('specificOption').value;
    const specificOptionSelect = document.getElementById('specificOption');
            const searchIds = document.getElementById('searchIds').value.trim().split(',').map(id => id.trim());
    const errorMessage = document.getElementById('error-message');
            const searchTag = document.getElementById('searchTag').value.trim().toLowerCase();
            const imageContainer = document.getElementById('imageContainer');
            const errorMessage = document.getElementById('error-message');


    filterButton.addEventListener('click', () => {
            imageContainer.innerHTML = '';
        // Limpa a mensagem de erro
            errorMessage.classList.add('hidden');
        errorMessage.classList.add('hidden');


        // Obtém os valores selecionados
            if (searchTag && (!mapType || !specificOption)) {
        const mapType = mapTypeSelect.value;
        const specificOption = specificOptionSelect.value;
 
        // Verifica se a tag foi preenchida e as opções foram selecionadas
        if (!mapType || !specificOption) {
            if (document.getElementById('searchIds').value.trim() !== '') {
                // Exibe a mensagem de erro se tentar filtrar por tag sem selecionar as opções
                 errorMessage.classList.remove('hidden');
                 errorMessage.classList.remove('hidden');
                 return;
                 return;
             }
             }
        }


        // Seu código para filtrar e mostrar as imagens aqui
             let images = [];
        // Exemplo: console.log('Filtrando com', { mapType, specificOption });
             if (mapType && specificOption) {
    });
                 images = specificOptions[mapType][specificOption] || [];
});
                 if (searchIds.length) {
 
                     images = images.filter(item => searchIds.includes(item.id));
        document.getElementById('specificOption').addEventListener('change', function () {
             const selectedMapType = document.getElementById('mapType').value;
            const selectedOption = this.value;
            const imageContainer = document.getElementById('imageContainer');
 
             if (selectedMapType && selectedOption) {
                 const images = specificOptions[selectedMapType][selectedOption];
                let imagesHtml = '';
 
                 if (Array.isArray(images)) {
                     images.forEach(image => {
                        imagesHtml += `
                            <div class="image-item">
                                <img src="${image.imageUrl}" alt="${selectedOption}">
                                <div class="image-info">
                                    <b>Número do Mapa</b>: ${image.id} <br>
                                    <b>Local</b>: ${image.local} <br>
                                    <b>Coordenada</b>: ${image.coordinates}
                                </div>
                            </div>
                        `;
                    });
                } else {
                    imagesHtml = `
                        <div class="image-item">
                            <img src="${images.imageUrl}" alt="${selectedOption}">
                            <div class="image-info">
                                <b>Número do Mapa</b>: ${images.id} <br>
                                <b>Local</b>: ${images.local} <br>
                                <b>Coordenada</b>: ${images.coordinates}
                            </div>
                        </div>
                    `;
                 }
                 }
                 imageContainer.innerHTML = imagesHtml;
                 if (searchTag) {
                imageContainer.classList.remove('hidden');
                    images = images.filter(item => item.tag && item.tag.toLowerCase().includes(searchTag));
            } else {
                imageContainer.classList.add('hidden');
            }
        });
        const enableFilterCheckbox = document.getElementById('enableFilter');
        const filterSection = document.getElementById('filterSection');
        const filterByTag = document.getElementById('filterByTag');
        const searchTagInput = document.getElementById('searchTag');
        const mapTypeSelect = document.getElementById('mapType');
        const specificOptionSelect = document.getElementById('specificOption');
        const imageContainer = document.getElementById('imageContainer');
 
        enableFilterCheckbox.addEventListener('change', () => {
            const isChecked = enableFilterCheckbox.checked;
            filterSection.classList.toggle('hidden', !isChecked);
            filterByTag.classList.toggle('hidden', !isChecked);
        });
 
        document.getElementById('filterButton').addEventListener('click', () => {
            const selectedMapType = mapTypeSelect.value;
            const selectedSpecificOption = specificOptionSelect.value;
            const searchTag = searchTagInput.value.toLowerCase();
 
            const imagesToShow = [];
 
            for (const [mapType, options] of Object.entries(specificOptions)) {
                for (const [option, images] of Object.entries(options)) {
                    if ((selectedMapType === mapType || !selectedMapType) &&
                        (selectedSpecificOption === option || !selectedSpecificOption)) {
                        imagesToShow.push(...images.filter(img => searchTag ? img.tag.toLowerCase() === searchTag : true));
                    }
                 }
                 }
             }
             }


            displayImages(imagesToShow);
             if (images.length) {
        });
                 images.forEach(item => {
 
                     const imageElement = document.createElement('div');
        function displayImages(images) {
                     imageElement.classList.add('image-item');
            imageContainer.innerHTML = '';
                     imageElement.innerHTML = `
 
                         <img src="${item.imageUrl}" alt="Mapa">
             if (images.length === 0) {
                imageContainer.innerHTML = '<p>Nenhuma imagem encontrada.</p>';
            } else {
                 images.forEach(img => {
                     const imgElement = document.createElement('div');
                     imgElement.className = 'image-item';
                     imgElement.innerHTML = `
                         <img src="${img.imageUrl}" alt="Mapa">
                         <div class="image-info">
                         <div class="image-info">
                             <p>ID: ${img.id}</p>
                             <p>ID: ${item.id}</p>
                             <p>Local: ${img.local}</p>
                             <p>Local: ${item.local}</p>
                             <p>Coordenadas: ${img.coordinates}</p>
                             <p>Coordenadas: ${item.coordinates}</p>
                         </div>
                         </div>
                     `;
                     `;
                     imageContainer.appendChild(imgElement);
                     imageContainer.appendChild(imageElement);
                 });
                 });
                 imageContainer.classList.remove('hidden');
                 imageContainer.classList.remove('hidden');
            } else {
                imageContainer.classList.add('hidden');
                errorMessage.classList.remove('hidden');
             }
             }
         }
         }
     </script>
     </script>
</body>
</body>
</html>
</html>

Edição das 23h26min de 26 de agosto de 2024

<!DOCTYPE html> <html lang="pt-BR">

<head>

   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Seleção e Exibição de Imagens</title>
   <style>
       .d-flex {
           display: flex;
           justify-content: center;
           align-items: center;
           flex-direction: column;
           margin-top: -15px;
       }
       .hidden {
           display: none;
       }
       .image-container {
           display: flex;
           flex-wrap: wrap;
           justify-content: center;
           gap: 10px;
           margin-top: 5px;
       }
       .image-container .image-item {
           flex: 1 0 30%;
           text-align: center;
       }
       .image-container img {
           object-fit: cover;
           margin-bottom: 5px;
       }
       .image-info {
           margin-top: 5px;
       }
       select,
       input[type="text"],
       button {
           margin: 5px;
       }
       #filterButton,
       #searchButton {
           background: none;
           border: none;
           padding: 0;
           cursor: pointer;
           margin-top: 5px;
       }
       #filterButton img,
       #searchButton img {
           border-radius: 12px;
           width: auto;
           height: auto;
       }
       .mw-body-content {
           display: flex;
       }
       .mw-parser-output {
           display: inline-block;
           padding: .5rem 2rem;
           margin: 0 auto;
           border: 30px solid transparent;
           border-image: url(https://wiki.pokexgames.com/images/3/37/Calculadora-de-Boost.png) 38;
           min-width: 340px;
           min-height: 270px;
       }
       .input-group {
           position: relative;
           margin: 20px 0;
       }
       .input-group label {
           position: absolute;
           top: -18px;
           background: none;
           padding: 0 5px;
           font-size: 14px;
           font-weight: bold;
           color: #0d0d0d;
       }
       .maps__select {
           width: 100%;
           padding: 10px;
           font-size: 16px;
           border-radius: 5px;
           border: 1px solid #ccc;
           appearance: none;
           background-color: #fff;
           box-sizing: border-box;
       }
       .input-group input[type="text"] {
           width: 100%;
           padding: 10px;
           font-size: 16px;
           border-radius: 5px;
           border: 1px solid #ccc;
           box-sizing: border-box;
       }
       .maps__label {
           position: absolute;
           top: -18px;
           background: none;
           padding: 0 5px;
           font-size: 14px;
           font-weight: bold;
           color: #0d0d0d;
       }
       .hover-minimize:hover {
           transform: scale(0.95);
       }
       .filter-container {
           display: flex;
           align-items: center;
       }
       .filter-container input[type="checkbox"] {
           margin: 0;
           padding: 0;
           width: auto;
           height: auto;
           vertical-align: middle;
       }
       .filter-label {
           margin-left: 10px;
           font-size: 14px;
           font-weight: bold;
           color: #0d0d0d;
           line-height: 1.5;
       }
   </style>

</head>

<body>

   <form id="mapForm">
           <select id="mapType" class="maps__select">
               <option value="">Selecione um mapa</option>
               <option value="1">Mapa Vermelho</option>
               <option value="2">Mapa Verde</option>
               <option value="3">Mapa Roxo</option>
           </select>
           <label class="maps__label" for="mapType">Tipo de Mapa</label>
           <input type="checkbox" id="enableFilter">
           <label for="enableFilter" class="filter-label">Ativar filtro</label>
   </form>
   <script>
       const specificOptions = {
           1: { // Mapa Vermelho
               'Areia': [
                   { id: '101', local: 'Green Island', coordinates: '3780, 3326, 7', imageUrl: 'https://wiki.pokexgames.com/images/d/db/3780%2C_3326%2C_7.png' },
               ],
               // Outras opções do Mapa Vermelho
           },
         2: { 
               'Areia': [
               { id: '1001', local: ' Outland Water', coordinates: '2847, 2827, 6', imageUrl: 'https://wiki.pokexgames.com/images/b/b9/Mapa_Verde_ADV_-_2847%2C_2827%2C_6.webp' },

{ id: '1002', local: ' Outland Water', coordinates: '2863, 2850, 6', imageUrl: 'https://wiki.pokexgames.com/images/c/c9/Mapa_Verde_ADV_-_2863%2C_2850%2C_6.webp' }, { id: '1003', local: ' Respawn de Baltoy', coordinates: '5575, 5658, 5', imageUrl: 'https://wiki.pokexgames.com/images/3/3f/Mapa_Verde_ADV_-_5575%2C_5658%2C_5.webp' }, { id: '1004', local: ' Respawn de Vibrava', coordinates: '5616, 5729, 7', imageUrl: 'https://wiki.pokexgames.com/images/6/67/Mapa_Verde_ADV_-_5616%2C_5729%2C_7.webp' }, { id: '1005', local: ' Respawn de Flygon', coordinates: '5730, 5708, 7', imageUrl: 'https://wiki.pokexgames.com/images/6/6b/Mapa_Verde_ADV_-_5730%2C_5708%2C_7.webp' }, { id: '1006', local: ' Respawn de Pelipper', coordinates: '5814, 6111, 7', imageUrl: 'https://wiki.pokexgames.com/images/0/06/Mapa_Verde_ADV_-_5814%2C_6111%2C_7.webp' },

               ],
               'Gelo': [
               { id: '2001', local: ' Outland Ice', coordinates: '2562, 3244, 6', imageUrl: 'https://wiki.pokexgames.com/images/4/40/Mapa_Verde_ADV_-_2562%2C_3244%2C_6.webp' },

{ id: '2002', local: ' Outland Ice', coordinates: '2670, 3318, 8', imageUrl: 'https://wiki.pokexgames.com/images/7/71/Mapa_Verde_ADV_-_2670%2C_3318%2C_8.webp' }, { id: '2003', local: ' Outland Ice', coordinates: '2695, 3286, 7', imageUrl: 'https://wiki.pokexgames.com/images/e/e5/Mapa_Verde_ADV_-_2695%2C_3286%2C_7.webp' }, { id: '2004', local: ' Outland Dragon', coordinates: '2710, 3287, 4', imageUrl: 'https://wiki.pokexgames.com/images/9/94/Mapa_Verde_ADV_-_2710%2C_3287%2C_4.webp' }, { id: '2005', local: ' Respawn de Swellow', coordinates: '5047, 5744, 5', imageUrl: 'https://wiki.pokexgames.com/images/7/7c/Mapa_Verde_ADV_-_5047%2C_5744%2C_5.webp' }, { id: '2006', local: ' Respawn de Walrein', coordinates: '5845, 5800, 7', imageUrl: 'https://wiki.pokexgames.com/images/9/93/Mapa_Verde_ADV_-_5845%2C_5800%2C_7.webp' },

               ],
               'Grama': [
               { id: '3001', local: ' Outland Bug', coordinates: '2633, 3039, 7', imageUrl: 'https://wiki.pokexgames.com/images/4/40/Mapa_Verde_ADV_-_2633%2C_3039%2C_7.webp' },

{ id: '3002', local: ' Outland Water', coordinates: '2654, 2810, 7', imageUrl: 'https://wiki.pokexgames.com/images/2/26/Mapa_Verde_ADV_-_2654%2C_2810%2C_7.webp' }, { id: '3003', local: ' Outland Grass', coordinates: '2863, 2879, 7', imageUrl: 'https://wiki.pokexgames.com/images/8/8d/Mapa_Verde_ADV_-_2863%2C_2879%2C_7.webp' }, { id: '3004', local: ' Respawn de Nuzleaf', coordinates: '5355, 5962, 7', imageUrl: 'https://wiki.pokexgames.com/images/d/d8/Mapa_Verde_ADV_-_5355%2C_5962%2C_7.webp' }, { id: '3005', local: ' Respawn de Grovyle', coordinates: '5383, 5892, 6', imageUrl: 'https://wiki.pokexgames.com/images/9/9c/Mapa_Verde_ADV_-_5383%2C_5892%2C_6.webp' }, { id: '3006', local: ' Respawn de Sceptile', coordinates: '5395, 5795, 6', imageUrl: 'https://wiki.pokexgames.com/images/d/de/Mapa_Verde_ADV_-_5395%2C_5795%2C_6.webp' }, { id: '3007', local: ' Respawn de Zangoose', coordinates: '5417, 5757, 7', imageUrl: 'https://wiki.pokexgames.com/images/4/49/Mapa_Verde_ADV_-_5417%2C_5757%2C_7.webp' }, { id: '3008', local: ' Respawn de Exploud', coordinates: '5437, 5561, 5', imageUrl: 'https://wiki.pokexgames.com/images/6/6c/Mapa_Verde_ADV_-_5437%2C_5561%2C_5.webp' }, { id: '3009', local: ' Respawn de Ludicolo', coordinates: '5463, 5838, 7', imageUrl: 'https://wiki.pokexgames.com/images/c/c3/Mapa_Verde_ADV_-_5463%2C_5838%2C_7.webp' }, { id: '3010', local: ' Respawn de Wingull', coordinates: '5726, 6160, 7', imageUrl: 'https://wiki.pokexgames.com/images/3/37/Mapa_Verde_ADV_-_5729%2C_6160%2C_7.webp' }, { id: '3011', local: ' Artificial Safari', coordinates: '5797, 5661, 7', imageUrl: 'https://wiki.pokexgames.com/images/3/3e/Mapa_Verde_ADV_-_5797%2C_5661%2C_7.webp' }, { id: '3012', local: ' Artificial Safari', coordinates: '5871, 5532, 7', imageUrl: 'https://wiki.pokexgames.com/images/b/b7/Mapa_Verde_ADV_-_5871%2C_5532%2C_7.webp' },

               ],
               'Pedra': [
               { id: '4001', local: ' Outland Fire', coordinates: '2793, 3029, 7', imageUrl: 'https://wiki.pokexgames.com/images/f/fc/Mapa_Verde_ADV_-_2793%2C_3029%2C_7.webp' },

{ id: '4002', local: ' Outland Water', coordinates: '2808, 2864, 7', imageUrl: 'https://wiki.pokexgames.com/images/0/0a/Mapa_Verde_ADV_-_2808%2C_2864%2C_7.webp' }, { id: '4003', local: ' Respawn de Hariyama', coordinates: '5368, 5779, 5', imageUrl: 'https://wiki.pokexgames.com/images/4/45/Mapa_Verde_ADV_-_5368%2C_5779%2C_5.webp' }, { id: '4004', local: ' Respawn de Blaziken', coordinates: '5613, 5910, 4', imageUrl: 'https://wiki.pokexgames.com/images/a/ab/Mapa_Verde_ADV_-_5613%2C_5910%2C_4.webp' }, { id: '4005', local: ' Respawn de Camerupt', coordinates: '5617, 5925, 5', imageUrl: 'https://wiki.pokexgames.com/images/a/a1/Mapa_Verde_ADV_-_5617%2C_5925%2C_5.webp' }, { id: '4006', local: ' Respawn de Claydol', coordinates: '5621, 5667, 5', imageUrl: 'https://wiki.pokexgames.com/images/7/72/Mapa_Verde_ADV_-_5621%2C_5667%2C_5.webp' }, { id: '4007', local: ' Respawn de Torkoal', coordinates: '5650, 5914, 6', imageUrl: 'https://wiki.pokexgames.com/images/c/c9/Mapa_Verde_ADV_-_5650%2C_5914%2C_6.webp' },

               ],
               'Subaquáticos': [
               { id: '5001', local: ' Caminho da Outland North', coordinates: '4204, 4404, 12', imageUrl: 'https://wiki.pokexgames.com/images/4/4b/Mapa_Verde_ADV_-_4204%2C_4404%2C_12.webp' },

{ id: '5002', local: ' Área subaquática próximo aos Zangoose', coordinates: '5425, 5747, 8', imageUrl: 'https://wiki.pokexgames.com/images/6/63/Mapa_Verde_ADV_-_5425%2C_5747%2C_8.webp' },

               ],
               'Terra': [
               { id: '6001', local: ' Outland Ground', coordinates: '2551, 3105, 7', imageUrl: 'https://wiki.pokexgames.com/images/8/8d/Mapa_Verde_ADV_-_2551%2C_3105%2C_7.webp' },

{ id: '6002', local: ' Outland Bug', coordinates: '2720, 3039, 7', imageUrl: 'https://wiki.pokexgames.com/images/e/e7/Mapa_Verde_ADV_-_2720%2C_3039%2C_7.webp' }, { id: '6003', local: ' Outland Fire', coordinates: '2842, 3073, 6', imageUrl: 'https://wiki.pokexgames.com/images/f/f1/Mapa_Verde_ADV_-_2842%2C_3073%2C_6.webp' }, { id: '6004', local: ' Outland Grass', coordinates: '2922, 2913, 6', imageUrl: 'https://wiki.pokexgames.com/images/3/3f/Mapa_Verde_ADV_-_2922%2C_2913%2C_6.webp' }, { id: '6005', local: ' Respawn de Toxicroak', coordinates: '5309, 5805, 6', imageUrl: 'https://wiki.pokexgames.com/images/4/40/Mapa_Verde_ADV_-_5309%2C_5805%2C_6.webp' }, { id: '6006', local: ' Respawn de Seviper', coordinates: '5317, 5787, 7', imageUrl: 'https://wiki.pokexgames.com/images/6/67/Mapa_Verde_ADV_-_5317%2C_5787%2C_7.webp' }, { id: '6007', local: ' Respawn de Shiftry', coordinates: '5400, 6039, 6', imageUrl: 'https://wiki.pokexgames.com/images/d/d7/Mapa_Verde_ADV_-_5400%2C_6039%2C_6.webp' }, { id: '6008', local: ' Respawn de Poochyena', coordinates: '5414, 6019, 8', imageUrl: 'https://wiki.pokexgames.com/images/3/31/Mapa_Verde_ADV_-_5414%2C_6019%2C_8.webp' }, { id: '6009', local: ' Respawn de Vigoroth', coordinates: '5569, 5883, 5', imageUrl: 'https://wiki.pokexgames.com/images/b/b2/Mapa_Verde_ADV_-_5569%2C_5883%2C_5.webp' }, { id: '6010', local: ' Respawn de Medicham', coordinates: '5606, 5682, 6', imageUrl: 'https://wiki.pokexgames.com/images/b/b3/Mapa_Verde_ADV_-_5606%2C_5682%2C_6.webp' }, { id: '6011', local: ' Entrada dos Castform de Phenac', coordinates: '5612, 5638, 7', imageUrl: 'https://wiki.pokexgames.com/images/a/a5/Mapa_Verde_ADV_-_5612%2C_5638%2C_7.webp' }, { id: '6012', local: ' Respawn de Swampert', coordinates: '5694, 5804, 7', imageUrl: 'https://wiki.pokexgames.com/images/8/82/Mapa_Verde_ADV_-_5694%2C_5804%2C_7.webp' },

               ],
               'Pisos':[
               { id: '7001', local: ' Outland Electric', coordinates: '2505, 3105, 10', imageUrl: 'https://wiki.pokexgames.com/images/b/b8/Mapa_Verde_ADV_-_2505%2C_3105%2C_10.webp' },
               { id: '7002', local: ' Outland Psychic', coordinates: '2586, 2968, 7', imageUrl: 'https://wiki.pokexgames.com/images/8/84/Mapa_Verde_ADV_-_2586%2C_2968%2C_7.webp' },
               { id: '7003', local: ' Outland Psychic', coordinates: '2607, 2958, 6', imageUrl: 'https://wiki.pokexgames.com/images/f/f3/Mapa_Verde_ADV_-_2607%2C_2958%2C_6.webp' },

{ id: '7004', local: ' Respawn de Lairon', coordinates: '5361, 5682, 7', imageUrl: 'https://wiki.pokexgames.com/images/e/eb/Mapa_Verde_ADV_-_5361%2C_5682%2C_7.webp' }, { id: '7005', local: ' Respawn de Metang', coordinates: '5437, 5561, 6', imageUrl: 'https://wiki.pokexgames.com/images/b/b0/Mapa_Verde_ADV_-_5437%2C_5561%2C_6.webp' }, { id: '7006', local: ' Respawn de Mightyena', coordinates: '5485, 5987, 8', imageUrl: 'https://wiki.pokexgames.com/images/0/06/Mapa_Verde_ADV_-_5485%2C_5987%2C_8.webp' }, { id: '7007', local: ' Pirâmide nos Cacturne', coordinates: '5631, 5589, 7', imageUrl: 'https://wiki.pokexgames.com/images/9/93/Mapa_Verde_ADV_-_5631%2C_5589%2C_7.webp' },

               ]
           },
           3: { // Mapa Roxo
               // Adicionar dados para o Mapa Roxo aqui
           }
       };
document.getElementById('mapType').addEventListener('change', updateOptions);
       document.getElementById('specificOption').addEventListener('change', updateOptions);
       document.getElementById('enableFilter').addEventListener('change', toggleFilter);
       document.getElementById('filterButton').addEventListener('click', applyFilters);
       document.getElementById('searchTag').addEventListener('input', toggleFilter);
       function updateOptions() {
           const mapType = document.getElementById('mapType').value;
           const specificOption = document.getElementById('specificOption').value;
           const specificOptionsDiv = document.getElementById('specificOptions');
           const filterSectionDiv = document.getElementById('filterSection');
           const filterByTagDiv = document.getElementById('filterByTag');
           
           if (mapType) {
               specificOptionsDiv.classList.remove('hidden');
           } else {
               specificOptionsDiv.classList.add('hidden');
               filterSectionDiv.classList.add('hidden');
               document.getElementById('searchTag').value = ;
           }
           if (mapType && specificOption) {
               filterSectionDiv.classList.remove('hidden');
           } else {
               filterSectionDiv.classList.add('hidden');
           }
       }
       function toggleFilter() {
           const isFilterEnabled = document.getElementById('enableFilter').checked;
           const filterByTagDiv = document.getElementById('filterByTag');
           const searchTagInput = document.getElementById('searchTag');
           
           if (isFilterEnabled) {
               filterByTagDiv.classList.remove('hidden');
           } else {
               filterByTagDiv.classList.add('hidden');
               searchTagInput.value = ;
           }
       }
       function applyFilters() {
           const mapType = document.getElementById('mapType').value;
           const specificOption = document.getElementById('specificOption').value;
           const searchIds = document.getElementById('searchIds').value.trim().split(',').map(id => id.trim());
           const searchTag = document.getElementById('searchTag').value.trim().toLowerCase();
           const imageContainer = document.getElementById('imageContainer');
           const errorMessage = document.getElementById('error-message');
           imageContainer.innerHTML = ;
           errorMessage.classList.add('hidden');
           if (searchTag && (!mapType || !specificOption)) {
               errorMessage.classList.remove('hidden');
               return;
           }
           let images = [];
           if (mapType && specificOption) {
               images = specificOptions[mapType][specificOption] || [];
               if (searchIds.length) {
                   images = images.filter(item => searchIds.includes(item.id));
               }
               if (searchTag) {
                   images = images.filter(item => item.tag && item.tag.toLowerCase().includes(searchTag));
               }
           }
           if (images.length) {
               images.forEach(item => {
                   const imageElement = document.createElement('div');
                   imageElement.classList.add('image-item');
                   imageElement.innerHTML = `
                       <img src="${item.imageUrl}" alt="Mapa">

ID: ${item.id}

Local: ${item.local}

Coordenadas: ${item.coordinates}

                   `;
                   imageContainer.appendChild(imageElement);
               });
               imageContainer.classList.remove('hidden');
           } else {
               imageContainer.classList.add('hidden');
               errorMessage.classList.remove('hidden');
           }
       }
   </script>

</body>

</html>