Files
Reims-landing/scripts/generate-og.mjs
T

134 lines
8.0 KiB
JavaScript

import { writeFileSync } from 'node:fs';
import { createRequire } from 'node:module';
import { resolve } from 'node:path';
const astroReq = createRequire(import.meta.resolve('astro'));
const sharp = astroReq('sharp');
const ogSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630" viewBox="0 0 1200 630">
<defs>
<linearGradient id="goGrad" gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0">
<stop offset="0" stop-color="#3b8cff" />
<stop offset="0.5" stop-color="#6d5dfc" />
<stop offset="1" stop-color="#ff7a9a" />
</linearGradient>
<linearGradient id="screenGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#35576b" />
<stop offset="48%" stop-color="#557586" />
<stop offset="100%" stop-color="#1d2d37" />
</linearGradient>
<linearGradient id="winGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#35A7FF" />
<stop offset="100%" stop-color="#0067D6" />
</linearGradient>
<linearGradient id="macLeft" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#45A9FF" />
<stop offset="100%" stop-color="#0056D6" />
</linearGradient>
</defs>
<!-- Crisp Tahoe Light Canvas -->
<rect width="1200" height="630" fill="#FFFFFF" />
<rect x="28" y="28" width="1144" height="574" rx="28" fill="#F4F6FA" stroke="#E5E7EB" stroke-width="1.5" />
<!-- Subtle Top Eyebrow Pill -->
<rect x="80" y="76" width="332" height="36" rx="18" fill="#FFFFFF" stroke="#E5E7EB" stroke-width="1.2" />
<circle cx="104" cy="94" r="5" fill="#007AFF" />
<text x="120" y="100" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="15.5" font-weight="600" fill="#1D1D1F">v0.2.11 · Apache-2.0 · Zero Telemetry</text>
<!-- Official reims-go Geometric Wordmark -->
<g transform="translate(76 225) scale(0.72)">
<g transform="translate(4 0)" fill="none" stroke-width="15" stroke-linecap="round" stroke-linejoin="round">
<path d="M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5" stroke="#1D1D1F" />
<path d="M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93" stroke="#1D1D1F" />
<path d="M133.5 -64.5V-7.5" stroke="#1D1D1F" />
<circle cx="133.5" cy="-94" r="9" fill="#ff7a9a" stroke="none" />
<path d="M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5" stroke="#1D1D1F" />
<path d="M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98" stroke="#1D1D1F" />
<path d="M340.5 -36H358.5" stroke="#6E6E73" />
<path d="M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01" stroke="url(#goGrad)" />
<path d="M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25" stroke="url(#goGrad)" />
<path d="M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01" stroke="url(#goGrad)" />
</g>
</g>
<!-- Main Headline -->
<text x="80" y="302" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="42" font-weight="700" fill="#1D1D1F" letter-spacing="-1">A macOS virtual machine</text>
<text x="80" y="354" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="42" font-weight="700" fill="#1D1D1F" letter-spacing="-1">for Windows 10 &amp; 11</text>
<!-- Subhead -->
<text x="80" y="406" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="22" font-weight="400" fill="#6E6E73">Metal to Vulkan 1.3 discrete GPU acceleration.</text>
<text x="80" y="438" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="22" font-weight="400" fill="#6E6E73">Single EXE workbench, zero-CLI setup, Guest Tools v8.</text>
<!-- Bottom Feature Pills -->
<g transform="translate(80 486)">
<rect x="0" y="0" width="198" height="44" rx="22" fill="#007AFF" />
<text x="99" y="28" text-anchor="middle" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="16" font-weight="600" fill="#FFFFFF">Metal &#x2192; Vulkan 1.3</text>
<rect x="214" y="0" width="186" height="44" rx="22" fill="#FFFFFF" stroke="#D1D5DB" stroke-width="1.2" />
<text x="307" y="28" text-anchor="middle" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="16" font-weight="600" fill="#1D1D1F">macOS Tahoe 26</text>
<rect x="416" y="0" width="178" height="44" rx="22" fill="#FFFFFF" stroke="#D1D5DB" stroke-width="1.2" />
<text x="505" y="28" text-anchor="middle" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="16" font-weight="600" fill="#1D1D1F">GUI + CLI Single EXE</text>
</g>
<!-- Right Side Minimalist Desktop Preview Card -->
<g transform="translate(730 92)">
<rect x="0" y="0" width="392" height="446" rx="22" fill="#FFFFFF" stroke="#D8DEE8" stroke-width="1.5" />
<!-- Titlebar -->
<path d="M0 22C0 9.85 9.85 0 22 0H370C382.15 0 392 9.85 392 22V46H0V22Z" fill="#EEF3FA" />
<line x1="0" y1="46" x2="392" y2="46" stroke="#E5E7EB" stroke-width="1" />
<circle cx="24" cy="23" r="5" fill="#D1D5DB" />
<circle cx="42" cy="23" r="5" fill="#D1D5DB" />
<circle cx="60" cy="23" r="5" fill="#D1D5DB" />
<text x="84" y="28" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="13" font-weight="600" fill="#1D1D1F">Reims-Go</text>
<!-- Platform Pair Badges (Win11 -> macOS Tahoe 26) -->
<g transform="translate(96 78)">
<!-- Win11 Tile -->
<rect x="0" y="0" width="68" height="68" rx="16" fill="#F4F6FA" stroke="#D8DEE8" stroke-width="1.4" />
<g transform="translate(16 16)" fill="url(#winGrad)">
<rect x="0" y="0" width="16.5" height="16.5" rx="2" />
<rect x="19.5" y="0" width="16.5" height="16.5" rx="2" />
<rect x="0" y="19.5" width="16.5" height="16.5" rx="2" />
<rect x="19.5" y="19.5" width="16.5" height="16.5" rx="2" />
</g>
<!-- Bridge Arrow -->
<line x1="84" y1="34" x2="116" y2="34" stroke="#007AFF" stroke-width="2.5" stroke-linecap="round" />
<path d="M110 27L118 34L110 41" fill="none" stroke="#007AFF" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
<!-- macOS Tahoe 26 Tile (Left Blue + Right White) -->
<rect x="132" y="0" width="68" height="68" rx="16" fill="#FFFFFF" stroke="#D8DEE8" stroke-width="1.4" />
<g transform="translate(141 9) scale(1.25)">
<rect x="2" y="2" width="36" height="36" rx="9" fill="#F4F8FF" stroke="#D8DEE8" stroke-width="1" />
<path d="M2 11C2 6.03 6.03 2 11 2H21.6C19.6 8.1 18.2 14.3 17.5 21.1H21.7C20.5 26.8 20.6 32.5 22.1 38H11C6.03 38 2 33.97 2 29V11Z" fill="url(#macLeft)" />
<rect x="11.2" y="12.2" width="2.7" height="5.4" rx="1.35" fill="#14233C" />
<rect x="26.3" y="12.2" width="2.7" height="5.4" rx="1.35" fill="#14233C" />
<path d="M10.4 24.4C13.3 28.4 16.9 30.1 20.2 30.1C23.5 30.1 26.9 28.4 29.6 24.4" fill="none" stroke="#14233C" stroke-width="2.35" stroke-linecap="round" />
</g>
</g>
<!-- Mini Simulated iMac Screen -->
<g transform="translate(76 176)">
<rect x="0" y="0" width="240" height="148" rx="14" fill="#1C1D21" />
<rect x="7" y="7" width="226" height="134" rx="8" fill="url(#screenGrad)" />
<text x="120" y="78" text-anchor="middle" font-family="Segoe UI, Inter, Arial, sans-serif" font-size="30" font-weight="600" fill="#FFFFFF" opacity="0.92">09:41</text>
<rect x="86" y="114" width="68" height="12" rx="6" fill="#FFFFFF" opacity="0.28" />
<!-- Stand -->
<rect x="96" y="148" width="48" height="20" rx="2" fill="#D2D6DF" />
<rect x="78" y="168" width="84" height="5" rx="2.5" fill="#C4C9D4" />
</g>
<!-- Bottom Status Pill -->
<rect x="36" y="376" width="320" height="42" rx="12" fill="#F4F6FA" stroke="#E5E7EB" stroke-width="1" />
<circle cx="58" cy="397" r="5" fill="#28CD41" />
<text x="74" y="402" font-family="Consolas, monospace" font-size="13.5" font-weight="600" fill="#1D1D1F">reims-graphics-pci · Vulkan 1.3</text>
</g>
</svg>`;
const outPath = resolve(process.cwd(), 'public/og-image.png');
const pngBuffer = await sharp(Buffer.from(ogSvg)).png({ compressionLevel: 9 }).toBuffer();
writeFileSync(outPath, pngBuffer);
console.log(`Generated ${outPath} (${pngBuffer.length} bytes)`);