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 = `
`;
// 2. Premium Dark Mode Glassmorphic FinTech Dashboard (2000 x 2000 - 1:1 Square)
const glassmorphismSvg = `
`;
// 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 `
`;
}
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);
});