← back to Homesonspec

apps/mobile/scripts/vshots/build.sh

40 lines

#!/usr/bin/env bash
# Build the 6 App Store screenshots (1320x2868) from faithful HTML reconstructions.
set -euo pipefail
cd "$(dirname "$0")"
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
RAW="raw"; OUT="../../screenshots/final"
mkdir -p "$RAW" "$OUT"
TMP="$(mktemp -d)"

shoot(){ # <url> <rawfile>
  # Chrome writes the PNG then hangs on the map's rAF loop → timeout kills the lingerer.
  timeout 22 "$CHROME" --headless=new --disable-gpu --no-sandbox --hide-scrollbars \
    --no-first-run --no-default-browser-check \
    --force-device-scale-factor=1 --window-size=1320,2868 \
    --virtual-time-budget=9000 \
    --user-data-dir="$TMP/p$RANDOM" \
    --screenshot="$RAW/$2" "file://$PWD/$1" >/dev/null 2>&1 || true
  echo "  captured $2 ($(sips -g pixelWidth -g pixelHeight "$RAW/$2" 2>/dev/null | awk '/pixel/{print $2}' | paste -sd x -))"
}

echo "== capturing raw frames =="
shoot "shot-map.html?mode=hero"      "01-map.png"
shoot "shot-map.html?mode=detail"    "02-detail.png"
shoot "shot-native.html?screen=browse" "03-browse.png"
shoot "shot-native.html?screen=saved"  "04-saved.png"
shoot "shot-native.html?screen=alerts" "05-alerts.png"
shoot "shot-map.html?mode=filter"    "06-filter.png"

echo "== compositing captions =="
cap(){ python3 frame-and-caption.py "$RAW/$1" "$OUT/$2" "$3"; }
cap 01-map.png    01-map.png     "62,000+ new homes. Mapped live."
cap 02-detail.png 02-detail.png  "Tap any home — price, beds, one-tap listing."
cap 03-browse.png 03-browse.png  "Every builder's spec homes. One app."
cap 04-saved.png  04-saved.png   "Save homes instantly — no login, ever."
cap 05-alerts.png 05-alerts.png  "Get pinged the moment a match lists."
cap 06-filter.png 06-filter.png  "Filter by Move-In Ready, Under Construction, Planned."
rm -rf "$TMP"
echo "== done → $OUT =="
ls -la "$OUT"/*.png