RetroWin is deployed as a static site on GitHub Pages. GitHub Pages serves files directly from the repository — it cannot intercept unknown paths and rewrite them toDocumentation 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.
index.html the way a Node server would. That means HTML5 history-mode routing (URLs like /about) would return a 404 for any direct link or refresh that lands outside the repo root. To work around this, RetroWin uses React Router v6’s HashRouter, which stores the current route in the URL fragment (/#/about). The browser never sends the fragment to the server, so the page load always succeeds and React Router reads the hash client-side.
Route definitions
Routes are declared inside the rootud() component, nested inside HashRouter. There are four named routes, each rendering a RetroWindow-wrapped page:
#/ or empty), <Routes> renders nothing from this block. The Desktop component independently checks useLocation().pathname === "/" and, when true, renders the welcome.htm RetroWindow directly — not through a <Route>.
Navigation
There are two ways to trigger a route change in RetroWin:useNavigate() hook — used in Taskbar (Start menu items) and in RetroWindow (the “X” close button). useNavigate returns an imperative navigate function that pushes a new entry into the router history.
DesktopIcon double-click — DesktopIcon also calls useNavigate() internally. Double-clicking any desktop icon (or single-tapping on mobile, where window.innerWidth < 768) calls navigate(to) with the icon’s to prop:
<a href="#/about"> anchors for its navigation list. These bypass React Router entirely and update the URL hash directly, which HashRouter then picks up automatically:
Static HTML pages
GitHub Pages can serve individual HTML files directly. RetroWin ships a static HTML page for each route underpages/:
assets/main.js) and sets a window.__STATIC_PAGE_ROUTE__ flag, then redirects the hash so the correct window opens when the page loads. This means a link to pages/About.html will land on the teal desktop with the About window already open:
Adding a new route
Create the page component
Add a new function component in
main.js (or as a separate file imported into it). Wrap the content in <RetroWindow>, giving it a title, url, defaultPosition, width, and height:Add a desktop icon
In the
Desktop component (ed() in main.js), add a <DesktopIcon> with a matching to prop:Add a Start menu entry
In
Taskbar.js, add a button inside the Start menu popup that calls handleNav("/resume"):