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

De PokeXGames
Ir para navegação Ir para pesquisar
Sem resumo de edição
Sem resumo de edição
 
(200 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
<script>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Busca de Imagens por Nome</title>
    <style>
        .input-group { margin-bottom: 1em; position: relative; }
        .dropdown {
            border: 1px solid #ccc;
            display: none;
            position: absolute;
            background-color: #fff;
            z-index: 1000;
            max-height: 150px;
            overflow-y: auto;
            width: 100%;
        }
        .dropdown-item {
            padding: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
        }
        .dropdown-item img {
            margin-right: 10px;
        }
        .dropdown-item:hover {
            background-color: #f0f0f0;
        }
        .image-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .image-item {
            margin-bottom: 1em;
            text-align: center;
        }
        .image-item img {
            display: block;
            margin: 0 auto;
        }


const optionsImageTestz = [
        .variations-container {
    {
            display: flex;
        label: "Arya Stark",
            flex-wrap: wrap;
        image: "/images/0/02/Unown-j.png",
            justify-content: center;
        obs: "<center>
            margin-top: 1em;
{| class="wikitable sortable" width="21%"
        }
! colspan="4" | Velocidades de Fly 
|-
! align="center"  colspan="2" class="unsortable" | Pokémon 
! align="center" | Velocidade


|-
        .variation-item {
| width="1%" align="center" | [[Arquivo:628-Braviary.png|link=Charizard]]
            width: 30%;
| width="11%" align="center" | [[Braviary]]
            box-sizing: border-box;
| width="1%" align="center" | 500
            margin: 10px;
|-
            text-align: center;
| width="1%" align="center" | [[Arquivo:006-Charizard.png|link=Charizard]]
            border: 1px solid #ccc;
| width="11%" align="center" | [[Charizard]]
            padding: 10px;
| width="1%" align="center" | 500
        }
|-
| width="1%" align="center" | [[Arquivo:006-shCharizard.png|link=Shiny Charizard]]
| width="11%" align="center" | [[Shiny Charizard]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:012-Sh Butterfree.png|link=Shiny Butterfree]]
| width="11%" align="center" | [[Shiny Butterfree]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:018-Pidgeot.png|link=Pidgeot]]
| width="11%" align="center" | [[Pidgeot]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:018-shPidgeot.png|link=Shiny Pidgeot]]
| width="11%" align="center" | [[Shiny Pidgeot]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:022-Fearow.png|link=Fearow]]
| width="11%" align="center" | [[Fearow]]
| width="1%" align="center" | 400
|-
| width="1%" align="center" | [[Arquivo:Shinyfea.png|link=Shiny Fearow]]
| width="11%" align="center" | [[Shiny Fearow]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:026-Raichu.png|link=Raichu]]
| width="11%" align="center" | [[Raichu]] <span style="color:red"> * </span>
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:026-Sh Raichu.png|link=Shiny Raichu]]
| width="11%" align="center" | [[Shiny Raichu]] <span style="color:red"> * </span>
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:049-Venomoth.png|link=Venomoth]]
| width="11%" align="center" | [[Venomoth]]
| width="1%" align="center" | 400
|-
| width="1%" align="center" | [[Arquivo:049-Sh Venomoth.png|link=Shiny Venomoth]]
| width="11%" align="center" | [[Shiny Venomoth]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:083-Farfetch-D.png|link=Farfetch'D]]
| width="11%" align="center" | [[Farfetch'D]]
| width="1%" align="center" | 400
|-
| width="1%" align="center" | [[Arquivo:083-shFarfetch-D.png|link=Elite Farfetch'D]]
| width="11%" align="center" | [[Elite Farfetch'D]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:094-Gengar.png|link=Gengar]]
| width="11%" align="center" | [[Gengar]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:Sgengar.png|link=Shiny Gengar]]
| width="11%" align="center" | [[Shiny Gengar]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:137-Porygon.png|link=Porygon]]
| width="11%" align="center" | [[Porygon]]
| width="1%" align="center" | 400
|-
| width="1%" align="center" | [[Arquivo:142-Aerodactyl.png|link=Aerodactyl]]
| width="11%" align="center" | [[Aerodactyl]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:148-Dragonair.png|link=Dragonair]]
| width="11%" align="center" | [[Dragonair]]
| width="1%" align="center" | 400
|-
| width="1%" align="center" | [[Arquivo:148-Sh Dragonair.png|link=Shiny Dragonair]]
| width="11%" align="center" | [[Shiny Dragonair]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:149-Dragonite.png|link=Dragonite]]
| width="11%" align="center" | [[Dragonite]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:164-Noctowl.png|link=Noctowl]]
| width="11%" align="center" | [[Noctowl]]
| width="1%" align="center" | 400
|-
| width="1%" align="center" | [[Arquivo:164-Sh Noctowl.png|link=Shiny Noctowl]]
| width="11%" align="center" | [[Shiny Noctowl]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:169-Crobat.png|link=Crobat]]
| width="11%" align="center" | [[Crobat]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:169-Sh Crobat.png|link=Shiny Crobat]]
| width="11%" align="center" | [[Shiny Crobat]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:178-Xatu.png|link=Xatu]]
| width="11%" align="center" | [[Xatu]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:178-shXatu.png|link=Shiny Xatu]]
| width="11%" align="center" | [[Shiny Xatu]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:214-Heracross.png|link=Heracross]]
| width="11%" align="center" | [[Heracross]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:225-Delibird.png|link=Delibird]]
| width="11%" align="center" | [[Delibird]]
| width="1%" align="center" | 400
|-
| width="1%" align="center" | [[Arquivo:225-Sh_Delibird.png|link=Shiny Delibird]]
| width="11%" align="center" | [[Shiny Delibird]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:227-Skarmory.png|link=Skarmory]]
| width="11%" align="center" | [[Skarmory]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:233-Porygon2.png|link=Porygon2]]
| width="11%" align="center" | [[Porygon2]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:277-Swellow.png|link=Swellow]]
| width="11%" align="center" | [[Swellow]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:279-Pelipper.png|link=Pelipper]]
| width="11%" align="center" | [[Pelipper]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:330-Flygon.png|link=Flygon]]
| width="11%" align="center" | [[Flygon]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:334-Altaria.png|link=Altaria]]
| width="11%" align="center" | [[Altaria]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:357-Tropius.png|link=Tropius]]
| width="11%" align="center" | [[Tropius]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:373-Salamence.png|link=Salamence]] 
| width="11%" align="center" | [[Salamence]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:398-Staraptor.png|link=Staraptor]]
| width="11%" align="center" | [[Staraptor]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:430-Honchkrow.png|link=Honchkrow]]
| width="11%" align="center" | [[Honchkrow]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:430-Shiny Honchkrow.png|link=Shiny Honchkrow]]
| width="11%" align="center" | [[Shiny Honchkrow]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:445-Garchomp.png|link=Garchomp]]
| width="11%" align="center" | [[Garchomp]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:462-Magnezone.png|link=Magnezone]]
| width="11%" align="center" | [[Magnezone]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:462-Shiny Magnezone.png|link=Shiny Magnezone]]
| width="11%" align="center" | [[Shiny Magnezone]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:468-Togekiss.png|link=Togekiss]]
| width="11%" align="center" | [[Togekiss]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:474.png|link=Porygon-Z]]
| width="11%" align="center" | [[Porygon-Z]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:567-Archeops.png|link=Archeops]]
| width="11%" align="center" | [[Archeops]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:623-Shiny_Golurk.png|link=Shiny Golurk]]
| width="11%" align="center" | [[Shiny Golurk]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:637-Volcarona.png|link=Volcarona]]
| width="11%" align="center" | [[Volcarona]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:663-Talonflame.png|link=Talonflame]]
| width="11%" align="center" | [[Talonflame]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:621-Druddigon.png|link=Druddigon]]
| width="11%" align="center" | [[Druddigon]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:621-Shiny_Druddigon.png|link=Shiny Druddigon]]
| width="11%" align="center" | [[Shiny Druddigon]]
| width="1%" align="center" | 600
|-
| width="1%" align="center" | [[Arquivo:623-Golurk.png|link=Golurk]]
| width="11%" align="center" | [[Golurk]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:635-Hydreigon.png|link=Hydreigon]]
| width="11%" align="center" | [[Hydreigon]]
| width="1%" align="center" | 500
|-
| width="1%" align="center" | [[Arquivo:635-Shiny Hydreigon.png|link=Shiny Hydreigon]]
| width="11%" align="center" | [[Shiny Hydreigon]]
| width="1%" align="center" | 600
|-
|}
</center>


