// Генерация серых заглушек (16:10) для страницы ai-dev. // Заглушки — намеренно нейтральный серый, без текста и градиентов. import fs from "node:fs"; import path from "node:path"; import sharp from "sharp"; const outDir = path.join(process.cwd(), "public", "assets", "ai-dev"); fs.mkdirSync(outDir, { recursive: true }); const W = 640; const H = 400; // Разные оттенки серого, чтобы карточки не выглядели одинаковыми при загрузке. const shades = [ { fill: "#2a2d31", label: "01" }, { fill: "#31353a", label: "02" }, { fill: "#25282c", label: "03" }, ]; const tiles = await Promise.all( shades.map(async ({ fill, label }) => { const svg = ` `; const file = path.join(outDir, `placeholder-${label}.webp`); await sharp(Buffer.from(svg)).webp({ quality: 72 }).toFile(file); return file; }), ); console.log(`Generated ${tiles.length} placeholders in ${outDir}`); for (const f of tiles) console.log(" ", path.basename(f), fs.statSync(f).size, "bytes");