Overview
Luz de Arcanos implements a complete 78-card Rider-Waite tarot deck with full upright and reversed interpretations. The system handles card drawing, randomization, and orientation assignment.Deck structure
The tarot deck consists of two main groups:- Major Arcana
- Minor Arcana
22 cards (IDs 0-21)Major life themes and spiritual lessons:
- The Fool (El Loco)
- The Magician (El Mago)
- The High Priestess (La Sacerdotisa)
- The Empress (La Emperatriz)
- The Emperor (El Emperador)
- And 17 more archetypal cards…
TarotCard interface
Each card is defined with the following TypeScript interface:Field descriptions
| Field | Type | Description |
|---|---|---|
id | number | Unique identifier (0-77) |
name | string | Card name in Spanish |
image | string | Image filename (e.g., “00_Fool.jpg”) |
uprightKeywords | string[] | Keywords for upright orientation |
reversedKeywords | string[] | Keywords for reversed orientation |
description | string | Poetic description of card essence |
reversed | boolean | Current orientation (set during draw) |
Card data examples
Upright vs reversed meanings
Each card has two distinct interpretations based on its orientation:Understanding reversals
Understanding reversals
Upright cards represent the card’s primary energy in its most direct form.Reversed cards can indicate:
- Blocked or weakened energy
- The shadow side of the card
- Internalized or delayed manifestation
- Opposition to the upright meaning
- Upright: alegría, éxito, vitalidad, claridad
- Reversed: exceso de ego, tristeza temporal, optimismo forzado, bloqueo
Card drawing algorithm
ThedrawCards function handles card selection and orientation:
How it works
- Shuffle: Creates a copy of
allCardsand randomizes order usingMath.random() - 0.5 - Select: Takes the first
ncards from the shuffled deck - Orient: Each card has a 40% chance of being reversed (
Math.random() > 0.6)
The 40% reversal rate (60/40 split) provides a balanced mix of upright and reversed cards without overwhelming the reading with reversals.
Usage example
Three-card spread
Luz de Arcanos uses a classic three-card spread:| Position | Meaning | Purpose |
|---|---|---|
| Past | What brought you here | Foundation and influences |
| Present | What’s happening now | Current situation and energies |
| Future | What’s coming | Likely outcome if path continues |
Complete card data structure
The full deck is exported asallCards in src/data/cards.ts:
The
reversed property is omitted from the stored data and added dynamically during the draw to keep the data structure clean.Card images
Each card references an image file stored in the/public/cards/ directory:
Keyword system
Keywords provide quick energy indicators for both AI interpretation and user understanding:- Sent to the AI for context
- Used in fallback readings
- Displayed in the card interface