diff --git a/website/.gitignore b/website/.gitignore new file mode 100644 index 000000000..b94707787 --- /dev/null +++ b/website/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ diff --git a/website/Caddyfile b/website/Caddyfile new file mode 100644 index 000000000..03a6ae77f --- /dev/null +++ b/website/Caddyfile @@ -0,0 +1,37 @@ +# Serves dist/ on Railway's $PORT. Fingerprinted CSS and JS are cached for a year, +# media for a week, and the page itself is always revalidated. +{ + admin off + auto_https off + persist_config off +} + +:{$PORT:8080} { + root * /srv + encode zstd gzip + + header { + X-Content-Type-Options nosniff + Referrer-Policy strict-origin-when-cross-origin + X-Frame-Options DENY + Permissions-Policy "interest-cohort=(), browsing-topics=(), camera=(), microphone=(), geolocation=()" + Content-Security-Policy "default-src 'self'; script-src 'self' {$CSP_SCRIPT}; style-src 'self' {$CSP_STYLE}; img-src 'self' data:; font-src 'self'; connect-src https://api.github.com https://raw.githubusercontent.com; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" + -Server + } + @assets path /assets/* + header @assets Cache-Control "public, max-age=31536000, immutable" + @media path /media/* /fonts/* /background.webp /og.png /favicon* /apple-touch-icon.png + header @media Cache-Control "public, max-age=604800" + @pages path / /index.html /404.html + header @pages Cache-Control "no-cache" + @legal path /LEGAL.md /fonts/*.txt + header @legal Content-Type "text/plain; charset=utf-8" + + file_server { + hide .csp-script .csp-style og.html + } + handle_errors { + rewrite * /404.html + file_server + } +} diff --git a/website/Dockerfile b/website/Dockerfile new file mode 100644 index 000000000..a5ae2f744 --- /dev/null +++ b/website/Dockerfile @@ -0,0 +1,18 @@ +# Railway builds this with the service's root directory set to `website`. +# Stage 1 renders dist/ from src/ and the README on main (no npm dependencies needed). +FROM node:22-alpine AS build +WORKDIR /site +COPY build.mjs ./ +COPY src ./src +COPY public ./public +COPY LEGAL.md ./ +ARG GITHUB_TOKEN +RUN node build.mjs + +# Stage 2 serves it with Caddy on $PORT. +FROM caddy:2-alpine +COPY Caddyfile /etc/caddy/Caddyfile +COPY --from=build /site/dist /srv +ENV PORT=8080 +# The Content-Security-Policy allows the page's inline script and style by the hashes the build wrote. +CMD ["sh", "-c", "CSP_SCRIPT=\"$(cat /srv/.csp-script)\" CSP_STYLE=\"$(cat /srv/.csp-style)\" exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile"] diff --git a/website/LEGAL.md b/website/LEGAL.md new file mode 100644 index 000000000..cfa47727c --- /dev/null +++ b/website/LEGAL.md @@ -0,0 +1,74 @@ +# The website's assets and their licences + +Every file the site serves, where it comes from and the terms it is used under. The build +copies this file to `/LEGAL.md` on the site. + +Horizon is not an official Minecraft product. It is not approved by or associated with +Mojang or Microsoft. Minecraft is a trademark of Mojang Synergies AB. + +## Code + +| File | Source | Licence | +| --- | --- | --- | +| `src/*.html`, `src/*.css`, `src/*.js`, `build.mjs`, `serve.mjs`, `scripts/*`, `Caddyfile`, `Dockerfile` | Written for this site | MIT, as the rest of Horizon ([LICENSE](https://github.com/ludovic111/horizon/blob/main/LICENSE)) | + +The site loads no third-party code at runtime: no frameworks, CDNs, analytics, trackers or +cookies. The only requests to other hosts are the browser's calls to `api.github.com` +(releases and patch notes) and `raw.githubusercontent.com` (the README's roadmap and +`launcher/links.json`), both on Horizon's own repository. + +## Fonts + +| File | Source | Licence | +| --- | --- | --- | +| `public/fonts/Geist-Regular.woff2`, `Geist-Medium.woff2`, `Geist-SemiBold.woff2`, `GeistMono-Regular.woff2` | Geist and Geist Mono, from `crates/horizon-theme/fonts` (converted from TTF to WOFF2) | SIL Open Font License 1.1, shipped as `public/fonts/OFL-Geist.txt` | +| `public/fonts/InstrumentSerif-Regular.woff2` | Instrument Serif, from `crates/horizon-theme/fonts` (converted from TTF to WOFF2) | SIL Open Font License 1.1, shipped as `public/fonts/OFL-InstrumentSerif.txt` | + +The fonts are self-hosted; nothing is fetched from a font service. + +## Icons and the social preview + +| File | Source | Licence | +| --- | --- | --- | +| `public/favicon.svg`, `public/favicon-32.png`, `public/apple-touch-icon.png` | Horizon's logo, `docs/media/logo.svg` (an original drawing of a sunset over blocks) | MIT, Horizon's original work | +| `public/og.png` | Rendered by `scripts/shots.mjs` from `public/og.html`: the Instrument Serif wordmark over `public/background.webp` | MIT for the layout; the fonts and background as listed here | + +No Minecraft logo or wordmark appears anywhere on the site, in images or as text styling. +GitHub and Discord appear only as plain text links, without their logos. + +## Background + +| File | Source | Licence | +| --- | --- | --- | +| `public/background.webp` | A crop of the frozen landscape Horizon renders behind its own title screen, cut from the interface-free part of `docs/media/menu-title.png` and blurred further (`scripts/assets.mjs`) | Horizon's rendering of a world generated by Horizon; the textures it draws are Mojang's, from the player's own copy of the game (see Screenshots) | + +The launcher's own background (`launcher/assets/background.jpg`, from backgrounds.supply) is +**not** used: its licence is unconfirmed. For the same reason the launcher's screenshots, +which show it, are not on the site. To use another background, replace +`public/background.webp` (one file; `og.png` is rendered from it). + +## Screenshots + +All captured in Horizon's Rust client, with vanilla resources prepared from the maintainer's +own copy of Minecraft: Java Edition 26.3, and no mods or shaders. Converted to WebP at 1600 +and 800 pixels wide by `scripts/assets.mjs`. + +| Files in `public/media/` | Source | What it shows | +| --- | --- | --- | +| `menu-title*.webp` | `docs/media/menu-title.png` | Horizon's own title screen (no Minecraft logo or splash text) | +| `menu-worlds*.webp` | `docs/media/menu-worlds.png` | Horizon's own world list | +| `menu-options*.webp` | `docs/media/menu-options.png` | Horizon's own options screen | +| `menu-pause*.webp` | `docs/media/menu-pause.png` | Horizon's own pause screen | +| `sunset*.webp`, `village*.webp`, `survival*.webp`, `nether*.webp`, `night*.webp`, `underwater*.webp` | `docs/media/*.jpg` | In-game views; none shows a Mojang logo or splash text | + +Horizon's interface in these images is Horizon's original work (MIT). The block, mob and +item textures and the HUD sprites drawn in them belong to Mojang and Microsoft; they are +shown as screenshots of the game, as the +[Minecraft Usage Guidelines](https://www.minecraft.net/en-us/usage-guidelines) allow for +fan websites about the game, with the disclaimer they require. The site offers no game +files: players need their own legally obtained copy of Minecraft: Java Edition. + +## Text + +The parity table and the roadmap are generated from Horizon's README, and the patch notes +come from Horizon's GitHub releases: Horizon's own text, MIT. diff --git a/website/README.md b/website/README.md new file mode 100644 index 000000000..3277fb6b6 --- /dev/null +++ b/website/README.md @@ -0,0 +1,82 @@ +# Horizon's website + +One static page in the launcher's design: the tokens of `crates/horizon-theme` (palette, +spacing, radii, motion), its bundled fonts, and the launcher's sidebar, rows and buttons. +Plain HTML, CSS and JavaScript; no framework and no runtime dependencies. + +## Layout + +``` +build.mjs renders dist/ (no dependencies) +serve.mjs a tiny static server for local checks +src/index.html the page, with {{placeholders}} build.mjs fills +src/404.html the not-found page +src/style.css the design tokens and every style +src/main.js download button, patch notes, roadmap, links, nav, tabs, lightbox +src/markdown.js a small Markdown renderer (escapes everything), shared by build and page +public/ fonts, screenshots, background, icons, og.png: copied as is +scripts/assets.mjs rebuilds public/ from the repo (fonts to WOFF2, images to WebP) +scripts/shots.mjs Playwright screenshots at every width, and og.png +Dockerfile, Caddyfile, railway.json the Railway service +LEGAL.md every asset, its source and licence +docs/widths/ full-page screenshots at 360–1920 px, a 1250×700 window and the open phone menu +``` + +## What comes from where + +- **Built in** (`build.mjs`): the parity table, its score, harness count and audit date, + and the roadmap, all from `README.md`; the Discord and Sponsor links from + `launcher/links.json`; the latest releases, when GitHub answers. Locally these come from + the checkout; on Railway, which builds only this folder, from `main` on GitHub. The build + fails if the README has no parity table or roadmap, so a broken README never deploys. +- **Fetched by the page**: the releases (the download button picks the newest + `launcher-v*` release's asset for the visitor's OS, and the three latest game releases' + notes are rendered), the roadmap from the raw README on `main`, and `links.json`. Each + falls back to what was built in, and the download button to the releases page. + +## Run it locally + +```sh +cd website +node build.mjs && node serve.mjs # http://localhost:4173 +``` + +Asset and screenshot scripts need the dev dependencies (sharp, wawoff2, Playwright): + +```sh +npm install +GITHUB_TOKEN=$(gh auth token) node build.mjs # optional token: bakes the releases past the API rate limit +npm run assets # after a font, screenshot or logo changes in the repo +npm run shots # docs/widths/*.png and public/og.png +``` + +Line lengths stay between 45 and 80 characters a line from 430 px up; on 360 and 390 px +phones the narrowest paragraphs (the roadmap's) fall to about 36–40, which is what 15 px text +allows in that width. `npm run shots` also reports horizontal overflow, tap targets under 44 px on touch widths +and characters per line, for 360 to 1920 px wide and a 1250×700 window. + +## Railway + +Create a service from the GitHub repo with **root directory `website`**. `railway.json` +selects the Dockerfile: a Node stage runs `build.mjs` (reading the README from `main`), and +a Caddy stage serves `dist/` on `$PORT` with compression, cache headers, a strict +Content-Security-Policy and the 404 page. Its watch patterns also redeploy when the README +or `launcher/links.json` change on main. No variables are needed; an optional +`GITHUB_TOKEN` (read-only, public repos) lets the build bake the releases even when +GitHub's anonymous rate limit is hit. + +## The background + +`public/background.webp` is Horizon's own frozen landscape, cut from the interface-free part +of `docs/media/menu-title.png`. The launcher's prismal background is not used, and the +launcher's screenshots are left out because they show it: its licence (backgrounds.supply) +is unconfirmed. The atmosphere is one replaceable file; see LEGAL.md. + +## Rules the site keeps + +- The disclaimer, "Not an official Minecraft product. Not approved by or associated with + Mojang or Microsoft.", is in the hero, the footer and the 404 page. +- No Minecraft logo or wordmark; "Minecraft" appears only descriptively ("for Minecraft: + Java Edition 26.3"). No game files are offered or linked. +- Parity is worded as the README words it: 100% of what the harnesses compare. +- No cookies, analytics, trackers or third-party fonts and scripts. diff --git a/website/build.mjs b/website/build.mjs new file mode 100644 index 000000000..61d0c87de --- /dev/null +++ b/website/build.mjs @@ -0,0 +1,185 @@ +// Builds the site into dist/: src/index.html with the README's parity table, roadmap and +// the community links baked in, plus public/ and fingerprinted CSS and JS. No dependencies. +// +// Railway builds only website/, so the README and links.json come from the repo when they +// are next to it (a local checkout) and from main on GitHub otherwise. The latest releases +// are baked in when GitHub answers, so the page reads well before (or without) JavaScript. +import { readFile, writeFile, mkdir, rm, cp } from "node:fs/promises"; +import { existsSync } from "node:fs"; +import { createHash } from "node:crypto"; +import { join, dirname } from "node:path"; +import { fileURLToPath } from "node:url"; +import { markdown, inline, section, escape } from "./src/markdown.js"; + +const site = dirname(fileURLToPath(import.meta.url)); +const dist = join(site, "dist"); +const REPO = "ludovic111/horizon"; +const RAW = `https://raw.githubusercontent.com/${REPO}/main/`; +const DEFAULT_LINKS = { discord: "https://discord.gg/HcTeMZxe5E", sponsor: "https://github.com/sponsors/ludovic111" }; + +async function repoFile(path) { + const local = join(site, "..", path); + if (existsSync(local)) return [await readFile(local, "utf8"), "the checkout"]; + const res = await fetch(RAW + path, { signal: AbortSignal.timeout(15000) }); + if (!res.ok) throw new Error(`${path}: ${res.status} from GitHub`); + return [await res.text(), "main on GitHub"]; +} + +// The README: required, a site with a stale or missing parity table is worse than no deploy. +const [readme, readmeFrom] = await repoFile("README.md"); + +let links = { ...DEFAULT_LINKS }; +try { + const parsed = JSON.parse((await repoFile("launcher/links.json"))[0]); + for (const key of Object.keys(links)) if (typeof parsed[key] === "string") links[key] = parsed[key].trim(); +} catch (e) { + console.warn(`links.json: ${e.message}; using the built-in links`); +} + +let releases = []; +try { + const res = await fetch(`https://api.github.com/repos/${REPO}/releases?per_page=30`, { + // An optional token (a Railway variable, or `gh auth token` locally) lifts the rate limit. + headers: { Accept: "application/vnd.github+json", ...(process.env.GITHUB_TOKEN ? { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } : {}) }, + signal: AbortSignal.timeout(15000), + }); + if (res.ok) releases = (await res.json()).filter((r) => !r.draft); + else console.warn(`releases: ${res.status} from GitHub; the page will load them itself`); +} catch (e) { + console.warn(`releases: ${e.message}; the page will load them itself`); +} + +// --- The parity table ------------------------------------------------------------------ + +const status = section(readme, "Project status") ?? ""; +const parityHeading = (status.match(/^###\s+(Java parity:\s*[\d.]+%)/m) || [])[1]; +if (!parityHeading) throw new Error("README: no '### Java parity: N%' heading under 'Project status'"); +const percent = parityHeading.match(/[\d.]+%/)[0]; +const parityBody = section(readme, parityHeading) ?? ""; +const rows = parityBody + .split("\n") + .filter((l) => /^\|/.test(l) && !/^\|\s*-/.test(l)) + .map((l) => + l + .replace(/^\|/, "") + .replace(/\|\s*$/, "") + .split("|") + .map((c) => c.trim()), + ); +const [, ...body] = rows; // the first row is the header +if (body.length < 5) throw new Error("README: the parity table has fewer than five rows"); +const harnesses = (readme.match(/all (\d[\d,]*) (?:parity )?harnesses/) || [])[1]; +if (!harnesses) throw new Error("README: no 'all N harnesses' count"); +const audited = (parityBody.match(/Last audited\s+(\d{4}-\d{2}-\d{2})/) || [])[1] ?? ""; +const intro = status.split(/^###/m)[0].trim(); + +const scoreLabel = (s) => ({ 0: "Absent", 0.25: "Started", 0.5: "Playable", 0.75: "Mostly complete", 1: "Complete" })[Number(s)] ?? s; +const parityRows = body + .map(([name, score, gaps]) => { + // "None: what matches" reads as the evidence; anything else is a gap and says so. + const none = gaps.match(/^None:\s*(.*)$/); + const detail = none + ? `No known gaps. ${inline(none[1].charAt(0).toUpperCase() + none[1].slice(1))}` + : inline(gaps); + return ` + ${inline(name)} + ${escape(score)}${escape(scoreLabel(score))} + ${detail} + `; + }) + .join("\n"); + +// --- The roadmap and the latest notes ------------------------------------------------- + +const roadmap = section(readme, "Roadmap"); +if (!roadmap) throw new Error("README: no Roadmap section"); + +const isGame = (tag) => /^v\d{4}\.\d{1,2}\.\d{1,2}/.test(tag); +const isLauncher = (tag) => tag.startsWith("launcher-v"); +const game = releases.filter((r) => isGame(r.tag_name)).slice(0, 3); +const launcher = releases.find((r) => isLauncher(r.tag_name) && !r.prerelease); + +// --- The page -------------------------------------------------------------------------- + +const fingerprint = (text) => createHash("sha256").update(text).digest("hex").slice(0, 10); + +await rm(dist, { recursive: true, force: true }); +await mkdir(join(dist, "assets"), { recursive: true }); +await cp(join(site, "public"), dist, { recursive: true }); +await cp(join(site, "LEGAL.md"), join(dist, "LEGAL.md")); + +const md = await readFile(join(site, "src/markdown.js"), "utf8"); +const mdName = `markdown.${fingerprint(md)}.js`; +await writeFile(join(dist, "assets", mdName), md); +const js = (await readFile(join(site, "src/main.js"), "utf8")).replace("./markdown.js", `./${mdName}`); +const jsName = `main.${fingerprint(js)}.js`; +await writeFile(join(dist, "assets", jsName), js); +const css = await readFile(join(site, "src/style.css"), "utf8"); +// The stylesheet is inlined into the page, so the first paint needs no second request. +const cssName = `style.${fingerprint(css)}.css`; +await writeFile(join(dist, "assets", cssName), css); +const inlineCss = css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s*\n\s*/g, "\n").trim(); + +const baked = { + links, + releases: releases.slice(0, 12).map((r) => ({ + tag_name: r.tag_name, + name: r.name, + published_at: r.published_at, + html_url: r.html_url, + prerelease: r.prerelease, + body: isGame(r.tag_name) ? r.body : "", + assets: r.assets.map((a) => ({ name: a.name, browser_download_url: a.browser_download_url, size: a.size })), + })), +}; + +const notesHtml = game.length + ? game.map((r, i) => releaseHtml(r, i === 0)).join("\n") + : `

