|
243 | 243 | @media (max-width: 699px) { .sn-say { font-size: 11px; padding: 3px 8px; max-width: min(130px, 44vw); } } |
244 | 244 | @media (prefers-reduced-motion: reduce) { .sn-say { animation: none; } } |
245 | 245 |
|
246 | | -/* ---- insects that come out from under a tapped decorative leaf (js/animals/insects.js) ---- */ |
| 246 | +/* ---- insects that come out from under a tapped decorative leaf (js/animals/insects.js): they never take taps; they just crawl away ---- */ |
247 | 247 | .insect { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .35s ease; will-change: transform; touch-action: manipulation; -webkit-tap-highlight-color: transparent; } |
248 | 248 | .insect.is-in { opacity: 1; } |
249 | 249 | .insect.is-out { opacity: 0; transition-duration: .5s; } |
250 | 250 | .insect.is-under { z-index: 0; } /* beneath the leaf (z-index 1) while it slips out */ |
251 | | -.insect.is-landed { pointer-events: auto; cursor: pointer; } |
252 | | -.insect.is-landed::after { content: ''; position: absolute; inset: -8px; } /* a forgiving tap area */ |
| 251 | +.hero-flowers .insect.is-under { z-index: -1; } /* the hero leaves sit in .hero-flowers' own stacking context, where the critter comes after them in the page order */ |
253 | 252 | .insect .in-flip, .insect .in-body { display: block; width: 100%; height: 100%; } |
254 | 253 | .insect.is-left .in-flip { transform: scaleX(-1); } |
255 | 254 | .insect svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 1px rgba(110, 80, 50, .28)); } |
256 | | -.insect.is-fly svg { filter: drop-shadow(0 4px 3px rgba(90, 67, 102, .2)); } |
257 | | -.insect.is-fly .in-body { animation: inFly .22s ease-in-out infinite alternate; } |
258 | 255 | .insect.is-crawl .in-body { animation: inCrawl .3s ease-in-out infinite alternate; } |
259 | 256 | .insect.in-caterpillar.is-crawl .in-body { transform-origin: 50% 100%; animation: inInch .9s ease-in-out infinite; } |
260 | | -.insect.is-wiggle .in-body { animation: inWiggle .5s ease; } |
261 | | -@keyframes inFly { from { transform: translateY(-1px) scale(1.06, .94); } to { transform: translateY(1px) scale(.94, 1.06); } } |
262 | 257 | @keyframes inCrawl { from { transform: translateY(0); } to { transform: translateY(-.6px) scale(1.04, .98); } } |
263 | 258 | @keyframes inInch { 0%, 100% { transform: scaleX(1); } 50% { transform: scale(.82, 1.14); } } |
264 | | -@keyframes inWiggle { 20% { transform: rotate(-14deg); } 50% { transform: rotate(12deg); } 80% { transform: rotate(-6deg); } } |
265 | 259 |
|
266 | 260 | /* --------------------------------------------------------------------- |
267 | 261 | The bird nest beside the DeviantArt button (js/animals/nest.js). |
|
311 | 305 | .bn[data-grow="3"] { --g: 1.18; } |
312 | 306 | .bn-baby { scale: var(--g); transition: scale 1.2s ease; } |
313 | 307 | .vine-bird.bn-parent svg { width: 43px; height: 35px; } |
314 | | -.bn-worm { position: absolute; left: 32px; top: 11px; width: 17px; height: 7px; border-radius: 3px; background: #e0868f; box-shadow: inset 0 -1px 0 rgba(150, 70, 90, 0.35); pointer-events: none; animation: bnWorm 0.5s ease-in-out infinite alternate; } |
315 | | -.bn-worm.fly { position: fixed; left: 0; top: 0; z-index: 7; width: 20px; height: 8px; } |
| 308 | +/* a small wriggly pink worm: a wavy body with a lighter band (clitellum) and a dot eye, drawn as an inline SVG so it stays readable at ~17px */ |
| 309 | +.bn-worm { position: absolute; left: 31px; top: 8px; width: 18px; height: 11px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 11'%3E%3Cpath d='M1.5 7.5 Q4 1.5 7 5.5 T12.5 5.5 T16 3.5' fill='none' stroke='%23c4636f' stroke-width='3.6' stroke-linecap='round'/%3E%3Cpath d='M1.5 7.5 Q4 1.5 7 5.5 T12.5 5.5 T16 3.5' fill='none' stroke='%23ec9aa3' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M10.2 3.2 L10.2 7.6' stroke='%23c4636f' stroke-width='1.1'/%3E%3Ccircle cx='16' cy='3.2' r='0.6' fill='%23402'/%3E%3C/svg%3E") center / 100% 100% no-repeat; pointer-events: none; animation: bnWorm 0.5s ease-in-out infinite alternate; } |
| 310 | +.bn-worm.fly { position: fixed; left: 0; top: 0; z-index: 7; width: 20px; height: 12px; animation: none; } /* no bnWorm here: its rotate/scale are applied outside the translate and would swing/squash the flight path */ |
316 | 311 | @keyframes bnWorm { to { rotate: 22deg; scale: 1.1 0.8; } } |
| 312 | +/* the 2nd and 3rd feedings bring a berry and a seed instead of the worm (data-food set in nest.js); they sit still instead of wriggling */ |
| 313 | +.bn-worm:not(.fly)[data-food=berry] { left: 35px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #ff9fb0 0 14%, transparent 16%), radial-gradient(circle at 50% 55%, #d6334f, #8e1d3c); box-shadow: 0 -2px 0 -1px #5a9a4a; animation: bnBob 0.5s ease-in-out infinite alternate; } |
| 314 | +.bn-worm:not(.fly)[data-food=seed] { left: 35px; top: 11px; width: 10px; height: 6px; border-radius: 60% 40% 60% 40% / 70% 70% 40% 40%; background: linear-gradient(100deg, #d9b26a 0 55%, #a97c3a 55% 62%, #d9b26a 62%); box-shadow: inset 0 -1px 0 rgba(90, 60, 20, 0.4); rotate: -18deg; animation: none; } |
| 315 | +.bn-worm.fly[data-food=berry] { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #ff9fb0 0 14%, transparent 16%), radial-gradient(circle at 50% 55%, #d6334f, #8e1d3c); box-shadow: 0 -2px 0 -1px #5a9a4a; animation: none; } |
| 316 | +.bn-worm.fly[data-food=seed] { width: 11px; height: 7px; border-radius: 60% 40% 60% 40% / 70% 70% 40% 40%; background: linear-gradient(100deg, #d9b26a 0 55%, #a97c3a 55% 62%, #d9b26a 62%); box-shadow: inset 0 -1px 0 rgba(90, 60, 20, 0.4); animation: none; } |
317 | 317 | @keyframes bnBob { to { translate: 0 -1.2px; } } |
318 | 318 | @keyframes bnBlink { 0%, 93%, 100% { scale: 1; } 96% { scale: 1 0.1; } } |
319 | 319 | @keyframes bnPeep { 0%, 90%, 100% { opacity: 0; scale: 0.4; } 93%, 97% { opacity: 1; scale: 0.9; } } |
|
0 commit comments