<span style="color:red"> * </span>''' O Item Y-Balloon garante velocidade equivalente ao Wing 5 ao Shiny Raichu ou seja, 870 de fly speed.'''<br>
        .variation-item img {
<span style="color:red"> * </span>''' O Item Y-Balloon garante velocidade semelhante ao Wing 2 ao Raichu, ficando com 640 de fly speed.'''
            width: 100px;
"
            height: 100px;
    },
            display: block;
    {
            margin: 0 auto 10px;
         label: "O ódio é um fardo muito grande para suportar (BEAR). Quem eu sou?",
        }
        image: "/images/7/74/Unown-b.png",
 
        obs: "<center><b>Unown B</b></center>"
         .swap-button {
    },
            margin-top: 10px;
    {
            cursor: pointer;
        label: "Se você persegue (CHASE) algo desesperadamente, isso te ilude. Quem eu sou?",
            width: 15px;
        image: "/images/6/66/Unown-c.png",
            height: 15px;
         obs: "<center><b>Unown C</b></center>"
            background: url('https://wiki.pokexgames.com/images/2/2d/Comvip.png') no-repeat center;
     },
            background-size: contain;
    {
            display: block;
        label: "Você não pode controlar a direção (DIRECT) do vento, mas pode ajustar as velas. Quem eu sou?",
            margin: 0 auto;
         image: "/images/2/23/Unown-d.png",
         }
        obs: "<center><b>Unown D</b></center>"
    </style>
    },
