diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6577d49e..8966854c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,10 @@ concurrency: # A new push to a pull request replaces its running checks; main's runs all finish (releases follow them). group: checks-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} +env: + # Test runs never reach the telemetry server: no live-count ping, no uploads (docs/telemetry.md). + HORIZON_TELEMETRY_URL: "off" + jobs: verify: runs-on: ubuntu-latest diff --git a/.github/workflows/launcher.yml b/.github/workflows/launcher.yml index 79ea852fb..02c61cdd1 100644 --- a/.github/workflows/launcher.yml +++ b/.github/workflows/launcher.yml @@ -49,6 +49,10 @@ concurrency: group: launcher-${{ github.ref == 'refs/heads/main' && 'release' || github.ref }} cancel-in-progress: false +env: + # Test runs never reach the telemetry server: no live-count ping, no uploads (docs/telemetry.md). + HORIZON_TELEMETRY_URL: "off" + jobs: decide: runs-on: ubuntu-latest @@ -188,9 +192,6 @@ jobs: retry "$launcher" install latest "$launcher" versions --installed "$launcher" links --json - "$launcher" menu-style classic - grep -qx 'menuStyle:classic' "$HORIZON_HOME/horizon.txt" - "$launcher" menu-style horizon clients=("$HORIZON_LAUNCHER_HOME"/versions/v*/horizon-client*) client="${clients[0]}" echo "installed client: $client" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 689cdae59..51f9e89cd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -23,6 +23,10 @@ permissions: concurrency: group: nightly-audit cancel-in-progress: false +env: + # Test runs never reach the telemetry server: no live-count ping, no uploads (docs/telemetry.md). + HORIZON_TELEMETRY_URL: "off" + jobs: audit: runs-on: [self-hosted, horizon-game] diff --git a/.github/workflows/parity.yml b/.github/workflows/parity.yml index 7289fe4de..a18fc5019 100644 --- a/.github/workflows/parity.yml +++ b/.github/workflows/parity.yml @@ -15,6 +15,10 @@ on: required: true permissions: contents: read +env: + # Test runs never reach the telemetry server: no live-count ping, no uploads (docs/telemetry.md). + HORIZON_TELEMETRY_URL: "off" + jobs: parity: runs-on: [self-hosted, horizon-game] diff --git a/.github/workflows/run-parity.yml b/.github/workflows/run-parity.yml index fd3cce6f8..a2b8e3291 100644 --- a/.github/workflows/run-parity.yml +++ b/.github/workflows/run-parity.yml @@ -11,6 +11,10 @@ permissions: concurrency: group: run-parity-${{ github.event.pull_request.number }} cancel-in-progress: true +env: + # Test runs never reach the telemetry server: no live-count ping, no uploads (docs/telemetry.md). + HORIZON_TELEMETRY_URL: "off" + jobs: parity: if: github.event.label.name == 'run-parity' diff --git a/README.md b/README.md index 72b6a3496..4abb52b86 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ The [documentation](https://playhorizon.dev/docs/) covers each of these. - **The game:** singleplayer with vanilla's world generation, mobs, villagers, raids, redstone, every command, the HUD and the recipe book, on saves in vanilla's format. Worlds from 1.8 to 26.2 are upgraded as vanilla does. [Status table](#project-status). - **Horizon's own extras:** new menus (vanilla's are one setting away), graphics presets, distant terrain up to 1024 chunks, controller support, optional zoom, minimap and more, all off by default where they would change the vanilla look. See [Settings](https://playhorizon.dev/docs/settings). - **Resource packs, shader packs and data packs:** resource packs work, Java shader packs run their full-screen effects (experimental), and data packs load functions, predicates and item modifiers. -- **Playing with others:** invite friends from the pause menu with a code, Open to LAN, and joining offline-mode servers. Horizon cannot sign in to a Microsoft account yet, so it cannot join servers that check accounts. See [Multiplayer](https://playhorizon.dev/docs/multiplayer). +- **Playing with others:** invite friends from the pause menu's Friends button with a code, Open to LAN, and joining offline-mode servers. Horizon cannot sign in to a Microsoft account yet, so it cannot join servers that check accounts. See [Multiplayer](https://playhorizon.dev/docs/multiplayer). - **Mods:** Horizon has its own mod system (Rust compiled to WebAssembly). Java mod jars do not run. See [Mods and data packs](https://playhorizon.dev/docs/mods). Screenshots, captured in the Rust client itself with vanilla assets and no mods or shaders: @@ -56,8 +56,8 @@ Screenshots, captured in the Rust client itself with vanilla assets and no mods Sunset over a savanna river valley and a plains village - Horizon's title screen over a veiled snowy landscape - The Video settings in their Simple view: a preset, render distance, field of view, framerate, VSync and GUI scale, each with what it costs + Survival at dusk: a zombie walks up, with the hotbar, health, hunger and experience + Vanilla's Video Settings screen with Horizon's own buttons at the top: Horizon Graphics, Advanced Graphics and Shader Packs A plains village among savanna hills, with farms, villagers and an iron golem diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 368813ecf..88d3197af 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -36,3 +36,15 @@ SOFTWARE. developers, with one upstream fix applied ([gfx-rs/wgpu#10124](https://github.com/gfx-rs/wgpu/pull/10124)). It is licensed under MIT or Apache-2.0; both licenses are in that folder (`LICENSE.MIT`, `LICENSE.APACHE`). + +## Pixelify Sans + +`crates/horizon-theme/fonts/PixelifySans-*.ttf` is [Pixelify Sans](https://github.com/eifetx/Pixelify-Sans) +by The Pixelify Sans Project Authors, licensed under the SIL Open Font License 1.1 +(`crates/horizon-theme/fonts/OFL-PixelifySans.txt`). + +## Pixelarticons + +`crates/horizon-theme/icons/pixel/*.svg` are icons from +[Pixelarticons](https://github.com/halfmage/pixelarticons) by Gerrit Halfmann, under the MIT +license (`crates/horizon-theme/icons/pixel/LICENSE-pixelarticons.txt`). diff --git a/crates/horizon-client/examples/weather_fixture.rs b/crates/horizon-client/examples/weather_fixture.rs index 15aab6bdb..3cf6c31be 100644 --- a/crates/horizon-client/examples/weather_fixture.rs +++ b/crates/horizon-client/examples/weather_fixture.rs @@ -11,6 +11,7 @@ fn bits(value: f32) -> String { fn main() -> Result<(), Box> { let args: Vec<_> = std::env::args().collect(); let mut output = String::new(); + let mut parameters = weather::ParameterCache::default(); for (case, line) in fs::read_to_string(&args[1])?.lines().enumerate() { let p: Vec<&str> = line.split_whitespace().collect(); let int = |i: usize| p[i].parse::().unwrap(); @@ -38,6 +39,13 @@ fn main() -> Result<(), Box> { bits(column.v_offset), column.light_coords )?; + assert_eq!( + parameters + .get(x, z) + .column(kind != 0, ticks, x, bottom, top, z, light, partial), + column, + "cached parameters differ from original random source at case {case}" + ); let max_alpha = if kind == 0 { 1.0 } else { 0.8 }; for v in weather::column_quad(&column, camera, max_alpha, radius, intensity) { write!( diff --git a/crates/horizon-client/src/entity.wgsl b/crates/horizon-client/src/entity.wgsl index 3b5dd9dcc..2e865dfb1 100644 --- a/crates/horizon-client/src/entity.wgsl +++ b/crates/horizon-client/src/entity.wgsl @@ -43,6 +43,7 @@ struct Out { @location(8) back_color: vec4, // entity.vsh's lightMapColor, multiplied in after the overlay. @location(9) light_color: vec4, + @location(10) @interpolate(flat) weather_rect: vec4, } // Shipped light.glsl; normals are already transformed and RGBA8_SNORM packed. fn entity_light(normal: vec3, nether: bool) -> f32 { @@ -216,3 +217,135 @@ fn linear_fog(d: f32, start: f32, end: f32) -> f32 { @fragment fn fs_water_mask() -> @location(0) vec4 { return vec4(0.0); } + +// WEATHER_MATH_BEGIN +// Unsigned 64-bit helpers (low word first). Snow adds a random double to a +// float drift before casting to float. Retaining the 53-bit base avoids early +// rounding, including ties, without requiring optional GPU float64 support. +fn weather_shr_jam(v: vec2, n: u32) -> vec2 { + if n == 0u { return v; } + if n < 32u { + return vec2((v.x >> n) | (v.y << (32u - n)) | select(0u, 1u, (v.x << (32u - n)) != 0u), v.y >> n); + } + if n == 32u { return vec2(v.y | select(0u, 1u, v.x != 0u), 0u); } + if n < 64u { + return vec2((v.y >> (n - 32u)) | select(0u, 1u, v.x != 0u || (v.y << (64u - n)) != 0u), 0u); + } + return vec2(select(0u, 1u, any(v != vec2(0u))), 0u); +} +fn weather_add64(a: vec2, b: vec2) -> vec2 { + let lo = a.x + b.x; + return vec2(lo, a.y + b.y + select(0u, 1u, lo < a.x)); +} +fn weather_sub64(a: vec2, b: vec2) -> vec2 { + return vec2(a.x - b.x, a.y - b.y - select(0u, 1u, a.x < b.x)); +} +fn weather_double_plus_float(base: vec2, delta: f32) -> f32 { + // The random base is nonnegative and either zero or >= 2^-53. + if all(base == vec2(0u)) { return select(delta, 0.0, delta == 0.0); } + let db = bitcast(delta); + let mag = db & 0x7fffffffu; + let be = i32((base.y >> 20u) & 2047u) - 1023; + var de = i32(mag >> 23u) - 127; + var dm = (mag & 0x7fffffu) | 0x800000u; + if mag < 0x800000u { + dm = mag; + if dm == 0u { de = -200; } + else { + let shift = countLeadingZeros(dm) - 8u; + dm <<= shift; + de = -126 - i32(shift); + } + } + let e = max(be, de); + // Leading significand bit at 61, with room for addition and guard bits. + var a = vec2(base.x << 9u, ((base.y & 0xfffffu) | 0x100000u) << 9u | (base.x >> 23u)); + var b = vec2(0u, dm << 6u); + a = weather_shr_jam(a, u32(e - be)); + b = weather_shr_jam(b, u32(e - de)); + var sign = 0u; + var value: vec2; + if (db >> 31u) == 0u { value = weather_add64(a, b); } + else if a.y > b.y || (a.y == b.y && a.x >= b.x) { value = weather_sub64(a, b); } + else { value = weather_sub64(b, a); sign = 0x80000000u; } + if all(value == vec2(0u)) { return 0.0; } + let leading = select(31u - countLeadingZeros(value.x), 63u - countLeadingZeros(value.y), value.y != 0u); + var exponent = e + i32(leading) - 61; + // Normalize the leading bit to 62. After jamming, bit 38 is the guard + // bit and bits 0..37 distinguish a tie from a value above the midpoint. + let shift = 62u - leading; + if shift >= 32u { value = vec2(0u, value.x << (shift - 32u)); } + else if shift != 0u { value = vec2(value.x << shift, (value.y << shift) | (value.x >> (32u - shift))); } + // Vanilla first rounds the addition to double, then casts to float. + // Round at bit 10 (53 retained bits) before the 24-bit rounding below; + // otherwise a double-rounding midpoint can select the wrong float. + let double_guard = (value.x & 512u) != 0u; + let double_sticky = (value.x & 511u) != 0u; + let double_odd = (value.x & 1024u) != 0u; + value.x &= 0xfffffc00u; + if double_guard && (double_sticky || double_odd) { + value = weather_add64(value, vec2(1024u, 0u)); + } + if (value.y & 0x80000000u) != 0u { + value = weather_shr_jam(value, 1u); + exponent += 1; + } + var mantissa = value.y >> 7u; + let guard = (value.y & 64u) != 0u; + let sticky = (value.y & 63u) != 0u || value.x != 0u; + if guard && (sticky || (mantissa & 1u) != 0u) { mantissa += 1u; } + if mantissa >= 0x1000000u { mantissa >>= 1u; exponent += 1; } + return bitcast(sign | (u32(exponent + 127) << 23u) | (mantissa & 0x7fffffu)); +} +fn weather_phase(animation: vec4, bases: vec4, snow: u32, time: vec4) -> vec2 { + if snow == 0u { + let ticks = time.x + animation.y; + let t = ticks + time.z; + let step = -t / 32.0; + let offset = step * animation.x; + return vec2(0.0, offset % 32.0); + } + let t = time.x + time.z; + let u_time = t * 0.01; + let du = u_time * animation.z; + let v_time = t * animation.w; + let dv = v_time * 0.001; + let u = weather_double_plus_float(bases.xy, du); + let v = weather_double_plus_float(bases.zw, dv); + let fall_time = time.y + time.z; + let fall = -fall_time / 512.0; + return vec2(u, fall + v); +} +// Atlas sampler is nearest with no mipmaps. Clamp the integer texel inside +// the sprite even when a fractional coordinate rounds up at its far edge. +fn weather_texel(uv: vec2, rect: vec4, dimensions: vec2) -> vec2 { + let size = vec2(dimensions); + let origin = vec2(round(rect.xy * size)); + let extent = max(vec2(round(rect.zw * size)), vec2(1)); + let local = min(vec2(floor(fract(uv) * vec2(extent))), extent - vec2(1)); + return origin + local; +} +// WEATHER_MATH_END + +struct WeatherTime { values: vec4 } +@group(1) @binding(1) var weather_time: WeatherTime; +@vertex fn vs_weather(@location(0) position: vec3, @location(1) uv: vec2, + @location(2) rect: vec4, @location(3) animation: vec4, + @location(4) bases: vec4, @location(5) color: vec4, + @location(6) light: vec4, @location(7) snow: u32) -> Out { + let phase = weather_phase(animation, bases, snow, weather_time.values); + var out = entity_vertex(position, uv + phase, 0u, color, light, vec4(0.0)); + out.weather_rect = rect; + return out; +} +@fragment fn fs_weather(in: Out) -> @location(0) vec4 { + // Repeat within this sprite, never across the atlas. The atlas uses nearest + // filtering and no mipmaps, so fractional UVs have no seam derivatives. + let texel = weather_texel(in.uv, in.weather_rect, textureDimensions(atlas)); + var color = textureLoad(atlas, texel, 0) * in.color; + if color.a < 0.1 { discard; } + color *= in.light_color; + let f = max(linear_fog(in.spherical, globals.fog.x, globals.fog.y), + linear_fog(in.cylindrical, globals.fog.z, globals.fog.w)); + return vec4(mix(color.rgb, globals.fog_color.rgb, f * globals.fog_color.a), color.a); +} diff --git a/crates/horizon-client/src/friends_screen.rs b/crates/horizon-client/src/friends_screen.rs new file mode 100644 index 000000000..7577e2add --- /dev/null +++ b/crates/horizon-client/src/friends_screen.rs @@ -0,0 +1,303 @@ +//! Play with Friends: Horizon's own sharing of the open world behind an +//! invite code (`game/friends.rs`). The pause menu's Friends button, the icon +//! vanilla's PauseScreen already has, opens it. It is drawn the way a mod adds +//! a screen to vanilla: the menu background, a centred title and text, +//! vanilla's buttons and Done in the footer. +use crate::{ + hud::{HudAtlas, HudBatch, rgba}, + multiplayer::wrap, + text::Text, + ui, +}; + +pub const TITLE: &str = "Play with Friends"; +/// What the screen shows (game/friends.rs fills it). +#[derive(Clone, Debug, Default)] +pub struct FriendsView { + /// A singleplayer world (not a server): sharing is offered. + pub shown: bool, + pub sharing: bool, + pub code: Option, + /// Who can join and what to do when friends on the internet can't (or, + /// before the code, what the game is doing). + pub status: String, + /// Friends on the internet can reach the host. + pub reachable: bool, + /// Where the troubleshooting is, when they can't. + pub help: Option, + /// The players in the world besides the host. + pub guests: Vec, + pub notice: Option, + /// The code was just copied. + pub copied: bool, +} + +/// A button's action. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Action { + Share, + Copy, + Stop, + /// Open the troubleshooting page. + Help, + Done, +} + +fn grey() -> u32 { + rgba(160, 160, 160, 255) +} +const WHITE: u32 = u32::MAX; +const HINT: &str = "Friends paste the code after the title screen's Friends button, in Direct Connection, or on the launcher's Play page."; + +struct Button { + x: f32, + y: f32, + w: f32, + label: &'static str, + action: Action, + active: bool, +} + +/// The centred lines (text, colour, y) and the buttons. +fn layout( + atlas: &HudAtlas, + (w, h): (f32, f32), + view: &FriendsView, +) -> (Vec<(String, u32, f32)>, Vec + GitHub + Download + + + + + `; +const siteFooter = ` `; + +const fixed = (x, n) => Number(x).toFixed(n); +const specTable = + `` + + GPUS.map((g) => ``).join("") + + `
Graphics cardFP32 TFLOPSBandwidth, GB/s
${escape(g.name)}${fixed(g.tflops, 1)}${g.gbps}
` + + CPUS.map((c) => ``).join("") + + `
ProcessorBoost, GHzGeneration factorSingle-thread score
${escape(c.name)}${fixed(c.ghz, 2)}${fixed(c.ipc, 2)}${fixed(singleThread(c), 2)}
`; +const options = (list, selected) => list.map((x) => `${escape(x.name)}`).join(""); +const playersGroups = benchSummary.groups.filter((g) => g.source === "players"); const values = { CSS: `/assets/${cssName}`, @@ -195,7 +257,21 @@ const values = { PARITY_CELLS: parityCells, PARITY_HEADLINE: parityHeadline, SUBSYSTEMS: String(body.length), - NOTES: notesHtml, + RECENT: recentHtml(game) || unavailable, + SITE_NAV: "", + SITE_FOOTER: siteFooter, + RELEASES_JS: `/assets/${names["releases-page.js"]}`, + RELEASE_LIST: releasesPageHtml(ours) || unavailable, + RELEASE_COUNT: ours.length ? `${ours.length} releases` : "", + NEWEST_TAG: escape(ours[0]?.tag_name || ""), + BENCH_JS: `/assets/${names["benchmarks-page.js"]}`, + MACHINES: machinesHtml(benchSummary), + PLAYERS: playersHtml(benchSummary), + PLAYERS_SOURCE: `${playersGroups.length ? `${playersGroups.length} groups` : "No groups yet"}, as of ${benchSummary.generated.slice(0, 10)}. The page asks the telemetry server for newer ones.`, + GPU_OPTIONS: options(GPUS, "NVIDIA GeForce RTX 4060"), + CPU_OPTIONS: options(CPUS, "AMD Ryzen 5 5600X"), + SPEC_TABLE: specTable, + BENCH_DATA: JSON.stringify(benchSummary).replace(/ { }; }); -const pages = ["index.html", "404.html", "privacy.html"]; +const pages = ["index.html", "404.html", "privacy.html", "releases.html", "benchmarks.html"]; +const currentPath = { "releases.html": "/releases", "benchmarks.html": "/benchmarks" }; for (const page of pages) { let html = await readFile(join(site, "src", page), "utf8"); + const own = { ...values, SITE_NAV: siteNav(currentPath[page]) }; html = html.replace(/\{\{(\w+)\}\}/g, (all, key) => { - if (!(key in values)) throw new Error(`${page}: unknown placeholder ${all}`); - return values[key]; + if (!(key in own)) throw new Error(`${page}: unknown placeholder ${all}`); + return own[key]; }); html = html.replace(/href="\/(favicon\.svg|favicon-32\.png|apple-touch-icon\.png)"/g, (all, icon) => `href="/${icon}?v=${iconVersions[icon]}"`); await writeFile(join(dist, page), html); @@ -306,7 +384,7 @@ const hashes = (re) => [...new Set([...allHtml.matchAll(re)].map((m) => `'sha256 await writeFile(join(dist, ".csp-script"), hashes(/ + + + + +{{SITE_NAV}} +
+
+

