not working

This commit is contained in:
MLH
2025-01-23 01:27:12 +01:00
parent c4a822be58
commit 821e3d1636
2 changed files with 32 additions and 10 deletions

View File

@ -13,6 +13,13 @@
overflow: hidden; overflow: hidden;
} }
.hopping-rabbit {
position: absolute;
bottom: 20px;
width: 100px;
animation: bunny-move 10s linear infinite, bunny-hop 1s ease-in-out infinite;
}
/* /*
@media (max-width: 768px) { @media (max-width: 768px) {
#rabbit { #rabbit {
@ -37,7 +44,6 @@
-webkit-animation-duration: 7s, 3s; -webkit-animation-duration: 7s, 3s;
-webkit-animation-timing-function: linear, ease-in-out; -webkit-animation-timing-function: linear, ease-in-out;
-webkit-animation-iteration-count: infinite, infinite; -webkit-animation-iteration-count: infinite, infinite;
-webkit-user-select: none;
animation-name: easter-fall, easter-shake; animation-name: easter-fall, easter-shake;
animation-duration: 7s, 3s; animation-duration: 7s, 3s;
animation-timing-function: linear, ease-in-out; animation-timing-function: linear, ease-in-out;
@ -97,23 +103,19 @@
@keyframes bunny-move { @keyframes bunny-move {
0% { 0% {
top: -10%; transform: translateX(-100%);
} }
100% { 100% {
top: 100%; transform: translateX(100%);
} }
} }
@keyframes bunny-hop { @keyframes bunny-hop {
0%, 100% {
0%, transform: translateY(0);
100% {
transform: translateX(0);
} }
50% { 50% {
transform: translateX(80px); transform: translateY(-30px);
} }
} }

View File

@ -127,6 +127,7 @@ function addRandomEaster(count) {
console.log('Random easter added'); console.log('Random easter added');
} }
/*
function addHoppingRabbit() { function addHoppingRabbit() {
if (!bunny) return; // only add the bunny if bunny is enabled if (!bunny) return; // only add the bunny if bunny is enabled
@ -166,6 +167,25 @@ function addHoppingRabbit() {
easterContainer.appendChild(rabbitDiv); easterContainer.appendChild(rabbitDiv);
hop(); hop();
} }
*/
function addHoppingRabbit() {
if (!bunny) return; // Nur ausführen, wenn Easter aktiviert ist
const easterContainer = document.querySelector('.easter-container');
if (!easterContainer) return;
// Hase erstellen
const rabbitImg = document.createElement("img");
rabbitImg.id = "rabbit";
rabbitImg.src = rabbit; // Bildpfad aus der bestehenden Definition
rabbitImg.alt = "Hoppelnder Osterhase";
// CSS-Klassen hinzufügen
rabbitImg.classList.add("hopping-rabbit");
easterContainer.appendChild(rabbitImg);
}
// initialize standard easter // initialize standard easter
function initEaster() { function initEaster() {