krz/daybyday

iOS learning games for young children: days, months, seasons, numbers, letters, animals and more. education ios kids swift https://krz.sh/apps/daybyday/

scripts/render-header.sh

main
daybyday/scripts/render-header.sh history · blame · raw

15 lines · 776 bytes · executable

 1#!/bin/sh
 2# Renders AppStore/header.html to the 21:9 (3840x1646) and 16:9 (5244x2950) App Store
 3# product page headers with headless Chromium, then removes the alpha channel.
 4# Needs Chromium.app and ImageMagick. Usage: scripts/render-header.sh
 5set -eu
 6
 7cd "$(dirname "$0")/../AppStore"
 8chromium=/Applications/Chromium.app/Contents/MacOS/Chromium
 9"$chromium" --headless --hide-scrollbars --force-device-scale-factor=1 --window-size=3840,1646 \
10    --screenshot=header-21x9.png "file://$PWD/header.html" 2>/dev/null
11"$chromium" --headless --hide-scrollbars --force-device-scale-factor=1 --window-size=5244,2950 \
12    --screenshot=header-16x9.png "file://$PWD/header.html#wide" 2>/dev/null
13for f in header-21x9.png header-16x9.png; do
14    magick "$f" -alpha off "PNG24:$f"
15done