Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/magical/llms.txt

Use this file to discover all available pages before exploring further.

The Writing page (/writing) is titled The Tomes and subtitled “Inscribed Thoughts & Chronicles.” It presents five writing entries as physical books standing on an animated shelf. Hovering any book causes it to rise, and a floating tooltip card appears above it showing a type badge, title, summary, and a call-to-action to open the full entry.

Visual & UX Overview

Animated Bookshelf

Books stand vertically in a horizontal flex row with items-end, each with a distinct background and text color defined per entry. A h-4 bg-mystic-900 border-t border-mystic-800 bar at the bottom creates the shelf ledge with a shadow-[0_10px_20px_rgba(0,0,0,0.5)] drop shadow. The shelf area uses h-96.

Book Hover Rise Effect

On hover, a book’s height transitions from h-[85%] to h-[95%] of the h-96 container (it “rises” upward from its base). This is achieved via a Framer Motion layout prop on the book motion.div, with a CSS transition-all duration-300 class alongside conditional class application.

Floating Tooltip

When a book is hovered, a w-72 tooltip card floats above it via position: absolute bottom-full. The card contains: a type label (in the entry’s text color), the entry title, a summary paragraph, and an “Open Volume” link. It appears and disappears with a Framer Motion AnimatePresence fade + translate.

Shelf Shadow

The bottom shelf bar is positioned absolutely at bottom-0 with z-0. Books are rendered on top at z-10 using relative z-10 h-96. The combined shadow creates a tangible, physical shelf quality.

Writing Entries Data

The five writing entries are stored as a static array. Each entry has an id, title, type, date, summary, color (Tailwind classes for card background and border), and textColor (for the type label):
const writings = [
  {
    id: 1,
    title: "The Anatomy of a Memory Leak",
    type: "Bug Report",
    color: "bg-mystic-900 border-mystic-violet/40",
    textColor: "text-mystic-violet",
    summary: "A detailed chronicle of hunting down a elusive memory leak in a React application that only appeared during the full moon (or rather, after 4 hours of continuous use).",
    date: "Oct 2023",
  },
  {
    id: 2,
    title: "CSS Grid: Sacred Geometry",
    type: "Technical Writeup",
    color: "bg-mystic-950 border-mystic-teal/40",
    textColor: "text-mystic-teal",
    summary: "Demystifying CSS Grid layouts by comparing them to ancient architectural blueprints. Stop using flexbox for everything.",
    date: "Aug 2023",
  },
  {
    id: 3,
    title: "From Triage to Try/Catch",
    type: "Reflection",
    color: "bg-mystic-800 border-mystic-mint/40",
    textColor: "text-mystic-mint",
    summary: "Reflections on how nursing triage protocols map surprisingly well to handling production incidents and debugging complex systems.",
    date: "May 2023",
  },
  {
    id: 4,
    title: "Accessibility as Empathy",
    type: "General Audience",
    color: "bg-mystic-900 border-slate-500/40",
    textColor: "text-slate-300",
    summary: "A non-technical explanation of why semantic HTML matters, framed around the idea that building for everyone is the most fundamental form of digital hospitality.",
    date: "Jan 2023",
  },
  {
    id: 5,
    title: "State Management Rituals",
    type: "Technical Writeup",
    color: "bg-mystic-950 border-mystic-violet/40",
    textColor: "text-mystic-violet",
    summary: "Comparing Redux, Zustand, and Context API. Which summoning circle is right for your particular demon?",
    date: "Nov 2022",
  },
];

Entry Summary Table

TitleTypeDateColor
The Anatomy of a Memory LeakBug ReportOct 2023bg-mystic-900 border-mystic-violet/40
CSS Grid: Sacred GeometryTechnical WriteupAug 2023bg-mystic-950 border-mystic-teal/40
From Triage to Try/CatchReflectionMay 2023bg-mystic-800 border-mystic-mint/40
Accessibility as EmpathyGeneral AudienceJan 2023bg-mystic-900 border-slate-500/40
State Management RitualsTechnical WriteupNov 2022bg-mystic-950 border-mystic-violet/40

Book Rise Animation

Each book uses a conditional class switch and a Framer Motion layout prop to animate the height change smoothly:
<motion.div
  className={`w-16 md:w-24 border-l border-r border-t rounded-t-md cursor-pointer
    flex flex-col items-center py-4 transition-all duration-300
    ${entry.color}
    ${isHovered ? "h-[95%] shadow-[0_0_30px_rgba(168,85,247,0.15)]" : "h-[85%]"}`}
  layout
  onMouseEnter={() => setHoveredBook(entry.id)}
  onMouseLeave={() => setHoveredBook(null)}
>
  {/* Icon, rotated title text, date */}
</motion.div>
hoveredBook is managed as a single state at the shelf level (storing the hovered entry’s id, or null). Only one tooltip is visible at a time. If the user moves directly from one book to another, the previous tooltip exits and the new one enters simultaneously via AnimatePresence.

Tooltip Anatomy

Each floating tooltip contains:
  1. Type label — rendered in the entry’s textColor (e.g., text-mystic-violet for Bug Report).
  2. Entry title — displayed in font-serif, matching the book spine.
  3. Summary — the full summary text from the entry object.
  4. “Open Volume” CTA — displayed with a book icon at the bottom of the tooltip.
The tooltip is positioned absolute bottom-full mb-6 left-1/2 -translate-x-1/2 and includes a decorative diamond rotate-45 caret at its base.

Customization

Append a new object to the writings array. Choose distinct color and textColor Tailwind classes to keep each book visually unique. Assign a new id and fill in title, type, date, and summary. The shelf will expand to accommodate the new book — no layout changes needed.
The current entries do not have URL fields in the source data. To add links, extend each entry object with a url field and update the “Open Volume” CTA to use that URL (e.g., window.open(url, "_blank") for external links).
The resting height is h-[85%] and hover height is h-[95%]. Increase the hover value (e.g., to h-[100%]) for a more dramatic pull-from-shelf effect. Decrease the resting value (e.g., to h-[80%]) to create a deeper “shelf well” appearance.

Component Dependencies

ComponentSourceRole
BackgroundEffectscomponents/BackgroundEffects.jsAmbient particle and blur layer
Navigationcomponents/Navigation.jsFixed top navigation bar
motion / AnimatePresenceFramer MotionBook rise animation (layout), tooltip enter/exit transitions
The shelf works best with an odd number of books (3, 5, 7) when centred in the layout — the middle book naturally draws the eye and suggests a focal piece. With an even number, consider left-aligning the shelf or adding a decorative bookend element on the right.

Build docs developers (and LLMs) love