Skip to content

feat: fix cursor lag, add Blade Runner city map, trim visual noise#4

Open
a20r wants to merge 1 commit into
mainfrom
feat/cursor-perf-city-map
Open

feat: fix cursor lag, add Blade Runner city map, trim visual noise#4
a20r wants to merge 1 commit into
mainfrom
feat/cursor-perf-city-map

Conversation

@a20r
Copy link
Copy Markdown
Owner

@a20r a20r commented May 21, 2026

Cursor performance fix

The custom cursor lagged badly, worst near the top of the page. Cause: it was positioned with left/top, which are layout properties — every mousemove triggered a reflow, and the hero is animation-heavy, so the main thread couldn't keep up.

  • Position via transform: translate3d(...) — compositor-only, no layout/reflow
  • Single requestAnimationFrame loop: the ring tracks the pointer 1:1, the trail lerps toward it
  • Replaced the expensive body:has(a:hover) selector with a delegated mouseover/mouseout class toggle
  • Custom cursor hidden on touch / coarse-pointer devices

Verified: after moving the mouse, #cursor carries translate3d(800px, 500px, 0px) — pure transform, zero layout cost.

Cleanup (less busy)

  • Removed the full-screen #flicker overlay — it animated opacity ~10×/sec, a constant full-viewport repaint that also worsened the cursor lag
  • Dropped the second hero "boot" line; trimmed hero badges from 6 to 4
  • Status bar: 3 items down to 2

City map (the bonus)

New "City Grid" section — a stylized Blade Runner street map rendered in SVG:

  • Angled grid district — offset street grid, generated in JS
  • Downtown ring road + radial plaza with converging avenues
  • Coastal expressway — curving cyan highway with animated traffic dots (SMIL animateMotion)
  • Rail line, bay, junction nodes, and a pulsing plaza marker
  • HUD corner brackets, a legend, and a Map nav link
  • Road-network glow uses a single SVG filter (renders once — no per-frame cost)

Verification

Screenshotted with headless Chromium:

  • Mobile (375px): scrollWidth === innerWidth — no horizontal scroll
  • Map, hero, and about sections render correctly
  • No JS errors (only a sandbox-only CDN cert warning under file://)

Test plan

  • Move the cursor around at the top of the page — should track smoothly
  • Scroll to the "City Grid" section — map renders, traffic dots move, plaza pulses
  • Check the Map nav link scrolls to the section
  • Mobile: confirm no horizontal scroll and the map scales down cleanly
  • Confirm the page feels less busy without the flicker overlay

https://claude.ai/code/session_01Y8g3FHp9dy1wN86ThR4hYp


Generated by Claude Code

Cursor performance:
- Position via translate3d (compositor-only) instead of left/top, which
  triggered layout/reflow on every mousemove — the cause of the lag,
  worst over the animation-heavy hero
- Single rAF loop; ring tracks 1:1, trail lerps
- Replace expensive body:has(a:hover) selector with delegated class toggle
- Hide custom cursor on touch / coarse-pointer devices

Cleanup:
- Remove full-screen #flicker overlay (constant 10fps repaint + visual noise)
- Drop second hero boot-text line; trim hero badges 6 -> 4
- Status bar 3 items -> 2

City map:
- New "City Grid" section: SVG Blade Runner map with angled grid district,
  downtown ring road, radial plaza, coastal expressway, rail line and bay
- Animated traffic dots via SMIL animateMotion; pulsing plaza marker
- Static road network glow via single SVG filter (renders once)
- Grid streets generated in JS; legend + HUD corner brackets
- Added Map nav link

https://claude.ai/code/session_01Y8g3FHp9dy1wN86ThR4hYp
@github-actions
Copy link
Copy Markdown
Contributor

Preview: https://a20r.github.io/previews/pr-4/

Commit: 2c2f85d — updates automatically on new pushes.

github-actions Bot pushed a commit that referenced this pull request May 21, 2026
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.

2 participants