Files
wizwar6e/packages/web/src/motion.ts
T
Eric WagonerandClaude Fable 5.1 a071494f4a Reduced motion is honored everywhere the table moves
One shared motion policy: the OS's reduce-motion setting, read live
through Svelte's own media query, folds into the flourishes switch.
Under it the board plays no flourishes, the reel skips its die
interlude and slate wipes, bodies jump between squares instead of
gliding, the canvas holds its ambient shimmers still, and the camera
cuts wherever the director would have panned — in the cockpit as in
the reel, so the eye still lands on what the director chose to watch.
Timers and animation frames are cleared when the policy flips or the
pane closes. A first turn and two reels stepped clean under the
setting with no errors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
2026-09-15 22:42:08 -04:00

12 lines
529 B
TypeScript

import { prefersReducedMotion } from "svelte/motion";
import { prefs } from "./prefs.svelte";
// Shared by the board, the reel, and the canvas. Svelte's own media query
// tracks the OS setting live and releases its listener when no reactive
// consumer remains.
export const motion = {
get reduced(): boolean { return prefersReducedMotion.current; },
/** Flourishes play only when the player wants them AND the OS allows motion. */
get effects(): boolean { return prefs.flourishes && !prefersReducedMotion.current; },
};