</head>
    {
<body>
         label: "A preparação é necessária antes de participar (ENGAGE) de qualquer reunião. Quem eu sou?",
     <form id="imageForm">
        image: "/images/4/42/Unown-e.png",
         <div class="input-group">
         obs: "<center><b>Unown E</b></center>"
            <input type="text" id="imageSearch" placeholder="Digite o nome da imagem" autocomplete="off">
     },
            <div id="dropdown" class="dropdown"></div>
    {
        </div>
        label: "É possível encontrar (FIND) esperança mesmo nos dias mais sombrios. Quem eu sou?",
 
        image: "/images/7/70/Unown-f.png",
         <div id="imageContainer" class="image-container hidden">
        obs: "<center><b>Unown F</b></center>"
            <!-- As imagens e suas informações serão exibidas aqui -->
    },
         </div>
    {
    </form>
        label: "Um amigo é um presente (GIFT) que você se dá. Quem eu sou?",
 
        image: "/images/2/21/Unown-g.png",
     <script>
        obs: "<center><b>Unown G</b></center>"
        const imageList = {
    },
            'Charmander': {
    {
                imageUrl: 'https://wiki.pokexgames.com/images/6/65/004-Charmander.png',  
        label: "Nós não podemos ajudar todo mundo, mas todo mundo pode ajudar (HELP) alguém. Quem eu sou?",
                variations: [
        image: "/images/1/19/Unown-h.png",
                    {  
        obs: "<center><b>Unown H</b></center>"
                        imageUrl: 'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',
    },
                        description: 'Charmander XXX',
    {
                        obtain: {
        label: "O medo pode aumentar (INCREASE) sua capacidade de sobreviver. Quem eu sou?",
                            url: 'https://wiki.pokexgames.com/index.php/Craft_Profissões_-_Estilista#Rank_E',
        image: "/images/f/f4/Unown-i.png",
                            text: 'Estilista'
        obs: "<center><b>Unown I</b></center>"
                        },
    },
                        additionalImages: [
    {
                            'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png', // Frente
        label: "Somente quando juntar (JOIN) todos os pedaços é que você poderá ver a foto. Quem eu sou?",
                            'https://example.com/left1.png',   // Lado Esquerdo
        image: "/images/0/02/Unown-j.png",
                            'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',   // Costas
        obs: "<center><b>Unown J</b></center>"
                            'https://example.com/right1.png'  // Lado Direito
    },
                        ]
    {
                    },
        label: "Se você continuar (KEEP) seguindo em frente, você não terá que parar. Quem eu sou?",
                    {
        image: "/images/9/9d/Unown-k.png",
                        imageUrl: 'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',
        obs: "<center><b>Unown K</b></center>"
                        description: 'Charmander brabo.',
    },
                        obtain: {
    {
                            url: 'https://wiki.pokexgames.com/index.php/Craft_Profissões_-_Estilista#Rank_E',
        label: "Você ri de mim porque eu sou diferente, eu rio (LAUGH) de vocês porque são todos iguais. Quem eu sou?",
                            text: 'Estilista'
        image: "/images/9/9c/Unown-l.png",
                        },
        obs: "<center><b>Unown L</b></center>"
                        additionalImages: [
    },
                            'https://example.com/front2.png', // Frente
    {
                            'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',   // Lado Esquerdo
        label: "Decida-se (MAKE), talvez você não tenha outra chance. Quem eu sou?",
                            'https://example.com/back2.png',   // Costas
        image: "/images/9/94/Unown-m.png",
                            'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png// Lado Direito
        obs: "<center><b>Unown M</b></center>"
                        ]
    },
                    }
    {
                ]
        label: "Você deveria encostar (NUZZLE) em algum lugar. Quem eu sou?",
            },
        image: "/images/4/4e/Unown-n.png",
        };
        obs: "<center><b>Unown N</b></center>"
 
    },
         const imageSearch = document.getElementById('imageSearch');
    {
        const dropdown = document.getElementById('dropdown');
        label: "Você pode observar (OBSERVE) muito apenas assistindo. Quem eu sou?",
         const imageContainer = document.getElementById('imageContainer');
        image: "/images/2/21/Unown-o.png",
 
        obs: "<center><b>Unown O</b></center>"
         imageSearch.addEventListener('input', function() {
    },
            const searchValue = this.value.trim().toLowerCase();
    {
            dropdown.innerHTML = '';
         label: "A vida é a farsa que todos devem executar (PERFORM). Quem eu sou?",
 
         image: "/images/a/a8/Unown-p.png",
            if (searchValue) {
         obs: "<center><b>Unown P</b></center>"
                Object.keys(imageList).forEach(imageName => {
    },
                    if (imageName.toLowerCase().includes(searchValue)) {
    {
                        const dropdownItem = document.createElement('div');
        label: "Há momentos especiais que aceleram (QUICKEN) seu coração. Quem eu sou?",
                        dropdownItem.classList.add('dropdown-item');
        image: "/images/a/ae/Unown-q.png",
                       
        obs: "<center><b>Unown Q</b></center>"
                        const imgElement = document.createElement('img');
    },
                        imgElement.src = imageList[imageName].imageUrl;
    {
                        imgElement.alt = imageName;
        label: "Você não precisa de algo para reassegurar (REASSURE) que você é real. Quem eu sou?",
                       
        image: "/images/4/4f/Unown-r.png",
                        dropdownItem.appendChild(imgElement);
        obs: "<center><b>Unown R</b></center>"
                        dropdownItem.appendChild(document.createTextNode(imageName));
    },
                       
    {
                        dropdownItem.addEventListener('click', function() {
        label: "Humanos estão sempre em busca (SEARCH) de significados. Quem eu sou?",
                            showImageInfo(imageName);
        image: "/images/f/fe/Unown-s.png",
                            dropdown.style.display = 'none';
        obs: "<center><b>Unown S</b></center>"
                        });
    },
                        dropdown.appendChild(dropdownItem);
    {
                    }
        label: "Se você disser (TELL) a verdade, não precisa se lembrar de nada. Quem eu sou?",
                });
        image: "/images/1/12/Unown-t.png",
 
         obs: "<center><b>Unown T</b></center>"
                dropdown.style.display = dropdown.childNodes.length ? 'block' : 'none';
    },
            } else {
    {
                dropdown.style.display = 'none';
        label: "Você não pode desfazer (UNDO) o passado... mas certamente pode não repeti-lo. Quem eu sou?",
            }
         image: "/images/1/1a/Unown-u.png",
         });
        obs: "<center><b>Unown U</b></center>"
 
    },
        document.addEventListener('click', function(event) {
    {
            if (!imageSearch.contains(event.target) && !dropdown.contains(event.target)) {
        label: "Quando você sabe o que está fazendo, quaisquer obstáculos desaparecem (VANISH) do seu caminho. Quem eu sou?",
                dropdown.style.display = 'none';
        image: "/images/1/15/Unown-v.png",
            }
        obs: "<center><b>Unown V</b></center>"
        });
    },
 
    {
         function showImageInfo(imageName) {
        label: "Para ter sucesso, você deve sempre saber o que quer (WANT). Quem eu sou?",
            const imageInfo = imageList[imageName];
        image: "/images/a/ad/Unown-w.png",
            let imagesHtml = `
        obs: "<center><b>Unown W</b></center>"
                <div class="image-item">
    },
                    <img src="${imageInfo.imageUrl}" alt="${imageName}">
    {
                </div>
        label: "XXXXX. Quem eu sou?",
                <div class="variations-container">
        image: "/images/5/58/Unown-x.png",
            `;
        obs: "<center><b>Unown X</b></center>"
 
    },
            imageInfo.variations.forEach((variation, index) => {
    {
                imagesHtml += `
        label: "Às vezes, o melhor que você pode fazer é ceder (YIELD) à tentação. Quem eu sou?",
                    <div class="variation-item">
        image: "/images/f/f9/Unown-y.png",
                        <img src="${variation.additionalImages[0]}" alt="Variation Image" class="variation-image" data-variation-index="${index}">
        obs: "<center><b>Unown Y</b></center>"
                          <div class="swap-button" data-variation-index="${index}"></div>
    },
                        <div class="image-info">
    {
                            <b>Nome do Addon</b>: ${variation.description}
        label: "Mantenha-se focado e amplie (ZOOM) suas metas. Quem eu sou?",
                            <b>Como Obter</b>: <a href="${variation.obtain.url}" target="_blank">${variation.obtain.text}</a>
        image: "/images/8/81/Unown-z.png",
                        </div>
         obs: "<center><b>Unown Z</b></center>"
                    </div>
    }
                `;
]
            });
</script>
 
            imagesHtml += '</div>';
 
            imageContainer.innerHTML = imagesHtml;
            imageContainer.classList.remove('hidden');
 
            // Alternar imagens ao clicar no botão de troca
            const swapButtons = document.querySelectorAll('.swap-button');
 
            swapButtons.forEach(button => {
                const index = button.getAttribute('data-variation-index');
                const variation = imageInfo.variations[index];
                let currentImageIndex = 0;
 
                button.addEventListener('click', () => {
                    currentImageIndex = (currentImageIndex + 1) % variation.additionalImages.length;
                    const variationImage = button.previousElementSibling;
                    variationImage.src = variation.additionalImages[currentImageIndex];
                });
            });
         }
    </script>
