Initial commit v1

This commit is contained in:
Rolf
2026-03-18 12:39:48 +01:00
parent 4897d3003f
commit cb04bf2ab8
12 changed files with 147 additions and 29 deletions
+26
View File
@@ -0,0 +1,26 @@
import sharp from 'sharp'
import { readFileSync } from 'fs'
import { join, dirname } from 'path'
import { fileURLToPath } from 'url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const root = join(__dirname, '..')
const icon = readFileSync(join(root, 'public/icons/icon.svg'))
const maskable = readFileSync(join(root, 'public/icons/icon-maskable.svg'))
await sharp(icon) .resize(192, 192).png().toFile(join(root, 'public/icons/icon-192.png'))
await sharp(icon) .resize(512, 512).png().toFile(join(root, 'public/icons/icon-512.png'))
await sharp(maskable) .resize(512, 512).png().toFile(join(root, 'public/icons/icon-512-maskable.png'))
// Apple touch icon (180×180, no transparency — white bg for iOS)
await sharp(icon)
.resize(180, 180)
.flatten({ background: '#ffffff' })
.png()
.toFile(join(root, 'public/icons/apple-touch-icon.png'))
// Favicon (32×32)
await sharp(icon).resize(32, 32).png().toFile(join(root, 'public/favicon.png'))
console.log('Icons generated.')