Refactor z-index values and optimize CSS properties for various seasonal styles; enhance performance with will-change property [skip ci]

This commit is contained in:
CodeDevMLH
2026-02-27 03:53:05 +01:00
parent f14785c54a
commit 73f9be91ef
11 changed files with 210 additions and 265 deletions

View File

@@ -5,7 +5,7 @@
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
pointer-events: none; pointer-events: none;
z-index: 9999; z-index: 10;
overflow: hidden; overflow: hidden;
contain: strict; contain: strict;
contain: layout paint; contain: layout paint;

View File

@@ -7,7 +7,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
pointer-events: none; pointer-events: none;
z-index: 10000; z-index: 10;
contain: layout paint; contain: layout paint;
} }

View File

@@ -6,7 +6,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
pointer-events: none; pointer-events: none;
z-index: 10; /* Behind popups but over background */ z-index: 10;
contain: strict; contain: strict;
overflow: hidden; overflow: hidden;
} }
@@ -30,8 +30,9 @@
} }
.oscar-spotlight { .oscar-spotlight {
will-change: transform;
position: absolute; position: absolute;
top: -10vh; top: 0;
/* MARK: SPOTLIGHT WIDTH CONFIGURATION */ /* MARK: SPOTLIGHT WIDTH CONFIGURATION */
/* To adjust bottom width (spread), change 'width' property (e.g., 20vw for narrow, 40vw for wide). */ /* To adjust bottom width (spread), change 'width' property (e.g., 20vw for narrow, 40vw for wide). */
/* To adjust top width (origin), modify first two percentages in 'clip-path' (e.g., 48% 0, 52% 0 for a very thin start). */ /* To adjust top width (origin), modify first two percentages in 'clip-path' (e.g., 48% 0, 52% 0 for a very thin start). */
@@ -42,9 +43,11 @@
transform-origin: top center; transform-origin: top center;
animation: spotlight-sweep 12s infinite alternate ease-in-out; animation: spotlight-sweep 12s infinite alternate ease-in-out;
mix-blend-mode: screen; mix-blend-mode: screen;
translate: 0 -10vh;
} }
.oscar-flash { .oscar-flash {
will-change: transform;
position: absolute; position: absolute;
width: 10px; width: 10px;
height: 10px; height: 10px;

View File

@@ -16,9 +16,7 @@
z-index: 15; z-index: 15;
top: 0; top: 0;
translate: 0 -15vh; translate: 0 -15vh;
user-select: none; user-select: none;
-webkit-user-select: none;
cursor: default;
cursor: default; cursor: default;
animation-name: resurrection-fall; animation-name: resurrection-fall;
animation-timing-function: linear; animation-timing-function: linear;

View File

@@ -21,40 +21,13 @@
color: #fff; color: #fff;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
text-shadow: 0 0 5px #000; text-shadow: 0 0 5px #000;
user-select: none; user-select: none;
-webkit-user-select: none;
cursor: default;
-webkit-animation-name: heart-fall, heart-shake;
-webkit-animation-duration: 12s, 3s;
-webkit-animation-timing-function: linear, ease-in-out;
-webkit-animation-iteration-count: infinite, infinite;
animation-name: snowflakes-fall, snowflakes-shake;
cursor: default; cursor: default;
animation-name: snowflakes-fall, snowflakes-shake; animation-name: snowflakes-fall, snowflakes-shake;
animation-duration: 12s, 3s; animation-duration: 12s, 3s;
animation-timing-function: linear, ease-in-out; animation-timing-function: linear, ease-in-out;
animation-iteration-count: infinite, infinite; animation-iteration-count: infinite, infinite;
@-webkit-keyframes snowflakes-fall {
0% {
translate: 0 -10vh;
}
} }
100% {
translate: 0 110vh;
}
}
@-webkit-keyframes snowflakes-shake {
0%,
100% {
transform: translateX(0);
}
50% {
transform: translateX(80px);
}
}

View File

