Mercurial
diff mrjunejune/generate-icons.sh @ 231:09a96dcb2b4c hg-web
[merge] Join existing hg-web branch head
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sun, 02 Aug 2026 16:50:48 -0700 |
| parents | 3b47e82ac57e |
| children | 9c2eec61a152 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mrjunejune/generate-icons.sh Sun Aug 02 16:50:48 2026 -0700 @@ -0,0 +1,42 @@ +#!/bin/bash + +# Generate PWA icons from SVG +# Requires ImageMagick: apt-get install imagemagick + +cd "$(dirname "$0")/src/public" + +if ! command -v convert &> /dev/null; then + echo "❌ ImageMagick not found. Please install it:" + echo " Ubuntu/Debian: sudo apt-get install imagemagick" + echo " macOS: brew install imagemagick" + echo "" + echo "Or use an online tool: https://realfavicongenerator.net/" + exit 1 +fi + +echo "🎨 Generating PWA icons from epi_all_colors.svg..." + +# 192x192 icon +echo " → Creating icon-192.png..." +convert epi_all_colors.svg -resize 192x192 -background none icon-192.png + +# 512x512 icon +echo " → Creating icon-512.png..." +convert epi_all_colors.svg -resize 512x512 -background none icon-512.png + +# Maskable icon (512x512 with safe zone - 80% of size) +echo " → Creating icon-maskable-512.png..." +convert epi_all_colors.svg -resize 409x409 -background none -gravity center -extent 512x512 icon-maskable-512.png + +echo "" +echo "✅ Icons generated successfully!" +echo "" +echo "Generated files:" +echo " - icon-192.png" +echo " - icon-512.png" +echo " - icon-maskable-512.png" +echo "" +echo "Next steps:" +echo " 1. Verify icons look good: ls -lh src/public/icon-*.png" +echo " 2. Test PWA: Open site in Chrome → DevTools → Application → Manifest" +echo " 3. Run Lighthouse audit to check PWA score"