/** * The SVG filter definitions behind the liquid-glass look, mounted exactly once * (from `AppProviders`) so `url(#…)` resolves anywhere in the app. * * Why these are static: refraction reads as *liquid* because the backdrop moves * behind a fixed displacement map — not because the map itself animates. * Animating `baseFrequency` would re-rasterise the turbulence every frame; a * static seed over the drifting aurora/canvas backdrop costs one raster pass * and looks the same. * * These are consumed through `theme.tokens.glass.rimFilter` / * `rimFilterChroma`, and only ever on a thin masked ring (see `Glass.tsx`) — * never over a whole pane, which would be Chrome-only and far too expensive on * a grid of cards. */ /** Turbulence shared by both rim filters: soft, lens-like lobes rather than sand. */ const Turbulence = () => ( <> ); /** Isolates one channel of the source so it can be displaced independently. */ const channelMatrix = (channel: 'r' | 'g' | 'b') => ({ r: '1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0', g: '0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0', b: '0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0', })[channel]; export const GlassDefs = () => ( ); /** * Fine grain, as a self-contained data URI rather than a `filter: url()` chain — * it tiles as a plain background-image, so it costs nothing per frame. * Layered at low opacity over the aurora it kills gradient banding and gives * the rim refraction something fine-grained to bend. */ export const GRAIN_DATA_URI = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E\")";