The release notes could not be loaded here.

Read them on GitHub`; + +function releaseHtml(r, open) { + const date = (r.published_at || "").slice(0, 10); + return `
+ ${escape(r.name || r.tag_name)} +
${markdown(r.body || "")}

Downloads and full notes on GitHub

+
`; +} + +const values = { + CSS: `/assets/${cssName}`, + STYLE: inlineCss, + JS: `/assets/${jsName}`, + PERCENT: percent, + HARNESSES: harnesses, + AUDITED: audited, + PARITY_INTRO: markdown(intro), + PARITY_ROWS: parityRows, + ROADMAP: markdown(roadmap, { shift: 1 }), + NOTES: notesHtml, + LAUNCHER_VERSION: launcher ? escape(launcher.tag_name.replace("launcher-v", "")) : "", + DISCORD: escape(links.discord || DEFAULT_LINKS.discord), + SPONSOR: escape(links.sponsor || DEFAULT_LINKS.sponsor), + BAKED: JSON.stringify(baked).replace(/ { + if (!(key in values)) throw new Error(`${page}: unknown placeholder ${all}`); + return values[key]; + }); + await writeFile(join(dist, page), html); +} + +// The page's inline script (it marks the page as scripted before CSS applies) and its +// inlined stylesheet: the Content-Security-Policy in the Caddyfile allows them by hash. +const indexHtml = await readFile(join(dist, "index.html"), "utf8"); +const hashes = (re) => [...new Set([...indexHtml.matchAll(re)].map((m) => `'sha256-${createHash("sha256").update(m[1]).digest("base64")}'`))].join(" "); +await writeFile(join(dist, ".csp-script"), hashes(/ + + + + + + +
+ Horizon + +
+ + + +
+
+

For Minecraft: Java Edition 26.3 Written in Rust

+

Horizon

+

A rewrite of the Java Edition client and its game logic in Rust, checked against the game itself with differential tests.

+ +

Linux x86-64, macOS on Apple Silicon and Windows x64. The launcher installs and updates Horizon.

+ +
+
+
Parity
+
Every subsystem matches vanilla in all {{HARNESSES}} harnesses: {{PERCENT}} of what the harnesses compare.
+
+
+
You need
+
Your own, legally obtained copy of Minecraft: Java Edition 26.3. Horizon contains no Minecraft code, assets or data.
+
+
+
Not official
+
Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.
+
+
+ +
+ Horizon's title screen: a sidebar, the Horizon title, Singleplayer and Multiplayer buttons and the last world played, over a blurred frozen landscape +
+
+ +
+

What it is

+
+

Horizon reimplements the Minecraft: Java Edition 26.3 client and its game logic in Rust, one subsystem at a time, and compares each piece with the vanilla game. Each of its {{HARNESSES}} differential harnesses drives the same inputs through Horizon and through the vanilla client and server, from your own copy of the game, and checks that the outputs are identical.

+

Every subsystem now matches vanilla in every harness that compares it. That is {{PERCENT}} of what the harnesses compare, not proof that nothing else differs: the remaining known differences are listed under What's next.

+

The native client runs on Linux, macOS on Apple Silicon and Windows. It opens on its own title screen, generates worlds with a Rust port of the vanilla generators and draws them with vanilla's block models, lighting, sky and fog.

+
+
+
+
Your own copy
+
Install Java Edition with the official launcher and play 26.3 once. Horizon builds its resources from those files on your machine and never downloads or shares game files.
+
+
+
For the setup
+
Python 3.10 or newer and Java 25 for the one-time resource preparation; a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac.
+
+
+
Licence
+
Horizon's own code is MIT. Minecraft is a trademark of Mojang Synergies AB; its code and assets belong to Mojang and Microsoft and are covered by the Minecraft EULA.
+
+
+
+ +
+

Screenshots

+

Captured in the Rust client itself, with vanilla assets from the player's own copy and no mods or shaders.

+
+ + + +
+ + +
+ +
+

Parity

+
{{PARITY_INTRO}}
+

From the README on mainlast audited {{AUDITED}}{{PERCENT}} of what the harnesses compare

+
+ + + + + + {{PARITY_ROWS}} + +
SubsystemScoreWhat the harnesses check
+
+

Each subsystem scores 0 (absent), 0.25 (started), 0.5 (playable, major features missing), 0.75 (mostly complete) or 1 (complete and verified against vanilla by differential tests).

+
+ +
+

Patch notes

+

What changed in each release, newest first.

+
+ {{NOTES}} +
+
+ +
+

What's next

+

The roadmap from the README, as it stands on main.

+
{{ROADMAP}}
+
+ +
+

Community

+
+
+
Discord
+
Questions, bug reports and screenshots.
+
Join the Discord
+
+
+
Sponsor
+
Horizon is built in the open. Sponsors fund the next release.
+
Sponsor on GitHub
+
+
+
Source
+
Issues and pull requests are welcome.
+
Open on GitHub
+
+
+
+ + +
+ + +
+ + +
+ + + + diff --git a/website/src/main.js b/website/src/main.js new file mode 100644 index 000000000..1df4a286a --- /dev/null +++ b/website/src/main.js @@ -0,0 +1,259 @@ +// The page's behaviour: the download button for this platform, the latest releases, the +// roadmap and links from main, the sidebar's selection, the screenshot tabs and lightbox. +// Everything degrades to the baked-in content when GitHub can't be reached. +import { markdown, escape, section } from "./markdown.js"; + +const REPO = "ludovic111/horizon"; +const RELEASES_PAGE = `https://github.com/${REPO}/releases?q=launcher-v&expanded=true`; +const baked = JSON.parse(document.getElementById("baked").textContent); +const reducedMotion = matchMedia("(prefers-reduced-motion: reduce)").matches; + +// --- GitHub -------------------------------------------------------------------------- + +async function cached(key, load) { + try { + const hit = JSON.parse(sessionStorage.getItem(key) || "null"); + if (hit && Date.now() - hit.at < 10 * 60 * 1000) return hit.value; + } catch {} + const value = await load(); + try { + sessionStorage.setItem(key, JSON.stringify({ at: Date.now(), value })); + } catch {} + return value; +} + +async function get(url, as = "json") { + const res = await fetch(url, { headers: as === "json" ? { Accept: "application/vnd.github+json" } : {} }); + if (!res.ok) throw new Error(`${res.status}`); + return as === "json" ? res.json() : res.text(); +} + +const releases = cached("horizon:releases", () => + get(`https://api.github.com/repos/${REPO}/releases?per_page=30`).then((list) => + list + .filter((r) => !r.draft) + .map((r) => ({ + tag_name: r.tag_name, + name: r.name, + published_at: r.published_at, + html_url: r.html_url, + prerelease: r.prerelease, + body: r.body || "", + assets: r.assets.map((a) => ({ name: a.name, browser_download_url: a.browser_download_url, size: a.size })), + })), + ), +).catch(() => baked.releases); + +// --- Download ------------------------------------------------------------------------ + +function platform() { + const ua = navigator.userAgent; + const hint = (navigator.userAgentData && navigator.userAgentData.platform) || navigator.platform || ""; + if (/iPhone|iPad|iPod|Android/i.test(ua) || (navigator.maxTouchPoints > 1 && /Mac/.test(hint))) return null; + if (/Win/i.test(hint) || /Windows/.test(ua)) return { key: "windows-x64", label: "Windows x64" }; + if (/Mac/i.test(hint) || /Mac OS X/.test(ua)) return { key: "macos-arm64", label: "macOS on Apple Silicon" }; + if (/Linux|X11/i.test(hint) || /Linux/.test(ua)) return { key: "linux-x86_64", label: "Linux x86-64" }; + return null; +} + +async function setUpDownload() { + const button = document.getElementById("download"); + const meta = document.getElementById("download-meta"); + const os = platform(); + const list = await releases; + const launcher = list.find((r) => r.tag_name.startsWith("launcher-v") && !r.prerelease); + if (!launcher) return; + const version = launcher.tag_name.replace("launcher-v", ""); + document.querySelectorAll("[data-launcher-version]").forEach((el) => (el.textContent = `Launcher ${version}`)); + const asset = os && launcher.assets.find((a) => a.name.includes(os.key)); + const others = `Other platforms`; + if (asset) { + button.href = asset.browser_download_url; + button.textContent = "Download the launcher"; + const mb = asset.size ? ` · ${(asset.size / 1e6).toFixed(0)} MB` : ""; + meta.innerHTML = `For ${escape(os.label)} · version ${escape(version)}${mb} · ${others}`; + } else { + button.href = launcher.html_url || RELEASES_PAGE; + meta.innerHTML = `Launcher ${escape(version)} for Linux x86-64, macOS on Apple Silicon and Windows x64. It runs on a computer, not on phones or tablets.`; + } +} + +// --- Patch notes --------------------------------------------------------------------- + +const isGame = (tag) => /^v\d{4}\.\d{1,2}\.\d{1,2}/.test(tag); + +async function setUpNotes() { + const list = (await releases).filter((r) => isGame(r.tag_name)); + if (!list.length) return; + const box = document.getElementById("releases"); + const shown = list.slice(0, 3); + box.innerHTML = + shown + .map((r, i) => { + const date = (r.published_at || "").slice(0, 10); + return `
+ ${escape(r.name || r.tag_name)} +
${markdown(r.body)}

