import fs from "fs"; import path from "path"; import sharp from "sharp"; const showcaseDir = path.join(process.cwd(), "public", "showcase"); if (!fs.existsSync(showcaseDir)) { fs.mkdirSync(showcaseDir, { recursive: true }); } // 1. Synthwave / Cyberpunk Sunset (2400 x 1350 - 16:9 2K) const synthwaveSvg = ` ${Array.from({ length: 120 }) .map(() => { const cx = Math.floor(Math.random() * 2400); const cy = Math.floor(Math.random() * 700); const r = (Math.random() * 1.8 + 0.5).toFixed(1); const op = (Math.random() * 0.7 + 0.3).toFixed(2); return ``; }) .join("\n ")} ${[600, 640, 675, 705, 730, 750, 765, 777] .map((y, i) => ``) .join("\n ")} ${[860, 875, 895, 920, 955, 1000, 1060, 1135, 1225, 1335] .map((y) => ``) .join("\n ")} ${Array.from({ length: 33 }) .map((_, i) => { const bottomX = (i - 16) * 160 + 1200; return ``; }) .join("\n ")} NEON HORIZON PROCEDURAL VECTOR GRAPHICS ENGINE `; // 2. Premium Dark Mode Glassmorphic FinTech Dashboard (2000 x 2000 - 1:1 Square) const glassmorphismSvg = ` ${Array.from({ length: 20 }) .map((_, row) => Array.from({ length: 20 }) .map((_, col) => ``) .join("") ) .join("\n ")} QUANTUM ANALYTICS ENTERPRISE TOTAL REVENUE (YTD) $4,892,340.50 +34.8% ↑ Active Workflows 18,492 99.98% uptime AI Inference Latency 14.2 ms Realtime stream Data Processed 942.6 TB +12.4% vs last week `; // 3. Sacred Geometry / Algorithmic Golden Mandala (2400 x 2400 - Ultra HD) function generateMandalaSvg() { const size = 2400; const center = size / 2; const rings = 12; const petals = 24; let elements = []; for (let r = 1; r <= rings; r++) { const radius = r * 85; const strokeWidth = (r % 3 === 0 ? 3 : 1.2); const opacity = (0.2 + (r / rings) * 0.7).toFixed(2); elements.push(``); } for (let i = 0; i < petals; i++) { const angle = (i * 360) / petals; elements.push(` `); } for (let i = 0; i < 48; i++) { const angle = (i * 360) / 48; elements.push(` `); } return ` ${elements.join("\n")} SACRED ALGORITHMIC HARMONY `; } async function runShowcase() { console.log("šŸŽØ Generating High-Resolution Showcase Art in public/showcase/...\n"); const items = [ { filename: "01_synthwave_cyberpunk_sunset.png", svg: synthwaveSvg, type: "png", }, { filename: "02_glassmorphic_fintech_dashboard.png", svg: glassmorphismSvg, type: "png", }, { filename: "03_sacred_geometry_mandala_2400.png", svg: generateMandalaSvg(), type: "png", }, ]; for (const item of items) { const destPath = path.join(showcaseDir, item.filename); const svgBuffer = Buffer.from(item.svg); console.log(`Rendering ${item.filename}...`); if (item.type === "png") { await sharp(svgBuffer) .png({ compressionLevel: 9, adaptiveFiltering: true }) .toFile(destPath); } else { await sharp(svgBuffer) .jpeg({ quality: 98, mozjpeg: true }) .toFile(destPath); } const stat = fs.statSync(destPath); console.log(`āœ“ Created: ${item.filename} (${(stat.size / 1024).toFixed(1)} KB)`); } console.log("\nšŸš€ All showcase art generated successfully in public/showcase/!"); } runShowcase().catch((err) => { console.error("Error generating showcase images:", err); process.exit(1); });