diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..7559784 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,65 @@ + + {/* ... existing meta tags ... */} + + {/* Splashscreens pour iOS */} + + + + {/* iPad Pro 12.9" */} + + + {/* iPad Pro 11" */} + + + {/* iPad Mini, Air */} + + + {/* iPhone X/XS */} + + + {/* iPhone XS Max */} + + + {/* iPhone XR */} + + + {/* iPhone 8, SE */} + + + {/* iPhone 8 Plus */} + + + {/* ... existing code ... */} +; diff --git a/public/images/screenshots/home.png b/public/images/screenshots/home.png new file mode 100644 index 0000000..7f54ff6 Binary files /dev/null and b/public/images/screenshots/home.png differ diff --git a/public/images/screenshots/reader.png b/public/images/screenshots/reader.png new file mode 100644 index 0000000..bca7fee Binary files /dev/null and b/public/images/screenshots/reader.png differ diff --git a/public/images/splash/splash-1125x2436.png b/public/images/splash/splash-1125x2436.png new file mode 100644 index 0000000..3b9086b Binary files /dev/null and b/public/images/splash/splash-1125x2436.png differ diff --git a/public/images/splash/splash-1242x2208.png b/public/images/splash/splash-1242x2208.png new file mode 100644 index 0000000..d1036a6 Binary files /dev/null and b/public/images/splash/splash-1242x2208.png differ diff --git a/public/images/splash/splash-1242x2688.png b/public/images/splash/splash-1242x2688.png new file mode 100644 index 0000000..46e5769 Binary files /dev/null and b/public/images/splash/splash-1242x2688.png differ diff --git a/public/images/splash/splash-1536x2048.png b/public/images/splash/splash-1536x2048.png new file mode 100644 index 0000000..f6fda1a Binary files /dev/null and b/public/images/splash/splash-1536x2048.png differ diff --git a/public/images/splash/splash-1668x2388.png b/public/images/splash/splash-1668x2388.png new file mode 100644 index 0000000..c7874a9 Binary files /dev/null and b/public/images/splash/splash-1668x2388.png differ diff --git a/public/images/splash/splash-2048x2732.png b/public/images/splash/splash-2048x2732.png new file mode 100644 index 0000000..870fee3 Binary files /dev/null and b/public/images/splash/splash-2048x2732.png differ diff --git a/public/images/splash/splash-750x1334.png b/public/images/splash/splash-750x1334.png new file mode 100644 index 0000000..6b610ff Binary files /dev/null and b/public/images/splash/splash-750x1334.png differ diff --git a/public/images/splash/splash-828x1792.png b/public/images/splash/splash-828x1792.png new file mode 100644 index 0000000..be1dd53 Binary files /dev/null and b/public/images/splash/splash-828x1792.png differ diff --git a/public/manifest.json b/public/manifest.json index 09ad56e..cff6541 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -74,6 +74,56 @@ "label": "Lecteur de BD StripStream" } ], + "splash_screens": [ + { + "src": "/images/splash/splash-2048x2732.png", + "sizes": "2048x2732", + "type": "image/png", + "platform": "iPad Pro 12.9" + }, + { + "src": "/images/splash/splash-1668x2388.png", + "sizes": "1668x2388", + "type": "image/png", + "platform": "iPad Pro 11" + }, + { + "src": "/images/splash/splash-1536x2048.png", + "sizes": "1536x2048", + "type": "image/png", + "platform": "iPad Mini/Air" + }, + { + "src": "/images/splash/splash-1125x2436.png", + "sizes": "1125x2436", + "type": "image/png", + "platform": "iPhone X/XS" + }, + { + "src": "/images/splash/splash-1242x2688.png", + "sizes": "1242x2688", + "type": "image/png", + "platform": "iPhone XS Max" + }, + { + "src": "/images/splash/splash-828x1792.png", + "sizes": "828x1792", + "type": "image/png", + "platform": "iPhone XR" + }, + { + "src": "/images/splash/splash-750x1334.png", + "sizes": "750x1334", + "type": "image/png", + "platform": "iPhone 8/SE" + }, + { + "src": "/images/splash/splash-1242x2208.png", + "sizes": "1242x2208", + "type": "image/png", + "platform": "iPhone 8 Plus" + } + ], "shortcuts": [ { "name": "Accueil", diff --git a/scripts/generate-icons.js b/scripts/generate-icons.js index 79500da..0f88a6c 100644 --- a/scripts/generate-icons.js +++ b/scripts/generate-icons.js @@ -6,11 +6,64 @@ const sizes = [72, 96, 128, 144, 152, 192, 384, 512]; const inputSvg = path.join(__dirname, "../public/favicon.svg"); const inputAppleSvg = path.join(__dirname, "../public/apple-icon.svg"); const outputDir = path.join(__dirname, "../public/images/icons"); +const screenshotsDir = path.join(__dirname, "../public/images/screenshots"); +const splashDir = path.join(__dirname, "../public/images/splash"); + +// Configuration des splashscreens pour différents appareils +const splashScreens = [ + { width: 2048, height: 2732, name: "iPad Pro 12.9" }, // iPad Pro 12.9 + { width: 1668, height: 2388, name: "iPad Pro 11" }, // iPad Pro 11 + { width: 1536, height: 2048, name: "iPad Mini/Air" }, // iPad Mini, Air + { width: 1125, height: 2436, name: "iPhone X/XS" }, // iPhone X/XS + { width: 1242, height: 2688, name: "iPhone XS Max" }, // iPhone XS Max + { width: 828, height: 1792, name: "iPhone XR" }, // iPhone XR + { width: 750, height: 1334, name: "iPhone 8/SE" }, // iPhone 8, SE + { width: 1242, height: 2208, name: "iPhone 8 Plus" }, // iPhone 8 Plus +]; + +async function generateSplashScreens() { + await fs.mkdir(splashDir, { recursive: true }); + + // Créer le SVG de base pour la splashscreen avec le même style que le favicon + const splashSvg = ` + + + + + + + + + + + `; + + for (const screen of splashScreens) { + const outputPath = path.join(splashDir, `splash-${screen.width}x${screen.height}.png`); + + await sharp(Buffer.from(splashSvg)) + .resize(screen.width, screen.height, { + fit: "contain", + background: "#4F46E5", + }) + .png() + .toFile(outputPath); + + console.log(`✓ Splashscreen ${screen.name} (${screen.width}x${screen.height}) générée`); + } +} async function generateIcons() { try { - // Créer le dossier de sortie s'il n'existe pas + // Créer les dossiers de sortie s'ils n'existent pas await fs.mkdir(outputDir, { recursive: true }); + await fs.mkdir(screenshotsDir, { recursive: true }); // Générer les icônes Android (avec bords arrondis) for (const size of sizes) { @@ -49,6 +102,63 @@ async function generateIcons() { console.log(`✓ Icône Apple ${size}x${size} générée`); } + // Générer les icônes de raccourcis + const shortcutIcons = [ + { name: "home", icon: "Home" }, + { name: "library", icon: "Library" }, + ]; + + for (const shortcut of shortcutIcons) { + const outputPath = path.join(outputDir, `${shortcut.name}.png`); + + // Créer une image carrée avec fond indigo et icône blanche + const svg = ` + + + + + `; + + await sharp(Buffer.from(svg)) + .resize(96, 96) + .png({ + compressionLevel: 9, + palette: true, + }) + .toFile(outputPath); + + console.log(`✓ Icône de raccourci ${shortcut.name} générée`); + } + + // Générer les screenshots de démonstration + const screenshots = [ + { name: "home", width: 1280, height: 720, color: "#1E293B" }, + { name: "reader", width: 1280, height: 720, color: "#0F172A" }, + ]; + + for (const screenshot of screenshots) { + const outputPath = path.join(screenshotsDir, `${screenshot.name}.png`); + + // Créer une image de démonstration simple + await sharp({ + create: { + width: screenshot.width, + height: screenshot.height, + channels: 4, + background: screenshot.color, + }, + }) + .png() + .toFile(outputPath); + + console.log(`✓ Screenshot ${screenshot.name} généré`); + } + + // Générer les splashscreens + await generateSplashScreens(); + console.log("\n✨ Toutes les icônes ont été générées avec succès !"); } catch (error) { console.error("Erreur lors de la génération des icônes:", error); @@ -56,4 +166,14 @@ async function generateIcons() { } } +// Fonction helper pour obtenir les chemins SVG des icônes +function getIconPath(iconName) { + const paths = { + Home: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6", + Library: + "M4 19.5A2.5 2.5 0 0 1 6.5 17H20M4 19.5A2.5 2.5 0 0 0 6.5 22H20M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20", + }; + return paths[iconName] || ""; +} + generateIcons();