5 802
edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 8: | Linha 8: | ||
.hidden { | .hidden { | ||
display: none; | display: none; | ||
} | |||
.image-container { | |||
display: flex; | |||
flex-wrap: wrap; | |||
justify-content: center; | |||
gap: 10px; | |||
margin-top: 20px; | |||
} | |||
.image-container .image-item { | |||
flex: 1 0 45%; /* Exibe duas imagens por linha */ | |||
max-width: 45%; | |||
text-align: center; | |||
} | } | ||
.image-container img { | .image-container img { | ||
width: 100px; | width: 100px; | ||
height: 100px; | height: 100px; | ||
margin: 5px; | margin-bottom: 10px; | ||
} | |||
.image-info { | |||
margin-top: 5px; | |||
} | } | ||
select { | select { | ||
margin: 5px; | margin: 5px; | ||
} | } | ||
</style> | </style> | ||
Linha 51: | Linha 63: | ||
<div id="imageContainer" class="image-container hidden"> | <div id="imageContainer" class="image-container hidden"> | ||
<!-- | <!-- As imagens e suas informações serão exibidas aqui --> | ||
</div> | </div> | ||
</form> | </form> | ||
Linha 57: | Linha 69: | ||
<script> | <script> | ||
const specificOptions = { | const specificOptions = { | ||
1: { | 1: { // Mapa Vermelho | ||
'Areia': { local: 'Pewter', coordinates: '3467, 3743, 6', imageUrl: 'https://wiki.pokexgames.com/images/b/bc/BagOfPollem.png' }, | 'Areia': [ | ||
{ local: 'Pewter', coordinates: '3467, 3743, 6', imageUrl: 'https://wiki.pokexgames.com/images/b/bc/BagOfPollem.png' }, | |||
{ local: 'Pewter', coordinates: '3467, 3743, 6', imageUrl: 'https://wiki.pokexgames.com/images/4/43/AnotherImage.png' }, | |||
{ local: 'Pewter', coordinates: '3467, 3743, 6', imageUrl: 'https://wiki.pokexgames.com/images/3/34/DifferentImage.png' }, | |||
{ local: 'Pewter', coordinates: '3467, 3743, 6', imageUrl: 'https://wiki.pokexgames.com/images/c/c4/ExampleImage.png' }, | |||
{ local: 'Pewter', coordinates: '3467, 3743, 6', imageUrl: 'https://wiki.pokexgames.com/images/5/56/AnotherExample.png' }, | |||
{ local: 'Pewter', coordinates: '3467, 3743, 6', imageUrl: 'https://wiki.pokexgames.com/images/a/a6/SampleImage.png' } | |||
], | |||
'Gelo': { local: 'Cerulean', coordinates: '1456, 2345, 4', imageUrl: 'https://wiki.pokexgames.com/images/4/43/AnotherImage.png' }, | 'Gelo': { local: 'Cerulean', coordinates: '1456, 2345, 4', imageUrl: 'https://wiki.pokexgames.com/images/4/43/AnotherImage.png' }, | ||
'Grama': { local: 'Vermilion', coordinates: '5678, 1234, 5', imageUrl: 'https://wiki.pokexgames.com/images/3/34/DifferentImage.png' }, | 'Grama': { local: 'Vermilion', coordinates: '5678, 1234, 5', imageUrl: 'https://wiki.pokexgames.com/images/3/34/DifferentImage.png' }, | ||
Linha 66: | Linha 85: | ||
'Pisos': { local: 'Cinnabar', coordinates: '7890, 1234, 6', imageUrl: 'https://wiki.pokexgames.com/images/d/d7/FinalExample.png' } | 'Pisos': { local: 'Cinnabar', coordinates: '7890, 1234, 6', imageUrl: 'https://wiki.pokexgames.com/images/d/d7/FinalExample.png' } | ||
}, | }, | ||
2: { | 2: { // Mapa Verde | ||
'Areia': { local: 'Saffron', coordinates: '3456, 7890, 7', imageUrl: 'https://wiki.pokexgames.com/images/b/bc/BagOfPollem.png' }, | 'Areia': { local: 'Saffron', coordinates: '3456, 7890, 7', imageUrl: 'https://wiki.pokexgames.com/images/b/bc/BagOfPollem.png' }, | ||
'Gelo': { local: 'Pallet', coordinates: '5678, 1234, 2', imageUrl: 'https://wiki.pokexgames.com/images/4/43/AnotherImage.png' }, | 'Gelo': { local: 'Pallet', coordinates: '5678, 1234, 2', imageUrl: 'https://wiki.pokexgames.com/images/4/43/AnotherImage.png' }, | ||
Linha 75: | Linha 94: | ||
'Pisos': { local: 'Celadon', coordinates: '5678, 1234, 2', imageUrl: 'https://wiki.pokexgames.com/images/d/d7/FinalExample.png' } | 'Pisos': { local: 'Celadon', coordinates: '5678, 1234, 2', imageUrl: 'https://wiki.pokexgames.com/images/d/d7/FinalExample.png' } | ||
}, | }, | ||
3: { | 3: { // Mapa Roxo | ||
'Areia': { local: 'Fuchsia', coordinates: '6789, 3456, 4', imageUrl: 'https://wiki.pokexgames.com/images/b/bc/BagOfPollem.png' }, | 'Areia': { local: 'Fuchsia', coordinates: '6789, 3456, 4', imageUrl: 'https://wiki.pokexgames.com/images/b/bc/BagOfPollem.png' }, | ||
'Gelo': { local: 'Cinnabar', coordinates: '7890, 1234, 1', imageUrl: 'https://wiki.pokexgames.com/images/4/43/AnotherImage.png' }, | 'Gelo': { local: 'Cinnabar', coordinates: '7890, 1234, 1', imageUrl: 'https://wiki.pokexgames.com/images/4/43/AnotherImage.png' }, | ||
Linha 103: | Linha 122: | ||
} else { | } else { | ||
document.getElementById('specificOptions').classList.add('hidden'); | document.getElementById('specificOptions').classList.add('hidden'); | ||
imageContainer.classList.add('hidden'); | |||
} | } | ||
}); | }); | ||
document.getElementById('specificOption').addEventListener('change', function() { | document.getElementById('specificOption').addEventListener('change', function() { | ||
const selectedMapType = document.getElementById('mapType').value; | |||
const selectedOption = this.value; | const selectedOption = this.value; | ||
const imageContainer = document.getElementById('imageContainer'); | const imageContainer = document.getElementById('imageContainer'); | ||
if (selectedMapType && selectedOption) { | |||
const images = specificOptions[selectedMapType][selectedOption]; | |||
if (selectedOption) { | let imagesHtml = ''; | ||
const | |||
if ( | if (Array.isArray(images)) { | ||
images.forEach(image => { | |||
imagesHtml += ` | |||
<div class="image-item"> | |||
<img src="${image.imageUrl}" alt="${selectedOption}"> | |||
<div class="image-info"> | |||
< | Local: ${image.local} <br> | ||
Coordenada: ${image.coordinates} | |||
</div> | |||
</div> | |||
`; | |||
}); | |||
} else { | |||
imagesHtml = ` | |||
<div class="image-item"> | |||
<img src="${images.imageUrl}" alt="${selectedOption}"> | |||
<div class="image-info"> | |||
Local: ${images.local} <br> | |||
Coordenada: ${images.coordinates} | |||
</div> | |||
</div> | </div> | ||
`; | `; | ||
} | } | ||
imageContainer.innerHTML = imagesHtml; | |||
imageContainer.classList.remove('hidden'); | |||
} else { | } else { | ||
imageContainer.classList.add('hidden'); | imageContainer.classList.add('hidden'); |