@@ -5,12 +5,13 @@
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
pointer-events: none; pointer-events: none;
z-index: 9999; z-index: 10;
overflow: hidden; overflow: hidden;
contain: strict; contain: strict;
} }
.space-bg-glow { .space-bg-glow {
will-change: transform;
position: absolute; position: absolute;
top: 0; left: 0; width: 100vw; height: 100vh; top: 0; left: 0; width: 100vw; height: 100vh;
background: radial-gradient(circle at 70% 30%, rgba(138, 43, 226, 0.15), transparent 60%), background: radial-gradient(circle at 70% 30%, rgba(138, 43, 226, 0.15), transparent 60%),
@@ -33,6 +34,7 @@
} }
.space-shooting-star { .space-shooting-star {
will-change: opacity;
position: absolute; position: absolute;
width: 250px; width: 250px;
height: 3px; height: 3px;
@@ -61,11 +63,11 @@
} }
.space-symbol img { .space-symbol img {
will-change: transform;
width: 6vh; width: 6vh;
height: auto; height: auto;
max-width: 60px; max-width: 60px;
object-fit: contain; object-fit: contain;
/* Add a slow spin to images */
animation: space-slow-spin var(--rot-dur, 20s) linear infinite; animation: space-slow-spin var(--rot-dur, 20s) linear infinite;
} }

View File

@@ -8,6 +8,7 @@
height: 100%; height: 100%;
pointer-events: none; pointer-events: none;
z-index: 10; z-index: 10;
contain: layout paint;
} }
.spooky { .spooky {
@@ -16,19 +17,8 @@
will-change: transform; will-change: transform;
translate: 0 120vh; translate: 0 120vh;
z-index: 15; z-index: 15;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; user-select: none;
-webkit-user-select: none;
cursor: default; cursor: default;
-webkit-animation-name: spooky-float;
-webkit-animation-duration: 10s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
animation-name: spooky-float; animation-name: spooky-float;
animation-duration: 10s; animation-duration: 10s;
animation-timing-function: linear; animation-timing-function: linear;
@@ -40,13 +30,6 @@
width: 30px; width: 30px;
height: auto; height: auto;
will-change: transform; will-change: transform;
-webkit-animation-name: spooky-shake;
-webkit-animation-duration: 3s;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
animation-name: spooky-shake; animation-name: spooky-shake;
animation-duration: 3s; animation-duration: 3s;
animation-timing-function: ease-in-out; animation-timing-function: ease-in-out;
@@ -59,22 +42,6 @@
width: 100%; width: 100%;
} }
@-webkit-keyframes spooky-float {
0% {
translate: 0 120vh;
opacity: 0;
}
10% {
opacity: 0.8;
}
90% {
opacity: 0.8;
}
100% {
translate: 0 -150px;
opacity: 0;
}
}
@keyframes spooky-float { @keyframes spooky-float {
0% { 0% {
@@ -93,14 +60,6 @@
} }
} }
@-webkit-keyframes spooky-shake {
0%, 100% {
transform: translateX(0) scale(1) rotate(15deg);
}
50% {
transform: translateX(80px) scale(1.2) rotate(-15deg);
}
}
@keyframes spooky-shake { @keyframes spooky-shake {
0%, 100% { 0%, 100% {
@@ -111,7 +70,6 @@
} }
} }
/* Base predefined starting offsets (if not overridden by js) */
.spooky:nth-of-type(0) { left: 1%; } .spooky:nth-of-type(0) { left: 1%; }
.spooky:nth-of-type(1) { left: 10%; } .spooky:nth-of-type(1) { left: 10%; }
.spooky:nth-of-type(2) { left: 20%; } .spooky:nth-of-type(2) { left: 20%; }

View File

