Chips sollen im Impressum fallen
This commit is contained in:
parent
5c59bf9f5d
commit
825050fc0b
4 changed files with 51 additions and 1 deletions
|
|
@ -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
BIN
img/Chips.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
|
|
@ -62,7 +62,7 @@
|
||||||
<footer>
|
<footer>
|
||||||
<p>© 2026 - Lernprojekt EIS</p>
|
<p>© 2026 - Lernprojekt EIS</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
<div class="chip-rain"></div>
|
||||||
<script src="script.js"></script>
|
<script src="script.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
26
js/script.js
26
js/script.js
|
|
@ -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);
|
||||||
Loading…
Reference in a new issue