From b84647c749dabdc011f62d8e8213743fd03f565b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 22 Jun 2026 10:15:42 +0300 Subject: Add large 2x2 feature tiles and a CSS-grid overview Allow a single photo to be blown up into a large "feature" tile that spans a 2x2 block of the album overview, controlled by a new THUMB_FEATURE_PERCENT (0-100, default 10; 0 disables). Each tile rolls for a feature first, then for a subdivision, otherwise stays a normal square. To pack mixed-size tiles (normal 1x1, subdivided 1x1, feature 2x2) without gaps, the overview is now a real CSS grid with grid-auto-flow: dense, so smaller tiles backfill the holes a 2x2 feature would leave. Tile spacing moved from per-image padding to the grid gap. Feature tiles reuse the img.thumb class and its dramatic hover. THUMB_FEATURE_PERCENT is wired through the same layers as THUMB_SUBDIVIDE_PERCENT: config defaults, 0..100 validation, --print-config, the --feature CLI flag, the usage text, and the shuriken.json / --dry-run metadata, with docs and tests updated. Generated HTML and CSS pass the W3C Nu HTML checker and CSS validator. Setting both percentages to 0 reproduces the previous all-1x1 grid. Co-Authored-By: Claude Opus 4.8 --- tests/cli.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/cli.sh b/tests/cli.sh index 3181746..cc8b925 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -140,6 +140,7 @@ assert metadata["settings"]["height"] == "120" assert metadata["settings"]["thumbheight"] == "30" assert metadata["settings"]["maxpreviews"] == maxpreviews assert metadata["settings"]["subdivide_percent"] == "30" +assert metadata["settings"]["feature_percent"] == "10" assert metadata["settings"]["image_jobs"] == "3" assert metadata["settings"]["shuffle"] is False assert isinstance(metadata["settings"]["splash_page"], bool) @@ -1414,6 +1415,7 @@ HEIGHT=1200 THUMBHEIGHT=300 MAXPREVIEWS=40 THUMB_SUBDIVIDE_PERCENT=30 +THUMB_FEATURE_PERCENT=10 IMAGE_JOBS=3 IMAGEMAGICK_TIMEOUT=60 RANDOM_SEED='' @@ -1464,6 +1466,7 @@ HEIGHT='' THUMBHEIGHT=30 MAXPREVIEWS=40 THUMB_SUBDIVIDE_PERCENT=30 +THUMB_FEATURE_PERCENT=10 IMAGE_JOBS=3 IMAGEMAGICK_TIMEOUT=60 RANDOM_SEED='' @@ -1607,6 +1610,7 @@ HEIGHT=120 THUMBHEIGHT=30 MAXPREVIEWS=7 THUMB_SUBDIVIDE_PERCENT=30 +THUMB_FEATURE_PERCENT=10 IMAGE_JOBS=3 IMAGEMAGICK_TIMEOUT=60 RANDOM_SEED='' @@ -1652,6 +1656,7 @@ HEIGHT=120 THUMBHEIGHT=30 MAXPREVIEWS=8 THUMB_SUBDIVIDE_PERCENT=30 +THUMB_FEATURE_PERCENT=10 IMAGE_JOBS=3 IMAGEMAGICK_TIMEOUT=60 RANDOM_SEED='' @@ -1705,6 +1710,7 @@ test_print_config_applies_cli_overrides_without_writes() { --thumbheight 45 \ --maxpreviews 9 \ --subdivide 55 \ + --feature 35 \ --image-jobs 2 \ --random-seed cli-seed \ --shuffle \ @@ -1723,6 +1729,7 @@ HEIGHT=456 THUMBHEIGHT=45 MAXPREVIEWS=9 THUMB_SUBDIVIDE_PERCENT=55 +THUMB_FEATURE_PERCENT=35 IMAGE_JOBS=2 IMAGEMAGICK_TIMEOUT=60 RANDOM_SEED=cli-seed @@ -1940,6 +1947,7 @@ test_dry_run_reports_cli_overrides_without_writes() { --thumbheight 45 \ --maxpreviews 2 \ --subdivide 25 \ + --feature 15 \ --image-jobs 2 \ --random-seed dry-seed \ --shuffle \ @@ -1960,6 +1968,7 @@ test_dry_run_reports_cli_overrides_without_writes() { test::assert_contains 'Thumb height: 45' "$output" test::assert_contains 'Max previews per page: 2' "$output" test::assert_contains 'Subdivide percent: 25' "$output" + test::assert_contains 'Feature percent: 15' "$output" test::assert_contains 'Image jobs: 2' "$output" test::assert_contains 'Random seed: dry-seed' "$output" test::assert_contains 'Shuffle: yes' "$output" -- cgit v1.2.3