Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(forge-desktop): add the /forge-desktop download page that offers each visitor the build for their OS

nirholas2ca82f538ba0
diff --git a/data/pages.json b/data/pages.json
index c27b2dc1c..068ad6127 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -749,6 +749,14 @@
"added": "2026-10-09",
"showcase": true
},
+ {
+ "path": "/forge-desktop",
+ "title": "three.ws Forge for Desktop",
+ "description": "Download three.ws Forge, the free desktop 3D studio for Windows, Linux and Apple silicon Macs. Turn a photo into a 3D model with open-source generators on your own GPU or the three.ws cloud, chain repair, remeshing, rigging and export in node workflows, import free CC0 models and publish to your three.ws account in one click. Based on Modly (MIT).",
+ "priority": 0.8,
+ "changefreq": "weekly",
+ "added": "2026-10-09"
+ },
{
"path": "/forge/workflows",
"title": "Forge Workflows: Chain 3D Tools into One Run",
diff --git a/pages/forge-desktop.html b/pages/forge-desktop.html
new file mode 100644
index 000000000..1ff616484
--- /dev/null
+++ b/pages/forge-desktop.html
@@ -0,0 +1,153 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <script>/* three.ws theme boot: no-flash */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+ <title>three.ws Forge for desktop · Image to 3D on your own GPU · three.ws</title>
+ <meta name="description" content="Download three.ws Forge, the desktop 3D studio for Windows, Linux and Apple silicon Macs. Turn images into 3D models with open-source generators on your own GPU or the three.ws cloud, chain mesh tools in node workflows, import free CC0 models and publish to your three.ws account." />
+ <link rel="canonical" href="https://three.ws/forge-desktop" />
+ <meta property="og:type" content="website" />
+ <meta property="og:title" content="three.ws Forge for desktop" />
+ <meta property="og:description" content="The desktop 3D studio: image to 3D on your own GPU or the three.ws cloud, node workflows, a free CC0 library and one-click publishing." />
+ <meta property="og:url" content="https://three.ws/forge-desktop" />
+ <meta property="og:image" content="https://three.ws/forge-desktop/forge-generate.webp" />
+ <meta property="og:image:alt" content="three.ws Forge with a model open in its 3D viewport" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:title" content="three.ws Forge for desktop" />
+ <meta name="twitter:description" content="The desktop 3D studio: image to 3D on your own GPU or the three.ws cloud, node workflows, a free CC0 library and one-click publishing." />
+ <meta name="twitter:image" content="https://three.ws/forge-desktop/forge-generate.webp" />
+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:locale" content="en_US" />
+ <meta name="twitter:site" content="@trythreews" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/mobile.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <link rel="stylesheet" href="/src/forge-desktop.css" />
+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"SoftwareApplication","name":"three.ws Forge","applicationCategory":"DesignApplication","operatingSystem":"Windows 10+, macOS 12+ (Apple silicon), Linux","description":"Desktop 3D studio: image to 3D on your own GPU or the three.ws cloud, node-based mesh workflows, a CC0 object library and publishing to three.ws.","url":"https://three.ws/forge-desktop","license":"https://opensource.org/licenses/MIT","isBasedOn":"https://github.com/lightningpixel/modly","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"}}]}</script>
+</head>
+<body class="fd-body">
+ <header class="site-header"><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="fd">
+ <section class="fd-hero" aria-labelledby="fdTitle">
+ <div class="fd-hero__copy">
+ <p class="fd-eyebrow"><span class="fd-eyebrow__mark" aria-hidden="true"></span>three.ws Forge for desktop</p>
+ <h1 id="fdTitle">A 3D studio that runs on your machine.</h1>
+ <p class="fd-lede">Turn a photo into a 3D model with open-source generators on your own GPU, or hand it to the three.ws cloud when you have no GPU at all. Clean it up, run it through a node workflow, and publish it to your three.ws account in one click.</p>
+
+ <!-- Filled by src/forge-desktop.js from https://three.ws/releases/forge/release.json -->
+ <div id="fdGet" class="fd-get" data-state="loading" aria-live="polite">
+ <div class="fd-get__skeleton" aria-hidden="true">
+ <span class="fd-sk fd-sk--btn"></span>
+ <span class="fd-sk fd-sk--line"></span>
+ </div>
+ </div>
+
+ <p class="fd-credit">Free and open source. Based on <a href="https://github.com/lightningpixel/modly" rel="noopener" target="_blank">Modly</a> by <a href="https://github.com/lightningpixel" rel="noopener" target="_blank">Lightning Pixel</a> (MIT license).</p>
+ </div>
+
+ <figure class="fd-shot" aria-labelledby="fdShotCaption">
+ <div class="fd-shot__tabs" role="tablist" aria-label="Screens">
+ <button type="button" role="tab" class="fd-tab" id="fdTab-generate" aria-controls="fdShotImg" aria-selected="true" data-shot="generate">Generate</button>
+ <button type="button" role="tab" class="fd-tab" id="fdTab-library" aria-controls="fdShotImg" aria-selected="false" tabindex="-1" data-shot="library">Library</button>
+ <button type="button" role="tab" class="fd-tab" id="fdTab-publish" aria-controls="fdShotImg" aria-selected="false" tabindex="-1" data-shot="publish">Publish</button>
+ <button type="button" role="tab" class="fd-tab" id="fdTab-settings" aria-controls="fdShotImg" aria-selected="false" tabindex="-1" data-shot="settings">Account</button>
+ </div>
+ <div class="fd-shot__frame" id="fdShotImg" role="tabpanel" aria-labelledby="fdTab-generate">
+ <img src="/forge-desktop/forge-generate.webp" width="1600" height="960" alt="three.ws Forge with an armchair from the CC0 library open in the 3D viewport" decoding="async" />
+ </div>
+ <figcaption id="fdShotCaption" class="fd-shot__caption">The viewport, with Import, Export, Publish, Smooth and Decimate on the toolbar.</figcaption>
+ </figure>
+ </section>
+
+ <section class="fd-section" aria-labelledby="fdWhatTitle">
+ <h2 id="fdWhatTitle" class="fd-h2">What is inside</h2>
+ <ul class="fd-features">
+ <li class="fd-feature">
+ <span class="fd-feature__icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9zM9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3"/></svg></span>
+ <h3 class="fd-h3">Your GPU or ours</h3>
+ <p>Install open-source generators such as Hunyuan3D, TripoSG and TRELLIS from the Extensions tab and run them locally, with no queue and no upload. The three.ws cloud generator is built in for machines without a GPU, and takes a photo, a text prompt or a sketch.</p>
+ </li>
+ <li class="fd-feature">
+ <span class="fd-feature__icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="5" cy="6" r="2.5"/><circle cx="19" cy="6" r="2.5"/><circle cx="12" cy="18" r="2.5"/><path d="M7.5 6h9M6.3 8.2l4.4 7.6M17.7 8.2l-4.4 7.6"/></svg></span>
+ <h3 class="fd-h3">Node workflows</h3>
+ <p>Chain generation, mesh repair, remeshing, smoothing, optimization, auto-rigging and export in a visual graph, save it, and run it again on the next image.</p>
+ </li>
+ <li class="fd-feature">
+ <span class="fd-feature__icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2l8.66 5v10L12 22l-8.66-5V7L12 2z"/><path d="M12 22V12M12 12l8.66-5M12 12L3.34 7"/></svg></span>
+ <h3 class="fd-h3">The CC0 library</h3>
+ <p>Search the <a href="/objects">three.ws object library</a> from the Import menu and drop a public-domain model into the viewport as a starting point, a reference or a workflow input.</p>
+ </li>
+ <li class="fd-feature">
+ <span class="fd-feature__icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 16V4M7 9l5-5 5 5"/><path d="M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3"/></svg></span>
+ <h3 class="fd-h3">Publish in one click</h3>
+ <p>Sign in once through your browser. Publish sends the open model to your account as a shareable 3D page you can embed, rig or give to an agent.</p>
+ </li>
+ </ul>
+ </section>
+
+ <section class="fd-section" id="fd-downloads" aria-labelledby="fdDlTitle" hidden>
+ <div class="fd-section__head">
+ <h2 id="fdDlTitle" class="fd-h2">All downloads</h2>
+ <p id="fdDlMeta" class="fd-muted"></p>
+ </div>
+ <div class="fd-table-wrap">
+ <table class="fd-table">
+ <thead><tr><th scope="col">Platform</th><th scope="col">File</th><th scope="col">Size</th><th scope="col">SHA-256</th></tr></thead>
+ <tbody id="fdDlRows"></tbody>
+ </table>
+ </div>
+ <div id="fdNotes" class="fd-notes"></div>
+ <details id="fdUnsigned" class="fd-details" hidden>
+ <summary>Opening an unsigned build</summary>
+ <div id="fdUnsignedBody" class="fd-details__body"></div>
+ </details>
+ </section>
+
+ <section class="fd-section" id="fd-source" aria-labelledby="fdSrcTitle">
+ <div class="fd-section__head">
+ <h2 id="fdSrcTitle" class="fd-h2">Run it from source</h2>
+ <p class="fd-muted">Needs Node.js 20 or later and Git. The first launch builds Forge's Python environment, which takes a few minutes.</p>
+ </div>
+ <div class="fd-code">
+ <pre id="fdSrcCode"><code>git clone --depth 1 https://github.com/nirholas/three.ws
+cd three.ws/apps/forge-desktop
+npm install
+npm run prepare-resources
+npm run dev</code></pre>
+ <button type="button" class="fd-btn fd-btn--sm fd-code__copy" data-copy="#fdSrcCode">Copy</button>
+ </div>
+ <p class="fd-muted fd-small"><code>prepare-resources</code> downloads a standalone Python for your platform so Forge never depends on the one your system ships. The <a href="https://github.com/nirholas/three.ws/tree/main/apps/forge-desktop" rel="noopener" target="_blank">source and build guide</a> covers packaging your own installer.</p>
+ </section>
+
+ <section class="fd-section" aria-labelledby="fdReqTitle">
+ <h2 id="fdReqTitle" class="fd-h2">System requirements</h2>
+ <dl class="fd-reqs">
+ <div><dt>Windows</dt><dd>Windows 10 or 11, 64-bit</dd></div>
+ <div><dt>macOS</dt><dd>macOS 12 Monterey or later on Apple silicon (M1 and newer)</dd></div>
+ <div><dt>Linux</dt><dd>64-bit Ubuntu 20.04+, Debian 11+, Fedora 39+ or another current glibc distribution</dd></div>
+ <div><dt>Local generation</dt><dd>An NVIDIA GPU (CUDA), an AMD Radeon GPU (ROCm, on Windows and Linux) or Apple silicon. Each model in the Extensions tab lists its VRAM needs.</dd></div>
+ <div><dt>Cloud generation</dt><dd>Any of the above, no GPU needed. Uses your three.ws plan.</dd></div>
+ </dl>
+ </section>
+
+ <aside class="fd-foot" aria-label="Related tools and credits">
+ <p>Prefer the browser? <a href="/workbench">Workbench</a> runs the same kind of workflow in a tab, <a href="/forge">Forge</a> generates on three.ws servers, and <a href="/modly">three.ws/modly</a> connects to Modly running on your computer.</p>
+ <p class="fd-credit">three.ws Forge is based on <a href="https://github.com/lightningpixel/modly" rel="noopener" target="_blank">Modly</a> by <a href="https://github.com/lightningpixel" rel="noopener" target="_blank">Lightning Pixel</a>, used under the MIT license. three.ws is not affiliated with Lightning Pixel. Read the <a href="/docs/forge-desktop">Forge desktop guide</a>.</p>
+ </aside>
+ <div id="fdToast" class="fd-toast" role="status" aria-live="polite" hidden></div>
+ </main>
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+
+ <script type="module" src="/src/forge-desktop.js"></script>
+</body>
+</html>
diff --git a/public/forge-desktop/forge-generate.webp b/public/forge-desktop/forge-generate.webp
new file mode 100644
index 000000000..6e720b8de
Binary files /dev/null and b/public/forge-desktop/forge-generate.webp differ
diff --git a/public/forge-desktop/forge-library.webp b/public/forge-desktop/forge-library.webp
new file mode 100644
index 000000000..bf7350a41
Binary files /dev/null and b/public/forge-desktop/forge-library.webp differ
diff --git a/public/forge-desktop/forge-publish.webp b/public/forge-desktop/forge-publish.webp
new file mode 100644
index 000000000..16194c723
Binary files /dev/null and b/public/forge-desktop/forge-publish.webp differ
diff --git a/public/forge-desktop/forge-settings.webp b/public/forge-desktop/forge-settings.webp
new file mode 100644
index 000000000..fb2ece81e
Binary files /dev/null and b/public/forge-desktop/forge-settings.webp differ
diff --git a/src/forge-desktop-release.js b/src/forge-desktop-release.js
new file mode 100644
index 000000000..049b606cb
--- /dev/null
+++ b/src/forge-desktop-release.js
@@ -0,0 +1,73 @@
+// Pure helpers for the /forge-desktop download page: which OS the visitor is on,
+// which file in release.json to offer them, and how to print a file size. Kept
+// free of the DOM so tests/forge-desktop-release.test.js can exercise them.
+
+export const PLATFORM_LABEL = { mac: 'macOS', win: 'Windows', linux: 'Linux' };
+
+/**
+ * The visitor's desktop platform, from User-Agent Client Hints when the browser
+ * offers them and the user agent string otherwise. Phones and tablets are
+ * 'other': Forge is a desktop app.
+ * @param {{ userAgent?: string, platform?: string, userAgentData?: { platform?: string, mobile?: boolean } }} nav
+ * @returns {'mac' | 'win' | 'linux' | 'other'}
+ */
+export function detectPlatform(nav) {
+ const hints = nav.userAgentData;
+ if (hints && typeof hints.platform === 'string' && hints.platform) {
+ if (hints.mobile) return 'other';
+ const p = hints.platform.toLowerCase();
+ if (p === 'macos') return 'mac';
+ if (p === 'windows') return 'win';
+ if (p === 'linux') return 'linux';
+ return 'other';
+ }
+ const ua = String(nav.userAgent || '');
+ if (/Android|iPhone|iPad|iPod|Mobile/i.test(ua)) return 'other';
+ if (/Windows NT/i.test(ua)) return 'win';
+ // iPadOS reports a Mac user agent; a touch-capable "Mac" is an iPad.
+ if (/Macintosh|Mac OS X/i.test(ua)) return Number(nav.maxTouchPoints) > 1 ? 'other' : 'mac';
+ if (/CrOS/i.test(ua)) return 'other';
+ if (/Linux|X11/i.test(ua)) return 'linux';
+ return 'other';
+}
+
+/**
+ * The file to put on the big download button: the platform's primary artifact
+ * (dmg, setup.exe, AppImage), falling back to any file for that platform.
+ * @param {Array<{ platform: string, primary?: boolean }>} files
+ * @param {'mac' | 'win' | 'linux' | 'other'} platform
+ */
+export function pickPrimary(files, platform) {
+ if (platform === 'other') return null;
+ const mine = files.filter((f) => f.platform === platform);
+ return mine.find((f) => f.primary) || mine[0] || null;
+}
+
+/** @param {number} bytes */
+export function formatBytes(bytes) {
+ if (!Number.isFinite(bytes) || bytes <= 0) return '';
+ if (bytes < 1024 * 1024) return `${Math.max(1, Math.round(bytes / 1024))} KB`;
+ if (bytes < 1024 ** 3) return `${(bytes / 1024 ** 2).toFixed(bytes < 100 * 1024 ** 2 ? 1 : 0)} MB`;
+ return `${(bytes / 1024 ** 3).toFixed(2)} GB`;
+}
+
+/**
+ * Accepts a parsed release.json only when every file the page renders has the
+ * fields it renders, so a malformed feed reads as "not published" rather than
+ * crashing the page halfway through the table.
+ */
+export function isUsableRelease(release) {
+ if (!release || typeof release !== 'object' || typeof release.version !== 'string') return false;
+ if (!Array.isArray(release.files) || release.files.length === 0) return false;
+ return release.files.every(
+ (f) =>
+ f &&
+ PLATFORM_LABEL[f.platform] &&
+ typeof f.url === 'string' &&
+ /^https:\/\//.test(f.url) &&
+ typeof f.name === 'string' &&
+ typeof f.label === 'string' &&
+ typeof f.sha256 === 'string' &&
+ /^[0-9a-f]{64}$/i.test(f.sha256),
+ );
+}
diff --git a/src/forge-desktop.css b/src/forge-desktop.css
new file mode 100644
index 000000000..eac028b2a
--- /dev/null
+++ b/src/forge-desktop.css
@@ -0,0 +1,742 @@
+/* /forge-desktop: the three.ws Forge download page. Hero with the download for
+ the visitor's OS, a tabbed tour of the app, the full download table from the
+ release feed, and building from source. Tokens come from public/tokens.css
+ (loaded through /style.css); the violet accent matches the app's own. */
+
+.fd-body {
+ background: var(--bg-0);
+ color: var(--ink);
+ --fd-accent: #a78bfa;
+ --fd-accent-strong: #8b5cf6;
+ --fd-accent-soft: color-mix(in srgb, var(--fd-accent) 14%, transparent);
+ --fd-on-accent: #ffffff;
+ --fd-warn: var(--warn, #fbbf24);
+ --fd-danger: var(--danger, #f87171);
+}
+
+html[data-theme='light'] .fd-body {
+ --fd-accent: #6d28d9;
+ --fd-accent-strong: #6d28d9;
+}
+
+.fd {
+ width: 100%;
+ box-sizing: border-box;
+ max-width: 1240px;
+ margin: 0 auto;
+ padding: var(--space-xl) var(--space-md) var(--space-2xl);
+}
+
+.fd a:not(.fd-btn) {
+ color: var(--fd-accent);
+ text-underline-offset: 2px;
+}
+
+.fd a:not(.fd-btn):hover {
+ text-decoration-thickness: 2px;
+}
+
+.fd a:focus-visible,
+.fd button:focus-visible,
+.fd summary:focus-visible {
+ outline: 2px solid var(--fd-accent);
+ outline-offset: 2px;
+ border-radius: var(--radius-sm);
+}
+
+.fd code {
+ font-family: var(--font-mono);
+ font-size: 0.92em;
+}
+
+.fd-muted {
+ color: var(--ink-dim);
+}
+
+.fd-small {
+ font-size: var(--text-sm);
+}
+
+.fd-h2 {
+ margin: 0;
+ font-family: var(--font-display);
+ font-size: var(--text-xl);
+ font-weight: var(--weight-semibold);
+ letter-spacing: -0.01em;
+}
+
+.fd-h3 {
+ margin: 0 0 var(--space-xs);
+ font-family: var(--font-display);
+ font-size: var(--text-base);
+ font-weight: var(--weight-semibold);
+}
+
+/* ── Hero ─────────────────────────────────────────────────────────────────── */
+
+.fd-hero {
+ display: grid;
+ grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
+ gap: var(--space-xl);
+ align-items: center;
+}
+
+.fd-eyebrow {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-xs);
+ margin: 0 0 var(--space-md);
+ font-size: var(--text-sm);
+ font-weight: var(--weight-medium);
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+ color: var(--fd-accent);
+}
+
+.fd-eyebrow__mark {
+ width: 8px;
+ height: 8px;
+ border-radius: 2px;
+ background: var(--fd-accent);
+ box-shadow: 0 0 12px var(--fd-accent);
+ transform: rotate(45deg);
+}
+
+.fd-hero h1 {
+ margin: 0 0 var(--space-md);
+ font-family: var(--font-display);
+ font-size: clamp(2rem, 4.2vw, var(--text-2xl));
+ line-height: 1.1;
+ letter-spacing: -0.02em;
+ font-weight: var(--weight-bold);
+}
+
+.fd-lede {
+ margin: 0 0 var(--space-lg);
+ font-size: var(--text-base);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+ max-width: 52ch;
+}
+
+.fd-credit {
+ margin: var(--space-md) 0 0;
+ font-size: var(--text-sm);
+ color: var(--ink-dim);
+}
+
+/* ── Download block ──────────────────────────────────────────────────────── */
+
+.fd-get {
+ min-height: 104px;
+ animation: fd-fade 0.25s ease both;
+}
+
+.fd-get__actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: var(--space-sm);
+}
+
+.fd-get__hint {
+ margin: var(--space-sm) 0 0;
+ font-size: var(--text-sm);
+ line-height: 1.6;
+ color: var(--ink-dim);
+ max-width: 56ch;
+}
+
+.fd-get__skeleton {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-sm);
+}
+
+.fd-sk {
+ display: block;
+ border-radius: var(--radius-md);
+ background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
+ background-size: 200% 100%;
+ animation: fd-shimmer 1.4s ease-in-out infinite;
+}
+
+.fd-sk--btn {
+ width: 240px;
+ height: 52px;
+}
+
+.fd-sk--line {
+ width: 70%;
+ max-width: 340px;
+ height: 14px;
+}
+
+@keyframes fd-shimmer {
+ from {
+ background-position: 100% 0;
+ }
+ to {
+ background-position: -100% 0;
+ }
+}
+
+@keyframes fd-fade {
+ from {
+ opacity: 0;
+ transform: translateY(4px);
+ }
+ to {
+ opacity: 1;
+ transform: none;
+ }
+}
+
+.fd-alert {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-md);
+ padding: var(--space-sm) var(--space-md);
+ border: 1px solid color-mix(in srgb, var(--fd-danger) 35%, transparent);
+ border-radius: var(--radius-md);
+ background: color-mix(in srgb, var(--fd-danger) 9%, transparent);
+ font-size: var(--text-md);
+}
+
+.fd-alert p {
+ margin: 0;
+}
+
+.fd-pill {
+ display: inline-flex;
+ align-items: center;
+ margin-right: var(--space-2xs);
+ padding: 1px 8px;
+ border-radius: var(--radius-pill);
+ background: var(--fd-accent-soft);
+ color: var(--fd-accent);
+ font-size: var(--text-2xs);
+ font-weight: var(--weight-semibold);
+ letter-spacing: 0.02em;
+ vertical-align: 1px;
+}
+
+.fd-pill--warn {
+ margin: 0 0 0 var(--space-xs);
+ background: color-mix(in srgb, var(--fd-warn) 14%, transparent);
+ color: var(--fd-warn);
+}
+
+/* ── Buttons ─────────────────────────────────────────────────────────────── */
+
+.fd-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: var(--space-xs);
+ min-height: 40px;
+ padding: 0 var(--space-md);
+ border: 1px solid var(--stroke-strong);
+ border-radius: var(--radius-md);
+ background: var(--surface-2);
+ color: var(--ink);
+ font: inherit;
+ font-size: var(--text-ui);
+ font-weight: var(--weight-medium);
+ text-decoration: none;
+ cursor: pointer;
+ transition:
+ background-color 0.15s ease,
+ border-color 0.15s ease,
+ transform 0.1s ease,
+ box-shadow 0.15s ease;
+}
+
+.fd-btn:hover {
+ background: var(--surface-3);
+ border-color: color-mix(in srgb, var(--fd-accent) 40%, var(--stroke-strong));
+}
+
+.fd-btn:active {
+ transform: translateY(1px) scale(0.99);
+}
+
+.fd-btn--primary {
+ border-color: transparent;
+ background: var(--fd-accent-strong);
+ color: var(--fd-on-accent);
+ box-shadow: 0 6px 24px color-mix(in srgb, var(--fd-accent-strong) 35%, transparent);
+}
+
+.fd-btn--primary:hover {
+ background: color-mix(in srgb, var(--fd-accent-strong) 86%, #ffffff);
+ border-color: transparent;
+ box-shadow: 0 8px 30px color-mix(in srgb, var(--fd-accent-strong) 45%, transparent);
+}
+
+.fd-btn--lg {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 2px;
+ min-height: 56px;
+ padding: var(--space-xs) var(--space-lg);
+ font-size: var(--text-base);
+}
+
+.fd-btn__meta {
+ font-size: var(--text-sm);
+ font-weight: var(--weight-regular);
+ opacity: 0.82;
+}
+
+.fd-btn--sm {
+ min-height: 30px;
+ padding: 0 var(--space-sm);
+ font-size: var(--text-sm);
+}
+
+/* ── Screens ─────────────────────────────────────────────────────────────── */
+
+.fd-shot {
+ margin: 0;
+ min-width: 0;
+}
+
+.fd-shot__tabs {
+ display: flex;
+ gap: var(--space-2xs);
+ margin-bottom: var(--space-sm);
+ padding: 3px;
+ width: fit-content;
+ max-width: 100%;
+ overflow-x: auto;
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ background: var(--surface-1);
+}
+
+.fd-tab {
+ flex: none;
+ padding: 6px 14px;
+ border: 0;
+ border-radius: var(--radius-pill);
+ background: transparent;
+ color: var(--ink-dim);
+ font: inherit;
+ font-size: var(--text-md);
+ font-weight: var(--weight-medium);
+ cursor: pointer;
+ transition:
+ background-color 0.15s ease,
+ color 0.15s ease;
+}
+
+.fd-tab:hover {
+ color: var(--ink);
+ background: var(--surface-2);
+}
+
+.fd-tab[aria-selected='true'] {
+ color: var(--ink);
+ background: var(--surface-3);
+ box-shadow: inset 0 0 0 1px var(--stroke-strong);
+}
+
+.fd-shot__frame {
+ position: relative;
+ overflow: hidden;
+ aspect-ratio: 1600 / 960;
+ border: 1px solid var(--stroke-strong);
+ border-radius: var(--radius-lg);
+ background: var(--bg-1);
+ box-shadow: var(--shadow-3), 0 0 80px color-mix(in srgb, var(--fd-accent-strong) 12%, transparent);
+}
+
+.fd-shot__frame img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ transition: opacity 0.2s ease;
+}
+
+.fd-shot__frame.is-swapping img {
+ opacity: 0.35;
+}
+
+.fd-shot__caption {
+ margin-top: var(--space-sm);
+ font-size: var(--text-sm);
+ color: var(--ink-dim);
+ min-height: 1.6em;
+}
+
+/* ── Sections ────────────────────────────────────────────────────────────── */
+
+.fd-section {
+ margin-top: var(--space-2xl);
+ animation: fd-fade 0.3s ease both;
+}
+
+.fd-section__head {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: var(--space-xs) var(--space-md);
+ margin-bottom: var(--space-md);
+}
+
+.fd-section__head p {
+ margin: 0;
+ font-size: var(--text-md);
+}
+
+.fd-section > .fd-h2 {
+ margin-bottom: var(--space-md);
+}
+
+.fd-features {
+ display: grid;
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+ gap: var(--space-md);
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.fd-feature {
+ padding: var(--space-md);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-lg);
+ background: var(--surface-1);
+ transition:
+ border-color 0.2s ease,
+ transform 0.2s ease,
+ background-color 0.2s ease;
+}
+
+.fd-feature:hover {
+ border-color: color-mix(in srgb, var(--fd-accent) 35%, var(--stroke));
+ background: var(--surface-2);
+ transform: translateY(-2px);
+}
+
+.fd-feature p {
+ margin: 0;
+ font-size: var(--text-md);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+}
+
+.fd-feature__icon {
+ display: inline-grid;
+ place-items: center;
+ width: 34px;
+ height: 34px;
+ margin-bottom: var(--space-sm);
+ border-radius: var(--radius-md);
+ background: var(--fd-accent-soft);
+ color: var(--fd-accent);
+}
+
+/* ── Downloads table ─────────────────────────────────────────────────────── */
+
+.fd-table-wrap {
+ overflow-x: auto;
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-lg);
+}
+
+.fd-table {
+ width: 100%;
+ border-collapse: collapse;
+ font-size: var(--text-md);
+}
+
+.fd-table th,
+.fd-table td {
+ padding: var(--space-sm) var(--space-md);
+ text-align: left;
+ white-space: nowrap;
+ border-bottom: 1px solid var(--stroke);
+}
+
+.fd-table th {
+ font-size: var(--text-sm);
+ font-weight: var(--weight-medium);
+ color: var(--ink-dim);
+ background: var(--surface-1);
+}
+
+.fd-table tbody tr:last-child td {
+ border-bottom: 0;
+}
+
+.fd-table tbody tr {
+ transition: background-color 0.15s ease;
+}
+
+.fd-table tbody tr:hover {
+ background: var(--surface-1);
+}
+
+.fd-plat {
+ font-weight: var(--weight-medium);
+}
+
+.fd-num {
+ font-variant-numeric: tabular-nums;
+}
+
+.fd-hash {
+ padding: 2px 8px;
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-sm);
+ background: transparent;
+ color: var(--ink-dim);
+ cursor: copy;
+ transition:
+ color 0.15s ease,
+ border-color 0.15s ease,
+ background-color 0.15s ease;
+}
+
+.fd-hash:hover {
+ color: var(--ink);
+ border-color: var(--stroke-strong);
+ background: var(--surface-2);
+}
+
+.fd-hash:active {
+ transform: translateY(1px);
+}
+
+.fd-notes {
+ display: grid;
+ gap: var(--space-sm);
+ margin-top: var(--space-md);
+}
+
+.fd-notes:empty {
+ display: none;
+}
+
+.fd-note {
+ padding: var(--space-md);
+ border-left: 2px solid var(--fd-accent);
+ background: var(--surface-1);
+ border-radius: 0 var(--radius-md) var(--radius-md) 0;
+}
+
+.fd-note p {
+ margin: 0;
+ font-size: var(--text-md);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+}
+
+.fd-details {
+ margin-top: var(--space-md);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-md);
+ background: var(--surface-1);
+}
+
+.fd-details summary {
+ padding: var(--space-sm) var(--space-md);
+ font-weight: var(--weight-medium);
+ cursor: pointer;
+ transition: color 0.15s ease;
+}
+
+.fd-details summary:hover {
+ color: var(--fd-accent);
+}
+
+.fd-details__body {
+ padding: 0 var(--space-md) var(--space-md);
+}
+
+.fd-details__body p {
+ margin: 0 0 var(--space-md);
+ font-size: var(--text-md);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+}
+
+.fd-details__body p:last-child {
+ margin-bottom: 0;
+}
+
+/* ── Source ──────────────────────────────────────────────────────────────── */
+
+.fd-code {
+ position: relative;
+ border: 1px solid var(--stroke-strong);
+ border-radius: var(--radius-lg);
+ background: var(--bg-1);
+}
+
+.fd-code pre {
+ margin: 0;
+ padding: var(--space-md) var(--space-md);
+ padding-right: 88px;
+ overflow-x: auto;
+ font-family: var(--font-mono);
+ font-size: var(--text-md);
+ line-height: 1.8;
+}
+
+.fd-code__copy {
+ position: absolute;
+ top: var(--space-sm);
+ right: var(--space-sm);
+}
+
+#fd-source > .fd-small {
+ margin: var(--space-sm) 0 0;
+ line-height: var(--leading-normal);
+}
+
+/* ── Requirements ────────────────────────────────────────────────────────── */
+
+.fd-reqs {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
+ gap: var(--space-md);
+ margin: 0;
+}
+
+.fd-reqs > div {
+ padding: var(--space-md);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-md);
+}
+
+.fd-reqs dt {
+ margin-bottom: var(--space-2xs);
+ font-weight: var(--weight-semibold);
+}
+
+.fd-reqs dd {
+ margin: 0;
+ font-size: var(--text-md);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+}
+
+/* ── Footer and toast ────────────────────────────────────────────────────── */
+
+.fd-foot {
+ margin-top: var(--space-2xl);
+ padding-top: var(--space-lg);
+ border-top: 1px solid var(--stroke);
+ font-size: var(--text-md);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+}
+
+.fd-foot p {
+ margin: 0 0 var(--space-sm);
+}
+
+.fd-toast {
+ position: fixed;
+ left: 50%;
+ bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
+ z-index: 50;
+ padding: var(--space-xs) var(--space-md);
+ border: 1px solid var(--stroke-strong);
+ border-radius: var(--radius-pill);
+ background: var(--bg-1);
+ color: var(--ink);
+ font-size: var(--text-md);
+ box-shadow: var(--shadow-2);
+ transform: translateX(-50%);
+ animation: fd-toast-in 0.2s ease both;
+}
+
+.fd-toast[hidden] {
+ display: none;
+}
+
+@keyframes fd-toast-in {
+ from {
+ opacity: 0;
+ transform: translate(-50%, 6px);
+ }
+ to {
+ opacity: 1;
+ transform: translate(-50%, 0);
+ }
+}
+
+/* ── Responsive ──────────────────────────────────────────────────────────── */
+
+@media (max-width: 1024px) {
+ .fd-hero {
+ grid-template-columns: minmax(0, 1fr);
+ }
+
+ .fd-features {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+}
+
+@media (max-width: 600px) {
+ .fd {
+ padding-top: var(--space-lg);
+ }
+
+ .fd-features {
+ grid-template-columns: minmax(0, 1fr);
+ }
+
+ .fd-get__actions .fd-btn {
+ flex: 1 1 100%;
+ }
+
+ .fd-btn--lg {
+ align-items: center;
+ }
+
+ .fd-alert {
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ /* The clone line is wider than a phone; keep Copy off the scrolling text. */
+ .fd-code {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .fd-code pre {
+ padding-right: var(--space-md);
+ }
+
+ .fd-code__copy {
+ position: static;
+ align-self: flex-end;
+ margin: 0 var(--space-sm) var(--space-sm) 0;
+ }
+
+ .fd-table th,
+ .fd-table td {
+ padding: var(--space-xs) var(--space-sm);
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .fd-get,
+ .fd-section,
+ .fd-toast,
+ .fd-sk {
+ animation: none;
+ }
+
+ .fd-feature:hover {
+ transform: none;
+ }
+}
diff --git a/src/forge-desktop.js b/src/forge-desktop.js
new file mode 100644
index 000000000..fe8d11f4a
--- /dev/null
+++ b/src/forge-desktop.js
@@ -0,0 +1,286 @@
+// /forge-desktop: the three.ws Forge download page. Reads the release feed the
+// Forge release pipeline publishes (apps/forge-desktop/cloudbuild.yaml and
+// scripts/release-mac.sh) and offers the build for the visitor's OS, every
+// other build with its size and SHA-256, and the release notes. Until the first
+// release is published the feed 404s and the page leads with running from source.
+
+import { pickPrimary, detectPlatform, formatBytes, isUsableRelease, PLATFORM_LABEL } from './forge-desktop-release.js';
+
+const FEED_URL = '/releases/forge/release.json';
+
+const SHOTS = {
+ generate: {
+ src: '/forge-desktop/forge-generate.webp',
+ alt: 'three.ws Forge with an armchair from the CC0 library open in the 3D viewport',
+ caption: 'The viewport, with Import, Export, Publish, Smooth and Decimate on the toolbar.',
+ },
+ library: {
+ src: '/forge-desktop/forge-library.webp',
+ alt: 'The three.ws library popover searching for chairs, showing a grid of thumbnails',
+ caption: 'Import, then three.ws library: search the free CC0 models and open one in a click.',
+ },
+ publish: {
+ src: '/forge-desktop/forge-publish.webp',
+ alt: 'The Publish to three.ws popover asking the user to sign in',
+ caption: 'Publish sends the open model to your three.ws account as a shareable 3D page.',
+ },
+ settings: {
+ src: '/forge-desktop/forge-settings.webp',
+ alt: 'Settings, three.ws section, offering browser sign-in or an API key',
+ caption: 'Settings, then three.ws: sign in through your browser, or paste an API key on managed machines.',
+ },
+};
+
+const $ = (sel, root = document) => root.querySelector(sel);
+
+function el(tag, attrs = {}, children = []) {
+ const node = document.createElement(tag);
+ for (const [k, v] of Object.entries(attrs)) {
+ if (v === undefined || v === null || v === false) continue;
+ if (k === 'class') node.className = v;
+ else if (k === 'text') node.textContent = v;
+ else node.setAttribute(k, v === true ? '' : String(v));
+ }
+ for (const child of [].concat(children)) {
+ if (child !== null && child !== undefined) node.append(child);
+ }
+ return node;
+}
+
+let toastTimer = 0;
+function toast(message) {
+ const t = $('#fdToast');
+ t.textContent = message;
+ t.hidden = false;
+ clearTimeout(toastTimer);
+ toastTimer = setTimeout(() => {
+ t.hidden = true;
+ }, 2200);
+}
+
+async function copyText(text, label = 'Copied') {
+ try {
+ await navigator.clipboard.writeText(text);
+ toast(label);
+ } catch {
+ toast('Copy failed. Select the text and copy it by hand.');
+ }
+}
+
+// ── Release feed ────────────────────────────────────────────────────────────
+
+/** @returns {Promise<{ status: 'ok', release: object } | { status: 'unpublished' } | { status: 'error', message: string }>} */
+async function loadRelease() {
+ let res;
+ try {
+ res = await fetch(FEED_URL, { headers: { accept: 'application/json' }, cache: 'no-cache' });
+ } catch {
+ return { status: 'error', message: 'Could not reach three.ws. Check your connection and try again.' };
+ }
+ if (res.status === 404) return { status: 'unpublished' };
+ if (!res.ok) return { status: 'error', message: `The release feed answered ${res.status}. Try again in a moment.` };
+ const type = res.headers.get('content-type') || '';
+ if (!type.includes('json')) return { status: 'unpublished' };
+ try {
+ const release = await res.json();
+ if (!isUsableRelease(release)) return { status: 'unpublished' };
+ return { status: 'ok', release };
+ } catch {
+ return { status: 'error', message: 'The release feed was not valid JSON. Try again in a moment.' };
+ }
+}
+
+function renderLoading(root) {
+ root.dataset.state = 'loading';
+ root.replaceChildren(
+ el('div', { class: 'fd-get__skeleton', 'aria-hidden': 'true' }, [el('span', { class: 'fd-sk fd-sk--btn' }), el('span', { class: 'fd-sk fd-sk--line' })]),
+ );
+}
+
+function renderError(root, message) {
+ root.dataset.state = 'error';
+ const retry = el('button', { type: 'button', class: 'fd-btn', text: 'Try again' });
+ retry.addEventListener('click', () => void init());
+ root.replaceChildren(
+ el('div', { class: 'fd-alert', role: 'alert' }, [el('p', { text: message }), retry]),
+ );
+}
+
+function renderUnpublished(root) {
+ root.dataset.state = 'unpublished';
+ const src = el('a', { class: 'fd-btn fd-btn--primary', href: '#fd-source', text: 'Run it from source' });
+ const repo = el('a', {
+ class: 'fd-btn',
+ href: 'https://github.com/nirholas/three.ws/tree/main/apps/forge-desktop',
+ rel: 'noopener',
+ target: '_blank',
+ text: 'View the source',
+ });
+ root.replaceChildren(
+ el('div', { class: 'fd-get__actions' }, [src, repo]),
+ el('p', { class: 'fd-get__hint' }, [
+ el('span', { class: 'fd-pill', text: 'Installers coming soon' }),
+ ' Signed installers for Windows, macOS and Linux will be listed here when the first release ships. Until then, Forge runs from source in five commands.',
+ ]),
+ );
+}
+
+function renderReady(root, release) {
+ root.dataset.state = 'ready';
+ const platform = detectPlatform(navigator);
+ const primary = pickPrimary(release.files, platform);
+ const actions = el('div', { class: 'fd-get__actions' });
+
+ if (primary) {
+ actions.append(
+ el('a', { class: 'fd-btn fd-btn--primary fd-btn--lg', href: primary.url, download: primary.name }, [
+ el('span', { text: `Download for ${PLATFORM_LABEL[primary.platform]}` }),
+ el('span', { class: 'fd-btn__meta', text: `${primary.label}, ${formatBytes(primary.size)}` }),
+ ]),
+ );
+ }
+ actions.append(el('a', { class: 'fd-btn', href: '#fd-downloads', text: primary ? 'Other platforms' : 'Choose a download' }));
+
+ const hint = el('p', { class: 'fd-get__hint' }, [`Version ${release.version}`, release.date ? `, released ${formatDate(release.date)}` : '', '.']);
+ if (platform === 'mac') hint.append(' Apple silicon Macs only.');
+ if (!primary && platform === 'other') hint.append(' Forge runs on Windows, macOS and Linux computers.');
+ root.replaceChildren(actions, hint);
+ renderDownloads(release);
+}
+
+function formatDate(iso) {
+ const d = new Date(`${iso}T00:00:00Z`);
+ if (Number.isNaN(d.getTime())) return iso;
+ return d.toLocaleDateString(undefined, { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' });
+}
+
+function renderDownloads(release) {
+ const section = $('#fd-downloads');
+ const rows = $('#fdDlRows');
+ rows.replaceChildren();
+ for (const f of release.files) {
+ const hash = el('button', { type: 'button', class: 'fd-hash', title: 'Copy the full SHA-256', 'aria-label': `Copy the SHA-256 of ${f.name}` }, [
+ el('code', { text: `${f.sha256.slice(0, 12)}…` }),
+ ]);
+ hash.addEventListener('click', () => void copyText(f.sha256, 'SHA-256 copied'));
+ rows.append(
+ el('tr', {}, [
+ el('td', {}, [
+ el('span', { class: 'fd-plat', text: PLATFORM_LABEL[f.platform] || f.platform }),
+ el('span', { class: 'fd-muted fd-small', text: ` ${f.arch}` }),
+ ]),
+ el('td', {}, [
+ el('a', { href: f.url, download: f.name, text: f.label }),
+ f.signed ? null : el('span', { class: 'fd-pill fd-pill--warn', text: 'unsigned' }),
+ ]),
+ el('td', { class: 'fd-num', text: formatBytes(f.size) }),
+ el('td', {}, [hash]),
+ ]),
+ );
+ }
+ $('#fdDlMeta').textContent = `three.ws Forge ${release.version}${release.date ? `, ${formatDate(release.date)}` : ''}`;
+
+ const notes = $('#fdNotes');
+ notes.replaceChildren();
+ for (const n of release.notes || []) {
+ notes.append(el('article', { class: 'fd-note' }, [el('h3', { class: 'fd-h3', text: n.title }), el('p', { text: n.summary })]));
+ }
+
+ renderUnsignedHelp(release.files);
+ section.hidden = false;
+}
+
+function renderUnsignedHelp(files) {
+ const unsigned = new Set(files.filter((f) => !f.signed).map((f) => f.platform));
+ const details = $('#fdUnsigned');
+ const body = $('#fdUnsignedBody');
+ body.replaceChildren();
+ if (unsigned.has('mac')) {
+ body.append(
+ el('h3', { class: 'fd-h3', text: 'macOS' }),
+ el('p', { text: 'Open the .dmg and drag three.ws Forge to Applications. The first time you open it, macOS says it cannot verify the developer: open System Settings, then Privacy & Security, scroll to the message about three.ws Forge and choose Open Anyway.' }),
+ );
+ }
+ if (unsigned.has('win')) {
+ body.append(
+ el('h3', { class: 'fd-h3', text: 'Windows' }),
+ el('p', { text: 'If SmartScreen shows "Windows protected your PC", choose More info, then Run anyway. Compare the file\'s SHA-256 with the one on this page first: in PowerShell, Get-FileHash <file>.' }),
+ );
+ }
+ if (unsigned.has('linux')) {
+ body.append(
+ el('h3', { class: 'fd-h3', text: 'Linux' }),
+ el('p', { text: 'Make the AppImage executable with chmod +x and run it, or install the .deb with sudo apt install ./<file>.deb. Check the download first with sha256sum.' }),
+ );
+ }
+ details.hidden = unsigned.size === 0;
+}
+
+// ── Screens ─────────────────────────────────────────────────────────────────
+
+function initShots() {
+ const tabs = [...document.querySelectorAll('.fd-tab')];
+ const panel = $('#fdShotImg');
+ const img = $('img', panel);
+ const caption = $('#fdShotCaption');
+
+ // Warm the cache so switching tabs never flashes an empty frame.
+ for (const s of Object.values(SHOTS)) {
+ const pre = new Image();
+ pre.decoding = 'async';
+ pre.src = s.src;
+ }
+
+ function select(tab, focus = false) {
+ const shot = SHOTS[tab.dataset.shot];
+ for (const t of tabs) {
+ const on = t === tab;
+ t.setAttribute('aria-selected', String(on));
+ t.tabIndex = on ? 0 : -1;
+ }
+ panel.setAttribute('aria-labelledby', tab.id);
+ panel.classList.add('is-swapping');
+ img.onload = () => panel.classList.remove('is-swapping');
+ img.src = shot.src;
+ img.alt = shot.alt;
+ caption.textContent = shot.caption;
+ if (img.complete) panel.classList.remove('is-swapping');
+ if (focus) tab.focus();
+ }
+
+ tabs.forEach((tab, i) => {
+ tab.addEventListener('click', () => select(tab));
+ tab.addEventListener('keydown', (e) => {
+ let next = -1;
+ if (e.key === 'ArrowRight') next = (i + 1) % tabs.length;
+ else if (e.key === 'ArrowLeft') next = (i - 1 + tabs.length) % tabs.length;
+ else if (e.key === 'Home') next = 0;
+ else if (e.key === 'End') next = tabs.length - 1;
+ if (next < 0) return;
+ e.preventDefault();
+ select(tabs[next], true);
+ });
+ });
+}
+
+function initCopy() {
+ for (const btn of document.querySelectorAll('[data-copy]')) {
+ btn.addEventListener('click', () => {
+ const target = $(btn.dataset.copy);
+ if (target) void copyText(target.textContent.trim(), 'Commands copied');
+ });
+ }
+}
+
+async function init() {
+ const root = $('#fdGet');
+ renderLoading(root);
+ const result = await loadRelease();
+ if (result.status === 'ok') renderReady(root, result.release);
+ else if (result.status === 'unpublished') renderUnpublished(root);
+ else renderError(root, result.message);
+}
+
+initShots();
+initCopy();
+void init();
diff --git a/tests/forge-desktop-release.test.js b/tests/forge-desktop-release.test.js
new file mode 100644
index 000000000..6308751fc
--- /dev/null
+++ b/tests/forge-desktop-release.test.js
@@ -0,0 +1,80 @@
+import { describe, expect, it } from 'vitest';
+import { detectPlatform, formatBytes, isUsableRelease, pickPrimary } from '../src/forge-desktop-release.js';
+
+const SHA = 'a'.repeat(64);
+const file = (platform, kind, primary = false) => ({
+ platform,
+ arch: platform === 'mac' ? 'arm64' : 'x64',
+ kind,
+ label: kind,
+ primary,
+ name: `three.ws-Forge-0.5.0-${platform}.${kind}`,
+ url: `https://three.ws/releases/forge/0.5.0/three.ws-Forge-0.5.0-${platform}.${kind}`,
+ size: 210_000_000,
+ sha256: SHA,
+ signed: false,
+});
+
+const FILES = [file('mac', 'zip'), file('mac', 'dmg', true), file('win', 'portable'), file('win', 'nsis', true), file('linux', 'deb'), file('linux', 'appimage', true)];
+
+describe('detectPlatform', () => {
+ it('prefers client hints', () => {
+ expect(detectPlatform({ userAgentData: { platform: 'macOS', mobile: false }, userAgent: 'Windows NT' })).toBe('mac');
+ expect(detectPlatform({ userAgentData: { platform: 'Windows', mobile: false } })).toBe('win');
+ expect(detectPlatform({ userAgentData: { platform: 'Linux', mobile: false } })).toBe('linux');
+ expect(detectPlatform({ userAgentData: { platform: 'Android', mobile: true } })).toBe('other');
+ expect(detectPlatform({ userAgentData: { platform: 'Chrome OS', mobile: false } })).toBe('other');
+ });
+
+ it('falls back to the user agent string', () => {
+ expect(detectPlatform({ userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Gecko/20100101 Firefox/131.0' })).toBe('win');
+ expect(detectPlatform({ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6) AppleWebKit/605.1.15 Safari/605.1.15', maxTouchPoints: 0 })).toBe('mac');
+ expect(detectPlatform({ userAgent: 'Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0' })).toBe('linux');
+ });
+
+ it('treats phones, tablets, iPadOS and ChromeOS as other', () => {
+ expect(detectPlatform({ userAgent: 'Mozilla/5.0 (Linux; Android 14; Pixel 8) Mobile Safari/537.36' })).toBe('other');
+ expect(detectPlatform({ userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) Mobile/15E148' })).toBe('other');
+ expect(detectPlatform({ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Safari/605.1.15', maxTouchPoints: 5 })).toBe('other');
+ expect(detectPlatform({ userAgent: 'Mozilla/5.0 (X11; CrOS x86_64 15917.0.0) Chrome/129.0' })).toBe('other');
+ });
+});
+
+describe('pickPrimary', () => {
+ it('offers each platform its primary artifact', () => {
+ expect(pickPrimary(FILES, 'mac').kind).toBe('dmg');
+ expect(pickPrimary(FILES, 'win').kind).toBe('nsis');
+ expect(pickPrimary(FILES, 'linux').kind).toBe('appimage');
+ });
+
+ it('falls back to any file for the platform, and to nothing for other', () => {
+ expect(pickPrimary([file('linux', 'deb')], 'linux').kind).toBe('deb');
+ expect(pickPrimary(FILES, 'other')).toBeNull();
+ expect(pickPrimary([file('win', 'nsis', true)], 'mac')).toBeNull();
+ });
+});
+
+describe('formatBytes', () => {
+ it('prints human sizes', () => {
+ expect(formatBytes(0)).toBe('');
+ expect(formatBytes(500)).toBe('1 KB');
+ expect(formatBytes(52 * 1024 * 1024)).toBe('52.0 MB');
+ expect(formatBytes(210_000_000)).toBe('200 MB');
+ expect(formatBytes(3 * 1024 ** 3)).toBe('3.00 GB');
+ });
+});
+
+describe('isUsableRelease', () => {
+ it('accepts a release.json the pipeline writes', () => {
+ expect(isUsableRelease({ schema: 1, version: '0.5.0', files: FILES })).toBe(true);
+ });
+
+ it('rejects empty, malformed or unsafe feeds', () => {
+ expect(isUsableRelease(null)).toBe(false);
+ expect(isUsableRelease({ version: '0.5.0', files: [] })).toBe(false);
+ expect(isUsableRelease({ files: FILES })).toBe(false);
+ expect(isUsableRelease({ version: '0.5.0', files: [{ ...FILES[0], sha256: 'abc' }] })).toBe(false);
+ expect(isUsableRelease({ version: '0.5.0', files: [{ ...FILES[0], url: 'javascript:alert(1)' }] })).toBe(false);
+ expect(isUsableRelease({ version: '0.5.0', files: [{ ...FILES[0], platform: 'beos' }] })).toBe(false);
+ });
+});
diff --git a/vercel.json b/vercel.json
index 66fa66ecc..e5cf9daa2 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1215,6 +1215,10 @@
"src": "/modly/?",
"dest": "/modly.html"
},
+ {
+ "src": "/forge-desktop/?",
+ "dest": "/forge-desktop.html"
+ },
{
"src": "/cad/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})/?",
"dest": "/cad.html"
diff --git a/vite.config.js b/vite.config.js
index 2e4ef65ef..9b6f4238a 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -835,6 +835,7 @@ const appConfig = {
diorama: resolve(__dirname, 'pages/diorama.html'),
cad: resolve(__dirname, 'pages/cad.html'),
modly: resolve(__dirname, 'pages/modly.html'),
+ 'forge-desktop': resolve(__dirname, 'pages/forge-desktop.html'),
receipts: resolve(__dirname, 'pages/receipts.html'),
fits: resolve(__dirname, 'pages/fits.html'),
viability: resolve(__dirname, 'pages/viability.html'),
@@ -1732,6 +1733,8 @@ const appConfig = {
'/cad/': resolve(root, 'pages/cad.html'),
'/modly': resolve(root, 'pages/modly.html'),
'/modly/': resolve(root, 'pages/modly.html'),
+ '/forge-desktop': resolve(root, 'pages/forge-desktop.html'),
+ '/forge-desktop/': resolve(root, 'pages/forge-desktop.html'),
'/trader': resolve(root, 'pages/trader.html'),
'/trader/': resolve(root, 'pages/trader.html'),
'/trade-rooms': resolve(root, 'pages/trade-room.html'),