BenchmarksHorizon against Java Edition 26.3

+

Same machine, same world, same flight.

+

We run Horizon and vanilla Minecraft: Java Edition 26.3 one after the other on the same computer: a fresh world from the same seed, the same settings, and the same four flights over a village, a forest, the ocean and a mountain. Every figure comes from the same code for both games. Where Java does better, the tables say so.

+ +
+

Measured by us

+

The project's own machines, at render distance 12 (vanilla's default) and 32. VSync off, no frame cap, a 1280x720 window, simulation distance 12, everything else at vanilla's defaults. Each figure is the median over the runs; the frame figures are averaged over the four flights.

+
+{{MACHINES}} +
+
+

Not yet measured against Java: the desktop (RTX 4080, Core i7-13700KF). It is in daily use; the comparison runs on it once it is free. The last figures from it are Horizon alone, from an older build (2026-10-13, offscreen, tools/graphics_bench.py): over the village, 2,409 FPS at render distance 8, 1,041 at 16 and 48 at 32, where that build still stuttered while loading. They are not comparable with the tables above; the picker estimates the RTX 4080 from the measured machines instead.

+
+
+ +
+

Your hardware

+

Pick a graphics card and a processor. If we or at least three players have measured that pair, you see what was measured; otherwise an estimate from the nearest measured machine, as a range.

+
+ + +
Render distance + + +
+
+

The picker needs JavaScript; the tables above and the method below work without it.

+
+ +
+

From players

+

Players who allow benchmark uploads in the launcher's data collection settings share the report of horizon-client --benchmark standard. Results are grouped by graphics card, processor and render distance, and a group shows only once at least 3 different installs are in it, so no one can be picked out. Only medians are published: no install ID, date, driver, memory size or screen.

+

{{PLAYERS_SOURCE}}

+
+{{PLAYERS}} +
+
+ +
+

How the estimates work

+
+

An estimate starts from the measured machine closest to the one you picked, then scales its figures with a small table of specifications we wrote ourselves (no benchmark database):

+
    +
  • GPU factor: the geometric mean of the two graphics cards' ratio of FP32 shader throughput (TFLOPS) and of memory bandwidth (GB/s), as their makers state them.
  • +
  • CPU factor: the ratio of the two processors' single-thread scores: top boost clock times a rough factor per chip generation (Zen 4 = 1).
  • +
  • Frame rate: when the measured run split each frame into CPU and GPU time, the slower side is scaled by its factor; otherwise by the geometric mean of both. Whatever the split, the real figure lies between the measured one scaled by the smaller and by the larger factor; we widen that by 15% for the roughness of the table, and show it as the range.
  • +
  • Load times are CPU work (generating, lighting and meshing chunks), scaled by the CPU factor. Memory is not scaled: it follows the world and the settings, not the speed.
  • +
+

Estimates ignore drivers, the graphics API, thermal limits and the operating system, which can matter as much as the chip. Treat them as a rough idea, and run horizon-client --benchmark standard on your own machine for the real figure.

+
+
+ The specification table +
{{SPEC_TABLE}}
+
+
+ +
+

How we measure

+
+

