What is this?
The Eye of Sauron is a playful web experiment where a digital Eye follows your mouse or touch across the screen.
Inspired by Tolkien’s legendary all-seeing eye, this project turns your cursor into Frodo carrying the One Ring — being constantly watched!
🛠️ How it works (Tech Details)
-
Built with Astro for a fast and flexible static site experience.
-
The Eye itself is drawn using a lightweight HTML Canvas element.
-
Mouse and touch movements are tracked in real-time with a simple event listener:
window.addEventListener("mousemove", (e) => { /* update eye position */ });
-
A little math magic (using
atan2
) calculates the rotation angle of the Eye based on cursor position:const angle = Math.atan2(cursorY - eyeCenterY, cursorX - eyeCenterX);
-
Smooth animation is achieved using
requestAnimationFrame
, keeping the Eye’s motion natural and snappy. -
Minimal assets — everything is rendered programmatically for a lightweight load and quick interaction.
💭 Why?
Because sometimes the world just needs a browser-based Eye of Sauron.
Fun, weird, and slightly unsettling — just how we like it at Brain Fart. 😈