aboutsummaryrefslogtreecommitdiff
path: root/aero.js
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-05-28 18:14:54 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-05-28 18:14:54 -0700
commit7b67d90f4f25eca2480d0d769ec5ab6305c4b4c6 (patch)
tree9cb7ff07be14d91a8c3c861e9a2ffcb67aaaa8bf /aero.js
parent40992af162a7b2564c869da2f4fd3745736346b7 (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.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/aero.js b/aero.js
index 695331f..c789026 100644
--- a/aero.js
+++ b/aero.js
@@ -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