From 67233721094b4ac0c3ed9fe916283022b3246db0 Mon Sep 17 00:00:00 2001 From: Brice Johnson <1939015+Bjohnson131@users.noreply.github.com> Date: Thu, 16 Jul 2026 00:42:52 -0500 Subject: [PATCH 1/4] Add MultiImageMode and supporting hooks for multi-image feature Signed-off-by: Brice Johnson <1939015+Bjohnson131@users.noreply.github.com> --- src/components/PrintUnlockEffect.tsx | 46 ++++++ src/hooks/useSecretCode.ts | 32 +++++ src/hooks/useTileWorkspace.ts | 51 +++++++ src/index.css | 201 +++++++++++++++++++++++++++ src/modes/MultiImageMode.tsx | 15 ++ 5 files changed, 345 insertions(+) create mode 100644 src/components/PrintUnlockEffect.tsx create mode 100644 src/hooks/useSecretCode.ts create mode 100644 src/hooks/useTileWorkspace.ts create mode 100644 src/modes/MultiImageMode.tsx diff --git a/src/components/PrintUnlockEffect.tsx b/src/components/PrintUnlockEffect.tsx new file mode 100644 index 0000000..301fe64 --- /dev/null +++ b/src/components/PrintUnlockEffect.tsx @@ -0,0 +1,46 @@ +import React, { useEffect } from 'react'; + +const DURATION_MS = 2600; + +function prefersReducedMotion(): boolean { + return ( + typeof window !== 'undefined' && + typeof window.matchMedia === 'function' && + window.matchMedia('(prefers-reduced-motion: reduce)').matches + ); +} + +/** + * A quick, self-timing FDM "print build" flourish that plays when the hidden + * feat35 code (see src/hooks/useSecretCode.ts) unlocks multi-image mode. It + * renders a full-screen, click-through overlay of a filament object printing + * layer-by-layer with a sweeping nozzle, then calls `onDone` so the parent can + * unmount it. Bows out immediately for anyone who prefers reduced motion. + */ +function PrintUnlockEffect({ onDone }: { onDone: () => void }): React.ReactElement | null { + const reduced = prefersReducedMotion(); + + useEffect(() => { + const t = window.setTimeout(onDone, reduced ? 0 : DURATION_MS); + return () => window.clearTimeout(t); + }, [onDone, reduced]); + + if (reduced) return null; + + return ( +