The Guestbook component (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/y2k-web/llms.txt
Use this file to discover all available pages before exploring further.
components/Guestbook.js, exported as G) is a classic late-1990s sign-my-guestbook form. Visitors enter their name or handle and leave a short message; entries are saved to localStorage under the key retro_guestbook so they persist across page refreshes for the duration of the browser session. The component is embedded directly on the Home page (/) under a “Don’t forget to sign!” heading — it is not a standalone routed page.
The Guestbook form at
components/Guestbook.js is not the same as the Contact page AIM-style instant-messenger window (at /contact). The Contact page (Ap component) is a separate IM chat interface. The Guestbook is the traditional sign-your-name form embedded on the home page.Features
Name / Handle Input
A text<input> (max 20 characters) bound to a controlled state field. Visitors type their screen name or handle here.
Message Textarea
A<textarea> (max 150 characters, fixed height, no resize) bound to a second controlled state field. Visitors type their message here.
Sign It! Button
A Windows-98-styled<button type="submit"> that submits the form. On submit, handleSend validates that both fields are non-empty, prepends the new entry to the messages array, writes the updated array back to localStorage, and clears both inputs.
Message Log
A scrollable<div> (h-48 overflow-y-auto) displaying all guestbook entries. Each entry shows:
- Name — in retro-blue Impact font
- Date — right-aligned in pixel font (formatted via
toLocaleDateString()) - Message — in Comic Sans style
Message State Structure
Messages live in auseState array. On mount a useEffect reads from localStorage:
- If
retro_guestbookexists in storage, it parses and loads those entries. - If not, it seeds two default entries and writes them to storage.
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (either a preset string or Date.now().toString()) |
name | string | The visitor’s name or handle |
message | string | The message body |
date | string | Formatted date string from toLocaleDateString() |
Submit Logic
When the form is submitted,handleSend runs the following steps:
localStorage so entries survive a page refresh.
localStorage Persistence
All guestbook data is stored client-side. The storage key isretro_guestbook. Data is stored as a JSON-serialised array of message objects. There is no server-side component — entries are only visible in the browser that submitted them.
To clear the guestbook, run the following in the browser console:
WindowFrame Title
The component is wrapped in aWindowFrame with the title Sign My Guestbook.exe.
Customizing the Seed Messages
To change the default messages shown before anyone has signed, find the seed array in theuseEffect inside Guestbook.js and edit the entries: