// Rebuild the social card with the real app screenshots: npm run generate:og import { ImageResponse } from 'next/og.js'; import { createElement as h } from 'react'; import sharp from 'sharp'; import { readFile, writeFile, mkdir } from 'node:fs/promises'; const img = async (path) => `data:image/png;base64,${(await sharp(await readFile(path)).png().toBuffer()).toString('base64')}`; const [logo, mac, phone] = await Promise.all([ img('public/jotley-logo.png'), img('public/media/shots/mac-summary-2.3.webp'), img('public/media/shots/iphone-summary-2.3.webp'), ]); const box = (style, ...children) => h('div', { style: { display: 'flex', ...style } }, ...children); const text = (value, style) => box(style, value); const card = box({ width: '100%', height: '100%', background: '#0d0b14', color: '#faf7ff', position: 'relative', overflow: 'hidden', fontFamily: 'sans-serif', backgroundImage: 'radial-gradient(ellipse at 90% 65%, #34205b 0%, #0d0b14 65%)', }, box({ position: 'absolute', left: 54, top: 46, alignItems: 'center', gap: 14 }, h('img', { src: logo, width: 48, height: 48, style: { borderRadius: 12 } }), text('Jotley', { fontSize: 34, fontWeight: 700, letterSpacing: -1 }), ), text('MAC · IPHONE · IPAD', { position: 'absolute', left: 56, top: 141, fontSize: 15, fontWeight: 700, letterSpacing: 3, color: '#bfa2f4' }), box({ position: 'absolute', left: 54, top: 192, flexDirection: 'column', fontSize: 61, lineHeight: 1.1, letterSpacing: -2.5, fontWeight: 700 }, text('Every word,'), text('captured and'), text('understood.', { color: '#8b5cf6' }), ), text('Voice notes. Powered by Apple Intelligence.', { position: 'absolute', left: 56, top: 416, fontSize: 21, color: '#ccc2de', width: 460, lineHeight: 1.5 }), box({ position: 'absolute', left: 56, bottom: 60, alignItems: 'center', gap: 16 }, text('Completely free', { background: '#261a3e', border: '1px solid #604389', padding: '10px 16px', borderRadius: 30, fontSize: 16, color: '#dfccff', fontWeight: 700 }), text('On-device AI', { fontSize: 16, color: '#afa5c1' }), ), // A desktop app window and an iPhone use the site's existing screenshots. box({ position: 'absolute', left: 580, top: 178, width: 574, height: 361, flexDirection: 'column', border: '1px solid #6a5b84', borderRadius: 16, overflow: 'hidden', boxShadow: '0 24px 60px #00000080', background: '#222' }, h('img', { src: mac, width: 572, height: 359, style: { objectFit: 'cover', objectPosition: 'top' } }), ), box({ position: 'absolute', left: 968, top: 100, width: 185, height: 403, background: '#08070b', padding: 5, border: '2px solid #82778f', borderRadius: 29, boxShadow: '0 18px 45px #00000080', overflow: 'hidden' }, h('img', { src: phone, width: 171, height: 389, style: { borderRadius: 22 } }), ), text('jotley.ai', { position: 'absolute', right: 48, bottom: 35, fontSize: 17, color: '#b9a9d0', letterSpacing: 1 }), ); const response = new ImageResponse(card, { width: 1200, height: 630 }); await mkdir('public/og', { recursive: true }); await writeFile('public/og/jotley-v2.png', Buffer.from(await response.arrayBuffer())); console.log('Generated public/og/jotley-v2.png (1200 × 630)');