Add Mario Day feature: implement CSS and JS for Mario animations and visibility toggle

This commit is contained in:
CodeDevMLH
2026-02-24 19:22:03 +01:00
parent 437569ec1d
commit 6632cc81de
3 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
.marioday-container {
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 10000;
contain: strict;
overflow: hidden;
}
.mario-wrapper {
position: absolute;
bottom: 5px;
left: -100px;
animation: mario-run 15s linear infinite;
will-change: left, transform;
}
.mario-runner {
width: 64px;
height: auto;
image-rendering: crisp-edges;
image-rendering: pixelated;
display: block;
will-change: transform;
}
.mario-jump {
animation: jump-arc 0.8s ease-in-out;
}
/* 8-bit coin styling */
.mario-coin {
position: absolute;
width: 32px;
height: 32px;
background-color: #ffd700;
border: 4px solid #b8860b;
border-radius: 50%;
box-shadow: inset 4px 4px 0 #fffbea, inset -4px -4px 0 #daa520;
animation: pop-up-arc 2s forwards;
}
.mario-coin::after {
content: '';
position: absolute;
top: 6px;
left: 10px;
width: 4px;
height: 12px;
background: #daa520;
}
@keyframes mario-run {
0% { left: -100px; transform: scaleX(1); }
45% { left: 110vw; transform: scaleX(1); }
50% { left: 110vw; transform: scaleX(-1); }
95% { left: -100px; transform: scaleX(-1); }
100% { left: -100px; transform: scaleX(1); }
}
@keyframes pop-up-arc {
0% { transform: translateY(0) rotateY(0deg); opacity: 0; animation-timing-function: ease-out; }
20% { opacity: 1; }
50% { transform: translateY(-30vh) rotateY(360deg); opacity: 1; animation-timing-function: ease-in; }
90% { opacity: 1; }
100% { transform: translateY(20vh) rotateY(720deg); opacity: 0; }
}
@keyframes jump-arc {
0% { transform: translateY(0); }
50% { transform: translateY(-25vh); }
100% { transform: translateY(0); }
}