Files
Duarte Santos d8d7257d35 Website: underline the demo-note link, 480 px WebP variant for phones, ?v=19
Lighthouse desktop flagged the one in-text link that relied on colour alone;
the hero and rail images gain a 480w candidate so a 2× phone no longer
downloads the 600w file.
2026-09-13 13:14:40 +02:00

18 lines
796 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Builds the website's img/ folder from ../assets: the five screenshots as PNG (fallback)
# plus WebP at 480, 600 and 1170 px wide (what <picture> actually serves), and the 1200×630
# social card. Needs ffmpeg with libwebp. Usage: website/build-images.sh <dist>/img
set -euo pipefail
out=${1:?target img dir}; mkdir -p "$out"
here=$(cd "$(dirname "$0")" && pwd)
for n in home workout stats plan library; do
src="$here/../assets/screenshots/$n.png"
cp "$src" "$out/$n.png"
for w in 480 600 1170; do
ffmpeg -v error -y -i "$src" -vf "scale=$w:-1:flags=lanczos" -c:v libwebp -quality 82 -compression_level 6 "$out/$n-$w.webp"
done
done
cp "$here/../assets/social.jpg" "$out/social.jpg"
cp "$here/../assets/banner.png" "$out/banner.png"
echo "images written to $out"