Skip to content

fix(explorer): give the landing orb a light-mode render - #1231

Open
max-digi wants to merge 2 commits into
mainfrom
fix/explorer-light-mode-orb
Open

fix(explorer): give the landing orb a light-mode render#1231
max-digi wants to merge 2 commits into
mainfrom
fix/explorer-light-mode-orb

Conversation

@max-digi

@max-digi max-digi commented Sep 3, 2026

Copy link
Copy Markdown

Problem

The landing orb had only one asset — landing-circles.png, near-white flat line work sized for the dark page. It was used in both themes, so on a white background it washed out to almost nothing.

Change

  • Adds landing-circles-light.png, a second render of the same artwork carrying its own shading.
  • Sphere.Artwork paints the orb as a background instead of an <img>, and styles.css selects the asset off html[data-theme="light"].
  • Light mode is held to opacity: 0.42, where the strands otherwise compete with the footer links they pass behind.
  • Sits the orb lower: the band drops from 242px to 194px, showing 68% of the artwork instead of 85%.

Dark mode keeps the same asset at full strength; only its position changes, along with light's.

Why a background and not an <img>

Only the asset for the active theme gets fetched (verified: one 200, no request for the other), and the swap lands before first paint. Theme is a data-theme attribute set by an inline boot script, while React theme state resolves after hydration — a React-driven src would flash the dark render at light-mode visitors.

Framing — nothing jumps when switching theme

Both assets are 1312×570: the orb rendered 1312px wide, cropped to its top 570 rows. The band is anchored to the viewport bottom and the artwork to the band's top, so the 194px height both lowers the orb and clips more of it — 194 of 285 CSS px visible, i.e. asset rows 0..388.

Measured live in both themes at the same viewport:

light dark
artwork box 62,506 656×285 62,506 656×285
band 0,506 780×194 0,506 780×194
background-size / position 100% / 0% 0% 100% / 0% 0%

The only properties differing between themes are background-image and opacity. Within the visible window the two renders' ink bounding boxes agree to 0.5 CSS px on every edge, the arch's top edge differs by a mean of 0.010 CSS px across 1208 columns (max 1 px), and mask IoU is 0.952.

Note: the light render's strands continue to row 569 where the dark one stops at 482 — both well below the clip line at 388, so hidden. If h-[194px] ever grows past ~241px, the two will stop revealing the same amount of orb.

Anti-aliasing

The strands are sub-pixel hairlines at 656 CSS px, so rasterising straight to target size broke them into dotted lines. Rendered at 4× and downsampled with Lanczos over premultiplied alpha. Grain (mean |Laplacian| in strand bodies) measured on the rendered page:

grain darkest strand
old asset in light mode 6.8 208
naive 1× render @42% 13.1 196
this PR (4× downsampled) @42% 5.9 200

Screenshots

Before After
drop before-light.png here drop lower-light.png here

Verification

  • pnpm check in apps/explorer — biome, tsgo, 110 env tests
  • pnpm exec vitest run — 112 tests
  • pnpm lint:tempo — exit 0
  • NODE_ENV=production pnpm build — clean, both assets present in dist/client
  • Light and dark checked in the running app at both band heights

🤖 Generated with Claude Code

The landing orb only ever had one asset: near-white flat line work sized
for the dark page. On a white background it washed out to almost nothing.

Adds a second render of the same artwork carrying its own shading, framed
identically to the dark one (both 1312x570, the orb at 1312 wide cropped to
its top 570 rows) so switching theme swaps the shading without moving the
arch. Verified the two agree to half a pixel on every edge of the visible
window.

The artwork is painted as a background rather than an <img> so only the
asset for the active theme is fetched, and so the swap happens before first
paint -- theme is a `data-theme` attribute set by an inline boot script,
while React theme state resolves after hydration, which would flash the
dark render at light-mode visitors.

Held to 42% opacity in light mode, where the strands otherwise compete with
the footer links they pass behind. Rendered at 4x and downsampled, because
the strands are sub-pixel hairlines at 656px and rasterising straight to
target size breaks them into dotted lines.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 5.9 MB +1.6 MB (+38.6%)
Gzip 1.7 MB +514.1 KB (+41.2%)
Brotli 1.5 MB +446.1 KB (+41.1%)
Chunk changes (>1KB)
Chunk Change
assets/chains.js (removed) -360.7 KB
assets/tempo-queries.js -301.0 KB
assets/core.js (removed) -189.5 KB
assets/export-rate-limit.js (removed) -177.3 KB
assets/engine-javascript.js (removed) -92.9 KB
assets/decodeAbiParameters.js (removed) -71.7 KB
assets/_hash.js -44.1 KB
assets/AbiItem.js (removed) -27.1 KB
assets/sha2.js (removed) -14.7 KB
assets/queryOptions.js -11.8 KB
assets/Bytes.js -9.6 KB
assets/env.js -8.9 KB
assets/fee-amm-pool-rows.js (removed) -6.6 KB
assets/validators.js (removed) -5.1 KB
assets/wagmi.config.js -2.4 KB
assets/tokens.js -1.3 KB
assets/react.js -1.1 KB
assets/Value.js (removed) -1.0 KB
assets/TransactionCell.js (new) +1.1 KB
assets/jsx-runtime.js (new) +1.1 KB
...and 38 more

Compared against main branch (baseline from 4/27/2026, 4:02:54 PM)

@max-digi
max-digi requested a review from emmajam September 3, 2026 16:10
Drops the band from 242px to 194px. The band is anchored to the viewport
bottom and the artwork to the band's top, so a shorter band both sits the
orb lower and clips more of it: 194 of 285 CSS px now show (68%) instead of
242 (85%) -- 20% less of the artwork.

Applies to both themes; the height is on the shared container. Verified the
artwork box is identical across themes (62,506 656x285) and that the two
renders agree to half a pixel on every edge of the newly visible window, so
switching theme moves nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 5.9 MB +1.6 MB (+38.6%)
Gzip 1.7 MB +514.1 KB (+41.2%)
Brotli 1.5 MB +446.1 KB (+41.1%)
Chunk changes (>1KB)
Chunk Change
assets/chains.js (removed) -360.7 KB
assets/tempo-queries.js -301.0 KB
assets/core.js (removed) -189.5 KB
assets/export-rate-limit.js (removed) -177.3 KB
assets/engine-javascript.js (removed) -92.9 KB
assets/decodeAbiParameters.js (removed) -71.7 KB
assets/_hash.js -44.1 KB
assets/AbiItem.js (removed) -27.1 KB
assets/sha2.js (removed) -14.7 KB
assets/queryOptions.js -11.8 KB
assets/Bytes.js -9.6 KB
assets/env.js -8.9 KB
assets/fee-amm-pool-rows.js (removed) -6.6 KB
assets/validators.js (removed) -5.1 KB
assets/wagmi.config.js -2.4 KB
assets/tokens.js -1.3 KB
assets/react.js -1.1 KB
assets/Value.js (removed) -1.0 KB
assets/TransactionCell.js (new) +1.1 KB
assets/jsx-runtime.js (new) +1.1 KB
...and 38 more

Compared against main branch (baseline from 4/27/2026, 4:02:54 PM)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant