Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Separate downloads showcase and docs with shared navigation

Nguyen Xuan And7b6160bba12
diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md
index 395df693..0c2a5b88 100644
--- a/THIRD-PARTY-NOTICES.md
+++ b/THIRD-PARTY-NOTICES.md
@@ -51,3 +51,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+## Simple Icons (package-manager logos)
+
+The npm, pnpm, Yarn and Bun SVG marks are sourced from Simple Icons and distributed under CC0-1.0. See public/licenses/simple-icons.txt. Brand marks remain subject to their respective trademark rights.
diff --git a/docs.html b/docs.html
index 781fde9c..61bcb00f 100644
--- a/docs.html
+++ b/docs.html
@@ -3,13 +3,11 @@
<head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="description" content="67.js documentation: scenes, materials, cameras, animation, GLB assets, CPU/GPU media export and AI agent workflows."/><title>Documentation · 67.js</title><link rel="icon" href="/favicon.svg"/></head>
<body class="documentation">
<a class="skip-link" href="#content">Skip to content</a>
-<aside class="navigation">
+<header class="navigation">
<a class="brand" href="/">67<span>.js</span></a>
- <p class="library-description">By CodePawl</p>
<span class="version" data-release-version>Loading release</span>
- <nav aria-label="Library"><a href="/">Showcase</a><a href="/docs.html" aria-current="page">Documentation</a><a href="/#downloads">Downloads</a></nav>
- <p class="navigation-note"><a href="https://codepawl.com">A CodePawl project ↗</a></p>
-</aside>
+ <nav aria-label="Library"><a href="/downloads.html">Downloads</a><a href="/">Showcase</a><a href="/docs.html" aria-current="page">Docs</a></nav>
+</header>
<main id="content" class="docs docs-page">
<aside class="docs-sidebar" aria-label="Documentation navigation">
<a class="docs-title" href="#install">Documentation</a>
diff --git a/downloads.html b/downloads.html
new file mode 100644
index 00000000..a417b76c
--- /dev/null
+++ b/downloads.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="theme-color" content="#191d22" />
+ <meta name="description" content="Install 67.js using npm, pnpm, Yarn or Bun. Find the current published release, source and documentation." />
+ <title>Downloads — 67.js</title>
+ <link rel="icon" href="/favicon.svg" />
+ </head>
+ <body>
+ <a class="skip-link" href="#content">Skip to content</a>
+ <header class="navigation">
+ <a class="brand" href="/" aria-label="67.js home">67<span>.js</span></a>
+ <span class="version" data-release-version>Loading release</span>
+ <nav aria-label="Library">
+ <a href="/downloads.html" aria-current="page">Downloads</a>
+ <a href="/">Showcase</a>
+ <a href="/docs.html">Docs</a>
+ </nav>
+ </header>
+ <main id="content" class="downloads-page">
+ <section id="downloads" class="downloads" aria-labelledby="downloads-title">
+ <div class="section-heading"><h1 id="downloads-title">Downloads</h1><span data-release-version>Loading release</span></div>
+ <p>Choose your package manager and install the current release</p>
+ <div class="package-install">
+ <div class="package-managers" role="group" aria-label="Package manager">
+ <button data-package-manager="npm" aria-pressed="true"><span class="package-logo package-logo-npm" aria-hidden="true"></span><span>npm</span></button>
+ <button data-package-manager="pnpm" aria-pressed="false"><span class="package-logo package-logo-pnpm" aria-hidden="true"></span><span>pnpm</span></button>
+ <button data-package-manager="yarn" aria-pressed="false"><span class="package-logo package-logo-yarn" aria-hidden="true"></span><span>Yarn</span></button>
+ <button data-package-manager="bun" aria-pressed="false"><span class="package-logo package-logo-bun" aria-hidden="true"></span><span>Bun</span></button>
+ </div>
+ <div class="command-row"><code data-install-command>Loading the release command…</code><button data-copy-install disabled>Copy command</button></div>
+ <div class="release-feedback"><p data-release-status role="status">Loading release information</p><button data-release-retry hidden>Retry</button></div>
+ <p class="package-note">The alias keeps imports short: <code>import { Renderer67 } from '67js'</code></p>
+ <div class="package-links"><a href="https://www.npmjs.com/package/@codepawlhq/67js" data-icon="package">View on npm</a><a href="https://github.com/anxuanng/67.js" data-icon="github">Source on GitHub</a><a href="/docs.html#getting-started" data-icon="book">Build your first scene</a></div>
+ </div>
+ <div class="release-links"><a href="./docs.html">Documentation</a><a href="./logo.svg" download>Logo SVG</a><a href="./changelog.md">Changelog</a><span data-release-commit>Release commit</span><a data-release-api aria-disabled="true">API reference ↗</a></div>
+ </section>
+ </main>
+ <script type="module" src="/src/home.js"></script>
+ </body>
+</html>
diff --git a/index.html b/index.html
index 2d1c4599..e61ed9a4 100644
--- a/index.html
+++ b/index.html
@@ -10,36 +10,18 @@
</head>
<body>
<a class="skip-link" href="#content">Skip to content</a>
- <aside class="navigation">
+ <header class="navigation">
<a class="brand" href="/" aria-label="67.js home">67<span>.js</span></a>
- <p class="library-description">Graphics toolkit by CodePawl</p>
<span class="version" data-release-version>Loading release</span>
<nav aria-label="Library">
- <a href="/#examples" aria-current="page">Showcase</a>
- <a href="./docs.html">Documentation</a>
- <a href="/#downloads">Downloads</a>
+ <a href="/downloads.html">Downloads</a>
+ <a href="/" aria-current="page">Showcase</a>
+ <a href="/docs.html">Docs</a>
</nav>
- <p class="navigation-note"><a href="https://codepawl.com">A CodePawl project ↗</a></p>
- </aside>
+ </header>
<main id="content">
<header class="introduction"><div><h1>Your 3D scene,<br />from browser to film</h1><p>67.js brings browser 3D, animation and image/video export into one workflow. Create interactive experiences and export the same scene as images or video</p><div class="hero-actions"><a href="./object.html" data-icon="cube">Try the object studio</a><a href="./docs.html#install" data-icon="code">Build your first scene</a></div></div></header>
- <section id="downloads" class="downloads" aria-labelledby="downloads-title">
- <div class="section-heading"><h2 id="downloads-title">Downloads</h2><span data-release-version>Loading release</span></div>
- <p>Choose your package manager and install the current release</p>
- <div class="package-install">
- <div class="package-managers" role="group" aria-label="Package manager">
- <button data-package-manager="npm" aria-pressed="true">npm</button>
- <button data-package-manager="pnpm" aria-pressed="false">pnpm</button>
- <button data-package-manager="yarn" aria-pressed="false">Yarn</button>
- <button data-package-manager="bun" aria-pressed="false">Bun</button>
- </div>
- <div class="command-row"><code data-install-command>Loading the release command…</code><button data-copy-install disabled>Copy command</button></div>
- <div class="release-feedback"><p data-release-status role="status">Loading release information</p><button data-release-retry hidden>Retry</button></div>
- <p class="package-note">The alias keeps imports short: <code>import { Renderer67 } from '67js'</code></p>
- <div class="package-links"><a href="https://www.npmjs.com/package/@codepawlhq/67js" data-icon="package">View on npm</a><a href="https://github.com/anxuanng/67.js" data-icon="github">Source on GitHub</a><a href="/docs.html#getting-started" data-icon="book">Build your first scene</a></div>
- </div>
- <div class="release-links"><a href="./docs.html">Documentation</a><a href="./logo.svg" download>Logo SVG</a><a href="./changelog.md">Changelog</a><span data-release-commit>Release commit</span><a data-release-api aria-disabled="true">API reference ↗</a></div>
- </section>
+
<section class="feature-showcase live-showcase" aria-label="Interactive 3D preview">
<canvas id="home-preview" tabindex="0" aria-label="Clockwork 3D model. Drag or use arrow keys to rotate. Use plus and minus to zoom."></canvas>
<p id="home-preview-status" role="status">Loading 3D preview…</p>
diff --git a/public/licenses/simple-icons.txt b/public/licenses/simple-icons.txt
new file mode 100644
index 00000000..70d4a7b6
--- /dev/null
+++ b/public/licenses/simple-icons.txt
@@ -0,0 +1,30 @@
+# CC0 1.0 Universal
+
+## Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an “owner”) of an original work of authorship and/or a database (each, a “Work”).
+
+Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works (“Commons”) that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the “Affirmer”), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights (“Copyright and Related Rights”). Copyright and Related Rights include, but are not limited to, the following:
+ 1. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
+ 2. moral rights retained by the original author(s) and/or performer(s);
+ 3. publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work;
+ 4. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(i), below;
+ 5. rights protecting the extraction, dissemination, use and reuse of data in a Work;
+ 6. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
+ 7. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer’s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer’s express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer’s express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer’s Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “License”). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer’s express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+ 1. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
+ 2. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
+ 3. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person’s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
+ 4. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
+
+For more information, please see <https://creativecommons.org/publicdomain/zero/1.0>.
diff --git a/public/logos/bun.svg b/public/logos/bun.svg
new file mode 100644
index 00000000..c9090d5f
--- /dev/null
+++ b/public/logos/bun.svg
@@ -0,0 +1 @@
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Bun</title><path d="M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"/></svg>
\ No newline at end of file
diff --git a/public/logos/npm.svg b/public/logos/npm.svg
new file mode 100644
index 00000000..e04468d9
--- /dev/null
+++ b/public/logos/npm.svg
@@ -0,0 +1 @@
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>npm</title><path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/></svg>
\ No newline at end of file
diff --git a/public/logos/pnpm.svg b/public/logos/pnpm.svg
new file mode 100644
index 00000000..b83d3832
--- /dev/null
+++ b/public/logos/pnpm.svg
@@ -0,0 +1 @@
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>pnpm</title><path d="M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM2 2h3.5v3.5H2zm8.25 0h3.498v3.5H10.25zm8.25 0H22v3.5h-3.5zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zm2 2H22v3.5h-3.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z"/></svg>
\ No newline at end of file
diff --git a/public/logos/yarn.svg b/public/logos/yarn.svg
new file mode 100644
index 00000000..072d5f4d
--- /dev/null
+++ b/public/logos/yarn.svg
@@ -0,0 +1 @@
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Yarn</title><path d="M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z"/></svg>
\ No newline at end of file
diff --git a/scripts/smoke-navigation.mjs b/scripts/smoke-navigation.mjs
index e2698ec6..b1e345f7 100644
--- a/scripts/smoke-navigation.mjs
+++ b/scripts/smoke-navigation.mjs
@@ -12,10 +12,12 @@ try {
const page = await browser.newPage({ reducedMotion: 'reduce' });
for (const colorScheme of ['light', 'dark']) {
await page.emulateMedia({ colorScheme });
- for (const route of ['/', '/docs.html', '/getting-started.html']) {
+ for (const route of ['/', '/downloads.html', '/docs.html', '/getting-started.html']) {
await page.goto(origin + route);
for (const width of [320, 390, 580, 1440]) {
await page.setViewportSize({ width, height: 1000 });
+ const linkPositions = await page.locator('.navigation nav a').evaluateAll(links => links.map(link => link.getBoundingClientRect().top));
+ assert.ok(linkPositions.every(top => Math.abs(top - linkPositions[0]) < 1), 'Library navigation wraps to another row');
const contrast = await page.locator('.navigation nav a[aria-current]').evaluate(link => {
const channels = color => color.match(/[\d.]+/g).map(Number);
const backgrounds = [];
diff --git a/scripts/smoke-site.mjs b/scripts/smoke-site.mjs
index 1772551b..ce58d6d4 100644
--- a/scripts/smoke-site.mjs
+++ b/scripts/smoke-site.mjs
@@ -17,7 +17,7 @@ try {
});
});
page.on('pageerror', error => errors.push(error.message));
- for (const route of ['/', '/docs.html', '/getting-started.html', '/object.html', '/motion.html', '/nature.html', '/assets.html', '/view2d.html', '/film.html']) {
+ for (const route of ['/', '/downloads.html', '/docs.html', '/getting-started.html', '/object.html', '/motion.html', '/nature.html', '/assets.html', '/view2d.html', '/film.html']) {
await page.goto(origin + route);
if (route.includes('object')) await page.waitForFunction(() => window.__studio?.renderer);
if (route.includes('motion')) await page.waitForFunction(() => window.__motion?.renderer);
@@ -47,28 +47,18 @@ try {
report.layouts.push({ route,width,overflow });
}
await page.setViewportSize({ width:1440,height:1000 });
- if (['/', '/docs.html', '/getting-started.html'].includes(route)) {
+ if (['/', '/downloads.html', '/docs.html', '/getting-started.html'].includes(route)) {
+ assert.equal(await page.locator('aside.navigation').count(), 0);
+ assert.deepEqual(await page.locator('.navigation nav .nav-label').allTextContents(), ['Downloads', 'Showcase', 'Docs']);
+ assert.equal(await page.locator('.navigation nav a[aria-current="page"]').count(), 1);
assert.equal(await page.locator('a[href$="llms.txt"]').count(), 0, 'Machine guide appears in public UI');
assert.equal(await page.locator('.navigation a[href*="getting-started.html"]').count(), 0, 'Getting started still has separate navigation');
}
if (route === '/') {
assert.equal(await page.locator('video').count(), 0, 'Homepage still embeds video');
- assert.ok(await page.evaluate(() => document.querySelector('#downloads').compareDocumentPosition(document.querySelector('.live-showcase')) & Node.DOCUMENT_POSITION_FOLLOWING));
- assert.equal(await page.locator('[data-package-manager]').count(), 4);
- assert.equal(await page.locator('[data-release-tarball], [data-release-module]').count(), 0);
+ assert.equal(await page.locator('#downloads').count(), 0, 'Downloads still merged into Showcase');
const scenePaths = await page.locator('.gallery .example').evaluateAll(links => links.map(link => new URL(link.href).pathname));
assert.equal(new Set(scenePaths).size, scenePaths.length, 'Showcase repeats the same scene');
- await page.locator('.navigation a[href="/#downloads"]').click();
- await page.waitForFunction(() => document.querySelector('.navigation a[aria-current]')?.getAttribute('href') === '/#downloads');
- for (const [manager, prefix] of [['npm', 'npm install'], ['pnpm', 'pnpm add'], ['yarn', 'yarn add'], ['bun', 'bun add']]) {
- await page.locator(`[data-package-manager="${manager}"]`).click();
- const expectedCommand = await page.evaluate(prefix => window.__home.state.release.installCommand.replace(/^npm install/, prefix), prefix);
- assert.equal(await page.locator('[data-install-command]').textContent(), expectedCommand);
- assert.equal(await page.locator(`[data-package-manager="${manager}"]`).getAttribute('aria-pressed'), 'true');
- await page.locator('[data-copy-install]').click();
- assert.equal(await page.evaluate(() => window.__copiedText), expectedCommand);
- }
- report.interactions.push('Unified package managers, unique showcase scenes and synchronized Downloads navigation');
await page.locator('#home-preview').scrollIntoViewIfNeeded();
await page.waitForFunction(() => window.__homePreview?.renderer && window.__homePreview.state.visible);
const initialDistance = await page.evaluate(() => window.__homePreview.state.distance);
@@ -88,6 +78,21 @@ try {
await page.screenshot({ path:'artifacts/home-live-preview.png' });
report.interactions.push('Live homepage 3D, keyboard rotation, zoom, reset and animation');
}
+ if (route === '/downloads.html') {
+ await page.waitForFunction(() => window.__home.state.status === 'ready');
+ assert.equal(await page.locator('.package-logo').count(), 4);
+ assert.equal(await page.locator('[data-package-manager]').count(), 4);
+ assert.equal(await page.locator('[data-release-tarball], [data-release-module]').count(), 0);
+ for (const [manager, prefix] of [['npm', 'npm install'], ['pnpm', 'pnpm add'], ['yarn', 'yarn add'], ['bun', 'bun add']]) {
+ await page.locator(`[data-package-manager="${manager}"]`).click();
+ const expectedCommand = await page.evaluate(prefix => window.__home.state.release.installCommand.replace(/^npm install/, prefix), prefix);
+ assert.equal(await page.locator('[data-install-command]').textContent(), expectedCommand);
+ assert.equal(await page.locator(`[data-package-manager="${manager}"]`).getAttribute('aria-pressed'), 'true');
+ await page.locator('[data-copy-install]').click();
+ assert.equal(await page.evaluate(() => window.__copiedText), expectedCommand);
+ }
+ report.interactions.push('Separate Downloads page with four branded package managers and command copying');
+ }
if (route === '/getting-started.html') {
assert.match(page.url(), /\/docs(?:\.html)?#install$/);
}
@@ -106,6 +111,9 @@ try {
assert.match(page.url(),/models-and-ai-agents/);
await page.locator('#doc-toc a[href="#getting-started"]').click();
assert.equal(await page.locator('#getting-started ol li').count(), 3);
+ const headerBounds = await page.locator('.navigation').boundingBox();
+ const copyBounds = await page.locator('#copy-doc-page').boundingBox();
+ assert.ok(copyBounds.y >= headerBounds.y + headerBounds.height, 'Sticky header covers Copy page');
assert.ok(await page.locator('.hljs-keyword').count() > 0);
assert.ok(await page.locator('.code-block').count() >= 2);
assert.equal(await page.locator('#copy-doc-page').count(), 1);
diff --git a/src/brand.js b/src/brand.js
index 0e3aa1ee..efea7443 100644
--- a/src/brand.js
+++ b/src/brand.js
@@ -21,7 +21,7 @@ const paths = {
package:'M3 7 12 2l9 5v10l-9 5-9-5V7Zm0 0 9 5 9-5M12 12v10M7.5 4.5l9 5v4',
github:'M9 19c-4 1-4-2-6-2m12 5v-4a3.5 3.5 0 0 0-1-2.7c3.3-.4 6.7-1.6 6.7-7.3a5.7 5.7 0 0 0-1.5-4 5.3 5.3 0 0 0-.1-4S18 0 15 2a14 14 0 0 0-7 0C5 0 3.9 0 3.9 0a5.3 5.3 0 0 0-.1 4 5.7 5.7 0 0 0-1.5 4c0 5.7 3.4 6.9 6.7 7.3A3.5 3.5 0 0 0 8 18v4',
};
-const labels = { Examples:'cube', Showcase:'cube', Documentation:'book', 'Getting started':'book', Downloads:'download', 'Package source':'code', Object:'cube', Nature:'leaf', Film:'film', Animation:'film', 'Save PNG':'image', 'Export GLB':'download' };
+const labels = { Examples:'cube', Showcase:'cube', Docs: 'book', Documentation:'book', 'Getting started':'book', Downloads:'download', 'Package source':'code', Object:'cube', Nature:'leaf', Film:'film', Animation:'film', 'Save PNG':'image', 'Export GLB':'download' };
for (const element of document.querySelectorAll('nav a, [data-icon], #save-image, #export')) {
const name = element.dataset.icon ?? labels[element.textContent.trim().replace(/[↓↗]/g, '').trim()];
if (!paths[name]) continue;
diff --git a/src/documentation.css b/src/documentation.css
index ab0105fe..1a31266b 100644
--- a/src/documentation.css
+++ b/src/documentation.css
@@ -1,6 +1,6 @@
.documentation { --syntax-string:#9dd1b6; --syntax-keyword:#c8b1ed; --syntax-number:#e8bd88; --syntax-comment:#a0a0a0; --syntax-name:#acc7ed; }
-.documentation .docs-page { display:grid; grid-template-columns:244px minmax(0,780px); gap:52px; max-width:1500px; padding:36px 40px 64px; }
-.docs-sidebar { position:sticky; top:28px; align-self:start; max-height:calc(100vh - 56px); overflow-y:auto; padding:0 5px 12px; }
+.documentation .docs-page { display:grid; grid-template-columns:244px minmax(0,780px); justify-content:center; gap:52px; max-width:1440px; margin-inline:auto; padding:36px 40px 64px; }
+.docs-sidebar { position:sticky; top:calc(var(--navigation-height,80px) + 24px); align-self:start; max-height:calc(100vh - var(--navigation-height,80px) - 48px); overflow-y:auto; padding:0 5px 12px; }
.docs-title { display:block; font-size:21px; font-weight:600; letter-spacing:-.5px; margin:5px 0 25px; }
.documentation .docs-search { display:block; margin:0; }
.docs-search > span { display:block; font-size:13px; margin-bottom:9px; color:var(--muted); }
@@ -24,7 +24,7 @@
.documentation .doc-copy-status { margin:0 0 12px; font-size:12px; color:var(--muted); }
.doc-copy-status:empty { display:none; }
.doc-copy-fallback { width:100%; min-height:160px; margin-bottom:24px; padding:14px; background:var(--bg); color:var(--text); border:1px solid var(--border); border-radius:var(--radius); font:13px/1.6 ui-monospace,Consolas,monospace; }
-.documentation #doc-article section { margin:0; }
+.documentation #doc-article section { margin:0; scroll-margin-top:calc(var(--navigation-height,80px) + 72px); }
.documentation #doc-article h1 { font-size:clamp(30px,3vw,42px); font-weight:600; letter-spacing:-1.2px; margin:0 0 28px; line-height:1.15; }
.documentation #doc-article p { color:var(--text); font-size:15px; line-height:1.8; margin:0 0 23px; }
.documentation #doc-article p code, .documentation #doc-article li code { background:var(--surface); padding:2px 5px; border-radius:5px; font-size:.88em; overflow-wrap:anywhere; }
diff --git a/src/documentation.js b/src/documentation.js
index c92ae58e..904f5c14 100644
--- a/src/documentation.js
+++ b/src/documentation.js
@@ -195,7 +195,7 @@ function openTopic(focus = false) {
article.replaceChildren(section);
if (currentTopic.id === 'install') {
const managerLink = document.createElement('p');
- managerLink.innerHTML = `<a href="/#downloads">Choose a package manager and get the current release ${icon('arrow')}</a>`;
+ managerLink.innerHTML = `<a href="/downloads.html">Choose a package manager and get the current release ${icon('arrow')}</a>`;
section.append(managerLink);
}
const index = topics.indexOf(currentTopic);
diff --git a/src/home.css b/src/home.css
index 02efeece..3e7bc0fe 100644
--- a/src/home.css
+++ b/src/home.css
@@ -10,7 +10,7 @@ a[aria-disabled='true'] { opacity: .5; pointer-events: none; }
:focus-visible { outline: 2px solid #a9d7c7; outline-offset: 4px; }
.skip-link { position: fixed; left: 16px; top: 12px; padding: 12px; z-index: 10; background: #edf0f2; color: #191d22; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
-.navigation { position: fixed; inset: 0 auto 0 0; width: 218px; padding: 36px 26px; background: #191d22; display: flex; flex-direction: column; align-items: flex-start; }
+.navigation { position:sticky; top:0; z-index:5; width:100%; padding:18px max(24px, calc((100vw - 1352px) / 2)); display:flex; flex-direction:row; align-items:center; gap:20px; }
.brand { font-size: 37px; font-weight: 650; letter-spacing: -2px; line-height: 1; }
.brand span { font-weight: 400; color: #b7c1c8; }
.library-description { margin: 13px 0 17px; font-size: 13px; color: #b8c1c7; }
@@ -20,7 +20,7 @@ nav a { font-size: 14px; padding: 11px 12px; margin-left: -12px; border-radius:
nav a:hover, nav a[aria-current] { background: #edf0f20a; }
nav a[aria-current] { color: #b8e6d2; }
.navigation-note { margin: auto 0 0; font-size: 12px; line-height: 1.8; color: #a3aeb7; }
-main { max-width: 1500px; margin-left: 218px; padding: 42px 44px 60px; }
+main { max-width: 1500px; margin: 0 auto; padding: 42px 44px 60px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.2; font-weight: 550; letter-spacing: -1.2px; margin-bottom: 14px; }
h2 { font-size: 21px; font-weight: 550; letter-spacing: -.5px; margin-bottom: 24px; }
@@ -67,7 +67,7 @@ code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.docs .install { margin-top: 24px; margin-bottom: 30px; }
@media (max-width: 1100px) { main { padding: 34px 30px 50px; } .introduction { align-items: flex-start; flex-direction: column; gap: 18px; } }
@media (max-width: 760px) {
- .navigation { position: static; width: auto; padding: 23px 22px 18px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
+ .navigation { padding:16px 22px; display:grid; grid-template-columns:1fr auto; gap:12px; }
.brand { font-size: 30px; }
.library-description, .navigation-note { display: none; }
.version { align-self: center; }
@@ -92,8 +92,8 @@ code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
/* Rounded surfaces and a static pixel dither keep the shared CodePawl theme. */
:root { color:var(--text); background:var(--window); }
-.navigation { background-color:var(--bg); background-image:var(--dither); border-right:1px solid var(--border); }
-.navigation nav { gap:6px; }
+.navigation { background-color:var(--bg); background-image:var(--dither); border:0; }
+.navigation nav { flex-direction:row; width:auto; margin:0 0 0 auto; gap:6px; }
.navigation nav a { display:flex; align-items:center; min-height:44px; padding:12px 14px; margin-left:0; border-radius:var(--radius); }
.navigation nav a:hover, .navigation nav a[aria-current] { background-color:var(--surface); background-image:var(--dither); }
main { max-width:1440px; }
@@ -133,7 +133,27 @@ button:hover { background:var(--border); }
.preview-tools button { min-height:40px; background:#2f2f2f; color:#ececec; }
.preview-tools button[aria-pressed=true] { background:#ececec; color:#171717; }
#home-preview-status { position:absolute; top:20px; left:20px; right:20px; margin:0; font-size:13px; color:#ececec; pointer-events:none; }
-main > .downloads { margin:28px 0 36px; }
+.downloads-page { max-width:1000px; }
+.downloads-page > .downloads { margin:20px 0; }
+.downloads-page .section-heading h1 { margin-bottom:16px; }
+.downloads-page .package-install { margin:26px 0; }
+.package-managers button { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:44px; }
+.package-logo { display:inline-block; flex:none; width:20px; height:20px; background:currentColor; mask:center / contain no-repeat; }
+.package-logo-npm { mask-image:url('/logos/npm.svg'); }
+.package-logo-pnpm { mask-image:url('/logos/pnpm.svg'); }
+.package-logo-yarn { mask-image:url('/logos/yarn.svg'); }
+.package-logo-bun { mask-image:url('/logos/bun.svg'); }
+body:has(.navigation) { --navigation-height:80px; }
+@media (max-width:760px) {
+ body:has(.navigation) { --navigation-height:120px; }
+ .navigation nav { grid-column:1 / -1; justify-content:center; width:100%; margin:0; gap:4px; }
+ .navigation nav a { padding:10px 12px; }
+}
+@media (max-width:440px) {
+ .navigation nav { flex-wrap:nowrap; }
+ .navigation nav a { padding:10px 8px; gap:6px; font-size:12px; white-space:nowrap; }
+ .package-managers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
+}
.showcase-caption { display:flex; justify-content:space-between; flex-wrap:wrap; gap:16px; padding:22px 24px; color:#ececec; }
.showcase-caption p { margin:6px 0 0; color:#b4b4b4; }
.showcase-caption a { align-self:center; border-radius:var(--radius); padding:12px 18px; background:#ececec; color:#171717; font-size:14px; }
@@ -154,7 +174,7 @@ main > .downloads { margin:28px 0 36px; }
#doc-article a { text-decoration:underline; }
.table-scroll { overflow-x:auto; }
table { border-collapse:collapse; width:100%; font-size:13px; line-height:1.6; margin:20px 0; }
-td, th { text-align:left; padding:12px; border-bottom:1px solid var(--border); vertical-align:top; }
+td, th { text-align:left; padding:12px; border-bottom:0; vertical-align:top; }
.docs pre { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:14px; padding:18px; overflow:visible; }
.docs pre code { display:block; min-width:0; overflow-x:auto; padding:6px 0; }
.docs ol { color:var(--muted); }
diff --git a/src/home.js b/src/home.js
index b4c078c9..d8863b47 100644
--- a/src/home.js
+++ b/src/home.js
@@ -111,51 +111,15 @@ document.querySelectorAll('[data-package-manager]').forEach(button => {
});
});
-const downloads = document.querySelector('#downloads');
-if (downloads) {
- const libraryLinks = [...document.querySelectorAll('.navigation nav a')];
- let navigationPending = false;
- function updateNavigation() {
- const bounds = downloads.getBoundingClientRect();
- const activeHash = bounds.top <= innerHeight * 0.6 && bounds.bottom > 0 ? '#downloads' : '#examples';
- for (const link of libraryLinks) {
- if (new URL(link.href).hash === activeHash) {
- link.setAttribute('aria-current', 'location');
- } else {
- link.removeAttribute('aria-current');
- }
- }
- navigationPending = false;
- }
- function scheduleNavigation() {
- if (navigationPending) return;
- navigationPending = true;
- requestAnimationFrame(updateNavigation);
- }
- function openHomeSection() {
- const target = document.getElementById(location.hash.slice(1));
- target?.scrollIntoView();
- scheduleNavigation();
+function redirectLegacyDownloads() {
+ if (['/', '/index.html'].includes(location.pathname) && location.hash === '#downloads') {
+ location.replace('/downloads.html');
}
- for (const link of libraryLinks) {
- const targetURL = new URL(link.href);
- if (!['#downloads', '#examples'].includes(targetURL.hash)) continue;
- link.addEventListener('click', event => {
- if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
- event.preventDefault();
- history.pushState(null, '', `/${targetURL.hash}`);
- openHomeSection();
- const section = document.getElementById(targetURL.hash.slice(1));
- section.setAttribute('tabindex', '-1');
- section.focus({ preventScroll: true });
- });
- }
- window.addEventListener('scroll', scheduleNavigation, { passive: true });
- window.addEventListener('resize', scheduleNavigation);
- window.addEventListener('hashchange', openHomeSection);
- window.addEventListener('popstate', openHomeSection);
- requestAnimationFrame(openHomeSection);
}
+
+redirectLegacyDownloads();
+window.addEventListener('hashchange', redirectLegacyDownloads);
+
document.querySelectorAll('.example img').forEach(image => {
image.addEventListener('error', () => {
image.alt = `${image.alt}. Preview unavailable. Open the example to explore it`;
diff --git a/vite.config.js b/vite.config.js
index 2249eb6e..192ba340 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -8,5 +8,5 @@ const headers = {
export default defineConfig({
server: { headers },
preview: { headers },
- build: { rolldownOptions: { input: { home: 'index.html', object: 'object.html', nature: 'nature.html', film: 'film.html', motion: 'motion.html', view2d: 'view2d.html', assets: 'assets.html', guide: 'getting-started.html', docs: 'docs.html' } } },
+ build: { rolldownOptions: { input: { home: 'index.html', downloads: 'downloads.html', object: 'object.html', nature: 'nature.html', film: 'film.html', motion: 'motion.html', view2d: 'view2d.html', assets: 'assets.html', guide: 'getting-started.html', docs: 'docs.html' } } },
});