Mercurial
comparison mrjunejune/generate-icons.sh @ 209:3b47e82ac57e
[MrJuneJune] PWA updates.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sun, 15 Feb 2026 15:43:26 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 208:5d3e116dd745 | 209:3b47e82ac57e |
|---|---|
| 1 #!/bin/bash | |
| 2 | |
| 3 # Generate PWA icons from SVG | |
| 4 # Requires ImageMagick: apt-get install imagemagick | |
| 5 | |
| 6 cd "$(dirname "$0")/src/public" | |
| 7 | |
| 8 if ! command -v convert &> /dev/null; then | |
| 9 echo "❌ ImageMagick not found. Please install it:" | |
| 10 echo " Ubuntu/Debian: sudo apt-get install imagemagick" | |
| 11 echo " macOS: brew install imagemagick" | |
| 12 echo "" | |
| 13 echo "Or use an online tool: https://realfavicongenerator.net/" | |
| 14 exit 1 | |
| 15 fi | |
| 16 | |
| 17 echo "🎨 Generating PWA icons from epi_all_colors.svg..." | |
| 18 | |
| 19 # 192x192 icon | |
| 20 echo " → Creating icon-192.png..." | |
| 21 convert epi_all_colors.svg -resize 192x192 -background none icon-192.png | |
| 22 | |
| 23 # 512x512 icon | |
| 24 echo " → Creating icon-512.png..." | |
| 25 convert epi_all_colors.svg -resize 512x512 -background none icon-512.png | |
| 26 | |
| 27 # Maskable icon (512x512 with safe zone - 80% of size) | |
| 28 echo " → Creating icon-maskable-512.png..." | |
| 29 convert epi_all_colors.svg -resize 409x409 -background none -gravity center -extent 512x512 icon-maskable-512.png | |
| 30 | |
| 31 echo "" | |
| 32 echo "✅ Icons generated successfully!" | |
| 33 echo "" | |
| 34 echo "Generated files:" | |
| 35 echo " - icon-192.png" | |
| 36 echo " - icon-512.png" | |
| 37 echo " - icon-maskable-512.png" | |
| 38 echo "" | |
| 39 echo "Next steps:" | |
| 40 echo " 1. Verify icons look good: ls -lh src/public/icon-*.png" | |
| 41 echo " 2. Test PWA: Open site in Chrome → DevTools → Application → Manifest" | |
| 42 echo " 3. Run Lighthouse audit to check PWA score" |