Skip to content

Add image zoom/lightbox for puzzle images#29

Merged
kishanasokan merged 3 commits intomainfrom
feature/image-zoom
Feb 27, 2026
Merged

Add image zoom/lightbox for puzzle images#29
kishanasokan merged 3 commits intomainfrom
feature/image-zoom

Conversation

@kishanasokan
Copy link
Copy Markdown
Owner

Summary

  • Adds a fullscreen lightbox modal for inspecting radiological puzzle images up close
  • Desktop: scroll-to-zoom (1x–4x), click-drag to pan, click backdrop/X/ESC to close
  • Mobile: pinch-to-zoom, single-finger drag to pan, tap outside/X to close
  • Magnifying glass icon on image corner indicates zoom capability
  • Auto-dismissing hint toast (5s) shows zoom/pan instructions on each open
  • Works with both annotated and non-annotated images, current and archived puzzles
  • Zero new dependencies — built with CSS transforms + native event handlers
  • Zero localStorage impact — no interference with game state, stats, or streaks

Files changed

  • components/ImageZoomModal.tsx (new) — Self-contained lightbox component
  • components/GamePage.tsx — Zoom trigger, state, and modal integration
  • app/globals.css — Two CSS animations (modal entrance + hint toast)

Test plan

  • All 159 existing tests pass
  • Desktop: click image → zoom modal opens, scroll to zoom, drag to pan, close via X/ESC/backdrop
  • Mobile: tap image → fullscreen modal, pinch to zoom, drag to pan, tap X/outside to close
  • Annotated image: make a guess, verify zoom shows annotated version
  • Archive puzzle: navigate to archived puzzle, verify zoom works identically
  • No regression: play full game, verify stats/streaks/share unaffected

🤖 Generated with Claude Code

Allows users to inspect radiological images more closely with a fullscreen
lightbox modal supporting scroll-to-zoom (desktop), pinch-to-zoom (mobile),
and drag-to-pan on both platforms. Zero new dependencies — built entirely
with CSS transforms and native touch/mouse/wheel event handlers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
radwordle Ready Ready Preview, Comment Feb 27, 2026 3:34am

- Remove isOpen prop; parent conditionally renders + uses key for fresh remount
- Replace useRef counter with useState for zoom key (refs can't be read in render)
- Provide initial value to cooldownTimer useRef (TypeScript strict mode)
- Simplify effects by removing isOpen guards (component only mounts when open)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensure Enter/Space keyboard trigger also increments zoomKey for fresh
remount, matching the click handler behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kishanasokan kishanasokan merged commit 2cf5177 into main Feb 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant