RetroWin is a single-page React 18 application that simulates a Windows 98 desktop environment in the browser. Rather than a conventional page layout, the entire viewport is treated as a desktop surface: icon grid, draggable windows, a persistent taskbar, and a CRT scanline overlay all compose into one cohesive illusion. React Router v6 (hash-based) determines which retro window is currently open, while Framer Motion handles drag-and-drop repositioning of those windows.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/retrowin/llms.txt
Use this file to discover all available pages before exploring further.
Component hierarchy
The root componentud() — mounted into #root by React 18’s createRoot — wraps the whole application in a HashRouter and lays out every major layer as siblings inside a single full-screen div:
Desktop component renders the desktop icon grid and, when the path is /, also mounts the welcome.htm RetroWindow that greets first-time visitors. Every routed page (AboutWindow, ProjectsWindow, SkillsWindow, ContactWindow) is itself a RetroWindow — the shared draggable window shell component.
Z-index layers
All layers are siblings in the DOM, stacked via explicit z-index values so that nothing accidentally occludes the taskbar or the CRT overlay:| Component | z-index | Purpose |
|---|---|---|
| Desktop icon grid | z-0 | Background icon layer, behind all windows |
RetroWindow (normal) | z-10 | Open page windows floating on the desktop |
RetroWindow (maximised) | z-50 | Expanded window fills the viewport above other windows |
Mascot | z-[55] | Always visible character, above maximised windows |
Taskbar | z-[60] | Fixed bottom bar, above the mascot |
| Start menu popup | z-[70] | Dropdown rendered above the taskbar itself |
CRTOverlay | z-[100] | Top-most fixed layer — scanlines and flicker affect everything |
State management
RetroWin has no external state library. All interactive state is managed with React’s built-inuseState:
- Window maximise toggle —
RetroWindowholds a localisMaximizedboolean. Clicking the maximise button (□) flips this flag, expanding the window to fill the viewport viainset-0 !w-full !h-full. - Guestbook form submission —
ContactWindowtracks asubmittedboolean. Onformsubmit the flag is set totrueand the form swaps out for a thank-you message. - Taskbar Start menu —
Taskbarholds anisOpenboolean that toggles the Start menu popup on button click. - Hit counter —
HitCounterreads and writes a visit count tolocalStorage, incrementing it on first render viauseEffect. - System clock —
Taskbarupdates aDateobject every second viasetIntervalinside auseEffectcleanup pattern.
Data flow
Navigation in RetroWin always flows in one direction:- User action — a double-click on a
DesktopIcon, a click on a Start menu item inTaskbar, or an<a href="#/about">link in the welcome window. useNavigate()/ hash anchor —DesktopIconandTaskbarcalluseNavigate()from React Router. Anchor links update the hash directly.- Hash change — the browser URL updates to e.g.
/#/about, andHashRouterreacts. <Routes>match — React Router matches the new path and renders the correspondingRetroWindowcomponent into the DOM alongside the persistent desktop layer.- Close — the
RetroWindow“X” button callsuseNavigate("/"), popping back to the desktop and unmounting the window.
The files under
assets/ — main.js, main.css, index.js, proxy.js — are the production Vite bundle output. They are minified and contain React, React Router, Framer Motion, and all application code compiled into a single module graph. Do not edit these files directly; they are regenerated each build from the source components under components/y2k/.