Back to winniegolf
SOURCE / PINNED RELEASE

Made of little things.

winniegolf

Release
017b791c0f4b…
Author-recorded commit
612845c125fd…
License
LICENSE
Author’s source reference
nostr://npub18weq5jzw27gkhwcuf6gu57alcptjdvh78nlulgpkz8s7pnlxfnnspc00s9/wss%3A%2F%2Fgit.napplet.soy%2F/n-2d501957e21

Archive hash verified: 713b42364f27a576…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

src/game/settings.ts
export interface GameSettings {
  /** HUD type size in CSS pixels, driven by the optional config domain. */
  textSize: number;
  /** Draw the predicted ball path while aiming. */
  aimGuide: boolean;
  /** Particles and screen shake. */
  effects: boolean;
  /** Name submitted to the optional shared board; empty means resolve later. */
  playerName: string;
}

/** Module defaults, used until (and whether or not) a shell supplies config. */
export const settings: GameSettings = {
  textSize: 14,
  aimGuide: true,
  effects: true,
  playerName: '',
};

let reducedMotionQuery: MediaQueryList | null = null;

/** Honour the OS reduced-motion preference for shake and particle counts. */
export function prefersReducedMotion(): boolean {
  if (!reducedMotionQuery) {
    reducedMotionQuery =
      typeof window.matchMedia === 'function'
        ? window.matchMedia('(prefers-reduced-motion: reduce)')
        : null;
  }
  return reducedMotionQuery?.matches === true;
}