@@ -5,16 +5,17 @@
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
pointer-events: none; pointer-events: none;
z-index: 9999; z-index: 10;
overflow: hidden; overflow: hidden;
contain: strict; contain: strict;
} }
.sports-symbol { .sports-symbol {
position: absolute; position: absolute;
top: -10vh; top: 0;
opacity: 0.9; opacity: 0.9;
z-index: 40; z-index: 40;
translate: 0 -10vh;
} }
.sports-inner { .sports-inner {
@@ -29,13 +30,15 @@
} }
.sports-confetti { .sports-confetti {
will-change: transform, opacity;
position: absolute; position: absolute;
top: -5vh; top: 0;
width: 10px; width: 10px;
height: 15px; height: 15px;
opacity: 0.8; opacity: 0.8;
animation: sports-confetti-fall linear infinite; animation: sports-confetti-fall linear infinite;
border-radius: 2px; border-radius: 2px;
translate: 0 -5vh;
} }
.sports-confetti.circle { .sports-confetti.circle {

View File

@@ -29,13 +29,14 @@
/* Sunbeams */ /* Sunbeams */
.spring-sunbeam { .spring-sunbeam {
position: fixed; position: fixed;
top: -50%; top: 0;
height: 200%; height: 200%;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 200, 0.08) 50%, rgba(255, 255, 255, 0)); background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 200, 0.08) 50%, rgba(255, 255, 255, 0));
z-index: 5; z-index: 5;
transform-origin: top center; transform-origin: top center;
pointer-events: none; pointer-events: none;
opacity: 0; opacity: 0;
translate: 0 -50vh;
} }
/* Grass Container (Wrapper) */ /* Grass Container (Wrapper) */
@@ -72,6 +73,7 @@
/* SVG Meadow Layer */ /* SVG Meadow Layer */
.spring-meadow-layer { .spring-meadow-layer {
will-change: transform;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
@@ -94,6 +96,7 @@
} }
.spring-sway { .spring-sway {
will-change: transform;
transform-origin: bottom center; transform-origin: bottom center;
animation: spring-meadow-sway 4s ease-in-out infinite alternate; animation: spring-meadow-sway 4s ease-in-out infinite alternate;
} }

View File

@@ -13,10 +13,11 @@
.starwars-center { .starwars-center {
position: absolute; position: absolute;
top: 50%; top: 0;
left: 50%; left: 50%;
width: 0; width: 0;
height: 0; height: 0;
translate: 0 50vh;
} }
.starwars-streak { .starwars-streak {

View File

@@ -35,6 +35,7 @@
} }
.underwater-seaweed { .underwater-seaweed {
will-change: transform, opacity;
position: absolute; position: absolute;
bottom: -1vh; bottom: -1vh;
font-size: 4rem; font-size: 4rem;
@@ -52,6 +53,7 @@
} }
.underwater-bubble { .underwater-bubble {
will-change: transform;
position: absolute; position: absolute;
bottom: -5vh; bottom: -5vh;
border-radius: 50%; border-radius: 50%;
@@ -73,13 +75,13 @@
} }
@keyframes underwater-traverse-up { @keyframes underwater-traverse-up {
0% { top: 120vh; } 0% { top: 0; translate: 0 120vh; }
100% { top: -20vh; } 100% { top: 0; translate: 0 -20vh; }
} }
@keyframes underwater-traverse-down { @keyframes underwater-traverse-down {
0% { top: -20vh; } 0% { top: 0; translate: 0 -20vh; }
100% { top: 120vh; } 100% { top: 0; translate: 0 120vh; }
} }
@keyframes underwater-sway-y { @keyframes underwater-sway-y {
@@ -101,8 +103,9 @@
} }
.underwater-god-rays { .underwater-god-rays {
will-change: transform;
position: absolute; position: absolute;
top: -50vh; top: 0;
left: -50vw; left: -50vw;
width: 200vw; width: 200vw;
height: 200vh; height: 200vh;
@@ -119,6 +122,7 @@
transform-origin: top center; transform-origin: top center;
mix-blend-mode: overlay; mix-blend-mode: overlay;
filter: blur(5px); filter: blur(5px);
translate: 0 -50vh;
} }
@keyframes god-rays-sway { @keyframes god-rays-sway {