40 const id = window.setTimeout(() => {
41 timers.delete(id);
42 fn();
43 }, ms);
44 timers.add(id);
45 };
46
47 const look = () => {
48 // Mostly a glance somewhere new; sometimes the eyes just drift.
49 if (Math.random() < 0.7) {
50 gx = rand(-1, 1);
51 gy = rand(-0.4, 1);
52 } else {
53 gx = clamp(gx + rand(-0.3, 0.3), -1, 1);
54 gy = clamp(gy + rand(-0.3, 0.3), -0.4, 1);
55 }
56 el.style.transform = `translate(${(gx * GAZE_X).toFixed(1)}px, ${(gy * GAZE_Y).toFixed(1)}px)`;