|
194 | 194 | .env-magic.is-still .env-glow { opacity: .24; transform: translate(-50%, -2px) scale(.95); } |
195 | 195 | } |
196 | 196 | @keyframes envFade { from { opacity: 0; } to { opacity: 1; } } |
| 197 | + |
| 198 | +/* ---- snails (js/animals/snails.js) ---- */ |
| 199 | +.snail { position: absolute; z-index: 3; width: 34px; height: 25px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; --sh1: #f4b9a8; --sh2: #d98b7b; --bd: #f0e0cc; --pt: #f6a9c4; --sn-in: .45s; } |
| 200 | +.snail[hidden] { display: none; } |
| 201 | +.snail::after { content: ''; position: absolute; inset: -10px; } /* a forgiving tap area */ |
| 202 | +.snail:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 4px; border-radius: 8px; } |
| 203 | +.sn-flip { display: block; width: 100%; height: 100%; } |
| 204 | +.snail.is-left .sn-flip { transform: scaleX(-1); } |
| 205 | +.snail svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 1px rgba(110, 80, 50, .25)); } |
| 206 | +.sn-foot { fill: var(--bd); } |
| 207 | +.sn-stalk { fill: none; stroke: var(--bd); stroke-width: 1.6; stroke-linecap: round; } |
| 208 | +.sn-eye { fill: #5a4366; } |
| 209 | +.sn-shell { fill: var(--sh1); stroke: var(--sh2); stroke-width: .8; } |
| 210 | +.sn-spiral { fill: none; stroke: var(--sh2); stroke-width: 1.3; stroke-linecap: round; } |
| 211 | +.sn-hi { fill: #fff; opacity: .45; } |
| 212 | +.sn-dec { display: none; fill: var(--sh2); opacity: .8; } |
| 213 | +.sn-petal { display: none; fill: var(--pt); stroke: rgba(255, 255, 255, .6); stroke-width: .4; } |
| 214 | +.snail.is-deco .sn-dec, .snail.has-petal .sn-petal { display: block; } |
| 215 | +.snail.is-wet .sn-hi { opacity: .8; } |
| 216 | +.sn-body { transform-origin: 20px 26px; transition: transform var(--sn-in) ease-in-out, opacity var(--sn-in) ease-in-out; } |
| 217 | +.snail.is-hidden .sn-body { transform: translateX(4px) scale(.15, .4); opacity: 0; } |
| 218 | +.snail.is-peek .sn-body { transform: translateX(8px) scale(.6, .9); } |
| 219 | +.snail.is-peek .sn-eyes { transform: translateY(2px); } |
| 220 | +@media (prefers-reduced-motion: no-preference) { |
| 221 | + .snail.is-crawl .sn-body { animation: snStretch 1.7s ease-in-out infinite; } |
| 222 | + .snail:not(.is-hidden):not(.is-peek):not(.is-crawl) .sn-eyes { transform-origin: 38px 17px; animation: snLook 7s ease-in-out infinite; } |
| 223 | + .snail.is-new svg { animation: snNew 1.3s ease; } |
| 224 | + .sn-trail { animation: snTrail 3.6s ease-out forwards; } |
| 225 | + .sn-spark { animation: snSpark 2.4s ease-out forwards; } |
| 226 | + .sn-flour { animation: snFlour 6s ease-in-out forwards; } |
| 227 | +} |
| 228 | +@media (prefers-reduced-motion: reduce) { .sn-body { transition: none; } } |
| 229 | +.sn-trail { position: absolute; z-index: 2; width: 10px; height: 3px; opacity: 0; border-radius: 50%; pointer-events: none; background: radial-gradient(ellipse, rgba(255, 255, 255, .95), rgba(190, 215, 240, .6) 55%, transparent 78%); transform: rotate(var(--r, 0deg)); opacity: 0; } |
| 230 | +.sn-spark { position: absolute; z-index: 2; width: 7px; height: 7px; pointer-events: none; opacity: 0; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); } |
| 231 | +.sn-flour { position: absolute; z-index: 2; width: 16px; height: 16px; pointer-events: none; opacity: 0; } |
| 232 | +.sn-flour svg { display: block; width: 100%; height: 100%; overflow: visible; } |
| 233 | +@keyframes snStretch { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.07); } } |
| 234 | +@keyframes snLook { 0%, 40%, 100% { transform: rotate(0); } 55% { transform: rotate(-5deg); } 75% { transform: rotate(4deg); } } |
| 235 | +@keyframes snNew { 0%, 100% { filter: drop-shadow(0 1px 1px rgba(110, 80, 50, .25)); } 40% { filter: drop-shadow(0 0 6px rgba(255, 230, 150, .95)) brightness(1.15); } } |
| 236 | +@keyframes snTrail { 0% { opacity: 0; scale: .6; } 12% { opacity: .85; scale: 1; } 100% { opacity: 0; scale: 1.25; } } |
| 237 | +@keyframes snSpark { 0% { opacity: 0; scale: .2; } 20% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .4; rotate: 50deg; } } |
| 238 | +@keyframes snFlour { 0% { opacity: 0; scale: .3; } 15% { opacity: .9; scale: 1; } 70% { opacity: .8; } 100% { opacity: 0; scale: 1.1; } } |
| 239 | +@media (max-width: 699px) { .snail { width: 28px; height: 21px; } } |
0 commit comments