Files
swiftcontrol/scripts/store_screenshots.sh
Jonas Acker fe5e96a596 feat(store): Play feature graphic, App Store header and search assets
store_screenshots/scripts/graphics.mjs renders the Play feature graphic and
the App Store product page header (3840x1646) and search results (3840x2560)
stills per language from the app captures, on the app's brand band. They lead
with virtual shifting, then the rider's own controllers, and follow the
stores' rules: copy and focal art in Apple's template safe areas, no prices,
URLs or other platforms; for Play a vibrant ground, no device imagery and the
centre clear of the preview video's play button. The copy lives in
scripts/creative-copy.mjs.

store_screenshots/header-loop is a HyperFrames project for a 10 s seamless
header loop: the design system's drivetrain shifting 12 → 14 → 12 with the
+ / − press, the contours drifting on a closed path. node render-all.mjs
renders one MP4 per language (renders/ is not committed).

The capture settle now waits 2.5 s: Trainer Controls' buttons fade their
own fill slower than the theme and were caught half light, half dark. A
failed capture run retries once; the feature graphic gets its own Play lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:37:02 +02:00

76 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Regenerates the store screenshot decks in store_screenshots/ from the
# current app:
# 1. test/screenshot_test.dart with EDITOR_CAPTURES=true renders the six
# store scenes bare (phone 1100x2390, iPad 2064x2752, desktop 3840x2400; light + dark)
# into the gitignored screenshots/editor/<locale>/.
# 2. store_screenshots/scripts/sync-captures.mjs copies them into the
# editor's public/screenshots/.
# 3. store_screenshots/scripts/export.mjs exports every deck headless into
# store_screenshots/out/<platform>/<device>/<WxH>/<locale>/.
# 4. store_screenshots/scripts/graphics.mjs renders the Play feature graphic
# and the App Store header / search results stills from the captures.
# 5. store_screenshots/scripts/publish.mjs compresses the sizes the stores
# get into the committed screenshots/store/<locale>/<slot>/, which
# scripts/prepare_store_screenshots.sh prefers over the Flutter-drawn
# boards for that locale.
#
# The decks themselves (copy, layouts, placement) live in
# store_screenshots/app-store-screenshots.json; edit them in the editor:
# cd store_screenshots && bun dev
#
# Usage: scripts/store_screenshots.sh [--locales en,de] (default: every store language) [--no-capture] [--no-export] [deck ...]
# --no-capture reuse the existing screenshots/editor/ captures
# --no-export stop after syncing (e.g. to open the editor)
# deck iphone ipad android mac android-10 android-7 (default: all)
#
# The App Store header loop (video) is its own HyperFrames project:
# cd store_screenshots/header-loop && node render-all.mjs
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
EDITOR="$ROOT/store_screenshots"
LOCALES=en,de,es,fr,it,pl
CAPTURE=1
EXPORT=1
DECKS=()
while [ $# -gt 0 ]; do
case "$1" in
--locales) LOCALES="$2"; shift 2 ;;
--no-capture) CAPTURE=0; shift ;;
--no-export) EXPORT=0; shift ;;
*) DECKS+=("$1"); shift ;;
esac
done
if [ "$CAPTURE" = 1 ]; then
echo "==> Rendering editor captures ($LOCALES)"
rm -rf "$ROOT/screenshots/editor"
capture() {
(cd "$ROOT" && flutter test --run-skipped --update-goldens \
--dart-define=EDITOR_CAPTURES=true --dart-define=STORE_LOCALES="$LOCALES" \
--name '^(Device|Trainer|Customization|Trainer Controls|Devices|Virtual Shifting Settings)$' \
test/screenshot_test.dart)
}
# The first scene sometimes trips over a plugin channel the test host lacks
# (app_links); a second run gets through.
capture || { echo "==> Capture failed; retrying once"; capture; }
fi
[ -d "$EDITOR/node_modules" ] || (cd "$EDITOR" && bun install)
echo "==> Syncing captures into the editor"
(cd "$EDITOR" && node scripts/sync-captures.mjs)
if [ "$EXPORT" = 1 ]; then
echo "==> Exporting decks"
(cd "$EDITOR" && node scripts/export.mjs ${DECKS[@]+"${DECKS[@]}"})
echo "==> Rendering store graphics (feature graphic, App Store header + search)"
(cd "$EDITOR" && node scripts/graphics.mjs)
echo "==> Publishing store sizes into screenshots/store/"
(cd "$EDITOR" && node scripts/publish.mjs)
fi