diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-28 18:14:54 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-28 18:14:54 -0700 |
| commit | 7b67d90f4f25eca2480d0d769ec5ab6305c4b4c6 (patch) | |
| tree | 9cb7ff07be14d91a8c3c861e9a2ffcb67aaaa8bf /aero.js | |
| parent | 40992af162a7b2564c869da2f4fd3745736346b7 (diff) | |
aero: align sparkle cursor with pointer at non-1.0 zoom
The sparkle div is appended inside the zoomed <html>, so writing raw
clientX/Y into style.left/top placed each sparkle at clientX*zoom on
screen — drifting toward the origin. Divide by window.__uiScale.
Diffstat (limited to 'aero.js')
| -rw-r--r-- | aero.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -48,8 +48,9 @@ function sparkleCursor() { last = now; const s = document.createElement('div'); s.className = 'sparkle'; - s.style.left = e.clientX + 'px'; - s.style.top = e.clientY + 'px'; + const z = window.__uiScale || 1; + s.style.left = (e.clientX / z) + 'px'; + s.style.top = (e.clientY / z) + 'px'; const theme = document.body.dataset.theme; // chrome: iridescent / holographic palette (cyan→magenta→pink) // aero: warm-cool rainbow as before |
