Update index.html

This commit is contained in:
TheErrorExe 2025-01-06 19:52:23 +01:00 committed by GitHub
parent 6c0cf07616
commit 9be1b762d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,7 @@
background-size: cover;
cursor: pointer;
margin-top: 20px;
transition: background 0.5s ease-in-out; /* Übergang beim Wechsel der Bilder */
}
/* Stil für das GIF */
@ -29,7 +30,7 @@
background-size: cover;
}
/* Stil für das verstecken von Elementen */
/* Stil für das Verstecken der Elemente */
.hidden {
visibility: hidden;
}
@ -119,27 +120,29 @@
const boomSound = new Audio('tnt-boom.mp3');
boomSound.play();
// Zeige das GIF
tntGif.style.display = 'block';
// Ersetze das PNG durch das GIF
tntBlock.style.backgroundImage = "url('tnt-explode.gif')";
tntGif.style.display = 'block'; // Zeige das GIF an
// Verstecke alle Elemente nach 4 Sekunden
// Verstecke alle anderen Elemente nach 4 Sekunden
setTimeout(() => {
allElements.forEach(el => {
el.classList.add('hidden');
});
}, 4000);
// Nach 7 Sekunden alle Elemente wieder sichtbar machen
// Nach 4 Sekunden das PNG wiederherstellen und das GIF entfernen
setTimeout(() => {
tntBlock.style.backgroundImage = "url('tnt-explode.png')";
tntGif.style.display = 'none'; // Entferne das GIF
}, 12000); // Warte 12 Sekunden (4s Sound + 7s Unsichtbarkeit + 1s GIF Anzeige)
// Nach 11 Sekunden alle Elemente wieder sichtbar machen
setTimeout(() => {
allElements.forEach(el => {
el.classList.remove('hidden');
});
}, 11000);
// Verhindere das Abspielen des GIFs im Hintergrund, wenn es nicht sichtbar ist
tntGif.addEventListener('animationend', () => {
tntGif.style.display = 'none'; // Stoppe das GIF
});
}
</script>
</body>