</body>
</html>

Edição atual tal como às 03h33min de 17 de setembro 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>Busca de Imagens por Nome</title>
   <style>
       .input-group { margin-bottom: 1em; position: relative; }
       .dropdown {
           border: 1px solid #ccc;
           display: none;
           position: absolute;
           background-color: #fff;
           z-index: 1000;
           max-height: 150px;
           overflow-y: auto;
           width: 100%;
       }
       .dropdown-item {
           padding: 8px;
           cursor: pointer;
           display: flex;
           align-items: center;
       }
       .dropdown-item img {
           margin-right: 10px;
       }
       .dropdown-item:hover {
           background-color: #f0f0f0;
       }
       .image-container {
           display: flex;
           flex-direction: column;
           align-items: center;
           justify-content: center;
       }
       .image-item { 
           margin-bottom: 1em; 
           text-align: center;
       }
       .image-item img {
           display: block;
           margin: 0 auto;
       }
       .variations-container {
           display: flex;
           flex-wrap: wrap;
           justify-content: center;
           margin-top: 1em;
       }
       .variation-item {
           width: 30%;
           box-sizing: border-box;
           margin: 10px;
           text-align: center;
           border: 1px solid #ccc;
           padding: 10px;
       }
       .variation-item img {
           width: 100px;
           height: 100px;
           display: block;
           margin: 0 auto 10px;
       }
       .swap-button {
           margin-top: 10px;
           cursor: pointer;
           width: 15px;
           height: 15px;
           background: url('https://wiki.pokexgames.com/images/2/2d/Comvip.png') no-repeat center;
           background-size: contain;
           display: block;
           margin: 0 auto;
       }
   </style>