tools/perf_bench.py starts each game from a fresh world (seed 1234, creative), waits until every chunk around the spawn is loaded and drawn, then for each scene teleports, waits for the chunks, holds for 2 seconds and flies a straight 192-block path in 12 seconds. Every frame is recorded. Vanilla runs as players get it (your own client, the official launcher's Java options, Java 25), driven by a small development-only mod that only calls the game's own code; nothing of Minecraft is shipped. The full method and its caveats are in docs/benchmark.md, and every raw report is in the repository.

+

Measure your own computer with horizon-client --benchmark standard --render-distance 12: it writes a report to the benchmarks folder of the game folder.

+
+
+

Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

+
+
+{{SITE_FOOTER}} + + + diff --git a/website/src/chrome.js b/website/src/chrome.js new file mode 100644 index 000000000..e70bfb073 --- /dev/null +++ b/website/src/chrome.js @@ -0,0 +1,90 @@ +// What every page with the site's top bar shares: the light and dark switch and the phone menu. +// Used by main.js (the home page) and page.js (Releases, Benchmarks). +const reducedMotion = matchMedia("(prefers-reduced-motion: reduce)").matches; + +// The page follows the system; the toggle picks the other appearance and remembers it. +export function setUpTheme() { + const root = document.documentElement; + const button = document.querySelector(".theme-toggle"); + if (!button) return; + const label = button.querySelector("[data-theme-label]"); + const system = matchMedia("(prefers-color-scheme: dark)"); + const dark = () => (root.dataset.theme ? root.dataset.theme === "dark" : system.matches); + const show = () => (label.textContent = dark() ? "Light" : "Dark"); + button.addEventListener("click", () => { + root.dataset.theme = dark() ? "light" : "dark"; + try { + localStorage.setItem("theme", root.dataset.theme); + } catch {} + show(); + }); + system.addEventListener("change", show); + show(); +} + +// The phone menu: a full-screen sheet; the page behind it is inert while it is open. +export function setUpMenu() { + const bar = document.querySelector(".nav"); + const button = document.querySelector(".menu-button"); + const menu = document.getElementById("menu"); + const main = document.getElementById("main"); + if (!bar || !button || !menu) return; + const label = button.querySelector(".menu-label"); + const items = [...menu.querySelectorAll("nav a")]; + items.forEach((a, i) => a.style.setProperty("transition-delay", `${60 + i * 35}ms`)); + let closing; + const setOpen = (open) => { + clearTimeout(closing); + button.setAttribute("aria-expanded", String(open)); + label.textContent = open ? "Close" : "Menu"; + bar.classList.toggle("is-menu", open); + main.inert = open; + document.body.style.overflow = open ? "hidden" : ""; + if (open) { + menu.hidden = false; + requestAnimationFrame(() => requestAnimationFrame(() => menu.classList.add("is-open"))); + items[0].focus({ preventScroll: true }); + } else { + menu.classList.remove("is-open"); + closing = setTimeout(() => (menu.hidden = true), reducedMotion ? 0 : 320); + } + }; + button.addEventListener("click", () => setOpen(button.getAttribute("aria-expanded") !== "true")); + items.forEach((a) => a.addEventListener("click", () => setOpen(false))); + addEventListener("keydown", (e) => { + if (e.key === "Escape" && button.getAttribute("aria-expanded") === "true") { + setOpen(false); + button.focus(); + } + }); + matchMedia("(min-width: 1120px)").addEventListener("change", (e) => e.matches && setOpen(false)); +} + +// GitHub answers, cached for ten minutes in the tab. +export 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; +} + +export 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(); +} + +export const slim = (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 })), +}); diff --git a/website/src/docs.html b/website/src/docs.html index 746e84fad..67b282f82 100644 --- a/website/src/docs.html +++ b/website/src/docs.html @@ -5,8 +5,8 @@ {{DOC_TITLE}} · Horizon docs - - + + diff --git a/website/src/estimate.js b/website/src/estimate.js new file mode 100644 index 000000000..245ec4094 --- /dev/null +++ b/website/src/estimate.js @@ -0,0 +1,77 @@ +// Estimates for hardware nobody has measured yet, from the nearest measured machine and the spec table +// (src/hardware.js). The method, which the Benchmarks page explains: +// +// - GPU factor: the geometric mean of the two GPUs' FP32 throughput ratio and memory bandwidth ratio. +// - CPU factor: the ratio of the two CPUs' single-thread scores (boost clock x generation factor). +// - Frames: when the measured run split each frame into CPU and GPU time, the slower of the two is scaled by its +// own factor; otherwise the frame rate is scaled by the geometric mean of both factors. Whatever the split, the +// true figure lies between the measured one scaled by the smaller and by the larger factor, widened by 15% for +// the roughness of the table: that is the range shown. +// - World and chunk load times are CPU work (generation, lighting, meshing): scaled by the CPU factor. +// - Memory is not scaled: it depends on the world and settings, not on speed. +import { findCpu, findGpu, singleThread } from "./hardware.js"; + +const MARGIN = 0.15; + +export function factors(fromGpu, fromCpu, toGpu, toCpu) { + const gpu = Math.sqrt((toGpu.tflops / fromGpu.tflops) * (toGpu.gbps / fromGpu.gbps)); + const cpu = singleThread(toCpu) / singleThread(fromCpu); + return { gpu, cpu }; +} + +const distance = (f) => Math.abs(Math.log(f.gpu)) + Math.abs(Math.log(f.cpu)); + +// The rows (benchmarks.json groups) usable as a base: a known GPU and CPU. +function known(rows) { + return rows.map((row) => ({ row, gpu: findGpu(row.gpu), cpu: findCpu(row.cpu) })).filter((r) => r.gpu && r.cpu); +} + +// The measured row for exactly this GPU and CPU, players' first when there are some (more installs), or null. +export function measured(rows, gpu, cpu, rd, game) { + const hits = known(rows).filter((r) => r.gpu === gpu && r.cpu === cpu && r.row.render_distance === rd && r.row.game === game); + hits.sort((a, b) => (b.row.installs || 0) - (a.row.installs || 0)); + return hits.map((r) => r.row); +} + +// The nearest measured machine for a target GPU and CPU, for one game and render distance. +export function nearest(rows, gpu, cpu, rd, game) { + let best = null; + for (const r of known(rows)) { + if (r.row.render_distance !== rd || r.row.game !== game) continue; + const f = factors(r.gpu, r.cpu, gpu, cpu); + const d = distance(f); + if (!best || d < best.d) best = { ...r, f, d }; + } + return best; +} + +export function estimate(rows, gpu, cpu, rd, game) { + const base = nearest(rows, gpu, cpu, rd, game); + if (!base) return null; + const m = base.row.medians; + const { gpu: g, cpu: c } = base.f; + const lo = Math.min(g, c) * (1 - MARGIN); + const hi = Math.max(g, c) * (1 + MARGIN); + let scale = Math.sqrt(g * c); + if (m.cpu_p50_ms && m.gpu_p50_ms) { + const worst = Math.max(m.cpu_p50_ms, m.gpu_p50_ms); + scale = worst / Math.max(m.cpu_p50_ms / c, m.gpu_p50_ms / g); + } + scale = Math.min(hi, Math.max(lo, scale)); + const fps = (x) => (x == null ? null : { value: x * scale, low: x * lo, high: x * hi }); + // A base held to its display's refresh rate gives only a floor for the average. + const avg = fps(m.avg_fps); + if (avg && base.row.capped_fps && m.avg_fps >= base.row.capped_fps * 0.97) Object.assign(avg, { value: null, high: null, atLeast: true }); + const time = (x, f) => (x == null ? null : { value: x / f, low: x / (f * (1 + MARGIN)), high: x / (f * (1 - MARGIN)) }); + return { + base: base.row, + factors: base.f, + avg_fps: avg, + low_1pct_fps: fps(m.low_1pct_fps), + p95_ms: m.p95_ms == null ? null : { value: m.p95_ms / scale, low: m.p95_ms / hi, high: m.p95_ms / lo }, + world_ms: time(m.world_ms, c), + chunk_load_ms: time(m.chunk_load_ms, c), + rss_steady_mb: m.rss_steady_mb == null ? null : { value: m.rss_steady_mb }, + rss_peak_mb: m.rss_peak_mb == null ? null : { value: m.rss_peak_mb }, + }; +} diff --git a/website/src/estimate.test.mjs b/website/src/estimate.test.mjs new file mode 100644 index 000000000..3666b7fa1 --- /dev/null +++ b/website/src/estimate.test.mjs @@ -0,0 +1,64 @@ +// node --test website/src/ (npm test in website/) +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { estimate, factors, measured, nearest } from "./estimate.js"; +import { CPUS, GPUS, findCpu, findGpu } from "./hardware.js"; + +const row = (gpu, cpu, medians, extra = {}) => ({ gpu, cpu, render_distance: 12, game: "horizon", source: "us", medians, ...extra }); +const mac = row("Apple M4 Pro", "Apple M4 Pro", { avg_fps: 500, low_1pct_fps: 100, p95_ms: 3, world_ms: 4000, chunk_load_ms: 1000, rss_peak_mb: 1500, rss_steady_mb: 1200 }); +const laptop = row("Mesa Intel HD Graphics 620 (KBL GT2)", "Intel Core i7-7500U CPU @ 2.70GHz", { avg_fps: 100, low_1pct_fps: 20, p95_ms: 15, world_ms: 12000, chunk_load_ms: 5000, rss_peak_mb: 1400, rss_steady_mb: 1100, cpu_p50_ms: 4, gpu_p50_ms: 9 }); + +test("every reported name of our machines is in the table", () => { + assert.equal(findGpu("Apple M4 Pro").name, "Apple M4 Pro (20-core GPU)"); + assert.equal(findGpu("Mesa Intel HD Graphics 620 (KBL GT2)").name, "Intel HD Graphics 620"); + assert.equal(findGpu("NVIDIA GeForce RTX 4080").name, "NVIDIA GeForce RTX 4080"); + assert.equal(findGpu("NVIDIA GeForce RTX 4080 SUPER"), null); + assert.equal(findCpu("13th Gen Intel Core i7-13700KF").name, "Intel Core i7-13700K / KF"); + assert.equal(findCpu("Intel Core i7-7500U CPU @ 2.70GHz").name, "Intel Core i7-7500U"); + for (const g of GPUS) assert.equal(findGpu(g.name), g, g.name); + for (const c of CPUS) assert.equal(findCpu(c.name), c, c.name); +}); + +test("an exact match is a measurement, not an estimate", () => { + assert.deepEqual(measured([mac, laptop], findGpu("Apple M4 Pro"), findCpu("Apple M4 Pro"), 12, "horizon"), [mac]); + assert.deepEqual(measured([mac], findGpu("Apple M4 Pro"), findCpu("Apple M4 Pro"), 32, "horizon"), []); +}); + +test("the nearest machine is the base, and the range holds the estimate", () => { + const gpu = findGpu("Intel Iris Xe Graphics (96 EU)"); + const cpu = findCpu("Intel Core i5-1135G7"); + assert.equal(nearest([mac, laptop], gpu, cpu, 12, "horizon").row, laptop); + const e = estimate([mac, laptop], gpu, cpu, 12, "horizon"); + const f = factors(findGpu(laptop.gpu), findCpu(laptop.cpu), gpu, cpu); + assert.ok(f.gpu > 1 && f.cpu > 1); + for (const key of ["avg_fps", "low_1pct_fps", "p95_ms", "world_ms", "chunk_load_ms"]) { + const { value, low, high } = e[key]; + assert.ok(low <= value && value <= high, key); + } + // GPU-bound frames (9 ms GPU, 4 ms CPU) follow the GPU factor. + assert.ok(Math.abs(e.avg_fps.value - 100 * Math.min(f.gpu, 9 / (4 / f.cpu))) < 1e-9); + assert.ok(Math.abs(e.world_ms.value - 12000 / f.cpu) < 1e-9); + assert.equal(e.rss_steady_mb.value, 1100); +}); + +test("no base, no estimate", () => { + assert.equal(estimate([mac], findGpu("Apple M4"), findCpu("Apple M4"), 32, "horizon"), null); + assert.equal(estimate([mac], findGpu("Apple M4"), findCpu("Apple M4"), 12, "vanilla"), null); +}); + +test("a base held to its display's refresh rate gives only a floor for the average", () => { + const held = { ...mac, capped_fps: 144, medians: { ...mac.medians, avg_fps: 144 } }; + const e = estimate([held], findGpu("NVIDIA GeForce RTX 4060"), findCpu("AMD Ryzen 5 5600X"), 12, "horizon"); + assert.equal(e.avg_fps.atLeast, true); + assert.equal(e.avg_fps.high, null); + assert.ok(e.avg_fps.low > 0); + // The lows sit under the cap: still a range. + assert.ok(e.low_1pct_fps.high > e.low_1pct_fps.low); +}); + +test("a release title of issue numbers falls back to its notes", async () => { + const { parts } = await import("./releases.js"); + const r = { tag_name: "v2026.10.22.07", name: "Horizon 2026.10.22.07: #1255, mob pushes, fix, #1222", body: "### Fixed\n- Fix #1222: single player runs in the frame again (#1257, fixes #1222)\n- Mob pushes: one list per mob (#1205)\n" }; + assert.equal(parts(r).line, "Single player runs in the frame again and 1 more"); + assert.equal(parts({ ...r, name: "Horizon 2026.10.22.05: Hoppers, mob tick, server tick" }).line, "Hoppers, mob tick, server tick"); +}); diff --git a/website/src/hardware.js b/website/src/hardware.js new file mode 100644 index 000000000..d65c84ae2 --- /dev/null +++ b/website/src/hardware.js @@ -0,0 +1,73 @@ +// The hardware the Benchmarks page can estimate for, from specifications only (our own table, no benchmark +// database): each GPU's FP32 shader throughput in TFLOPS and its memory bandwidth in GB/s as its maker states them, +// and each CPU's single-thread score = its top boost clock (GHz) x our rough per-generation factor (instructions per +// clock, Zen 4 = 1). The factors are round numbers, so estimates are ranges, and the page says so. +// `match` finds a reported name (the GPU and CPU strings in benchmark reports) in this table. + +export const GPUS = [ + { name: "NVIDIA GeForce RTX 4090", tflops: 82.6, gbps: 1008, match: /RTX 4090/i }, + { name: "NVIDIA GeForce RTX 4080", tflops: 48.7, gbps: 717, match: /RTX 4080(?! SUPER)/i }, + { name: "NVIDIA GeForce RTX 4070 Ti", tflops: 40.1, gbps: 504, match: /RTX 4070 Ti/i }, + { name: "NVIDIA GeForce RTX 4070", tflops: 29.1, gbps: 504, match: /RTX 4070(?! Ti)/i }, + { name: "NVIDIA GeForce RTX 4060 Ti", tflops: 22.1, gbps: 288, match: /RTX 4060 Ti/i }, + { name: "NVIDIA GeForce RTX 4060", tflops: 15.1, gbps: 272, match: /RTX 4060(?! Ti)/i }, + { name: "NVIDIA GeForce RTX 3080", tflops: 29.8, gbps: 760, match: /RTX 3080(?! Ti)/i }, + { name: "NVIDIA GeForce RTX 3070", tflops: 20.3, gbps: 448, match: /RTX 3070(?! Ti)/i }, + { name: "NVIDIA GeForce RTX 3060", tflops: 12.7, gbps: 360, match: /RTX 3060(?! Ti)/i }, + { name: "NVIDIA GeForce RTX 3050", tflops: 9.1, gbps: 224, match: /RTX 3050/i }, + { name: "NVIDIA GeForce RTX 2060", tflops: 6.5, gbps: 336, match: /RTX 2060(?! SUPER)/i }, + { name: "NVIDIA GeForce GTX 1660 SUPER", tflops: 5.0, gbps: 336, match: /GTX 1660 SUPER/i }, + { name: "NVIDIA GeForce GTX 1060 6GB", tflops: 4.4, gbps: 192, match: /GTX 1060/i }, + { name: "NVIDIA GeForce GTX 1050 Ti", tflops: 2.1, gbps: 112, match: /GTX 1050 Ti/i }, + { name: "AMD Radeon RX 7900 XTX", tflops: 61.4, gbps: 960, match: /RX 7900 XTX/i }, + { name: "AMD Radeon RX 7800 XT", tflops: 37.3, gbps: 624, match: /RX 7800 XT/i }, + { name: "AMD Radeon RX 7600", tflops: 21.8, gbps: 288, match: /RX 7600(?! XT)/i }, + { name: "AMD Radeon RX 6700 XT", tflops: 13.2, gbps: 384, match: /RX 6700 XT/i }, + { name: "AMD Radeon RX 6600", tflops: 8.9, gbps: 224, match: /RX 6600(?! XT)/i }, + { name: "AMD Radeon RX 580", tflops: 6.2, gbps: 256, match: /RX 580/i }, + { name: "AMD Radeon 780M (integrated)", tflops: 8.6, gbps: 89, match: /780M/i }, + { name: "Steam Deck (AMD Van Gogh)", tflops: 1.6, gbps: 88, match: /VanGogh|Van Gogh|Custom GPU 0405/i }, + { name: "Intel Arc A770", tflops: 19.7, gbps: 560, match: /Arc.*A770/i }, + { name: "Intel Iris Xe Graphics (96 EU)", tflops: 2.1, gbps: 68, match: /Iris\(?R?\)? Xe/i }, + { name: "Intel HD Graphics 620", tflops: 0.4, gbps: 34, match: /\bU?HD Graphics 620\b/i }, + { name: "Apple M1", tflops: 2.6, gbps: 68, match: /^Apple M1$/i }, + { name: "Apple M2", tflops: 3.6, gbps: 100, match: /^Apple M2$/i }, + { name: "Apple M3", tflops: 4.1, gbps: 100, match: /^Apple M3$/i }, + { name: "Apple M4", tflops: 4.3, gbps: 120, match: /^Apple M4$/i }, + { name: "Apple M1 Pro (16-core GPU)", tflops: 5.2, gbps: 200, match: /^Apple M1 Pro$/i }, + { name: "Apple M4 Pro (20-core GPU)", tflops: 8.5, gbps: 273, match: /^Apple M4 Pro$/i }, + { name: "Apple M4 Max (40-core GPU)", tflops: 17.0, gbps: 546, match: /^Apple M4 Max$/i }, +]; + +// ghz: top single-core boost clock; ipc: our per-generation factor (Zen 4 = 1). +export const CPUS = [ + { name: "Intel Core i7-7500U", ghz: 3.5, ipc: 0.62, match: /i7-7500U/i }, + { name: "Intel Core i5-7200U", ghz: 3.1, ipc: 0.62, match: /i5-7200U/i }, + { name: "Intel Core i5-8250U", ghz: 3.4, ipc: 0.62, match: /i5-8250U/i }, + { name: "Intel Core i5-9400F", ghz: 4.1, ipc: 0.62, match: /i5-9400/i }, + { name: "Intel Core i7-9700K", ghz: 4.9, ipc: 0.62, match: /i7-9700K/i }, + { name: "Intel Core i5-10400", ghz: 4.3, ipc: 0.62, match: /i5-10400/i }, + { name: "Intel Core i5-1135G7", ghz: 4.2, ipc: 0.78, match: /i5-1135G7/i }, + { name: "Intel Core i5-12400", ghz: 4.4, ipc: 0.95, match: /i5-12400/i }, + { name: "Intel Core i5-13600K", ghz: 5.1, ipc: 0.95, match: /i5-13600K/i }, + { name: "Intel Core i7-13700K / KF", ghz: 5.4, ipc: 0.95, match: /i7-13700K/i }, + { name: "Intel Core i9-14900K", ghz: 6.0, ipc: 0.95, match: /i9-14900K/i }, + { name: "AMD Ryzen 5 3600", ghz: 4.2, ipc: 0.72, match: /Ryzen 5 3600/i }, + { name: "AMD Ryzen 5 5600X", ghz: 4.6, ipc: 0.88, match: /Ryzen 5 5600X?\b/i }, + { name: "AMD Ryzen 7 5800X3D", ghz: 4.5, ipc: 0.88, match: /5800X3D/i }, + { name: "AMD Ryzen 5 7600X", ghz: 5.3, ipc: 1.0, match: /Ryzen 5 7600/i }, + { name: "AMD Ryzen 7 7800X3D", ghz: 5.0, ipc: 1.0, match: /7800X3D/i }, + { name: "AMD Ryzen 9 7950X", ghz: 5.7, ipc: 1.0, match: /Ryzen 9 7950X(?!3D)/i }, + { name: "AMD Ryzen 7 9700X", ghz: 5.5, ipc: 1.12, match: /Ryzen 7 9700X/i }, + { name: "AMD Ryzen 7 7840U / HS", ghz: 5.1, ipc: 1.0, match: /7840(U|HS)/i }, + { name: "Steam Deck (AMD Zen 2, 4 cores)", ghz: 3.5, ipc: 0.72, match: /AMD Custom APU 0405|Van ?Gogh/i }, + { name: "Apple M1", ghz: 3.2, ipc: 1.25, match: /^Apple M1$/i }, + { name: "Apple M2", ghz: 3.5, ipc: 1.28, match: /^Apple M2$/i }, + { name: "Apple M3", ghz: 4.05, ipc: 1.38, match: /^Apple M3$/i }, + { name: "Apple M4", ghz: 4.4, ipc: 1.5, match: /^Apple M4$/i }, + { name: "Apple M4 Pro", ghz: 4.5, ipc: 1.5, match: /^Apple M4 Pro$/i }, +]; + +export const singleThread = (cpu) => cpu.ghz * cpu.ipc; +export const findGpu = (name) => GPUS.find((g) => g.name === name || g.match.test(name || "")) || null; +export const findCpu = (name) => CPUS.find((c) => c.name === name || c.match.test(name || "")) || null; diff --git a/website/src/index.html b/website/src/index.html index 270128d91..9c7c3ca3e 100644 --- a/website/src/index.html +++ b/website/src/index.html @@ -5,8 +5,8 @@ Horizon: a Rust rewrite for Minecraft: Java Edition 26.3 - - + + @@ -27,6 +27,7 @@ + @@ -42,9 +43,10 @@ In game Parity Launcher - Notes + New Community - Contributors + Releases + Benchmarks Docs + +
  1. 01Matches vanilla{{PERCENT}}
  2. 02Differential harnesses{{HARNESSES}}
  3. 03Drawn by Horizon5 shots
  4. -
  5. 04What changedNotes
  6. +
  7. 04Recently addedReleases
  8. +

Unofficial. Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

-
- +
@@ -166,7 +173,7 @@
  • One-click install

    Pick a release and it installs the build for your platform into its own folder, then prepares the resources from your Java Edition 26.3 install.

  • Updates on its own

    It looks for a new Horizon release when it starts and every four hours, and updates itself from the launcher's own releases.

  • Client or server

    Start the client, or host a server from the Servers page: create it, start it, watch players and the console, change its settings and keep backups.

  • -
  • Your choice of menus

    Play with Horizon's own menus, shown here, or vanilla's classic screens.

  • +
  • Logs and crash reports

    The Settings page shows where the game's logs and crash reports are, and horizon-launcher logs prints them.

  • Modpacks and packs

    The Modpacks page reads a Modrinth or CurseForge pack and carries over the mods Horizon can run. The Mods page installs resource packs, shader packs and modpacks from Modrinth.

  • @@ -176,34 +183,29 @@
    -
    +
    - - -
    The launcher's Play page: the version, Client and Server, the version picker and Play, the prepared resources and the Minecraft folder as a numbered list
    -
    Horizon's title screen: the mark and the pages on the left, the Horizon title, Singleplayer and Multiplayer, the last world played and the faint wordmark, over a veiled snowy landscape
    -
    The Singleplayer page: the worlds as a numbered list with their dates and game modes, and Create world and Play
    -
    The Video settings in their Simple view: a preset, render distance, field of view, framerate, VSync and GUI scale, each with what it costs
    -
    The pause screen of a world, with Back to game, Open to LAN and Save and quit
    +
    Vanilla's Video Settings screen with Horizon's own buttons at the top: Horizon Graphics, Advanced Graphics and Shader Packs
    -

    The launcher, and Horizon's own menus in the game. The launcher opens them, or vanilla's.

    +

    The launcher, and Horizon's graphics settings in the game: vanilla's menus, with Horizon's pages added the way mods add theirs.

    -
    +
    -

    05Patch notes

    -

    What changed

    +

    05Releases

    +

    Recently added

    +

    Alpha builds come out many times a day, as changes land; about once a day the tested ones become Stable, the launcher's default. The newest, and what they added:

    -
    - {{NOTES}} +
    + {{RECENT}}
    @@ -236,7 +238,7 @@ diff --git a/website/src/main.js b/website/src/main.js index e61453730..4298cf1fd 100644 --- a/website/src/main.js +++ b/website/src/main.js @@ -1,10 +1,12 @@ // The page's behaviour: the download buttons for this platform, the latest releases, the -// links and contributors, the navigation, the menus' tabs, the lightbox and the motion. +// links and contributors, how many play now, the navigation, the menus' tabs, the lightbox +// and the motion. // Everything degrades to the baked-in content when GitHub can't be reached. import { escape } from "./markdown.js"; -import { releasesHtml } from "./releases.js"; +import { recentHtml } from "./releases.js"; import { contributorsFrom, contributorsHtml } from "./contributors.js"; import { isGame, isLauncher as isLauncherTag, launcherVersion, newestFirst } from "./versions.js"; +import { cached, get, setUpMenu, setUpTheme, slim } from "./chrome.js"; const REPO = "ludovic111/horizon"; const RELEASES_PAGE = `https://github.com/${REPO}/releases?q=launcher&expanded=true`; @@ -13,33 +15,6 @@ 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 slim = (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 })), -}); const isLauncher = (r) => isLauncherTag(r.tag_name) && !r.prerelease; // The newest 100 releases (GitHub's most per page). Game betas come out several times a day, so the stable game @@ -106,11 +81,12 @@ async function setUpDownload() { document.querySelectorAll("[data-download-meta]").forEach((p) => (p.innerHTML = meta)); } -// --- Patch notes and the links from main --------------------------------- +// --- Recently added and the links from main --------------------------------- -async function setUpNotes() { - const list = (await releases).filter((r) => isGame(r.tag_name) && !r.prerelease).sort((a, b) => newestFirst(a.tag_name, b.tag_name)); - if (list.length) document.getElementById("releases").innerHTML = releasesHtml(list.slice(0, 3)); +// "Recently added": the newest game releases, Alpha and Stable. +async function setUpRecent() { + const html = recentHtml((await releases).filter((r) => isGame(r.tag_name))); + if (html) document.getElementById("recent-releases").innerHTML = html; } async function setUpLinks() { @@ -128,6 +104,34 @@ async function setUpLinks() { }); } +// --- Playing now --------------------------------------------------------------------- + +const TELEMETRY = "https://telemetry.playhorizon.dev"; + +// How many play right now, from the games' anonymous "I'm playing" pings (Privacy explains them). The +// server rounds it and makes it again at most every 15 seconds; the row stays hidden while nobody plays +// or the server doesn't answer. +async function setUpLive() { + const row = document.querySelector("[data-live]"); + if (!row) return; + const update = async () => { + try { + const res = await fetch(`${TELEMETRY}/v1/live`, { signal: AbortSignal.timeout(3000) }); + if (!res.ok) throw new Error(String(res.status)); + const { playing } = await res.json(); + if (!Number.isInteger(playing) || playing < 1) throw new Error("nobody"); + row.querySelector("[data-live-count]").textContent = playing.toLocaleString("en"); + row.hidden = false; + // It shows up after the others came in, so it skips their entrance. + row.classList.add("is-visible"); + } catch { + row.hidden = true; + } + }; + await update(); + setInterval(() => document.visibilityState === "visible" && update(), 60_000); +} + // --- Navigation ---------------------------------------------------------------------- function setUpNav() { @@ -151,40 +155,6 @@ function setUpNav() { }; onScroll(update); update(); - - // The phone menu: a full-screen sheet; the page behind it is inert while it is open. - const button = document.querySelector(".menu-button"); - const menu = document.getElementById("menu"); - const main = document.getElementById("main"); - const label = button.querySelector(".menu-label"); - const items = [...menu.querySelectorAll("nav a")]; - items.forEach((a, i) => a.style.setProperty("transition-delay", `${60 + i * 35}ms`)); - let closing; - const setOpen = (open) => { - clearTimeout(closing); - button.setAttribute("aria-expanded", String(open)); - label.textContent = open ? "Close" : "Menu"; - bar.classList.toggle("is-menu", open); - main.inert = open; - document.body.style.overflow = open ? "hidden" : ""; - if (open) { - menu.hidden = false; - requestAnimationFrame(() => requestAnimationFrame(() => menu.classList.add("is-open"))); - items[0].focus({ preventScroll: true }); - } else { - menu.classList.remove("is-open"); - closing = setTimeout(() => (menu.hidden = true), reducedMotion ? 0 : 320); - } - }; - button.addEventListener("click", () => setOpen(button.getAttribute("aria-expanded") !== "true")); - items.forEach((a) => a.addEventListener("click", () => setOpen(false))); - addEventListener("keydown", (e) => { - if (e.key === "Escape" && button.getAttribute("aria-expanded") === "true") { - setOpen(false); - button.focus(); - } - }); - matchMedia("(min-width: 1120px)").addEventListener("change", (e) => e.matches && setOpen(false)); } // One rAF-throttled scroll listener for everything that follows the scroll. @@ -254,27 +224,6 @@ function setUpLightbox() { }); } -// --- Light and dark ------------------------------------------------------------------ - -// The page follows the system; the toggle picks the other appearance and remembers it. -function setUpTheme() { - const root = document.documentElement; - const button = document.querySelector(".theme-toggle"); - const label = button.querySelector("[data-theme-label]"); - const system = matchMedia("(prefers-color-scheme: dark)"); - const dark = () => (root.dataset.theme ? root.dataset.theme === "dark" : system.matches); - const show = () => (label.textContent = dark() ? "Light" : "Dark"); - button.addEventListener("click", () => { - root.dataset.theme = dark() ? "light" : "dark"; - try { - localStorage.setItem("theme", root.dataset.theme); - } catch {} - show(); - }); - system.addEventListener("change", show); - show(); -} - // --- Motion --------------------------------------------------------------------------- function setUpReveal() { @@ -308,9 +257,11 @@ function setUpReveal() { setUpReveal(); setUpTheme(); setUpNav(); +setUpMenu(); setUpTabs(); setUpLightbox(); setUpDownload(); -setUpNotes(); +setUpRecent(); setUpLinks(); setUpContributors(); +setUpLive(); diff --git a/website/src/privacy.html b/website/src/privacy.html index def61dcc9..6b562a4cf 100644 --- a/website/src/privacy.html +++ b/website/src/privacy.html @@ -5,8 +5,8 @@ Privacy · Horizon - - + + @@ -26,25 +26,25 @@
  • Performance statistics, after each play session of a minute or more. These are the frame-time and tick-time percentiles and a 14-bucket histogram (never a recording of each frame), the peak memory, how long the game took to start and to load the world, and the settings that change performance (render and simulation distance, frame limit, VSync, fullscreen, graphics mode).
  • Crash reports, when the game crashes. They hold the error, where it happened in Horizon's code, your graphics adapter and settings. They hold no log, no world, no server and no resource packs.
  • Bug reports that you write and send yourself. The end of the game's log goes with one only if you add it after reading it, and lines of chat are removed first.
  • -
  • Benchmark uploads of the benchmarks you run. These are shown publicly in the community results.
  • +
  • Benchmark uploads of the benchmarks you run. They are shown publicly on the Benchmarks page, only as medians of groups of at least 3 different installs with the same graphics card, processor and render distance; never one by one, and never with your install ID, the day, your OS version, driver, memory or screen.
  • Each one also carries the Horizon version, the day it was made (not the time), and a description of your machine: the operating system and version, the CPU model and thread count, the memory rounded to the gigabyte, and the GPU, its driver and the graphics backend. It also carries a random install ID. The launcher makes that ID the first time you allow something; it says nothing about you and exists only so that your data can be deleted.

    Never sent: your Microsoft or Minecraft account name or UUID, world names, server or LAN addresses, chat, and your user name or home folder in file paths. Before anything is kept, those are replaced with placeholders, along with e-mail and IP addresses. The server does not store the IP address requests come from.

    The launcher shows exactly what would be sent: Settings → Data collection → View what would be sent, or horizon-launcher data show. Every field is listed in docs/telemetry.md.

    The "I'm playing" ping

    -

    The game has an anonymous "I'm playing" ping, so the launcher can show how many people play Horizon right now. It is off today: no server receives it yet, so the game sends nothing. This is what it would hold, so you know before it is ever switched on. It would be sent once a minute while you play, whatever the switches say.

    -

    It would hold: a random number made when the game starts and forgotten when it closes, the Horizon version, your operating system (Linux, macOS or Windows), and whether you have a world open to LAN or to friends. It would not hold: your account, your install ID, world or server names, your hardware or settings, or anything you do in the game. The random number changes every time you start the game, so two of your sessions can't be linked to each other or to you.

    -

    The server would keep the pings in memory only, never on disk, and not with the address they came from (that is used only to stop abuse, as below). A session would count while it pinged in the last two minutes and is then forgotten. What it would show is the number playing now, per version and with a world open, rounded.

    +

    The game sends an anonymous "I'm playing" ping, so the launcher can show how many people play Horizon right now. It is sent once a minute while you play, whatever the switches say.

    +

    It holds: a random number made when the game starts and forgotten when it closes, the Horizon version, your operating system (Linux, macOS or Windows), and whether you have a world open to LAN or to friends. It does not hold: your account, your install ID, world or server names, your hardware or settings, or anything you do in the game. The random number changes every time you start the game, so two of your sessions can't be linked to each other or to you.

    +

    The server keeps the pings in memory only, never on disk, and not with the address they came from (that is used only to stop abuse, as below). A session counts while it pinged in the last two minutes and is then forgotten. What it shows is the number playing now, per version and with a world open, rounded.

    Why

    -

    To find what is slow or crashes on which machines, and fix it. If it is switched on, the ping shows players, and Horizon, how many people play right now. Benchmark uploads also show other players how Horizon runs on hardware like theirs. Nothing is sold, shared for advertising, or used to identify you.

    +

    To find what is slow or crashes on which machines, and fix it. The ping shows players, and Horizon, how many people play right now. Benchmark uploads also show other players how Horizon runs on hardware like theirs. Nothing is sold, shared for advertising, or used to identify you.

    On what basis

    -

    For the switches: your consent (Article 6(1)(a) of the EU's General Data Protection Regulation). It is given kind by kind, recorded on your computer with the version of the question you answered and when, and withdrawn at any time with the same switches. Withdrawing deletes what was waiting to be sent. When what is collected changes, the launcher asks again, and nothing new is sent until you answer. The ping would hold nothing that identifies you; the address it comes from would be used only to limit how often one address may send, kept in memory for an hour at most and never stored.

    +

    For the switches: your consent (Article 6(1)(a) of the EU's General Data Protection Regulation). It is given kind by kind, recorded on your computer with the version of the question you answered and when, and withdrawn at any time with the same switches. Withdrawing deletes what was waiting to be sent. When what is collected changes, the launcher asks again, and nothing new is sent until you answer. The ping holds nothing that identifies you; the address it comes from is used only to limit how often one address may send, kept in memory for an hour at most and never stored.

    Where and how long

    -

    Items wait on your computer (telemetry/ in the game folder) and are sent compressed when the launcher starts or closes, to Horizon's own server at Railway. The server keeps them for 180 days, then deletes them. What stays after that are anonymous totals per day, Horizon version, operating system, GPU maker and render distance (for example "120 sessions on macOS with Apple GPUs at render distance 12"). They hold no install ID, and groups too small to be anonymous are never shown.

    +

    Items wait on your computer (telemetry/ in the game folder) and are sent compressed when the launcher starts or closes, to Horizon's own server, telemetry.playhorizon.dev, hosted by Railway in the European Union (Amsterdam, the Netherlands). The server keeps them for 180 days, then deletes them. What stays after that are anonymous totals per day, Horizon version, operating system, GPU maker and render distance (for example "120 sessions on macOS with Apple GPUs at render distance 12"). They hold no install ID, and groups too small to be anonymous are never shown.

    Deleting your data

    Settings → Data collection → Delete my data, or horizon-launcher data delete. The server deletes everything sent under your install ID, your share of the totals is recomputed, anything waiting on your computer is removed, and you get a new install ID. You can also turn everything off, or delete the telemetry/ folder.

    diff --git a/website/src/releases-page.js b/website/src/releases-page.js new file mode 100644 index 000000000..ace84f63d --- /dev/null +++ b/website/src/releases-page.js @@ -0,0 +1,78 @@ +// The Releases page: the list baked at build time, refreshed from GitHub when a newer release is out, and the +// channel filter. Without JavaScript the baked list reads as it is. +import { releasesPageHtml } from "./releases.js"; +import { isGame, isLauncher, newestFirst } from "./versions.js"; +import { cached, get, setUpMenu, setUpTheme, slim } from "./chrome.js"; + +const REPO = "ludovic111/horizon"; +const list = document.getElementById("release-list"); +const counter = document.querySelector("[data-release-count]"); +const buttons = [...document.querySelectorAll("[data-filter]")]; +let filter = "all"; + +const ours = (r) => !r.draft && (isGame(r.tag_name) || isLauncher(r.tag_name)); + +// Every release, a page of 100 at a time (GitHub's most), up to 500. +async function loadAll() { + const all = []; + for (let page = 1; page <= 5; page++) { + const batch = await get(`https://api.github.com/repos/${REPO}/releases?per_page=100&page=${page}`); + all.push(...batch.filter(ours).map(slim)); + if (batch.length < 100) break; + } + return all; +} + +function apply() { + const entries = [...list.querySelectorAll(".release-entry")]; + let shown = 0; + for (const el of entries) { + const on = filter === "all" || el.dataset.channel === filter; + el.hidden = !on; + if (on) shown++; + } + counter.textContent = `${shown} release${shown === 1 ? "" : "s"}`; + buttons.forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.filter === filter))); +} + +async function refresh() { + // One small request first: the full list only when GitHub has something newer than the page. + const newest = await cached("horizon:releases-newest", () => get(`https://api.github.com/repos/${REPO}/releases?per_page=5`)).catch(() => null); + if (!newest) return; + const top = newest.filter(ours).map((r) => r.tag_name).sort(newestFirst)[0]; + if (!top || top === list.dataset.newest) return; + const all = await cached("horizon:releases-all", loadAll).catch(() => null); + if (!all || !all.length) return; + const open = new Set([...list.querySelectorAll(".release-entry[open]")].map((el) => el.id)); + list.innerHTML = releasesPageHtml(all); + list.dataset.newest = top; + // Keep what the reader opened open. + open.forEach((id) => document.getElementById(id)?.setAttribute("open", "")); + apply(); +} + +// A link to one release (/releases#release-v0.2.1) opens it. +function openTarget() { + const el = location.hash && document.getElementById(location.hash.slice(1)); + if (el && el.classList.contains("release-entry")) { + if (el.hidden) { + filter = "all"; + apply(); + } + el.open = true; + el.scrollIntoView(); + } +} + +buttons.forEach((b) => + b.addEventListener("click", () => { + filter = b.dataset.filter; + apply(); + }), +); +addEventListener("hashchange", openTarget); +setUpTheme(); +setUpMenu(); +apply(); +openTarget(); +refresh().then(openTarget); diff --git a/website/src/releases.html b/website/src/releases.html new file mode 100644 index 000000000..f0e4b2de4 --- /dev/null +++ b/website/src/releases.html @@ -0,0 +1,50 @@ + + + + + + Releases · Horizon + + + + + + + + + + + + + + + + + + + + + +{{SITE_NAV}} +
    +
    +

    ReleasesEvery version, newest first

    +

    What's new in Horizon

    +

    Each release lists what it adds and fixes, then its full notes and its downloads. Alpha builds come out many times a day as changes land and can break; about once a day the tested ones become Stable, what the launcher installs unless you pick Alpha in its Settings. The launcher has its own releases.

    +
    + + + + +
    +

    {{RELEASE_COUNT}}

    +
    +{{RELEASE_LIST}} +
    +

    The releases on GitHub

    +

    Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

    +
    +
    +{{SITE_FOOTER}} + + diff --git a/website/src/releases.js b/website/src/releases.js index 1b7011999..2e6a2e524 100644 --- a/website/src/releases.js +++ b/website/src/releases.js @@ -1,42 +1,152 @@ -// The patch notes: the latest game release in full, the ones before it folded. Shared by -// build.mjs (baked into the page) and main.js (refreshed from GitHub). -import { markdown, escape } from "./markdown.js"; +// The release notes on the site: the home page's "Recently added" block and the Releases page (every release, +// newest first). Shared by build.mjs (baked into the pages) and the pages' scripts (refreshed from GitHub). +// Tags: the game's vX.Y.Z and the launcher's launcher@X.Y.Z from 0.2, vYYYY.MM.DD[.N] and launcher-vX.Y.Z before +// (src/versions.js). Alpha is a game pre-release, Stable a game release (docs/release-flow.md, "Channels"). +import { markdown, inline, escape } from "./markdown.js"; +import { isLauncher, launcherVersion, newestFirst } from "./versions.js"; const REPO = "ludovic111/horizon"; +export const channel = (r) => (isLauncher(r.tag_name) ? "Launcher" : r.prerelease ? "Alpha" : "Stable"); +const anchor = (r) => `release-${r.tag_name.replace(/[^\w.-]/g, "-")}`; + // "Horizon 0.2.3: Cave culling, weather" (before 0.2, "Horizon 2026.10.13: …") reads as the version and its line. -function parts(r) { - const version = r.tag_name.replace(/^v/, ""); - const name = r.name || ""; - const line = name.includes(": ") ? name.slice(name.indexOf(": ") + 2) : name.replace(/^Horizon\s*/, "").replace(version, "").trim(); +export function parts(r) { + const version = launcherVersion(r.tag_name) ?? r.tag_name.replace(/^v/, ""); + const name = (r.name || "").trim(); + let line = name.includes(": ") ? name.slice(name.indexOf(": ") + 2) : name.replace(/^Horizon( launcher)?\s*/i, "").replace(version, "").trim(); + if (junk(line)) line = fromNotes(r.body) || line; return { version, line: line.charAt(0).toUpperCase() + line.slice(1), date: (r.published_at || "").slice(0, 10) }; } -export function releasesHtml(list) { - if (!list.length) return ""; - const [latest, ...older] = list; - const l = parts(latest); - const head = `
    -
    -

    Latest release

    -

    ${escape(l.version)}

    - ${l.line ? `

    ${escape(l.line)}

    ` : ""} - Downloads and full notes -
    -
    ${markdown(latest.body || "")}
    -
    `; - const rest = older +// A title made of issue numbers and "fix" ("#1255, mob pushes, fix, #1222") says nothing. +const junk = (line) => { + const bits = line.split(",").map((b) => b.trim()).filter(Boolean); + return bits.length > 1 && bits.filter((b) => /^(#\d+|fix(es)?|fixed)$/i.test(b)).length * 2 >= bits.length; +}; + +// The first item that isn't a bare "Fix #123:" prefix, as the line: "Mob pushes: one list per mob… and 3 more fixes". +function fromNotes(body) { + const s = sections(body); + const items = [...s.filter((x) => /^new|what's new/i.test(x.title)), ...s.filter((x) => /^fixed/i.test(x.title))].flatMap((x) => x.items).map(plainItem); + const clean = items.map((i) => i.replace(/^(fix|fixes)\s+#\d+:\s*/i, "").replace(/^\w+\([^)]*\):\s*/, "")).filter(Boolean); + if (!clean.length) return ""; + const first = clean[0].replace(/[.]$/, ""); + return clean.length > 1 ? `${first} and ${clean.length - 1} more` : first; +} + +// The notes' "### Heading" sections and their top-level items, in order. +export function sections(body) { + const out = []; + let current = null; + for (const raw of (body || "").replace(/\r\n?/g, "\n").split("\n")) { + const heading = raw.match(/^#{2,3}\s+(.+?)\s*$/); + if (heading) out.push((current = { title: heading[1], items: [] })); + else if (current && /^[-*]\s+/.test(raw)) current.items.push(raw.replace(/^[-*]\s+/, "").trim()); + } + return out; +} + +// An item without its pull request references: "Riptide (#123, fixes #45)" -> "Riptide". +export const plainItem = (item) => item.replace(/\s*\((?:#\d+|fixes #\d+|[^()]*#\d+[^()]*)\)\s*/g, " ").replace(/\s+/g, " ").trim(); + +// The notes' first sentence, for a release with no title line and no sections ("Rebuilt from the latest main."). +const firstLine = (body) => ((body || "").split(/\r?\n/).find((l) => l.trim() && !/^#/.test(l)) || "").trim().replace(/[.:]$/, ""); + +const count = (n, one, many) => `${n} ${n === 1 ? one : many}`; + +// What a release changes, in a line: "12 new, 30 fixed, 2 known issues". +export function overview(r) { + const s = sections(r.body); + const by = (re) => s.filter((x) => re.test(x.title)).reduce((n, x) => n + x.items.length, 0); + const added = by(/^new|what's new/i); + const fixed = by(/^fixed/i); + const known = by(/^known/i); + const bits = []; + if (added) bits.push(count(added, "new feature", "new features")); + if (fixed) bits.push(count(fixed, "fix", "fixes")); + if (known) bits.push(count(known, "known issue", "known issues")); + return { added, fixed, known, text: bits.join(", ") }; +} + +export function highlights(r, n = 3) { + const added = sections(r.body).filter((x) => /^new|what's new/i.test(x.title)).flatMap((x) => x.items); + return added.slice(0, n).map(plainItem); +} + +const byTag = (a, b) => newestFirst(a.tag_name, b.tag_name); +const badge = (r) => `${channel(r)}`; + +// The home page: the newest releases on a line each, and what the newest ones added. +export function recentHtml(list, { rows = 5, picks = 3 } = {}) { + const sorted = [...list].sort(byTag); + const game = sorted.filter((r) => !isLauncher(r.tag_name)); + if (!game.length) return ""; + const lines = game + .slice(0, rows) .map((r) => { - const o = parts(r); - return `
    - ${escape(o.version)}${escape(o.line)} -
    ${markdown(r.body || "")}

    Downloads and full notes on GitHub

    -
    `; + const p = parts(r); + return `
  • ${escape(p.version)}${escape(p.line || overview(r).text || firstLine(r.body) || "Release notes")}${badge(r)}
  • `; }) .join(""); - return `${head} -
    - ${rest ? `

    Earlier releases

    ${rest}` : ""} -

    Every release on GitHub

    -
    `; + // What landed last: the "New" items of the newest releases with the highest pull request numbers (a release's + // notes list everything since the last Stable, oldest first). + const pr = (item) => Math.max(0, ...[...item.matchAll(/#(\d+)/g)].map((m) => Number(m[1]))); + const seen = new Set(); + const picked = game + .slice(0, rows) + .flatMap((r) => sections(r.body).filter((x) => /^new|what's new/i.test(x.title)).flatMap((x) => x.items).map((raw) => ({ raw, item: plainItem(raw), r }))) + .filter(({ item }) => !seen.has(item) && seen.add(item)) + .sort((a, b) => pr(b.raw) - pr(a.raw)) + .slice(0, picks); + const picks_ = picked + .map(({ item, r }) => `
  • ${inline(item)}

    ${escape(parts(r).version)}
  • `) + .join(""); + return `
      ${lines}
    + ${picks_ ? `

    New lately

      ${picks_}
    ` : ""} +

    Every release, with its full notes

    `; } + +const ASSET_LABELS = [ + [/linux-x86_64/, "Linux x86-64"], + [/macos-arm64/, "macOS, Apple Silicon"], + [/macos-x86_64/, "macOS, Intel"], + [/windows-x64/, "Windows x64"], +]; +function assetLabel(name) { + if (/^SHA256SUMS/.test(name)) return name.endsWith(".sig") ? "Checksums signature" : "Checksums"; + const os = ASSET_LABELS.find(([re]) => re.test(name)); + const what = /server/.test(name) ? "Server" : /launcher/.test(name) ? "Launcher" : /smoke-test/.test(name) ? "Smoke test" : "Game"; + return os ? `${what}, ${os[1]}` : name; +} +const size = (bytes) => (bytes >= 1e6 ? `${(bytes / 1e6).toFixed(0)} MB` : bytes >= 1e3 ? `${(bytes / 1e3).toFixed(0)} kB` : `${bytes} B`); + +function releaseHtml(r, open) { + const p = parts(r); + const o = overview(r); + const top = highlights(r, 4); + const downloads = (r.assets || []) + .map((a) => `
  • ${escape(assetLabel(a.name))}${escape(a.name)} · ${size(a.size || 0)}
  • `) + .join(""); + return `
    + ${escape(p.version)}${badge(r)}${escape(p.line)} +
    + ${o.text || top.length ? `
    + ${o.text ? `

    ${escape(o.text)}

    ` : ""} + ${top.length ? `
      ${top.map((t) => `
    • ${inline(t)}
    • `).join("")}
    ` : ""} +
    ` : ""} +
    ${markdown(r.body || "") || "

    No notes for this release.

    "}
    + ${downloads ? `

    Downloads

      ${downloads}
    ` : ""} +

    This release on GitHub

    +
    +
    `; +} + +// The Releases page: every release, newest first; the newest few open. +export function releasesPageHtml(list, { open = 3 } = {}) { + const sorted = [...list].sort(byTag); + if (!sorted.length) return ""; + return sorted.map((r, i) => releaseHtml(r, i < open)).join("\n"); +} + +export const releasesUrl = `https://github.com/${REPO}/releases`; diff --git a/website/src/style.css b/website/src/style.css index 03004464b..9ced17c69 100644 --- a/website/src/style.css +++ b/website/src/style.css @@ -1,8 +1,7 @@ /* Horizon's design language (docs/design-system.md), set as a page. The tokens come from crates/horizon-theme through src/tokens.css, which build.mjs puts before this file: the - same palette, type, spacing and motion as the launcher and the game's menus. Type is the - interface; content is numbered index lists with one-pixel rules; one violet accent for the - main action, links and focus; space instead of borders; quiet motion. */ + launcher's Blocks palettes, type, spacing and motion. The base below lays out the page; the + "Blocks" section at the end gives it the launcher's blocky, Minecraft-like look. */ @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; } @@ -301,12 +300,7 @@ figcaption span { font-family: var(--mono); font-size: var(--text-micro); letter .screen-caption { margin-top: 12px; font-size: var(--text-caption); color: var(--muted); } /* Patch notes. */ -.release-latest { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; padding-top: 32px; border-top: 1px solid var(--rule); } -.release-head { position: sticky; top: calc(var(--nav) + 24px); align-self: start; display: flex; flex-direction: column; gap: 12px; } .eyebrow { text-transform: uppercase; } -.release-version { font-size: var(--text-display); line-height: var(--text-display-line); letter-spacing: var(--text-display-tracking); font-weight: 500; } -.release-line { color: var(--muted); max-width: 36ch; } -.release-body { font-size: var(--text-ui); } .prose h2, .prose h3, .prose h4 { font-size: var(--text-heading); line-height: var(--text-heading-line); color: var(--ink); margin-top: 28px; } .prose ul, .prose ol { padding-left: 18px; list-style: disc; } .prose li + li { margin-top: 6px; } @@ -314,8 +308,6 @@ figcaption span { font-family: var(--mono); font-size: var(--text-micro); letter .prose strong { color: var(--ink); font-weight: 500; } .prose pre { padding: 16px; border-radius: var(--radius-plate); background: var(--plate-soft); overflow-x: auto; } .prose pre code { background: none; padding: 0; } -.release-older { margin-top: 64px; } -.release-older-title { font: var(--text-micro) / var(--text-micro-line) var(--mono); letter-spacing: var(--text-micro-tracking); color: var(--muted); text-transform: uppercase; margin-bottom: 12px; } .release { border-top: 1px solid var(--rule); } .release:last-of-type { border-bottom: 1px solid var(--rule); } .release summary { @@ -405,9 +397,9 @@ figcaption span { font-family: var(--mono); font-size: var(--text-micro); letter /* --- Narrow screens ------------------------------------------------------------------------ */ @media (max-width: 900px) { - .section-head, .parity-hero, .launcher-grid, .release-latest { grid-template-columns: minmax(0, 1fr); } + .section-head, .parity-hero, .launcher-grid { grid-template-columns: minmax(0, 1fr); } .section-head { gap: 16px; } - .screens, .release-head { position: static; } + .screens { position: static; } .fact { grid-template-columns: var(--index) minmax(0, 1fr); row-gap: 6px; } .fact p { grid-column: 2; } .mosaic { grid-template-columns: minmax(0, 1fr); } @@ -499,3 +491,253 @@ figcaption span { font-family: var(--mono); font-size: var(--text-micro); letter @media (pointer: coarse) { .docs-nav li a, .docs-toc a, .docs-bar-title, .docs-bar-link { display: flex; align-items: center; min-height: 44px; } } + +/* --- Blocks: the launcher's look on the page (docs/design-system.md, "Blocks") ------------- + Pixel type for headings and controls, square panels with a dark outline, a light bevel on top + and a darker lip below, the violet face for the main action, sunk wells, a stone texture + behind the page and Horizon's pixel landscape behind the hero. The art is drawn in code + (scripts/art.mjs, like launcher/src/art.rs); nothing in it comes from Minecraft. */ + +@font-face { font-family: "Pixelify Sans"; src: url("/fonts/PixelifySans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; } +@font-face { font-family: "Pixelify Sans"; src: url("/fonts/PixelifySans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; } +@font-face { font-family: "Pixelify Sans"; src: url("/fonts/PixelifySans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; } + +:root { + --stone: url("/media/stone-light.png"); + --scene: url("/media/scene-light.png"); + --sky: #8d7fd8; + --panel-edges: inset 0 var(--block-bevel) 0 var(--bevel), inset 0 calc(-1 * var(--block-bevel)) 0 var(--lip); + --radius: 0px; --radius-plate: 0px; --radius-pill: 0px; +} +:root[data-theme="dark"] { --stone: url("/media/stone-dark.png"); --scene: url("/media/scene-dark.png"); --sky: #0a0f2c; } +@media (prefers-color-scheme: dark) { + :root:not([data-theme="light"]) { --stone: url("/media/stone-dark.png"); --scene: url("/media/scene-dark.png"); --sky: #0a0f2c; } +} + +/* The stone: 64 texels of the page colour in close shades, each texel 4 px. */ +body { position: relative; isolation: isolate; } +body::before { + content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; + background: var(--stone) 0 0 / 256px 256px repeat; image-rendering: pixelated; +} + +/* Pixel type for what names and what you act on; paragraphs stay in Geist. */ +.display, .title, .statement, .row-name, .card-title, .release-tag, .count, +.fact h3, .features h3, .system h3, .contributors-title, .footer-disclaimer, .footer-word, +.nav-mark, .docs-prose h2, .docs-prose h3, .prose h2, .prose h3, .prose h4, .menu nav a { + font-family: var(--pixel); font-weight: 600; letter-spacing: 0; +} +.display, .count, .footer-word { font-weight: 700; } +.nav-mark { font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; } +code { border-radius: 0; background: var(--well); box-shadow: 0 0 0 1px var(--outline); } + +/* Buttons: blocks with an outline, a bevel and a lip; they sink a pixel when pressed. */ +.button { + border: var(--block-outline) solid var(--outline); border-radius: 0; + font: 500 var(--text-ui) / 1 var(--pixel); + box-shadow: inset 0 var(--block-bevel) 0 var(--button-bevel), inset 0 calc(-1 * var(--block-lip)) 0 var(--lip); + padding-bottom: 2px; +} +.button.large { font-size: 18px; } +.button.primary { background: var(--face); color: var(--on-face); box-shadow: inset 0 var(--block-bevel) 0 var(--face-bevel), inset 0 calc(-1 * var(--block-lip)) 0 var(--face-lip); } +.button.primary:hover { opacity: 1; filter: brightness(1.08); } +.button.secondary { background: var(--button); } +.button.secondary:hover { background: var(--button); filter: brightness(1.06); } +.button.ghost { border-color: transparent; box-shadow: none; } +.button:active { opacity: 1; transform: translateY(1px); box-shadow: inset 0 var(--block-bevel) 0 var(--lip); } +:focus-visible { border-radius: 0; } + +/* The top bar: the sidebar colour with an outline under it, tabs with an accent underline. */ +.nav.is-scrolled, .nav.is-menu { background: var(--side); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 var(--block-outline) 0 var(--outline); } +.nav-links a, .nav-github, .theme-toggle { border-radius: 0; font-family: var(--pixel); font-weight: 500; font-size: 15px; } +.nav-links a:hover, .nav-github:hover, .theme-toggle:hover { background: var(--raised); } +.nav-links a[aria-current] { background: var(--raised); box-shadow: inset 0 -3px 0 var(--accent); } +.theme-toggle { text-transform: none; letter-spacing: 0; } +.menu { background: var(--side); } +.menu nav a { border-bottom: 0; } + +/* Lists become stacks of panels. */ +.index, .systems, .contributors-list { border-top: 0; display: grid; gap: 8px; } +.row, .system, .release, .release:last-of-type, .contributor { border-bottom: 0; border-top: 0; } +.row > a, .row.card, .fact.row, .features li, .system, .release, .contributor, .docs-pager a { + background: var(--panel); border: var(--block-outline) solid var(--outline); box-shadow: var(--panel-edges); + border-radius: 0; +} +.row > a, .row.card, .fact.row, .features li, .system { padding-left: 20px; padding-right: 20px; } +.row > a::before, .row.card::before { display: none; } +.row > a:hover, .row.card:hover, .contributor:hover, .docs-pager a:hover { background: var(--raised); } +.row > a:hover .row-index { color: var(--accent); } +.row-name { font-size: clamp(20px, 2.2vw, 28px); } +.release { padding: 0 20px; } +.release + .release { margin-top: 8px; } +.release .prose { padding-left: 12rem; } +.contributor { padding: 12px 14px; } +.contributors-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; } +.contributor-avatar { border-radius: 0; box-shadow: 0 0 0 2px var(--outline); image-rendering: pixelated; } +.system.is-full .system-state { color: var(--success); } + +/* Screenshots and the launcher's screens: square, outlined. */ +.zoom, .screen, .lightbox, .prose pre, .docs-prose figure img { border-radius: 0; box-shadow: 0 0 0 var(--block-outline) var(--outline); } +.tabs { border-radius: 0; background: var(--well); box-shadow: 0 0 0 var(--block-outline) var(--outline); } +.tabs button { border-radius: 0; font-family: var(--pixel); font-weight: 500; font-size: 15px; } +.tabs button[aria-selected="true"] { color: var(--on-face); } +.tab-pill { border-radius: 0; background: var(--face); box-shadow: inset 0 var(--block-bevel) 0 var(--face-bevel), inset 0 calc(-1 * var(--block-bevel)) 0 var(--face-lip); } + +/* The hero: Horizon's landscape under a veil of the page colour, the words on the left. */ +.hero { + position: relative; isolation: isolate; overflow: hidden; + background: var(--scene) 70% 100% / clamp(1200px, 135vw, 2400px) auto no-repeat, var(--sky); image-rendering: pixelated; + border-bottom: var(--block-outline) solid var(--outline); +} +.hero::before { + content: ""; position: absolute; inset: 0; z-index: -1; + background: + linear-gradient(90deg, color-mix(in srgb, var(--page) 92%, transparent) 0%, color-mix(in srgb, var(--page) 78%, transparent) 45%, color-mix(in srgb, var(--page) 0%, transparent) 78%), + linear-gradient(180deg, color-mix(in srgb, var(--page) 0%, transparent) 55%, color-mix(in srgb, var(--page) 70%, transparent) 100%); +} +.hero .kicker span, .hero .kicker { color: var(--ink-soft); } +.hero .lede { color: var(--ink-soft); } +.hero { padding-bottom: clamp(160px, 18vw, 280px); } +.hero-after { padding-top: 40px; } +.hero-after .hero-index { margin-top: 0; max-width: 860px; } +.hero-after .disclaimer { margin-top: 24px; } +@media (max-width: 900px) { + .hero::before { background: color-mix(in srgb, var(--page) 84%, transparent); } +} + +/* Documentation. */ +.docs-bar { background: var(--side); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 var(--block-outline) 0 var(--outline); } +.docs-nav li a { border-radius: 0; } +.docs-nav li a[aria-current] { background: var(--raised); box-shadow: inset 4px 0 0 var(--accent); } +.docs-toc a { border-radius: 0; background: var(--button); box-shadow: 0 0 0 var(--block-outline) var(--outline); } +.docs-pager a { box-shadow: var(--panel-edges); } +.docs-prose h2 { border-top: var(--block-outline) solid var(--outline); } +.docs-prose blockquote { border-left: 4px solid var(--accent); background: var(--panel); padding: 10px 16px; box-shadow: 0 0 0 var(--block-outline) var(--outline); } + +/* The footer: the giant wordmark in pixels. */ +.footer { background: var(--side); border-top: var(--block-outline) solid var(--outline); margin-top: 48px; } +.footer-word { color: var(--raised); letter-spacing: 0.02em; } +:root[data-theme="dark"] .footer-word { color: var(--panel); } +@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .footer-word { color: var(--panel); } } + +/* --- Releases and Benchmarks pages, and the home page's "Recently added" ------------------ */ + +/* Pixelify Sans' "fi" ligature draws as "A" ("8 Axes"): no common ligatures anywhere. */ +:root { font-variant-ligatures: no-common-ligatures; } + +.page-main { padding-top: calc(var(--nav) + clamp(40px, 6vw, 80px)); } +.page-title { max-width: 18ch; margin-bottom: 20px; } +.page-main > .container > .lede { font-size: var(--text-body); } +.page-main .disclaimer { margin-top: 48px; } + +/* Channel and source badges: small square tags. */ +.badge { + display: inline-flex; align-items: center; height: 22px; padding: 0 8px; margin-right: 10px; vertical-align: 2px; + font: 500 12px / 1 var(--pixel); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; + border: var(--block-outline) solid var(--outline); background: var(--well); color: var(--ink-soft); +} +.badge-stable { background: color-mix(in srgb, var(--success) 22%, var(--panel)); color: var(--ink); } +.badge-alpha { background: color-mix(in srgb, var(--warn) 24%, var(--panel)); color: var(--ink); } +.badge-launcher { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); color: var(--ink); } +.badge-us { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); color: var(--ink); } +.badge-players { background: color-mix(in srgb, var(--success) 22%, var(--panel)); color: var(--ink); } +.badge-estimate { background: color-mix(in srgb, var(--warn) 24%, var(--panel)); color: var(--ink); } + +/* Home: the newest releases on a line each, then what they added. */ +.recent-list .row > a { grid-template-columns: 8.5rem minmax(0, 13rem) minmax(0, 1fr) auto; align-items: baseline; } +.recent-line { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.recent-list .row-name { font-size: clamp(18px, 1.8vw, 22px); } +.recent-list .badge { margin-right: 0; } +.recent-picks { margin-top: 32px; } +.recent-picks .eyebrow { margin-bottom: 12px; } +.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } +.highlight { + display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 18px 20px; + background: var(--panel); border: var(--block-outline) solid var(--outline); box-shadow: var(--panel-edges); +} +.highlight p { color: var(--ink); } +.highlight-from { font: var(--text-micro) / 1 var(--mono); letter-spacing: var(--text-micro-tracking); color: var(--muted); } +.highlight-from:hover { color: var(--accent); } + +/* Releases: a filter, then every release as a panel that opens. */ +.release-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; } +.release-filter .button[aria-pressed="true"] { background: var(--face); color: var(--on-face); box-shadow: inset 0 var(--block-bevel) 0 var(--face-bevel), inset 0 calc(-1 * var(--block-lip)) 0 var(--face-lip); } +.release-count { margin: 16px 0 12px; } +.release-list { display: grid; gap: 8px; } +.release-list .release + .release { margin-top: 0; } +.release-entry summary { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; } +.release-entry .release-sub { display: flex; align-items: baseline; flex-wrap: wrap; row-gap: 4px; } +.release-detail { padding: 0 0 24px 11rem; margin-left: 16px; display: grid; gap: 20px; max-width: calc(11rem + 16px + var(--measure) + 120px); } +.release-detail .prose { padding: 0; margin: 0; font-size: var(--text-ui); max-width: none; } +.release-overview { padding: 16px 18px; background: var(--well); box-shadow: 0 0 0 var(--block-outline) var(--outline); } +.release-counts { font-family: var(--pixel); font-weight: 600; color: var(--ink); margin-bottom: 8px; } +.release-overview ul { list-style: square; padding-left: 18px; color: var(--ink-soft); font-size: var(--text-ui); } +.release-overview li + li { margin-top: 4px; } +.release-downloads ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; } +.release-downloads li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--button); box-shadow: 0 0 0 var(--block-outline) var(--outline); } +.release-downloads li a { font-weight: 500; } +.release-downloads li span { font: var(--text-micro) / 1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; } +.release-github { font-size: var(--text-caption); } +.release-entry:target { box-shadow: var(--panel-edges), 0 0 0 3px var(--accent); } + +/* Benchmarks. */ +.bench-section { margin-top: clamp(64px, 8vw, 112px); } +.bench-section > .title { margin-bottom: 16px; } +.bench-section > .lede { margin-bottom: 32px; } +.machines { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; } +.machine { min-width: 0; padding: 24px; background: var(--panel); border: var(--block-outline) solid var(--outline); box-shadow: var(--panel-edges); } +.machine-head { display: grid; gap: 10px; margin-bottom: 20px; } +.machine-name { font-family: var(--pixel); font-weight: 600; font-size: var(--text-title); line-height: var(--text-title-line); } +.machine-facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; } +.machine-facts div { display: flex; gap: 8px; min-width: 0; } +.machine-facts dt { font: var(--text-micro) / 1.6 var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); } +.machine-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: var(--text-caption); color: var(--ink-soft); } +.machine-note { font-size: var(--text-caption); color: var(--muted); max-width: 90ch; } +/* relative: the screen-reader-only labels inside are absolute and would escape the scroll box otherwise. */ +.table-wrap { position: relative; overflow-x: auto; } +.bench-table { width: 100%; border-collapse: collapse; font-size: var(--text-ui); } +.bench-table th, .bench-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: baseline; } +.bench-table thead th { font: var(--text-micro) / 1.4 var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); font-weight: 400; } +.bench-table thead tr:first-child th { color: var(--ink); } +.bench-table tbody th { font-weight: 500; color: var(--ink); } +.bench-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; } +.bench-table td.wins { color: var(--ink); font-weight: 600; } +.bench-table td.vs { font-size: var(--text-caption); white-space: nowrap; } +.vs-horizon { color: var(--success); } +.vs-java { color: var(--danger); } +.vs-tie, .vs-none { color: var(--muted); } +.capped { font: var(--text-micro) / 1 var(--mono); color: var(--warn); cursor: help; } +.metric-hint { display: block; font: var(--text-micro) / 1.4 var(--mono); color: var(--muted); font-weight: 400; } +.java-wins { margin-top: 16px; font-size: var(--text-caption); color: var(--ink-soft); } +.picker { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; padding: 20px; background: var(--panel); border: var(--block-outline) solid var(--outline); box-shadow: var(--panel-edges); } +.picker label { display: grid; gap: 6px; } +.picker label > span, .picker legend { font: var(--text-micro) / 1.4 var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); } +.picker select { + min-width: min(320px, 80vw); height: var(--control); padding: 0 10px; font: inherit; font-size: var(--text-ui); color: var(--ink); + background: var(--well); border: var(--block-outline) solid var(--outline); border-radius: 0; +} +.picker-rd { display: flex; gap: 16px; align-items: center; border: 0; padding: 0; margin: 0; } +.picker-rd legend { margin-bottom: 6px; } +.picker-rd label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pixel); font-weight: 500; height: var(--control); } +.picker-rd input { accent-color: var(--accent); width: 18px; height: 18px; } +.pick-result { margin-top: 16px; padding: 20px; background: var(--panel); border: var(--block-outline) solid var(--outline); box-shadow: var(--panel-edges); } +.pick-head { margin-bottom: 12px; font-size: var(--text-caption); color: var(--ink-soft); line-height: 1.8; } +.pick-result .meta { margin-top: 12px; } +.empty { color: var(--muted); } +.prose-section .prose { max-width: 80ch; } +.spec-table { margin-top: 24px; } +.spec-table summary { cursor: pointer; font-family: var(--pixel); font-weight: 600; } +.spec-table .bench-table { margin-top: 16px; max-width: 760px; } + +@media (max-width: 900px) { + .recent-list .row > a { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; } + .recent-list .row-index { grid-column: 1; grid-row: 1; } + .recent-list .row-name { grid-column: 1; grid-row: 2; } + .recent-line { grid-column: 1 / -1; grid-row: 3; white-space: normal; } + .recent-list .row-meta { grid-column: 2; grid-row: 1; } + .highlights { grid-template-columns: minmax(0, 1fr); } + .release-entry summary { grid-template-columns: minmax(0, 1fr) auto; } + .release-detail { padding-left: 0; margin-left: 0; } + .machine { padding: 16px; } +} +.older-runs { margin-top: 16px; max-width: 90ch; padding: 16px 20px; background: var(--well); box-shadow: 0 0 0 var(--block-outline) var(--outline); font-size: var(--text-caption); } diff --git a/website/src/tokens.css b/website/src/tokens.css index d272865cc..816ad5b8e 100644 --- a/website/src/tokens.css +++ b/website/src/tokens.css @@ -2,21 +2,39 @@ docs/design-system.md describes the tokens. */ :root { - --page: #fafafc; - --plate-soft: #f3f3f8; - --plate: #ebecf4; - --surface: #ffffff; - --rule: #e2e3ea; - --ink: #16181f; - --ink-soft: #3b3e49; - --muted: #646875; - --accent: #5b3fd6; + --page: #ece7f7; + --plate-soft: #e9e3f8; + --plate: #ddd4f3; + --surface: #f8f6fd; + --rule: #e4ddf4; + --ink: #1b1530; + --ink-soft: #3b3354; + --muted: #585071; + --accent: #5333c9; --on-accent: #ffffff; - --danger: #b4372a; - --success: #1d7a48; + --danger: #a3301d; + --success: #136336; + --warn: #7a4f00; + --side: #e2dbf2; + --panel: #f8f6fd; + --raised: #e9e3f8; + --button: #ddd4f3; + --button-bevel: #f4f0fe; + --well: #f3f0fb; + --bevel: #ffffff; + --lip: #c3b8e2; + --outline: #2b2244; + --face: #5b3fd6; + --face-bevel: #8069ef; + --face-lip: #3a2694; + --on-face: #ffffff; color-scheme: light; --font: "Geist", ui-sans-serif, system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace; + --pixel: "Pixelify Sans", "Geist", ui-sans-serif, sans-serif; + --block-outline: 2px; + --block-bevel: 2px; + --block-lip: 4px; --text-micro: 11px; --text-micro-line: 1.5; --text-micro-tracking: 0.04em; @@ -88,34 +106,62 @@ @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { - --page: #0d0e13; - --plate-soft: #181a22; - --plate: #20222c; - --surface: #16181f; - --rule: #24262f; + --page: #0f0d17; + --plate-soft: #221e34; + --plate: #2b2641; + --surface: #1a1727; + --rule: #120f1c; --ink: #ecedf3; --ink-soft: #c5c7d1; - --muted: #8b8f9c; + --muted: #a29cb8; --accent: #9a86ff; - --on-accent: #0d0e13; + --on-accent: #ffffff; --danger: #f07a68; --success: #45c27a; + --warn: #f0b84f; + --side: #0b0a11; + --panel: #1a1727; + --raised: #221e34; + --button: #2b2641; + --button-bevel: #3d3560; + --well: #0c0b12; + --bevel: #342d52; + --lip: #07060b; + --outline: #05040a; + --face: #5b3fd6; + --face-bevel: #8a74ff; + --face-lip: #3a2694; + --on-face: #ffffff; color-scheme: dark; } } :root[data-theme="dark"] { - --page: #0d0e13; - --plate-soft: #181a22; - --plate: #20222c; - --surface: #16181f; - --rule: #24262f; + --page: #0f0d17; + --plate-soft: #221e34; + --plate: #2b2641; + --surface: #1a1727; + --rule: #120f1c; --ink: #ecedf3; --ink-soft: #c5c7d1; - --muted: #8b8f9c; + --muted: #a29cb8; --accent: #9a86ff; - --on-accent: #0d0e13; + --on-accent: #ffffff; --danger: #f07a68; --success: #45c27a; + --warn: #f0b84f; + --side: #0b0a11; + --panel: #1a1727; + --raised: #221e34; + --button: #2b2641; + --button-bevel: #3d3560; + --well: #0c0b12; + --bevel: #342d52; + --lip: #07060b; + --outline: #05040a; + --face: #5b3fd6; + --face-bevel: #8a74ff; + --face-lip: #3a2694; + --on-face: #ffffff; color-scheme: dark; }