Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/guest-portfolio.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
CrtOverlay.js is a thin wrapper component that layers three divs over the entire viewport to produce a convincing retro CRT monitor effect: a phosphor-glowing content layer, a scanline/vignette overlay, and an optional flicker animation. All visual work is done in CSS (assets/main.css).
CSS Custom Properties
The entire colour scheme is driven by four CSS variables defined on:root, swapped by adding the theme-amber class to <body>:
setTheme("amber") or setTheme("green") from TerminalContext — the useEffect in TerminalContext applies the class: document.body.className = theme === "amber" ? "theme-amber" : "".
Component Structure
| Class | z-index | Role |
|---|---|---|
.crt-container | — (relative) | Viewport-sized root, overflow: hidden |
.crt-content | z-index: 10 | Children + phosphor text glow |
.crt-overlay | z-index: 50 | Scanlines, vignette, sweep animation |
Phosphor Glow
The.crt-content class adds a soft text shadow using --color-glow, making all text look like it is emitting light from a phosphor-coated screen:
Scanlines
The.crt-overlay div renders a horizontal scanline grid using a repeating linear gradient. Every 4 px, half the height is transparent and the other half is a semi-transparent black band — simulating the dark horizontal stripes between phosphor rows:
Scanline Sweep Animation
The.crt-overlay::before pseudo-element adds a single bright horizontal band that travels down the screen continuously, simulating the electron beam of a real CRT:
scanline keyframe moves the band from top to bottom over 8 seconds, looping forever.
Vignette
The deepinset box-shadow on .crt-overlay darkens the edges of the screen, pulling the viewer’s eye toward the centre — just like the curved glass of a real CRT:
Screen Curvature
Applying the.crt-curvature class to .crt-container (or any wrapper) rounds the corners and adds a secondary inset shadow to increase the illusion of a curved glass bezel:
Flicker Animation
The.crt-flicker class is applied to .crt-content whenever reduceMotion is false. It runs a rapid 0.15 s brightness oscillation that mimics the subtle flicker of an aging CRT tube:
reduceMotion flag (accessible via TerminalContext), both the flicker animation and the .crt-overlay div are suppressed entirely.
Turn-On Animation
WhenisBooting is true, the .crt-content div receives the animate-turn-on class, playing a 4-second power-on effect defined with Tailwind’s @keyframes:
TypewriterText Component
TypewriterText.js is a utility component used by both BootSequence and AsciiBanner. It types a string character by character, with variable delays for punctuation to make it feel organic:
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | — | The full string to type out |
delay | number | 30 | Base delay in ms per character |
fast | boolean | false | Halves delay; disables punctuation pauses |
onComplete | () => void | — | Callback fired when all characters are typed |
Custom Scrollbar
The terminal’s scrollbar is styled to match the active theme colour so it doesn’t break the retro aesthetic:--color-primary as the background and --color-bg as the text colour, maintaining the green-on-black or amber-on-black inversion.
Typewriter Cursor
The blinking block cursor used throughout the UI (inTerminalInput and BootSequence) is a CSS-only animated <span>:
step-end timing function produces a hard on/off blink rather than a fade, matching the look of real terminal cursors.