</head> <body>

   <form id="imageForm">
           <input type="text" id="imageSearch" placeholder="Digite o nome da imagem" autocomplete="off">
   </form>
   <script>
       const imageList = {
           'Charmander': { 
               imageUrl: 'https://wiki.pokexgames.com/images/6/65/004-Charmander.png', 
               variations: [
                   { 
                       imageUrl: 'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',
                       description: 'Charmander XXX',
                       obtain: {
                           url: 'https://wiki.pokexgames.com/index.php/Craft_Profissões_-_Estilista#Rank_E',
                           text: 'Estilista'
                       },
                       additionalImages: [
                           'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',  // Frente
                           'https://example.com/left1.png',   // Lado Esquerdo
                           'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',   // Costas
                           'https://example.com/right1.png'   // Lado Direito
                       ]
                   },
                   {  
                       imageUrl: 'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',
                       description: 'Charmander brabo.',
                       obtain: {
                           url: 'https://wiki.pokexgames.com/index.php/Craft_Profissões_-_Estilista#Rank_E',
                           text: 'Estilista'
                       },
                       additionalImages: [
                           'https://example.com/front2.png',  // Frente
                           'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png',   // Lado Esquerdo
                           'https://example.com/back2.png',   // Costas
                           'https://wiki.pokexgames.com/images/3/3b/Clefable_Lovely-_Accessory.png'   // Lado Direito
                       ]
                   }
               ]
           },
       };
       const imageSearch = document.getElementById('imageSearch');
       const dropdown = document.getElementById('dropdown');
       const imageContainer = document.getElementById('imageContainer');
       imageSearch.addEventListener('input', function() {
           const searchValue = this.value.trim().toLowerCase();
           dropdown.innerHTML = ;
           if (searchValue) {
               Object.keys(imageList).forEach(imageName => {
                   if (imageName.toLowerCase().includes(searchValue)) {
                       const dropdownItem = document.createElement('div');
                       dropdownItem.classList.add('dropdown-item');
                       
                       const imgElement = document.createElement('img');
                       imgElement.src = imageList[imageName].imageUrl;
                       imgElement.alt = imageName;
                       
                       dropdownItem.appendChild(imgElement);
                       dropdownItem.appendChild(document.createTextNode(imageName));
                       
                       dropdownItem.addEventListener('click', function() {
                           showImageInfo(imageName);
                           dropdown.style.display = 'none';
                       });
                       dropdown.appendChild(dropdownItem);
                   }
               });
               dropdown.style.display = dropdown.childNodes.length ? 'block' : 'none';
           } else {
               dropdown.style.display = 'none';
           }
       });
       document.addEventListener('click', function(event) {
           if (!imageSearch.contains(event.target) && !dropdown.contains(event.target)) {
               dropdown.style.display = 'none';
           }
       });
       function showImageInfo(imageName) {
           const imageInfo = imageList[imageName];
           let imagesHtml = `
                   <img src="${imageInfo.imageUrl}" alt="${imageName}">
           `;
           imageInfo.variations.forEach((variation, index) => {
               imagesHtml += `
                       <img src="${variation.additionalImages[0]}" alt="Variation Image" class="variation-image" data-variation-index="${index}">
                           Nome do Addon: ${variation.description} 
                           Como Obter: <a href="${variation.obtain.url}" target="_blank">${variation.obtain.text}</a>
               `;
           });
imagesHtml += '

';

           imageContainer.innerHTML = imagesHtml;
           imageContainer.classList.remove('hidden');
           // Alternar imagens ao clicar no botão de troca
           const swapButtons = document.querySelectorAll('.swap-button');
           swapButtons.forEach(button => {
               const index = button.getAttribute('data-variation-index');
               const variation = imageInfo.variations[index];
               let currentImageIndex = 0;
               button.addEventListener('click', () => {
                   currentImageIndex = (currentImageIndex + 1) % variation.additionalImages.length;
                   const variationImage = button.previousElementSibling;
                   variationImage.src = variation.additionalImages[currentImageIndex];
               });
           });
       }
   </script>

</body> </html>