Photo Gallery Module

← App map · The “photo gallery” tab: a 5 × 5 wall of photos you move across one cell at a time, with a full-screen viewer.

Screenshots scroll sideways · tap to enlarge

What it does

The wonder’s Unsplash collection id picks one of 8 bundled lists of 24 photo ids (UnsplashPhotoData.photosByCollectionId); the list is repeated and cut to fill 25 cells, and each photo loads from wonderous.info at 400, 800 or 1200 px (doubled on 1.5× screens and desktop) — the live Unsplash API in UnsplashService is only used by dev tools. The grid starts on index 13 (12.5 rounds up, one cell right of centre). A swipe of 30 px in any of 8 directions or an arrow key moves one cell or row (never past an edge), and tapping a visible neighbour selects it; the whole grid slides there in 240 ms while the selected photo scales to 1.15 and a 70 % black overlay keeps a rounded cut-out around it that briefly shrinks 25 % along the swipe axis. Tapping the selected photo opens FullscreenUrlImgViewer with all 25 at 1200 px (pinch to zoom, swipe between them); closing it returns the page you ended on and the grid jumps there without animating. One corner cell, chosen per wonder, hides the wonder’s second collectible until it is found.

Logic class diagram

Everything is index arithmetic on a fixed grid: swipes, keys and taps become a new index, and the offset that centres it is computed, not scrolled.

Screen widget composition

A grid bigger than the screen, translated so the selected cell sits in the middle, under a black overlay with a cut-out.

Swipe across the wall and open a photo sequence

A swipe is snapped to one of 8 directions, turned into an index, and the grid animates to that index’s offset.

Key files