Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/fortune-seeker/llms.txt

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

TarotCard is the centerpiece interactive element of Fortune Seeker. It renders a 16rem × 24rem playing-card-sized tile that flips in 3D to reveal custom content. The component appears on the Projects (Major Arcana) page, the Skills (Cast Spells) page, and anywhere the portfolio showcases a discrete piece of work or information. Each card enters the viewport with a staggered fade-and-rise animation, then hovers with a subtle lift, and flips with spring-physics rotation when clicked.

Props

frontContent
ReactNode
required
The content displayed on the revealed face of the card — the side shown after the card flips. Despite the name, this is the information side (project title, description, links, etc.), not the decorative back design.
backContent
ReactNode
Reserved for future use in the current implementation. The decorative obsidian-and-gold mandala face is hard-coded as the unflipped side; this prop slot exists for extensibility.
isFlipped
boolean
Controls the flip state externally. When provided, the component operates in controlled mode and will not manage its own internal state. When omitted (undefined), the component is uncontrolled and toggles its own flip state on each click.
onClick
() => void
Optional callback fired when the card is clicked. In uncontrolled mode this fires after the internal state toggle. In controlled mode, use this handler to update isFlipped in the parent.
className
string
Additional Tailwind utility classes appended to the card’s root element. Defaults to an empty string.
delay
number
Seconds of delay before the card’s entrance animation begins. Useful for staggering a grid of cards. Defaults to 0.

Usage Example

import TarotCard from "@/components/TarotCard";

// Uncontrolled — manages its own flip state
export default function ProjectsPage() {
  return (
    <div className="grid grid-cols-3 gap-8">
      <TarotCard
        delay={0}
        frontContent={
          <div>
            <h3>Project Alpha</h3>
            <p>A full-stack e-commerce platform built with Next.js.</p>
          </div>
        }
      />
      <TarotCard
        delay={0.15}
        frontContent={
          <div>
            <h3>Project Beta</h3>
            <p>Real-time data dashboard powered by WebSockets.</p>
          </div>
        }
      />
    </div>
  );
}
// Controlled — parent owns the flip state
import { useState } from "react";
import TarotCard from "@/components/TarotCard";

export default function ControlledCard() {
  const [flipped, setFlipped] = useState(false);

  return (
    <TarotCard
      isFlipped={flipped}
      onClick={() => setFlipped((prev) => !prev)}
      frontContent={<p>Revealed content goes here.</p>}
    />
  );
}

Behavior & Animation

Entrance

When a TarotCard mounts, Framer Motion animates it from opacity: 0, y: 50 to opacity: 1, y: 0 over 0.8s with an easeOut curve. The delay prop offsets this transition so multiple cards can cascade into view one after another.

Hover

While the cursor is over the card, whileHover scales the card to 1.05 and lifts it by 10px upward (translateY: -10). A gold gradient sweep — a diagonal shine — also becomes visible, sliding from left to right over 1.5s as a shimmer effect.

Flip

Clicking the card triggers a rotateY animation on the inner container:
  • Unflipped: rotateY: 0 — shows the decorative obsidian face with a gold SVG mandala (two concentric circles, a diamond, crossing diagonal lines, and a filled center dot).
  • Flipped: rotateY: 180 — reveals the frontContent face, styled with a gradient from midnight to obsidian and a brighter gold border. A brief white shimmer sweeps across on flip completion.
Both faces use backface-hidden to prevent bleed-through. The flip uses spring physics with stiffness: 60 and damping: 15, producing a satisfying, slightly elastic rotation over approximately 0.8s.
The inner container uses the CSS preserve-3d transform style. Ensure the parent context does not apply overflow: hidden or a CSS transform that would flatten the 3D perspective — either will cause the flip to appear as a 2D scale instead of a true rotation.
Stagger a grid of cards by incrementing delay in steps of 0.10.15 seconds per card. For example, map over an array and pass delay={index * 0.12} to create a smooth cascade entrance.

Build docs developers (and LLMs) love