The Screensaver component replicates the classic Windows screensaver experience: leave the portfolio untouched for 60 seconds and a full-screen black overlay appears with the Windows logo and “Portfolio OS” text bouncing endlessly around the screen — just like a DVD player menu. Any interaction immediately dismisses it.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/log-portfolio/llms.txt
Use this file to discover all available pages before exploring further.
Idle Detection
The component listens for three browser events onwindow: mousemove, keydown, and click. Each event triggers the same handler, which both resets the active state to false (dismissing the screensaver if it’s showing) and clears then restarts a 60-second setTimeout:
e()) so the timer begins as soon as the component renders — no interaction needed to start counting.
Visual: The Full-Screen Overlay
Whenactive is true, the component renders a full-screen black div with z-[999999] — above every other element in the application, including windows and Clippy:
pointer-events-none prevents the overlay itself from consuming mouse events, which ensures the mousemove listener on window still fires even while the screensaver is active, allowing instant dismissal.
Logo and Text
Inside the overlay, a Framer Motionmotion.div contains the Windows logo (loaded from Wikimedia Commons) and the “Portfolio OS” label, both at 50% opacity for the authentic dim-screensaver look:
x and y values come from the position state (l), which is updated each animation frame by the bounce loop.
Bounce Physics
The bounce loop runs inside a seconduseEffect that only activates when active is true. It uses requestAnimationFrame to move the logo at a constant velocity and reverse direction when a wall is hit:
{ x: 3, y: 3 } pixels per frame — roughly 180px/s at 60 fps.
Customizing the Screensaver
Change the idle timeout
Find the
6e4 literal in components/Screensaver.js and replace it with your preferred timeout in milliseconds:Change the bounce speed
Locate the
useState call that initialises velocity and increase or decrease the values:Swap the logo or text
Edit the JSX in
components/Screensaver.js. Replace the <img> tag’s src with any image URL, and change the <span> text to whatever you like:The screensaver overlay uses
pointer-events-none, so clicks that dismiss it pass through to the desktop below. This means you can click a desktop icon to both dismiss the screensaver and open a window in one action.