2026-09-25 13:36:13 -04:00
|
|
|
import { keyframes, style } from '@vanilla-extract/css';
|
2026-06-30 19:41:58 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Autumn overlay keyframes. Every animation touches ONLY `transform` and
|
2026-09-25 13:58:15 -04:00
|
|
|
* `opacity` so the compositor can run them without layout or paint.
|
2026-06-30 19:41:58 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2026-09-25 13:58:15 -04:00
|
|
|
* A leaf falls from above to below the viewport while slowly turning. One tall
|
|
|
|
|
* translateY serves every leaf; per-leaf duration/delay/size give parallax.
|
2026-06-30 19:41:58 -04:00
|
|
|
*/
|
|
|
|
|
export const animLeafFall = keyframes({
|
|
|
|
|
'0%': { transform: 'translate3d(0, -12vh, 0) rotate(-30deg)', opacity: '0' },
|
2026-09-25 13:58:15 -04:00
|
|
|
'6%': { opacity: '1' },
|
|
|
|
|
'50%': { transform: 'translate3d(10px, 50vh, 0) rotate(160deg)' },
|
|
|
|
|
'94%': { opacity: '0.9' },
|
|
|
|
|
'100%': { transform: 'translate3d(-6px, 114vh, 0) rotate(340deg)', opacity: '0' },
|
2026-06-30 19:41:58 -04:00
|
|
|
});
|
|
|
|
|
|
2026-09-25 13:58:15 -04:00
|
|
|
/** Lateral sway on the leaf's wrapper so the descent reads as wind. */
|
2026-06-30 19:41:58 -04:00
|
|
|
export const animLeafSway = keyframes({
|
|
|
|
|
'0%': { transform: 'translate3d(0, 0, 0)' },
|
|
|
|
|
'50%': { transform: 'translate3d(34px, 0, 0)' },
|
|
|
|
|
'100%': { transform: 'translate3d(0, 0, 0)' },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
2026-09-25 13:58:15 -04:00
|
|
|
* Soft flutter on the blade. [#237] Gentler than before (scaleX 0.82 made
|
|
|
|
|
* leaves flatten into slivers mid-flip).
|
2026-06-30 19:41:58 -04:00
|
|
|
*/
|
|
|
|
|
export const animLeafFlutter = keyframes({
|
2026-09-25 13:58:15 -04:00
|
|
|
'0%': { transform: 'rotate(-10deg) scaleX(1)' },
|
|
|
|
|
'50%': { transform: 'rotate(10deg) scaleX(0.92)' },
|
|
|
|
|
'100%': { transform: 'rotate(-10deg) scaleX(1)' },
|
2026-06-30 19:41:58 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
2026-09-25 13:58:15 -04:00
|
|
|
* [#237] A gust: the leaf enters from the left, is blown across and up while
|
|
|
|
|
* spinning, and leaves on the right in ~6 s (14 % of a 42 s cycle). The rest
|
|
|
|
|
* of the cycle it waits off-screen, invisible.
|
2026-06-30 19:41:58 -04:00
|
|
|
*/
|
2026-09-25 13:58:15 -04:00
|
|
|
export const animGust = keyframes({
|
|
|
|
|
'0%': { transform: 'translate3d(-12vw, 0, 0) rotate(0deg)', opacity: '0' },
|
|
|
|
|
'1%': { opacity: '1' },
|
|
|
|
|
// Fast in, then carried steadily across and up (linear timing: an eased
|
|
|
|
|
// curve would apply per segment and stop the leaves mid-air).
|
|
|
|
|
'3.5%': { transform: 'translate3d(22vw, -3vh, 0) rotate(200deg)' },
|
|
|
|
|
'8%': { transform: 'translate3d(62vw, -12vh, 0) rotate(420deg)' },
|
|
|
|
|
'12.5%': { opacity: '1' },
|
|
|
|
|
'14%': { transform: 'translate3d(112vw, -24vh, 0) rotate(700deg)', opacity: '0' },
|
|
|
|
|
'100%': { transform: 'translate3d(112vw, -24vh, 0) rotate(700deg)', opacity: '0' },
|
2026-06-30 19:41:58 -04:00
|
|
|
});
|
2026-09-25 13:36:13 -04:00
|
|
|
|
|
|
|
|
/**
|
2026-09-25 13:58:15 -04:00
|
|
|
* Leaf blade. On the dark themes the crimson/russet leaves sank into the
|
|
|
|
|
* background, so they are lifted there.
|
2026-09-25 13:36:13 -04:00
|
|
|
*/
|
|
|
|
|
export const leafBlade = style({
|
|
|
|
|
selectors: {
|
|
|
|
|
'body.dark-theme &, body.butter-theme &': {
|
2026-09-25 13:58:15 -04:00
|
|
|
filter: 'brightness(1.6) saturate(1.2)',
|
2026-09-25 13:36:13 -04:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|