From 003ac744a397c3081dbcaab1e2706d3ae893111e Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Thu, 19 Nov 2026 21:37:30 -0700 Subject: [PATCH] chore(deps): move strata to v0.8.0 Moves every strata pin to v0.8.0 (5ea7e14f0e59618179c11fe9784e9b4102acc0f1). Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 2 +- strata.ref | 2 +- web/strata-kit/PIN | 2 +- web/strata-kit/SHA256SUMS | 2 +- web/strata-kit/strata-loader.js | 41 ++++++++++++++++++++++++++++----- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5b910a..3daaaa7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ option(STEADING_WITH_STRATA "Build the playable game and save integration on the option(STEADING_WEB "Build the browser game (Emscripten + Strata's WebGL 2 backend; no OpenUSD, no saves)" OFF) # The Strata commit the game is built against (the v0.7.0 tag; strata.ref # carries the same SHA for CI). Pinned; bump deliberately. -set(STEADING_STRATA_REF "20827c3d67e71c1f942c29e7cf8adfa4801188a8" CACHE STRING "Strata git ref (a full commit SHA in CI)") +set(STEADING_STRATA_REF "5ea7e14f0e59618179c11fe9784e9b4102acc0f1" CACHE STRING "Strata git ref (a full commit SHA in CI)") # Emscripten: the rules, tools and tests build as they are and the tests run # under Node; STEADING_WEB adds the browser game. Strata compiles C++ diff --git a/strata.ref b/strata.ref index 0e9c8c8..06c6fed 100644 --- a/strata.ref +++ b/strata.ref @@ -1 +1 @@ -20827c3d67e71c1f942c29e7cf8adfa4801188a8 +5ea7e14f0e59618179c11fe9784e9b4102acc0f1 diff --git a/web/strata-kit/PIN b/web/strata-kit/PIN index 0e9c8c8..06c6fed 100644 --- a/web/strata-kit/PIN +++ b/web/strata-kit/PIN @@ -1 +1 @@ -20827c3d67e71c1f942c29e7cf8adfa4801188a8 +5ea7e14f0e59618179c11fe9784e9b4102acc0f1 diff --git a/web/strata-kit/SHA256SUMS b/web/strata-kit/SHA256SUMS index 2e484d6..b4085c2 100644 --- a/web/strata-kit/SHA256SUMS +++ b/web/strata-kit/SHA256SUMS @@ -1,2 +1,2 @@ -fa03e8ed92759359359f29f40668c947e63b0c9f3eabafcce2f911110637f5c3 strata-loader.js +c4079c74093525b25dac4fcac7c4d56976f1d1e03ef5239a5f873878d0119eb6 strata-loader.js 8e3fc647b4775773eabc147e564ffbddd0653b252eff96c5432213ee362798df LICENSE diff --git a/web/strata-kit/strata-loader.js b/web/strata-kit/strata-loader.js index 3ac65ee..0110f4c 100644 --- a/web/strata-kit/strata-loader.js +++ b/web/strata-kit/strata-loader.js @@ -13,6 +13,7 @@ trailer: {webm: "...", mp4: "..."}, // optional: played when the page can't run live fallback: {href: "/", text: "Open the 2D dashboard"}, // optional link on every fallback gate: false, // true: wait for a tap when the device asks for less + mount: el, contain: true, // optional: cover only `el` (a page section), not the viewport }); // ... create the scene with StrataKit.create({module: mod, ...}), then: StrataLoader.done(); @@ -28,7 +29,7 @@ } show() takes load()'s display options (title, poster, trailer, fallback, - mount) and returns false, with the fallback showing, when WebGL 2 is + mount, contain) and returns false, with the fallback showing, when WebGL 2 is missing. progress(fraction, label) clamps the fraction to 0..1 and never moves the bar back; the label (or the percentage) replaces the size line. @@ -50,6 +51,14 @@ Save-Data, or under 4 GB of device memory where the browser says) gets the poster and a "Start" button instead of an automatic download. + By default the overlay covers the viewport (position:fixed), whatever + `mount` is. With contain: true it covers only `mount` instead + (position:absolute inside it, scrolling with it): for a scene in one + section of a longer page, such as a hero render or a card. A `mount` whose + position is static is made position:relative so the overlay has something + to be absolute to. The slow bar (slow()) then sits at the bottom of `mount` + too. Without `mount`, contain does nothing. + load() resolves with the module, or rejects with an Error whose `code` is "no-webgl2", "network" or "engine" after the fallback is already showing. @@ -65,6 +74,7 @@ .sk-loader{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:16px; background:var(--sk-loader-bg,#101712);color:var(--sk-loader-fg,#e3ece4); font:14px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;transition:opacity .3s} +.sk-loader.sk-contained{position:absolute} .sk-loader[hidden]{display:none} .sk-loader.sk-done{opacity:0;pointer-events:none} .sk-loader .sk-backdrop{position:absolute;inset:0;background-size:cover;background-position:center; @@ -90,6 +100,11 @@ let root = null, opts = {}, state = "idle", shown = 0; + // The element the overlay covers when contain is set, else null (the viewport). + function container() { + return opts.contain && opts.mount ? opts.mount : null; + } + function el(tag, cls, text) { const e = document.createElement(tag); if (cls) e.className = cls; @@ -110,6 +125,11 @@ document.head.appendChild(style); root = el("div", "sk-loader"); root.setAttribute("role", "status"); + const scope = container(); + if (scope) { + root.classList.add("sk-contained"); + if (getComputedStyle(scope).position === "static") scope.style.position = "relative"; + } if (opts.poster) { const b = el("div", "sk-backdrop"); b.style.backgroundImage = `url("${String(opts.poster).replace(/"/g, "%22")}")`; @@ -372,10 +392,18 @@ if (document.querySelector(".sk-slow")) return; const bar = el("div", "sk-slow"); bar.setAttribute("role", "status"); - bar.style.cssText = "position:fixed;left:50%;transform:translateX(-50%);bottom:max(12px,env(safe-area-inset-bottom));" + + const inside = container(); + bar.style.cssText = (inside ? "position:absolute;" : "position:fixed;") + "left:50%;transform:translateX(-50%);bottom:max(12px,env(safe-area-inset-bottom));" + "z-index:21;background:rgba(0,0,0,.7);color:#fff;padding:8px 12px;border-radius:8px;" + - "font:13px system-ui,sans-serif;display:flex;gap:10px;align-items:center;max-width:calc(100vw - 32px)"; + "font:13px system-ui,sans-serif;display:flex;flex-wrap:wrap;gap:10px;align-items:center;width:max-content;" + + (inside ? "max-width:calc(100% - 32px)" : "max-width:calc(100vw - 32px)"); bar.appendChild(el("span", "", "This device is drawing slowly.")); + // The buttons wrap under the text together when the row is too narrow + // (a 390 px phone), rather than squeezing it onto several lines. The + // width is max-content because left:50% alone would cap an auto width at + // half the viewport. + const buttons = el("div", ""); + buttons.style.cssText = "display:flex;gap:10px;margin-left:auto"; const b = el("button", "", opts.trailer ? "Show the clip" : (opts.fallback.text || "Open the simpler view")); b.type = "button"; b.style.cssText = "font:inherit;min-height:36px;padding:4px 10px;border-radius:6px;border:0;cursor:pointer"; @@ -388,9 +416,10 @@ x.setAttribute("aria-label", "Dismiss"); x.style.cssText = b.style.cssText; x.addEventListener("click", () => bar.remove()); - bar.appendChild(b); - bar.appendChild(x); - document.body.appendChild(bar); + buttons.appendChild(b); + buttons.appendChild(x); + bar.appendChild(buttons); + (inside || document.body).appendChild(bar); } window.StrataLoader = {load, show, progress, done, fallback, slow, hasWebGL2, get state() { return state; }};