diff --git a/Jellyfin.Plugin.Seasonals/Web/easter.css b/Jellyfin.Plugin.Seasonals/Web/easter.css
index f29ccf7..fcb6dd7 100644
--- a/Jellyfin.Plugin.Seasonals/Web/easter.css
+++ b/Jellyfin.Plugin.Seasonals/Web/easter.css
@@ -1,161 +1,64 @@
.easter-container {
display: block;
- position: fixed;
- overflow: hidden;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- pointer-events: none;
- z-index: 10;
- contain: layout paint;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+ z-index: 10000;
+ contain: strict;
+ overflow: hidden;
+}
+
+.easter-grass-container {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 8vh;
+ pointer-events: none;
+ z-index: 1000;
+}
+
+.easter-meadow-layer {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.easter-meadow {
+ width: 100%;
+ height: 100%;
+ display: block;
+ overflow: visible;
+}
+
+/* sway */
+.easter-sway {
+ transform-origin: bottom center;
+ animation: easter-wind-sway 6s ease-in-out infinite alternate;
+}
+
+@keyframes easter-wind-sway {
+ 0% { transform: skewX(-3deg); }
+ 100% { transform: skewX(5deg); }
}
.hopping-rabbit {
- position: fixed;
- z-index: 15;
- bottom: 10px;
- width: 70px;
- overflow: hidden;
- pointer-events: none;
+ position: absolute;
+ bottom: -15px;
+ left: 0;
+ width: 160px;
+ height: auto;
+ z-index: 1002;
+ will-change: transform;
}
-
@media (max-width: 768px) {
.hopping-rabbit {
width: 60px;
}
-}
-
-
-.easter {
- position: fixed;
- z-index: 15;
- top: -10%;
- font-size: 1em;
- color: #fff;
- font-family: Arial, sans-serif;
- text-shadow: 0 0 5px #000;
- user-select: none;
- -webkit-user-select: none;
- cursor: default;
- -webkit-animation-name: easter-fall, easter-shake;
- -webkit-animation-timing-function: linear, ease-in-out;
- -webkit-animation-iteration-count: infinite, infinite;
- animation-name: easter-fall, easter-shake;
- animation-timing-function: linear, ease-in-out;
- animation-iteration-count: infinite, infinite;
-}
-
-.easter img {
- z-index: 15;
- height: auto;
- width: 20px;
-}
-
-@-webkit-keyframes easter-fall {
- 0% {
- top: -10%;
- }
-
- 100% {
- top: 110%;
- }
-}
-
-@-webkit-keyframes easter-shake {
-
- 0%,
- 100% {
- -webkit-transform: translateX(0);
- transform: translateX(0);
- }
-
- 50% {
- -webkit-transform: translateX(80px);
- transform: translateX(80px);
- }
-}
-
-@keyframes easter-fall {
- 0% {
- top: -10%;
- }
-
- 100% {
- top: 110%;
- }
-}
-
-@keyframes easter-shake {
-
- 0%,
- 100% {
- transform: translateX(0);
- }
-
- 50% {
- transform: translateX(80px);
- }
-}
-
-
-.easter:nth-of-type(0) {
- left: 0%;
- animation-delay: 0s, 0s;
-}
-
-.easter:nth-of-type(1) {
- left: 10%;
- animation-delay: 1s, 1s;
-}
-
-.easter:nth-of-type(2) {
- left: 20%;
- animation-delay: 6s, 0.5s;
-}
-
-.easter:nth-of-type(3) {
- left: 30%;
- animation-delay: 4s, 2s;
-}
-
-.easter:nth-of-type(4) {
- left: 40%;
- animation-delay: 2s, 2s;
-}
-
-.easter:nth-of-type(5) {
- left: 50%;
- animation-delay: 8s, 3s;
-}
-
-.easter:nth-of-type(6) {
- left: 60%;
- animation-delay: 6s, 2s;
-}
-
-.easter:nth-of-type(7) {
- left: 70%;
- animation-delay: 2.5s, 1s;
-}
-
-.easter:nth-of-type(8) {
- left: 80%;
- animation-delay: 1s, 0s;
-}
-
-.easter:nth-of-type(9) {
- left: 90%;
- animation-delay: 3s, 1.5s;
-}
-
-.easter:nth-of-type(10) {
- left: 25%;
- animation-delay: 2s, 0s;
-}
-
-.easter:nth-of-type(11) {
- left: 65%;
- animation-delay: 4s, 2.5s;
}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.Seasonals/Web/easter.js b/Jellyfin.Plugin.Seasonals/Web/easter.js
index 356d62c..8562d76 100644
--- a/Jellyfin.Plugin.Seasonals/Web/easter.js
+++ b/Jellyfin.Plugin.Seasonals/Web/easter.js
@@ -1,66 +1,19 @@
const config = window.SeasonalsPluginConfig?.Easter || {};
-const easter = config.EnableEaster !== undefined ? config.EnableEaster : true; // enable/disable easter
-const randomEaster = config.EnableRandomEaster !== undefined ? config.EnableRandomEaster : true; // enable random easter
-const randomEasterMobile = config.EnableRandomEasterMobile !== undefined ? config.EnableRandomEasterMobile : false; // enable random easter on mobile devices (Warning: High values may affect performance)
-const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random easter
-const easterEggCount = config.EggCount || 20; // count of random extra easter
+const easter = config.EnableEaster !== undefined ? config.EnableEaster : true;
+const enableBunny = config.EnableBunny !== undefined ? config.EnableBunny : true;
+/* MARK: BUNNY LOCOMOTION CONFIGURATION */
+const jumpDistanceVw = 5; // Distance in vw the bunny covers per jump
+const jumpDurationMs = 770; // Time in ms the bunny spends moving during a jump
+const pauseDurationMs = 116.6666; // Time in ms the bunny pauses between jumps
-const bunny = config.EnableBunny !== undefined ? config.EnableBunny : true; // enable/disable hopping bunny
-const bunnyDuration = config.BunnyDuration || 12000; // duration of the bunny animation in ms
-const hopHeight = config.HopHeight || 12; // height of the bunny hops in px
-const minBunnyRestTime = config.MinBunnyRestTime || 2000; // minimum time the bunny rests in ms
-const maxBunnyRestTime = config.MaxBunnyRestTime || 5000; // maximum time the bunny rests in ms
+const minBunnyRestTime = config.MinBunnyRestTime || 2000;
+const maxBunnyRestTime = config.MaxBunnyRestTime || 5000;
+const eggCount = config.EggCount || 15;
+const rabbit = "../Seasonals/Resources/easter_images/Osterhase.gif";
-let msgPrinted = false; // flag to prevent multiple console messages
-let animationFrameId;
-
-// function to check and control the easter
-function toggleEaster() {
- const easterContainer = document.querySelector('.easter-container');
- if (!easterContainer) return;
-
- const videoPlayer = document.querySelector('.videoPlayerContainer');
- const trailerPlayer = document.querySelector('.youtubePlayerContainer');
- const isDashboard = document.body.classList.contains('dashboardDocument');
- const hasUserMenu = document.querySelector('#app-user-menu');
-
- // hide easter if video/trailer player is active or dashboard is visible
- if (videoPlayer || trailerPlayer || isDashboard || hasUserMenu) {
- easterContainer.style.display = 'none'; // hide easter
- if (animationFrameId) {
- cancelAnimationFrame(animationFrameId);
- animationFrameId = null;
- }
- if (!msgPrinted) {
- console.log('Easter hidden');
- msgPrinted = true;
- }
- } else {
- easterContainer.style.display = 'block'; // show easter
- if (!animationFrameId) {
- animateRabbit(); // start animation
- }
- if (msgPrinted) {
- console.log('Easter visible');
- msgPrinted = false;
- }
- }
-}
-
-// observe changes in the DOM
-const observer = new MutationObserver(toggleEaster);
-
-// start observation
-observer.observe(document.body, {
- childList: true, // observe adding/removing of child elements
- subtree: true, // observe all levels of the DOM tree
- attributes: true // observe changes to attributes (e.g. class changes)
-});
-
-
-const images = [
+const easterEggImages = [
"../Seasonals/Resources/easter_images/egg_1.png",
"../Seasonals/Resources/easter_images/egg_2.png",
"../Seasonals/Resources/easter_images/egg_3.png",
@@ -73,121 +26,231 @@ const images = [
"../Seasonals/Resources/easter_images/egg_10.png",
"../Seasonals/Resources/easter_images/egg_11.png",
"../Seasonals/Resources/easter_images/egg_12.png",
+ "../Seasonals/Resources/easter_images/eggs.png"
];
-const rabbit = "../Seasonals/Resources/easter_images/easter-bunny.png";
-function addRandomEaster(count) {
- const easterContainer = document.querySelector('.easter-container'); // get the leave container
- if (!easterContainer) return; // exit if leave container is not found
-
- console.log('Adding random easter eggs');
-
- // Array of leave characters
- for (let i = 0; i < count; i++) {
- // create a new leave element
- const eggDiv = document.createElement('div');
- eggDiv.className = "easter";
-
- // pick a random easter symbol
- const imageSrc = images[Math.floor(Math.random() * images.length)];
- const img = document.createElement("img");
- img.src = imageSrc;
-
- eggDiv.appendChild(img);
-
- // set random horizontal position, animation delay and size(uncomment lines to enable)
- const randomLeft = Math.random() * 100; // position (0% to 100%)
- const randomAnimationDelay = Math.random() * 12; // delay (0s to 12s)
- const randomAnimationDelay2 = Math.random() * 5; // delay (0s to 5s)
-
- // apply styles
- eggDiv.style.left = `${randomLeft}%`;
- eggDiv.style.animationDelay = `${randomAnimationDelay}s, ${randomAnimationDelay2}s`;
-
- // set random animation duration
- if (enableDiffrentDuration) {
- const randomAnimationDuration = Math.random() * 10 + 6; // delay (6s to 10s)
- const randomAnimationDuration2 = Math.random() * 5 + 2; // delay (2s to 5s)
- eggDiv.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
- }
-
-
- // add the leave to the container
- easterContainer.appendChild(eggDiv);
+function createEasterGrassAndEggs(container) {
+ let grassContainer = container.querySelector('.easter-grass-container');
+ if (!grassContainer) {
+ grassContainer = document.createElement('div');
+ grassContainer.className = 'easter-grass-container';
+ container.appendChild(grassContainer);
+ }
+
+ grassContainer.innerHTML = '';
+
+ let pathsBg = '';
+ let pathsFg = '';
+ const w = window.innerWidth;
+ const hSVG = 80; // Grass 80px high
+
+ // Generate Grass
+ const bladeCount = w / 5;
+ for (let i = 0; i < bladeCount; i++) {
+ const height = Math.random() * 40 + 20;
+ const x = i * 5 + Math.random() * 3;
+ const hue = 80 + Math.random() * 40; // slightly more yellow-green for spring/easter
+ const color = `hsl(${hue}, 60%, 40%)`;
+ const line = `