diff --git a/android/app/src/main/ic_launcher-playstore.png b/android/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..3648119 Binary files /dev/null and b/android/app/src/main/ic_launcher-playstore.png differ diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml index d5fccc5..0b2735f 100644 --- a/android/app/src/main/res/drawable/ic_launcher_background.xml +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,170 +1,33 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 036d09b..c4a603d 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 036d09b..c4a603d 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index c023e50..b05ff8c 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png index 2127973..03b38dc 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index b441f37..b05ff8c 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 72905b8..7d4aa85 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png index 8ed0605..bd0f55a 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 9502e47..7d4aa85 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 4d1e077..378f61e 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png index df0f158..8e90221 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 853db04..378f61e 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 6cdf97c..650c423 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png index 2960cbb..7711932 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 8e3093a..650c423 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 46de6e2..25eed6d 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png index d2ea9ab..1be4436 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index a40d73e..25eed6d 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..85b4771 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/icon-192.png b/public/icon-192.png new file mode 100644 index 0000000..25eed6d Binary files /dev/null and b/public/icon-192.png differ diff --git a/public/icon-512.png b/public/icon-512.png new file mode 100644 index 0000000..3648119 Binary files /dev/null and b/public/icon-512.png differ diff --git a/public/icon-maskable.png b/public/icon-maskable.png new file mode 100644 index 0000000..3648119 Binary files /dev/null and b/public/icon-maskable.png differ diff --git a/public/icon.svg b/public/icon.svg index fab5aaf..af04fc4 100644 --- a/public/icon.svg +++ b/public/icon.svg @@ -1,22 +1,45 @@ - + - - + + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + - - برگ وسط diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest index 2358e36..bcc1f8e 100644 --- a/public/manifest.webmanifest +++ b/public/manifest.webmanifest @@ -11,11 +11,9 @@ "background_color": "#060c1f", "theme_color": "#060c1f", "icons": [ - { - "src": "/icon.svg", - "sizes": "any", - "type": "image/svg+xml", - "purpose": "any maskable" - } + { "src": "/icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any" }, + { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" }, + { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" }, + { "src": "/icon-maskable.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } ] } diff --git a/scripts/icon/gen-icons.mjs b/scripts/icon/gen-icons.mjs new file mode 100644 index 0000000..fcdf2a2 --- /dev/null +++ b/scripts/icon/gen-icons.mjs @@ -0,0 +1,79 @@ +// Generates every app/website/Android icon asset from the two master SVGs: +// scripts/icon/icon.svg — full design (navy bg + gold frame + fanned cards) +// scripts/icon/icon-foreground.svg — cards only, transparent (Android adaptive foreground) +// Run: node scripts/icon/gen-icons.mjs +import sharp from "sharp"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const root = path.resolve(here, "..", ".."); +const fullSvg = fs.readFileSync(path.join(here, "icon.svg")); +const fgSvg = fs.readFileSync(path.join(here, "icon-foreground.svg")); + +const R = (p) => path.join(root, p); +const ensure = (p) => fs.mkdirSync(path.dirname(p), { recursive: true }); + +async function png(svg, size) { + return sharp(svg, { density: 384 }).resize(size, size, { fit: "contain", background: { r: 0, g: 0, b: 0, alpha: 0 } }).png().toBuffer(); +} +async function write(svg, size, dest) { + ensure(R(dest)); + fs.writeFileSync(R(dest), await png(svg, size)); + console.log(" ", dest, `(${size})`); +} + +// PNG-in-ICO container (16/32/48), accepted by all modern browsers. +function buildIco(entries) { + const header = Buffer.alloc(6); + header.writeUInt16LE(0, 0); header.writeUInt16LE(1, 2); header.writeUInt16LE(entries.length, 4); + const dir = Buffer.alloc(16 * entries.length); + let offset = 6 + 16 * entries.length; + entries.forEach((e, i) => { + const b = i * 16; + dir.writeUInt8(e.size >= 256 ? 0 : e.size, b); + dir.writeUInt8(e.size >= 256 ? 0 : e.size, b + 1); + dir.writeUInt16LE(1, b + 4); dir.writeUInt16LE(32, b + 6); + dir.writeUInt32LE(e.buf.length, b + 8); dir.writeUInt32LE(offset, b + 12); + offset += e.buf.length; + }); + return Buffer.concat([header, dir, ...entries.map((e) => e.buf)]); +} + +const ANDROID = [ + ["mipmap-mdpi", 48, 108], + ["mipmap-hdpi", 72, 162], + ["mipmap-xhdpi", 96, 216], + ["mipmap-xxhdpi", 144, 324], + ["mipmap-xxxhdpi", 192, 432], +]; + +async function run() { + console.log("Web / PWA:"); + // public/icon.svg = the vector master (manifest references it) + fs.copyFileSync(path.join(here, "icon.svg"), R("public/icon.svg")); + console.log(" public/icon.svg (vector)"); + await write(fullSvg, 192, "public/icon-192.png"); + await write(fullSvg, 512, "public/icon-512.png"); + await write(fullSvg, 512, "public/icon-maskable.png"); + await write(fullSvg, 180, "public/apple-touch-icon.png"); + await write(fullSvg, 180, "src/app/apple-icon.png"); + + // favicon.ico (16/32/48) + const ico = buildIco(await Promise.all([16, 32, 48].map(async (s) => ({ size: s, buf: await png(fullSvg, s) })))); + ensure(R("src/app/favicon.ico")); + fs.writeFileSync(R("src/app/favicon.ico"), ico); + console.log(" src/app/favicon.ico (16/32/48)"); + + console.log("Android (Capacitor):"); + for (const [dir, launcher, fg] of ANDROID) { + await write(fullSvg, launcher, `android/app/src/main/res/${dir}/ic_launcher.png`); + await write(fullSvg, launcher, `android/app/src/main/res/${dir}/ic_launcher_round.png`); + await write(fgSvg, fg, `android/app/src/main/res/${dir}/ic_launcher_foreground.png`); + } + await write(fullSvg, 512, "android/app/src/main/ic_launcher-playstore.png"); + + console.log("Done."); +} +run().catch((e) => { console.error(e); process.exit(1); }); diff --git a/scripts/icon/icon-foreground.svg b/scripts/icon/icon-foreground.svg new file mode 100644 index 0000000..8666130 --- /dev/null +++ b/scripts/icon/icon-foreground.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/icon/icon.svg b/scripts/icon/icon.svg new file mode 100644 index 0000000..af04fc4 --- /dev/null +++ b/scripts/icon/icon.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/apple-icon.png b/src/app/apple-icon.png new file mode 100644 index 0000000..85b4771 Binary files /dev/null and b/src/app/apple-icon.png differ diff --git a/src/app/favicon.ico b/src/app/favicon.ico index 718d6fe..619c1ca 100644 Binary files a/src/app/favicon.ico and b/src/app/favicon.ico differ