Downloads and full notes on GitHub

+
`; + }) + .join("") + + (list.length > shown.length + ? `

Older releases on GitHub

` + : ""); +} + +// --- The roadmap and the links from main --------------------------------------------- + +async function setUpRoadmap() { + try { + const readme = await cached("horizon:readme", () => get(`https://raw.githubusercontent.com/${REPO}/main/README.md`, "text")); + const roadmap = section(readme, "Roadmap"); + if (roadmap) document.getElementById("roadmap").innerHTML = markdown(roadmap, { shift: 1 }); + } catch {} +} + +async function setUpLinks() { + let links = baked.links; + try { + const remote = await cached("horizon:links", () => get(`https://raw.githubusercontent.com/${REPO}/main/launcher/links.json`, "text").then(JSON.parse)); + links = { ...links }; + for (const key of Object.keys(links)) if (typeof remote[key] === "string") links[key] = remote[key].trim(); + } catch {} + document.querySelectorAll("[data-link]").forEach((a) => { + const url = links[a.dataset.link]; + // An empty address hides its row, as in the launcher. + if (!url) a.closest(".row").hidden = true; + else if (/^https:\/\//.test(url)) a.href = url; + }); +} + +// --- The sidebar --------------------------------------------------------------------- + +function setUpNav() { + const nav = document.getElementById("nav"); + const sidebar = document.querySelector(".sidebar"); + const menu = document.querySelector(".menu-button"); + const selection = nav.querySelector(".nav-selection"); + const links = [...nav.querySelectorAll("a")]; + const sections = links.map((a) => document.querySelector(a.getAttribute("href"))); + + const select = (index) => { + links.forEach((a, i) => (i === index ? a.setAttribute("aria-current", "true") : a.removeAttribute("aria-current"))); + const a = links[index]; + selection.style.height = `${a.offsetHeight}px`; + selection.style.transform = `translateY(${a.offsetTop}px)`; + nav.classList.add("has-selection"); + }; + + let current = -1; + const update = () => { + const line = innerHeight * 0.35; + let index = 0; + sections.forEach((s, i) => { + if (s.getBoundingClientRect().top <= line) index = i; + }); + if (innerHeight + scrollY >= document.documentElement.scrollHeight - 2) index = sections.length - 1; + if (index !== current) select((current = index)); + }; + let queued = false; + addEventListener("scroll", () => { + if (!queued) requestAnimationFrame(() => ((queued = false), update())); + queued = true; + }, { passive: true }); + addEventListener("resize", () => select(Math.max(current, 0))); + update(); + + const setOpen = (open) => { + sidebar.classList.toggle("is-open", open); + menu.setAttribute("aria-expanded", String(open)); + menu.textContent = open ? "Close" : "Menu"; + if (open) select(Math.max(current, 0)); + }; + menu.addEventListener("click", () => setOpen(!sidebar.classList.contains("is-open"))); + links.forEach((a) => a.addEventListener("click", () => setOpen(false))); + addEventListener("keydown", (e) => { + if (e.key === "Escape" && sidebar.classList.contains("is-open")) { + setOpen(false); + menu.focus(); + } + }); +} + +// --- Screenshots --------------------------------------------------------------------- + +function setUpTabs() { + const list = document.querySelector(".segmented"); + const tabs = [...list.querySelectorAll('[role="tab"]')]; + const selection = list.querySelector(".segment-selection"); + const place = (tab) => { + selection.style.width = `${tab.offsetWidth}px`; + selection.style.height = `${tab.offsetHeight}px`; + selection.style.transform = `translate(${tab.offsetLeft}px, ${tab.offsetTop - 2}px)`; + }; + const choose = (tab, focus) => { + tabs.forEach((t) => { + const on = t === tab; + t.setAttribute("aria-selected", String(on)); + t.tabIndex = on ? 0 : -1; + document.getElementById(t.getAttribute("aria-controls")).hidden = !on; + }); + place(tab); + if (focus) tab.focus(); + }; + tabs.forEach((tab, i) => { + tab.addEventListener("click", () => choose(tab)); + tab.addEventListener("keydown", (e) => { + const step = { ArrowRight: 1, ArrowLeft: -1 }[e.key]; + if (step) choose(tabs[(i + step + tabs.length) % tabs.length], true); + }); + }); + place(tabs.find((t) => t.getAttribute("aria-selected") === "true")); + addEventListener("resize", () => place(tabs.find((t) => t.getAttribute("aria-selected") === "true"))); + document.fonts?.ready.then(() => place(tabs.find((t) => t.getAttribute("aria-selected") === "true"))); +} + +function setUpLightbox() { + const dialog = document.querySelector(".lightbox"); + const big = dialog.querySelector("img"); + const caption = dialog.querySelector(".lightbox-caption"); + document.querySelectorAll(".zoom").forEach((button) => { + button.addEventListener("click", () => { + const img = button.querySelector("img"); + big.src = img.currentSrc.replace("-800.webp", ".webp"); + big.alt = img.alt; + caption.textContent = img.alt; + dialog.showModal(); + }); + }); + dialog.addEventListener("click", (e) => { + if (e.target === dialog) dialog.close(); + }); +} + +function setUpReveal() { + const items = document.querySelectorAll(".reveal"); + if (reducedMotion || !("IntersectionObserver" in window)) { + items.forEach((el) => el.classList.add("is-visible")); + return; + } + const observer = new IntersectionObserver( + (entries) => + entries.forEach((e) => { + if (e.isIntersecting) { + e.target.classList.add("is-visible"); + observer.unobserve(e.target); + } + }), + { rootMargin: "0px 0px -8% 0px" }, + ); + items.forEach((el) => observer.observe(el)); +} + +setUpReveal(); +setUpNav(); +setUpTabs(); +setUpLightbox(); +setUpDownload(); +setUpNotes(); +setUpRoadmap(); +setUpLinks(); diff --git a/website/src/markdown.js b/website/src/markdown.js new file mode 100644 index 000000000..a17ab4b96 --- /dev/null +++ b/website/src/markdown.js @@ -0,0 +1,146 @@ +// A small Markdown renderer for release notes and the README: headings, paragraphs, +// lists (nested by indentation), fenced code, quotes, rules, and inline code, bold, +// italic and links. Everything is escaped first, so its output never carries raw HTML. +// Shared by build.mjs (Node) and main.js (browser). + +const REPO_BLOB = "https://github.com/ludovic111/horizon/blob/main/"; + +export function escape(text) { + return text.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]); +} + +function href(url) { + url = url.trim(); + if (/^(https?:|mailto:)/i.test(url)) return url; + if (url.startsWith("#")) return null; // README anchors have no target here + if (/^[a-z]+:/i.test(url)) return null; // javascript: and the like + return REPO_BLOB + url.replace(/^\.?\//, ""); +} + +export function inline(text) { + const codes = []; + let out = text.replace(/`([^`]+)`/g, (_, code) => { + codes.push(code); + return `\u0000${codes.length - 1}\u0000`; + }); + const links = []; + out = out.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (_, label, url) => { + links.push([label, url]); + return `\u0001${links.length - 1}\u0001`; + }); + out = escape(out) + .replace(/\*\*([^*]+)\*\*/g, "$1") + .replace(/(^|[^\w*])\*([^*\s][^*]*)\*/g, "$1$2") + .replace(/(^|[^\w])_([^_\s][^_]*)_(?!\w)/g, "$1$2") + .replace(/<(https?:\/\/[^\s&]+)>/g, (_, u) => `${u}`); + out = out.replace(/\u0001(\d+)\u0001/g, (_, i) => { + const [label, url] = links[i]; + const target = href(url); + const body = inline(label); + return target ? `${body}` : body; + }); + return out.replace(/\u0000(\d+)\u0000/g, (_, i) => `${escape(codes[i])}`); +} + +const indentOf = (line) => line.match(/^ */)[0].length; +const ITEM = /^(\s*)([-*+]|\d+[.)])\s+(.*)$/; + +function list(lines, start) { + // Collects the items at this list's indentation; deeper lines belong to the item above. + const base = indentOf(lines[start]); + const ordered = /\d/.test(lines[start].match(ITEM)[2]); + const items = []; + let i = start; + while (i < lines.length) { + const line = lines[i]; + if (!line.trim()) { + const next = lines.slice(i + 1).find((l) => l.trim()); + if (next && ITEM.test(next) && indentOf(next) >= base) { + i++; + continue; + } + break; + } + const m = line.match(ITEM); + if (m && indentOf(line) === base) { + items.push({ text: [m[3]], children: [] }); + } else if (m && indentOf(line) > base) { + const [html, end] = list(lines, i); + items[items.length - 1].children.push(html); + i = end; + continue; + } else if (indentOf(line) > base && items.length) { + items[items.length - 1].text.push(line.trim()); + } else { + break; + } + i++; + } + const tag = ordered ? "ol" : "ul"; + const body = items.map((it) => `
  • ${inline(it.text.join(" "))}${it.children.join("")}
  • `).join(""); + return [`<${tag}>${body}`, i]; +} + +/** Renders Markdown; `shift` moves headings down (a `#` becomes `h{1 + shift}`). */ +export function markdown(source, { shift = 0 } = {}) { + const lines = source.replace(/\r\n?/g, "\n").split("\n"); + const out = []; + let i = 0; + while (i < lines.length) { + const line = lines[i]; + if (!line.trim() || /^\s*<\/?[a-z][^>]*>\s*$/i.test(line)) { + i++; // blank lines and lone HTML tags (the README's layout tables) are skipped + continue; + } + let m; + if ((m = line.match(/^(#{1,6})\s+(.*?)\s*#*$/))) { + const level = Math.min(6, m[1].length + shift); + out.push(`${inline(m[2])}`); + i++; + } else if ((m = line.match(/^\s*(```|~~~)/))) { + const fence = m[1]; + const code = []; + i++; + while (i < lines.length && !lines[i].trim().startsWith(fence)) code.push(lines[i++]); + i++; + out.push(`
    ${escape(code.join("\n"))}
    `); + } else if (/^\s*([-*_])(\s*\1){2,}\s*$/.test(line)) { + out.push("
    "); + i++; + } else if (ITEM.test(line)) { + const [html, end] = list(lines, i); + out.push(html); + i = end; + } else if (line.startsWith(">")) { + const quote = []; + while (i < lines.length && lines[i].startsWith(">")) quote.push(lines[i++].replace(/^>\s?/, "")); + out.push(`
    ${markdown(quote.join("\n"), { shift })}
    `); + } else { + const para = []; + while ( + i < lines.length && + lines[i].trim() && + !/^(#{1,6}\s|>|\s*```|\s*~~~)/.test(lines[i]) && + !ITEM.test(lines[i]) + ) { + para.push(lines[i++].trim()); + } + out.push(`

    ${inline(para.join(" "))}

    `); + } + } + return out.join("\n"); +} + +/** The body of the section titled `title` (any heading level), up to the next heading at its level or above. */ +export function section(source, title) { + const lines = source.replace(/\r\n?/g, "\n").split("\n"); + const level = (l) => (l.match(/^(#{1,6})\s/) || [, ""])[1].length; + const start = lines.findIndex((l) => level(l) > 0 && l.replace(/^#+/, "").trim() === title); + if (start < 0) return null; + const depth = level(lines[start]); + const end = lines.findIndex((l, i) => i > start && level(l) > 0 && level(l) <= depth); + return lines + .slice(start + 1, end < 0 ? undefined : end) + .join("\n") + .trim(); +} diff --git a/website/src/style.css b/website/src/style.css new file mode 100644 index 000000000..f121eaac0 --- /dev/null +++ b/website/src/style.css @@ -0,0 +1,450 @@ +/* Horizon's design tokens (crates/horizon-theme), the dark appearance the launcher draws: + one neutral palette and one violet accent, spacing 4/8/12/16/24/32, 1px dividers, + Geist for the interface, Instrument Serif for titles, Geist Mono for code. */ + +@font-face { font-family: "Geist"; src: url("/fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; } +@font-face { font-family: "Geist"; src: url("/fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; } +@font-face { font-family: "Geist"; src: url("/fonts/Geist-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; } +@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; } +@font-face { font-family: "Instrument Serif"; src: url("/fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; } + +:root { + --bg: #111113; + --sidebar: #0c0c0d; + --raised: #1a1a1d; + --hover: #202024; + --border: #26262a; + --text: #e8e8ea; + --muted: #9a9aa1; + --faint: #8a8a92; /* the token's #626269, lifted to pass WCAG AA for small text, on raised surfaces too */ + --accent: #7c5cc4; + --accent-text: #a48ae6; /* the accent as link text, readable on --bg */ + --on-accent: #ffffff; + + --font: "Geist", ui-sans-serif, system-ui, sans-serif; + --display: "Instrument Serif", ui-serif, Georgia, serif; + --mono: "Geist Mono", ui-monospace, monospace; + + --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; + --radius: 6px; --radius-segment: 5px; --radius-group: 7px; --radius-card: 8px; + --control: 30px; --segment: 26px; --control-large: 40px; + --sidebar-w: 200px; --row-label: 150px; + + /* Motion: short and eased out, never bouncy (GPUI's ease_out_quint). */ + --quick: 160ms; --move: 240ms; + --ease: cubic-bezier(0.22, 1, 0.36, 1); + + --content: 760px; + --wide: 980px; +} + +*, *::before, *::after { box-sizing: border-box; } + +html { + background: var(--bg); + color: var(--text); + font: 400 15px/1.6 var(--font); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-rendering: optimizeLegibility; + scroll-behavior: smooth; + scroll-padding-top: var(--s6); +} +body { margin: 0; min-height: 100vh; } +img { display: block; max-width: 100%; height: auto; } +::selection { background: rgba(124, 92, 196, 0.45); color: #fff; } + +a { color: var(--accent-text); text-decoration: none; transition: color var(--quick) var(--ease); } +a:hover { color: var(--text); } +:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 3px; } + +code { + font: 13px/1.5 var(--mono); + background: var(--raised); + border: 1px solid var(--border); + border-radius: 4px; + padding: 1px 5px; + overflow-wrap: anywhere; +} + +.skip { + position: fixed; left: var(--s4); top: var(--s4); z-index: 20; + padding: var(--s2) var(--s3); border-radius: var(--radius); + background: var(--raised); color: var(--text); border: 1px solid var(--border); + transform: translateY(-200%); transition: transform var(--quick) var(--ease); +} +.skip:focus { transform: none; } + +/* The atmosphere: Horizon's frozen landscape, veiled the way the launcher veils its background. */ +.atmosphere { + position: fixed; inset: 0; z-index: -1; pointer-events: none; + background: + linear-gradient(90deg, rgba(17, 17, 19, 0.9) 0%, rgba(17, 17, 19, 0) 70%), + linear-gradient(180deg, rgba(17, 17, 19, 0) 25%, rgba(17, 17, 19, 0.95) 100%), + linear-gradient(rgba(17, 17, 19, 0.55), rgba(17, 17, 19, 0.55)), + url("/background.webp") center / cover no-repeat, + var(--bg); +} + +/* --- The sidebar, as in the launcher ------------------------------------------------- */ + +.sidebar { + position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); + display: flex; flex-direction: column; + padding: var(--s5) var(--s3) var(--s5); + background: var(--sidebar); + border-right: 1px solid var(--border); + z-index: 10; +} +.wordmark { + font: 400 24px/1 var(--display); + color: var(--text); + letter-spacing: -0.01em; +} +.sidebar > .wordmark { padding: var(--s2) 10px var(--s6); } +.wordmark:hover { color: var(--text); } + +nav { position: relative; display: flex; flex-direction: column; gap: 2px; } +nav a { + position: relative; z-index: 1; + height: var(--control); display: flex; align-items: center; + padding: 0 10px; border-radius: var(--radius); + color: var(--muted); font-size: 14px; + transition: color var(--quick) var(--ease), background-color var(--quick) var(--ease); +} +nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); } +nav a[aria-current="true"] { color: var(--text); } +.no-js nav a[aria-current="true"], nav:not(.has-selection) a[aria-current="true"] { background: var(--raised); } +.nav-selection { + position: absolute; left: 0; right: 0; top: 0; height: var(--control); + background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); + opacity: 0; + transition: transform var(--move) var(--ease), opacity var(--quick) var(--ease); +} +nav.has-selection .nav-selection { opacity: 1; } + +.sidebar-foot { + margin-top: auto; padding: 0 10px; + display: flex; flex-direction: column; gap: var(--s2); + font-size: 13px; color: var(--faint); +} +.sidebar-foot a { color: var(--muted); } +.sidebar-foot a:hover { color: var(--text); } +.sidebar-foot span:empty { display: none; } + +.topbar { display: none; } + +/* --- Content ------------------------------------------------------------------------ */ + +main { + margin-left: var(--sidebar-w); + padding: 0 clamp(var(--s5), 6vw, 72px); +} +main > section, .footer { max-width: var(--content); } +main > section.wide { max-width: var(--wide); } +main > section { padding: 96px 0 0; } + +.hero { padding-top: 88px; } +.eyebrow { margin: 0 0 var(--s3); color: var(--faint); font-size: 13px; letter-spacing: 0.01em; } +.eyebrow span { margin: 0 6px; } +h1 { + margin: 0; + font: 400 clamp(64px, 9vw, 112px)/0.95 var(--display); + letter-spacing: -0.02em; +} +.lede { margin: var(--s5) 0 0; max-width: 34em; font-size: 18px; line-height: 1.55; color: var(--muted); } + +h2 { + margin: 0 0 var(--s3); + font: 400 44px/1.05 var(--display); + letter-spacing: -0.01em; +} +.section-lede { margin: 0 0 var(--s5); color: var(--muted); } +.section-lede p { margin: 0 0 var(--s3); } +.muted { color: var(--muted); } + +/* Buttons: primary is the accent, secondary is raised with a hairline. */ +.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); } +.button { + display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); + height: var(--control); padding: 0 var(--s3); + border-radius: var(--radius); border: 1px solid transparent; + font: 500 13px/1 var(--font); white-space: nowrap; cursor: pointer; + transition: background-color var(--quick) var(--ease), border-color var(--quick) var(--ease), opacity var(--quick) var(--ease), color var(--quick) var(--ease); +} +.button.large { height: var(--control-large); padding: 0 var(--s5); font-size: 15px; border-radius: var(--radius-group); } +.button.primary { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0); } +.button.primary:hover { color: var(--on-accent); box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.1); } +.button.primary:active { opacity: 0.82; } +.button.secondary { background: var(--raised); color: var(--text); border-color: var(--border); } +.button.secondary:hover { background: var(--hover); color: var(--text); } +.button.secondary:active { opacity: 0.8; } + +.download-meta { margin: var(--s3) 0 0; font-size: 13px; color: var(--faint); min-height: 1.6em; } +.download-meta a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; } +.download-meta a:hover { color: var(--text); } + +/* Rows: label, value and an optional action, between 1px dividers. */ +.rows { margin: 40px 0 0; border-top: 1px solid var(--border); } +.row { + display: grid; grid-template-columns: var(--row-label) 1fr auto; gap: var(--s5); + align-items: center; + padding: var(--s4) 0; + border-bottom: 1px solid var(--border); +} +.row dt { color: var(--muted); font-size: 14px; } +.row dd { margin: 0; } +.row-action { justify-self: end; } +.disclaimer { color: var(--text); } + +.shot { margin: 0; } +.shot img, .shot .zoom { + border-radius: var(--radius-card); +} +.shot img { + width: 100%; + border: 1px solid var(--border); + background: var(--raised); +} +.hero-shot { margin-top: 56px; } +.shot figcaption { margin-top: var(--s2); font-size: 13px; color: var(--faint); } +.zoom { + display: block; width: 100%; padding: 0; margin: 0; + border: 0; background: none; cursor: zoom-in; +} +.zoom img { transition: border-color var(--quick) var(--ease), opacity var(--quick) var(--ease); } +.zoom:hover img { border-color: #3a3a40; } + +/* Prose: release notes, the roadmap and running text. */ +.prose { color: var(--muted); } +.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote { margin: 0 0 var(--s4); } +.prose strong { color: var(--text); font-weight: 600; } +.prose h3, .prose h4, .prose h5 { margin: var(--s5) 0 var(--s2); color: var(--text); font: 600 15px/1.4 var(--font); } +.prose ul { list-style: none; padding: 0; } +.prose ul > li { position: relative; padding-left: var(--s5); margin-bottom: var(--s2); } +.prose ul > li::before { content: "–"; position: absolute; left: 0; color: var(--faint); } +.prose ol { padding-left: var(--s5); } +.prose pre { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); overflow-x: auto; } +.prose pre code { background: none; border: 0; padding: 0; } +.prose a { text-decoration: underline; text-decoration-color: rgba(164, 138, 230, 0.35); text-underline-offset: 3px; } +.prose > :last-child { margin-bottom: 0; } +#about .prose p { color: var(--text); opacity: 0.86; } + +/* The segmented control, as the launcher's Client / Server switch. */ +.segmented { + position: relative; display: inline-flex; gap: 2px; padding: 2px; + background: var(--sidebar); border: 1px solid var(--border); border-radius: var(--radius-group); + margin-bottom: var(--s5); +} +.segmented button { + position: relative; z-index: 1; + height: var(--segment); padding: 0 var(--s3); + border: 0; border-radius: var(--radius-segment); background: none; + font: 500 13px/1 var(--font); color: var(--muted); cursor: pointer; + transition: color var(--quick) var(--ease); +} +.segmented button[aria-selected="true"] { color: var(--text); } +.segmented button:hover { color: var(--text); } +.segment-selection { + position: absolute; top: 2px; left: 0; height: var(--segment); width: 0; + background: var(--hover); border-radius: var(--radius-segment); + transition: transform var(--move) var(--ease), width var(--move) var(--ease); +} +.no-js .segmented { display: none; } +.no-js .gallery[hidden] { display: grid; margin-top: var(--s5); } + +.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); } +.gallery .span { grid-column: 1 / -1; } +.gallery:not([hidden]) { animation: fade var(--move) var(--ease); } + +/* The parity table. */ +.table-meta { margin: 0 0 var(--s3); font-size: 13px; color: var(--faint); } +.table-meta + .table-scroll { margin-top: var(--s2); } +.table-scroll + .table-meta { margin-top: var(--s4); } +.table-scroll { overflow-x: auto; border-top: 1px solid var(--border); } +.parity { width: 100%; border-collapse: collapse; font-size: 14px; } +.parity th, .parity td { text-align: left; vertical-align: top; padding: var(--s4) var(--s4) var(--s4) 0; border-bottom: 1px solid var(--border); } +.parity thead th { padding-top: var(--s3); padding-bottom: var(--s3); font-weight: 400; font-size: 13px; color: var(--faint); } +.parity tbody th { width: 30%; font-weight: 500; color: var(--text); } +.parity td { color: var(--muted); } +.parity td:last-child { padding-right: 0; } +.parity .score { width: 150px; white-space: nowrap; } +.pill { + display: inline-block; min-width: 26px; padding: 1px 7px; margin-right: var(--s2); + border: 1px solid var(--border); border-radius: 999px; + font: 12px/1.5 var(--mono); text-align: center; color: var(--muted); +} +.pill.is-full { border-color: rgba(124, 92, 196, 0.55); color: var(--accent-text); } +.score-label { font-size: 13px; color: var(--faint); } +.gap-none { color: var(--text); } + +/* Releases. */ +.releases { border-top: 1px solid var(--border); } +.release { border-bottom: 1px solid var(--border); } +.release summary { + display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); + padding: var(--s4) 0; cursor: pointer; list-style: none; +} +.release summary::-webkit-details-marker { display: none; } +.release-title { font-weight: 600; color: var(--text); } +.release summary::before { + content: ""; flex: none; align-self: center; width: 6px; height: 6px; margin-right: -4px; + border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); + transform: rotate(-45deg); transition: transform var(--quick) var(--ease); +} +.release[open] summary::before { transform: rotate(45deg); } +.release summary .release-title { flex: 1; } +.release time { color: var(--faint); font-size: 13px; white-space: nowrap; } +.release .prose { padding: 0 0 var(--s5) 18px; animation: slide var(--move) var(--ease); } +.release-more { margin-top: var(--s4); font-size: 13px; } + +#roadmap h2, #roadmap h3 { margin-top: 0; } +#roadmap p { margin-bottom: var(--s4); } + +/* Footer. */ +.footer { + margin-top: 120px; padding: var(--s6) 0 48px; + border-top: 1px solid var(--border); + font-size: 13px; color: var(--faint); +} +.footer p { margin: 0 0 var(--s3); max-width: 46em; } +.footer a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; } +.footer a:hover { color: var(--text); } +.footer code { font-size: 12px; } +.disclaimer-strong { color: var(--text) !important; font-size: 14px; } +.footer-links { display: flex; flex-wrap: wrap; gap: var(--s5); margin-top: var(--s5) !important; } +.footer-links a { text-decoration: none; } + +/* The lightbox. */ +.lightbox { + width: min(1400px, 94vw); max-width: none; max-height: 94vh; padding: var(--s4); + background: var(--bg); color: var(--text); + border: 1px solid var(--border); border-radius: var(--radius-card); +} +.lightbox::backdrop { background: rgba(8, 8, 9, 0.82); } +.lightbox[open] { animation: fade var(--move) var(--ease); } +.lightbox img { width: 100%; max-height: calc(94vh - 110px); object-fit: contain; border-radius: var(--radius); } +.lightbox form { display: flex; justify-content: flex-end; margin-bottom: var(--s3); } +.lightbox-caption { margin: var(--s3) 0 0; font-size: 13px; color: var(--muted); } + +/* Motion: sections fade and rise once; nothing moves for those who ask for less. */ +.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); } +.js .reveal.is-visible { opacity: 1; transform: none; } +.hero > * { animation: rise 600ms var(--ease) both; } +.hero > :nth-child(2) { animation-delay: 40ms; } +.hero > :nth-child(3) { animation-delay: 80ms; } +.hero > :nth-child(4), .hero > :nth-child(5) { animation-delay: 120ms; } +.hero > :nth-child(n + 6) { animation-delay: 180ms; } +@keyframes rise { from { opacity: 0; transform: translateY(8px); } } +@keyframes fade { from { opacity: 0; } } +@keyframes slide { from { opacity: 0; transform: translateY(-4px); } } + +@media (prefers-reduced-motion: reduce) { + html { scroll-behavior: auto; } + *, *::before, *::after { animation: none !important; transition: none !important; } + .js .reveal { opacity: 1; transform: none; } +} + +/* The 404 page. */ +.lost-main { margin: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 720px; padding: 48px clamp(24px, 8vw, 96px); } +.lost-main .disclaimer-strong { margin-top: 64px; color: var(--faint) !important; font-size: 13px; } + +/* --- Phones and narrow windows ------------------------------------------------------ */ + +@media (max-width: 900px) { + html { scroll-padding-top: 72px; } + .topbar { + position: sticky; top: 0; z-index: 11; + display: flex; align-items: center; justify-content: space-between; + height: 56px; padding: 0 var(--s4); + background: rgba(12, 12, 13, 0.86); + -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); + border-bottom: 1px solid var(--border); + } + .topbar .wordmark { font-size: 24px; } + .menu-button { + height: var(--control); padding: 0 var(--s3); + background: var(--raised); color: var(--text); + border: 1px solid var(--border); border-radius: var(--radius); + font: 500 13px/1 var(--font); cursor: pointer; + } + .no-js .menu-button { display: none; } + .sidebar { + inset: 56px 0 auto 0; width: auto; padding: var(--s3) var(--s4) var(--s4); + border-right: 0; border-bottom: 1px solid var(--border); + background: rgba(12, 12, 13, 0.97); + opacity: 0; transform: translateY(-6px); visibility: hidden; + transition: opacity var(--quick) var(--ease), transform var(--quick) var(--ease), visibility 0s linear var(--quick); + } + .sidebar.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; } + .no-js .sidebar { position: static; opacity: 1; transform: none; visibility: visible; } + .sidebar > .wordmark { display: none; } + .sidebar-foot { flex-direction: row; justify-content: space-between; margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); } + nav a { height: 40px; font-size: 15px; } + .nav-selection { height: 40px; } + + main { margin-left: 0; padding: 0 20px; } + main > section { padding-top: 72px; } + .hero { padding-top: 48px; } + .lede { font-size: 17px; } + h2 { font-size: 38px; } + .row { grid-template-columns: 1fr; gap: var(--s1); } + .row-action { justify-self: start; margin-top: var(--s2) !important; } + .gallery { grid-template-columns: 1fr; } + .actions .button.large { flex: 1 1 auto; } + .parity, .parity tbody, .parity tr, .parity th, .parity td { display: block; width: auto !important; } + .parity thead { display: none; } + .parity tr { padding: var(--s4) 0; border-bottom: 1px solid var(--border); } + .parity th, .parity td { border: 0; padding: 0; } + .parity tbody th { margin-bottom: var(--s2); } + .parity .score { margin-bottom: var(--s2); } + .release .prose { padding-left: 0; } + .footer { margin-top: 88px; } +} + +/* Line lengths: running text stays between about 45 and 80 characters a line. */ +.prose p, .prose li, .section-lede, .lede, .row dd, .footer p, .table-meta { max-width: 68ch; } +.parity td { max-width: 60ch; } + +/* Touch: every control is at least 44px tall, whatever the width. */ +@media (pointer: coarse), (max-width: 900px) { + .button, .button.large, .menu-button, nav a, .segmented button { min-height: 44px; } + .nav-selection { height: 44px; } + .segmented button { padding: 0 var(--s4); } + .release summary { min-height: 44px; align-items: center; } + .zoom { min-height: 44px; } + .footer-links a, .sidebar-foot a, .download-meta a { display: inline-flex; align-items: center; min-height: 44px; } + .footer-links { gap: var(--s4); } +} + +/* Short windows: the hero keeps its title, line and buttons in view. */ +@media (max-height: 760px) and (min-width: 901px) { + .hero { padding-top: 48px; } + h1 { font-size: clamp(56px, 12vh, 96px); } + .lede { margin-top: var(--s4); } + .actions { margin-top: var(--s5); } + .rows { margin-top: var(--s6); } + .sidebar > .wordmark { padding-bottom: var(--s5); } +} + +@media (max-width: 420px) { + main { padding: 0 16px; } + h1 { font-size: 64px; } + h2 { font-size: 34px; } +} + +.footer p { max-width: 36em; } +.topbar .wordmark { display: inline-flex; align-items: center; min-height: 44px; } +@media (max-width: 420px) { + html { font-size: 14.5px; } + .prose, .row dd { letter-spacing: -0.003em; } +} +.js .gallery[hidden] { display: none; } +.prose p, .prose li, .section-lede, .row dd { max-width: 56ch; } +.hero { max-width: var(--wide) !important; } +.hero > .rows, .hero > .download-meta { max-width: var(--content); } +.hero > .lede { max-width: 34em; } +main { position: relative; z-index: 0; } +@media (max-width: 900px) { + .sidebar { background: var(--sidebar); z-index: 12; } +}