Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/retro-cosmic-arcade/llms.txt
Use this file to discover all available pages before exploring further.
WebringNav is a site-wide navigation component that mimics the “webring” navigation bars popular on personal home pages in the late 1990s. It reads the current route via React Router 6’s useLocation hook, finds the matching entry in a predefined routes array, and renders PREV and NEXT links that wrap around at the ends of the list. It also provides a static INDEX link to / and a RANDOM link that navigates to a randomly selected route on click.
Props
This component accepts no props. All routing context is read internally viauseLocation.
Usage
PlaceWebringNav inside your layout shell or at the top of any page component. It must be rendered within a React Router context (e.g., inside BrowserRouter or HashRouter):
Routes array
The component uses a statically defined routes array. The full list, in order, is:name values are displayed in the PREV/NEXT labels and in the current-page indicator.
Navigation logic
PREV and NEXT
The component finds the current route’s index withroutes.findIndex(r => r.path === location.pathname). PREV and NEXT indices are calculated with wrap-around logic:
| Condition | Behavior |
|---|---|
| Current is first route | PREV wraps to the last route in the array |
| Current is last route | NEXT wraps to the first route |
| Any other position | PREV = index − 1, NEXT = index + 1 |
Current page indicator
The active page name is displayed in the center of the nav bar, styledtext-y2k-lime animate-blink and surrounded by square brackets: [ PROJECTS ].
INDEX link
The INDEX link is always a hard link to"/" — it does not depend on the current route position and always takes the user to the home page.
RANDOM link
The RANDOM link’sto prop is computed at render time as:
Because the RANDOM link target is calculated at render time rather than on click, the destination is determined when the component renders, not when the user clicks. In practice this is imperceptible, but be aware that it will not re-roll on repeated clicks on the same page without a re-render in between.
Layout and styling
The nav renders as a<nav> element with three rows:
- Header label —
"-- OFFICIAL WEBRING NAVIGATION --"intext-y2k-magenta text-xs. - Main row —
◄ PREV (NAME),[ CURRENT ], andNEXT (NAME) ►in a flex row withgap-4. - Utility row —
INDEXandRANDOMlinks separated by a pipe character|.
| Token / Class | Effect |
|---|---|
font-silkscreen | Pixel Silkscreen font for all text |
bg-y2k-panel | Dark panel background |
border-b-2 border-y2k-cyan | Cyan bottom border separating nav from content |
text-y2k-silver | Default link color (PREV / NEXT) |
hover:text-y2k-cyan | Link hover color |
text-y2k-lime animate-blink | Current page indicator (blinking lime) |
text-y2k-magenta | INDEX and RANDOM link colors |
Extending the routes
To add a new page to the webring rotation, add an entry to theroutes array inside WebringNav.js: