diff --git a/.changeset/fresh-og-image.md b/.changeset/fresh-og-image.md new file mode 100644 index 0000000..7813573 --- /dev/null +++ b/.changeset/fresh-og-image.md @@ -0,0 +1,5 @@ +--- +'@crypt.fyi/web': patch +--- + +Refresh the social share image to match the redesigned site, serve it at 1200x630 from an absolute URL with size and alt metadata, and add `pnpm og:image` to regenerate it. diff --git a/packages/web/index.html b/packages/web/index.html index 5d052ce..e834483 100644 --- a/packages/web/index.html +++ b/packages/web/index.html @@ -37,19 +37,31 @@ property="og:description" content="Open-source platform for secure one-time secret sharing with zero-knowledge ML-KEM post-quantum encryption. Your secrets are encrypted in your browser, never accessible to our servers, and automatically deleted after viewing. Fully auditable codebase." /> - - + + + + + + + + - - + + + pathToFileURL(themeRequire.resolve(`@fontsource-variable/${pkg}/files/${file}`)).href; + +// Kept in step with landing.title / landing.subtitle / landing.demo in locales/en.ts and the +// demo values in src/pages/Landing.tsx. +const copy = { + badge: 'Open source · self-hostable', + title: 'Open-Source Zero-Knowledge Secret Sharing', + subtitle: 'Encrypt in your browser. Share once. Gone forever.', + detail: 'Post-quantum end-to-end encryption. Our servers never see your secrets.', + browser: 'In your browser', + server: 'On our server', + afterRead: 'After it is read', + nothing: 'nothing', + burned: 'Burned', + plaintext: 'API_TOKEN=demo-not-a-real-token', + ciphertext: '9fK2xQ7vLp0tRz4mWb8sYc1NeH6uJd3AoG5iTq…', +}; + +const logo = readFileSync(resolve(webDir, 'public/logo-light.svg'), 'utf8') + .replace(/stroke="white"/g, 'stroke="currentColor" fill="currentColor"') + .replace(/width="370" height="198"/, 'width="74" height="40"'); + +const flame = + ''; + +const html = /* html */ ` + + + + + + +
${logo}crypt.fyi
+
+
+ ${copy.badge} +

${copy.title}

+

${copy.subtitle}

+

${copy.detail}

+
+
+

${copy.browser}

${copy.plaintext}

+

${copy.server}

${copy.ciphertext}

+

${copy.afterRead}

${copy.nothing}

${flame}${copy.burned}
+
+
+ + +`; + +// Loaded from a file rather than setContent so the file:// font URLs are same-origin. +const tmp = mkdtempSync(join(tmpdir(), 'og-image-')); +const htmlPath = join(tmp, 'og.html'); +writeFileSync(htmlPath, html); + +const browser = await chromium.launch(); +try { + const page = await browser.newPage({ viewport: { width: WIDTH, height: HEIGHT } }); + await page.goto(pathToFileURL(htmlPath).href, { waitUntil: 'load' }); + await page.evaluate(() => document.fonts.ready); + const out = resolve(webDir, 'public/og.png'); + await page.screenshot({ path: out, type: 'png' }); + console.log(`Wrote ${out} (${WIDTH}x${HEIGHT})`); +} finally { + await browser.close(); + rmSync(tmp, { recursive: true, force: true }); +}