Chips sollen im Impressum fallen

This commit is contained in:
ElenaRJ 2026-05-27 18:36:59 +02:00
parent 5c59bf9f5d
commit 825050fc0b
4 changed files with 51 additions and 1 deletions

View file

@ -227,3 +227,27 @@ img {
max-width: 100%; max-width: 100%;
height: auto; height: auto;
} }
Für fallende Chips
.chip {
position: fixed;
top: -100px;
width: 80px;
height: auto;
pointer-events: none;
animation: fall linear forwards;
z-index: 9999;
}
@keyframes fall {
0% {
transform: translateY(0) rotate(0deg);
opacity: 1;
}
100% {
transform: translateY(110vh) rotate(360deg);
opacity: 0;
}
}

BIN
img/Chips.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -62,7 +62,7 @@
<footer> <footer>
<p>&copy; 2026 - Lernprojekt EIS</p> <p>&copy; 2026 - Lernprojekt EIS</p>
</footer> </footer>
<div class="chip-rain"></div>
<script src="script.js"></script> <script src="script.js"></script>
</body> </body>

View file

@ -1 +1,27 @@
console.log ("Meine Seite läuft"); console.log ("Meine Seite läuft");
Für die fallenden Chips
function createChip() {
const chip = document.createElement("img");
chip.src = "img/Chips.png";
chip.classList.add("chip");
chip.style.left = Math.random() * window.innerWidth + "px";
chip.style.animationDuration =
(Math.random() * 3 + 3) + "s";
chip.style.width =
(Math.random() * 50 + 50) + "px";
document.body.appendChild(chip);
setTimeout(() => {
chip.remove();
}, 6000);
}
setInterval(createChip, 300);