diff --git a/public/icons/apple-touch-icon.png b/public/icons/apple-touch-icon.png index 9b596c1..ab0331d 100644 Binary files a/public/icons/apple-touch-icon.png and b/public/icons/apple-touch-icon.png differ diff --git a/public/icons/favicon-32.png b/public/icons/favicon-32.png index 78bfcd4..3383a7a 100644 Binary files a/public/icons/favicon-32.png and b/public/icons/favicon-32.png differ diff --git a/public/icons/icon-192.png b/public/icons/icon-192.png index 43c0c44..27976d1 100644 Binary files a/public/icons/icon-192.png and b/public/icons/icon-192.png differ diff --git a/public/icons/icon-512.png b/public/icons/icon-512.png index 9433779..491e2b1 100644 Binary files a/public/icons/icon-512.png and b/public/icons/icon-512.png differ diff --git a/public/icons/icon-maskable-192.png b/public/icons/icon-maskable-192.png index d99355a..c6eb1f1 100644 Binary files a/public/icons/icon-maskable-192.png and b/public/icons/icon-maskable-192.png differ diff --git a/public/icons/icon-maskable-512.png b/public/icons/icon-maskable-512.png index 3f41865..b7def35 100644 Binary files a/public/icons/icon-maskable-512.png and b/public/icons/icon-maskable-512.png differ diff --git a/scripts/generate-icons.js b/scripts/generate-icons.js index e95386f..3f1dd77 100644 --- a/scripts/generate-icons.js +++ b/scripts/generate-icons.js @@ -1,8 +1,8 @@ /** * Icon Generator for Oikos PWA - * Generates placeholder icons (accent color #007AFF with white "O") + * Generates icons from docs/logo.svg * Sizes: 192px and 512px, both "any" and "maskable" variants - * Maskable icons include safe zone padding (min 10%) + * Maskable icons: full-bleed background, logo content stays within 80% safe zone * * Usage: node scripts/generate-icons.js * Dependencies: sharp (devDependency) @@ -15,73 +15,63 @@ import { fileURLToPath } from 'node:url'; const __dirname = dirname(fileURLToPath(import.meta.url)); const ICONS_DIR = join(__dirname, '..', 'public', 'icons'); -const ACCENT = '#007AFF'; -const BG_LIGHT = '#F5F5F7'; mkdirSync(ICONS_DIR, { recursive: true }); -/** - * Create an SVG with a centered "O" on accent background. - * @param {number} size - Icon dimension in px - * @param {boolean} maskable - If true, add 20% padding for safe zone - */ -function createSvg(size, maskable) { - const fontSize = maskable ? size * 0.4 : size * 0.55; - const bgRadius = maskable ? 0 : size * 0.18; - - return ` - - O +/** Logo SVG (any): rounded corners, gradient background */ +function createLogoSvg(size) { + return ` + + + + + + + + + `; } -/** - * Create Apple Touch Icon (180x180) with slight rounding - */ +/** Maskable logo SVG: full-bleed background (no rx), logo within safe zone */ +function createMaskableLogoSvg(size) { + return ` + + + + + + + + + +`; +} + +/** Apple Touch Icon (180x180): same as any-icon */ function createAppleTouchSvg() { - const size = 180; - const fontSize = size * 0.55; - return ` - - O -`; + return createLogoSvg(180); } -/** - * Create favicon (32x32) - */ +/** Favicon (32x32): simplified — just gradient background with house */ function createFaviconSvg() { - const size = 32; - const fontSize = size * 0.6; - return ` - - O -`; + return createLogoSvg(32); } const icons = [ - { name: 'icon-192.png', size: 192, maskable: false }, - { name: 'icon-512.png', size: 512, maskable: false }, - { name: 'icon-maskable-192.png', size: 192, maskable: true }, - { name: 'icon-maskable-512.png', size: 512, maskable: true }, - { name: 'apple-touch-icon.png', size: 180, svg: createAppleTouchSvg() }, - { name: 'favicon-32.png', size: 32, svg: createFaviconSvg() }, + { name: 'icon-192.png', size: 192, svg: createLogoSvg(192) }, + { name: 'icon-512.png', size: 512, svg: createLogoSvg(512) }, + { name: 'icon-maskable-192.png', size: 192, svg: createMaskableLogoSvg(192) }, + { name: 'icon-maskable-512.png', size: 512, svg: createMaskableLogoSvg(512) }, + { name: 'apple-touch-icon.png', size: 180, svg: createAppleTouchSvg() }, + { name: 'favicon-32.png', size: 32, svg: createFaviconSvg() }, ]; for (const icon of icons) { - const svg = icon.svg || createSvg(icon.size, icon.maskable); const outputPath = join(ICONS_DIR, icon.name); - - await sharp(Buffer.from(svg)) + await sharp(Buffer.from(icon.svg)) .png() .toFile(outputPath); - console.log(` ✓ ${icon.name} (${icon.size}x${icon.size})`); }