Spaces:
Running

Rabbit / style.css
Joey889's picture
Upload 4 files
6072ea1 verified
Raw History Blame Contribute Delete
9.8 kB
:root {
--sky-top: #7ed1ff;
--sky-bottom: #f3fbff;
--grass-main: #73d65f;
--grass-dark: #43a53c;
--grass-light: #9bec73;
--fence-red: #db4545;
--fence-red-dark: #b72d2d;
--sign-pink: #ff74b1;
--sign-yellow: #ffe77a;
--rabbit: #ffffff;
--rabbit-shadow: #d9d9d9;
--ear-pink: #ffbfd7;
--speech-bg: rgba(255, 255, 255, 0.98);
--text: #25314d;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
min-height: 100vh;
font-family: "Segoe UI", "Noto Sans TC", sans-serif;
color: var(--text);
background: linear-gradient(to bottom, #dff5ff, #f8fff7);
overflow-x: hidden;
}
.top-bar,
.footer {
text-align: center;
position: relative;
z-index: 10;
}
.top-bar { padding: 14px 12px 8px; }
.top-bar p { margin: 10px 0 0; font-size: 1rem; font-weight: 700; }
.footer { padding: 10px 12px 22px; font-size: .92rem; }
.signboard-wrap { display: flex; justify-content: center; }
.signboard {
display: inline-block;
padding: 14px 28px;
font-size: clamp(2rem, 4vw, 3.2rem);
font-weight: 900;
letter-spacing: 1px;
color: #fff;
background:
radial-gradient(circle at 20% 20%, #fff1 0 10%, transparent 11%),
linear-gradient(135deg, var(--sign-pink), #ff9e60 55%, var(--sign-yellow));
border: 6px solid #fff5bd;
border-radius: 28px;
text-shadow:
2px 2px 0 #ff4f91,
4px 4px 0 rgba(122, 39, 75, 0.28);
box-shadow: 0 10px 0 #f3c95d, 0 16px 30px rgba(0,0,0,0.18);
transform: rotate(-1.5deg);
}
.zoo-scene {
position: relative;
width: min(1240px, 96vw);
height: 74vh;
min-height: 560px;
margin: 0 auto;
border-radius: 30px;
overflow: hidden;
box-shadow: 0 16px 45px rgba(0, 72, 120, 0.18);
background:
radial-gradient(circle at 18% 14%, rgba(255,255,255,0.95) 0 5%, transparent 6%),
radial-gradient(circle at 82% 18%, rgba(255,255,255,0.82) 0 4%, transparent 5%),
linear-gradient(to bottom, var(--sky-top), var(--sky-bottom) 58%, var(--grass-light) 58%, var(--grass-main) 100%);
}
.sun {
position: absolute;
top: 30px;
right: 56px;
width: 112px;
height: 112px;
border-radius: 50%;
background: radial-gradient(circle, #fff8bf 0%, #ffe36b 58%, #ffbe3f 100%);
box-shadow: 0 0 42px rgba(255, 211, 87, 0.7);
}
.cloud {
position: absolute;
width: 140px;
height: 56px;
border-radius: 999px;
background: rgba(255,255,255,0.95);
filter: drop-shadow(0 6px 10px rgba(0,0,0,0.07));
animation: drift 22s linear infinite;
}
.cloud::before,
.cloud::after {
content: "";
position: absolute;
border-radius: 50%;
background: rgba(255,255,255,0.95);
}
.cloud::before { width: 54px; height: 54px; left: 18px; top: -22px; }
.cloud::after { width: 68px; height: 68px; right: 18px; top: -28px; }
.cloud-1 { top: 92px; left: 76px; }
.cloud-2 { top: 148px; left: 360px; animation-duration: 26s; }
.cloud-3 { top: 70px; left: 720px; animation-duration: 20s; }
.hill {
position: absolute;
border-radius: 50% 50% 0 0;
}
.hill-back {
bottom: 180px;
left: -2%;
width: 52%;
height: 170px;
background: #8fe06d;
}
.hill-front {
bottom: 152px;
right: -5%;
width: 60%;
height: 220px;
background: #64c84a;
}
.fence {
position: absolute;
left: 0;
right: 0;
bottom: 158px;
height: 88px;
z-index: 2;
background:
linear-gradient(to bottom,
transparent 0 18px,
var(--fence-red) 18px 32px,
transparent 32px 44px,
var(--fence-red-dark) 44px 58px,
transparent 58px 100%
);
}
.fence::before {
content: "";
position: absolute;
inset: 0;
background:
linear-gradient(to right,
transparent 0 2%,
var(--fence-red) 2% 5%,
transparent 5% 12%,
var(--fence-red) 12% 15%,
transparent 15% 22%,
var(--fence-red) 22% 25%,
transparent 25% 32%,
var(--fence-red) 32% 35%,
transparent 35% 42%,
var(--fence-red) 42% 45%,
transparent 45% 52%,
var(--fence-red) 52% 55%,
transparent 55% 62%,
var(--fence-red) 62% 65%,
transparent 65% 72%,
var(--fence-red) 72% 75%,
transparent 75% 82%,
var(--fence-red) 82% 85%,
transparent 85% 92%,
var(--fence-red) 92% 95%,
transparent 95% 100%);
opacity: .95;
}
.zoo-scene::after {
content: "";
position: absolute;
inset: auto 0 0 0;
height: 200px;
background:
radial-gradient(circle at 14% 100%, rgba(255,255,255,0.2) 0 14%, transparent 15%),
radial-gradient(circle at 46% 100%, rgba(255,255,255,0.16) 0 19%, transparent 20%),
radial-gradient(circle at 76% 100%, rgba(255,255,255,0.13) 0 16%, transparent 17%),
linear-gradient(to top, var(--grass-dark), var(--grass-main));
}
.carrot {
position: absolute;
bottom: 92px;
width: 20px;
height: 56px;
background: linear-gradient(to bottom, #ffb050, #f57424 70%, #d95b16);
clip-path: polygon(50% 100%, 0 0, 100% 0);
z-index: 4;
animation: sway 3.2s ease-in-out infinite;
}
.carrot::before,
.carrot::after {
content: "";
position: absolute;
top: -10px;
width: 12px;
height: 20px;
background: linear-gradient(to bottom, #5cd05c, #2f9c39);
border-radius: 12px 12px 0 12px;
}
.carrot::before { left: 1px; transform: rotate(-35deg); }
.carrot::after { right: 1px; transform: rotate(35deg) scaleX(-1); }
.carrot-1 { left: 10%; }
.carrot-2 { left: 24%; animation-delay: -.6s; }
.carrot-3 { left: 41%; animation-delay: -1.2s; }
.carrot-4 { left: 63%; animation-delay: -.9s; }
.carrot-5 { left: 79%; animation-delay: -1.5s; }
.carrot-6 { left: 90%; animation-delay: -.3s; }
.rabbit {
position: absolute;
bottom: 106px;
width: 114px;
height: 150px;
border: none;
background: transparent;
padding: 0;
cursor: pointer;
z-index: 5;
transform-origin: bottom center;
animation: hop 2.15s ease-in-out infinite;
}
.rabbit:focus-visible {
outline: 3px solid rgba(67, 130, 255, 0.45);
outline-offset: 4px;
border-radius: 24px;
}
.rabbit .ear,
.rabbit .face,
.rabbit .body,
.rabbit .foot,
.rabbit .tail,
.rabbit .speech,
.rabbit .eye,
.rabbit .nose,
.rabbit .mouth,
.rabbit .cheek {
position: absolute;
}
.rabbit .ear {
top: 6px;
width: 24px;
height: 68px;
border-radius: 999px;
background: var(--rabbit);
box-shadow: inset 0 0 0 2px #f3f3f3;
}
.rabbit .ear::after {
content: "";
position: absolute;
inset: 10px 5px;
border-radius: 999px;
background: var(--ear-pink);
}
.ear-left { left: 26px; transform: rotate(-10deg); }
.ear-right { right: 26px; transform: rotate(10deg); }
.rabbit .face {
top: 42px;
left: 25px;
width: 64px;
height: 54px;
border-radius: 50%;
background: var(--rabbit);
box-shadow: inset 0 -2px 0 #ececec;
}
.rabbit .body {
top: 78px;
left: 16px;
width: 82px;
height: 58px;
border-radius: 48% 48% 38% 38%;
background: var(--rabbit);
box-shadow: inset 0 -3px 0 var(--rabbit-shadow);
}
.rabbit .tail {
top: 96px;
right: 5px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #f6f6f6;
box-shadow: inset 0 -2px 0 #d9d9d9;
}
.rabbit .foot {
bottom: 10px;
width: 30px;
height: 15px;
border-radius: 999px;
background: #f3f3f3;
}
.foot-left { left: 20px; }
.foot-right { right: 20px; }
.rabbit .eye {
top: 20px;
width: 7px;
height: 9px;
border-radius: 50%;
background: #2f3143;
}
.eye-left { left: 18px; }
.eye-right { right: 18px; }
.rabbit .nose {
top: 28px;
left: 28px;
width: 8px;
height: 6px;
background: #ff97a8;
border-radius: 50% 50% 60% 60%;
}
.rabbit .mouth {
top: 34px;
left: 24px;
width: 16px;
height: 10px;
border-bottom: 2px solid #8c6670;
border-radius: 0 0 14px 14px;
}
.rabbit .cheek {
top: 28px;
width: 10px;
height: 7px;
border-radius: 50%;
background: rgba(255, 164, 189, 0.6);
}
.cheek-left { left: 9px; }
.cheek-right { right: 9px; }
.rabbit .speech {
left: 50%;
bottom: 132px;
transform: translateX(-50%) scale(.92);
width: 200px;
padding: 10px 12px;
border-radius: 18px;
background: var(--speech-bg);
color: #28405d;
font-size: .93rem;
font-weight: 800;
line-height: 1.35;
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.13);
opacity: 0;
pointer-events: none;
transition: opacity .2s ease, transform .2s ease;
}
.rabbit .speech::after {
content: "";
position: absolute;
left: 50%;
bottom: -10px;
width: 16px;
height: 16px;
background: var(--speech-bg);
transform: translateX(-50%) rotate(45deg);
}
.rabbit.talking .speech {
opacity: 1;
transform: translateX(-50%) scale(1);
}
.rabbit-1 { left: 9%; animation-delay: 0s; }
.rabbit-2 { left: 25%; animation-delay: .35s; }
.rabbit-3 { left: 43%; animation-delay: .7s; }
.rabbit-4 { left: 61%; animation-delay: 1.05s; }
.rabbit-5 { left: 79%; animation-delay: 1.4s; }
.rabbit-2 .ear::after { background: #ffd3e5; }
.rabbit-3 .ear::after { background: #c9d8ff; }
.rabbit-4 .ear::after { background: #ffe3a6; }
.rabbit-5 .ear::after { background: #d4f1c7; }
@keyframes hop {
0%, 100% { transform: translateY(0) scaleX(1); }
20% { transform: translateY(-12px) scaleX(.98); }
42% { transform: translateY(-34px) scaleX(1.03); }
55% { transform: translateY(-10px) scaleX(.98); }
75% { transform: translateY(0) scaleX(1.02); }
}
@keyframes drift {
0% { transform: translateX(0); }
50% { transform: translateX(30px); }
100% { transform: translateX(0); }
}
@keyframes sway {
0%, 100% { transform: rotate(-4deg); }
50% { transform: rotate(4deg); }
}
@media (max-width: 900px) {
.zoo-scene { min-height: 780px; height: auto; aspect-ratio: 3 / 4; }
.fence { bottom: 190px; }
.hill-front { bottom: 182px; }
.hill-back { bottom: 220px; }
.rabbit { transform: scale(.9); }
.rabbit-1 { left: 4%; bottom: 106px; }
.rabbit-2 { left: 25%; bottom: 120px; }
.rabbit-3 { left: 47%; bottom: 102px; }
.rabbit-4 { left: 16%; bottom: 250px; }
.rabbit-5 { left: 60%; bottom: 248px; }
}