"use client"; /** * The tarot cards, drawn as SVG in the "celestial astrolabe" style of the * Sorsfonalak chart wheel (from the tarot design studio): every major arcana * has its own symbol, the minor arcana show their suit and rank. */ import { useId } from "react"; import type { MinorRank, TarotCardData, TarotElement, TarotSuit } from "@/lib/tarot"; const GOLD = "#DFC180"; const BRIGHT = "#F2DDA8"; /** The line weight of the drawings. */ const SW = 1.18; const ELEMENT_COLOR: Record = { Levegő: '#6C95C9', Víz: '#75A1D0', Tűz: '#D89A68', Föld: '#C9AD72', Éter: '#DFC180', }; function getSuitAccent(suit: TarotSuit, secondaryDefault: string): string { switch (suit) { case 'wands': return '#D89A68'; case 'cups': return '#6C95C9'; case 'swords': return '#9BB7DB'; case 'pentacles': return '#C8B078'; default: return secondaryDefault; } } /** Crisp reusable suit emblem centered at (0,0), nominal radius ~14 */ function SuitEmblem({ suit, gold, secondary, sw, scale = 1, }: { suit: Exclude; gold: string; secondary: string; sw: number; scale?: number; }) { return ( {suit === 'wands' && ( )} {suit === 'cups' && ( )} {suit === 'swords' && ( )} {suit === 'pentacles' && ( )} ); } /** Pip coordinates in local central box (-60..60 x, -105..105 y) */ const PIP_LAYOUTS: Record> = { 2: [ [0, -48], [0, 48], ], 3: [ [0, -56], [-34, 34], [34, 34], ], 4: [ [-34, -44], [34, -44], [-34, 44], [34, 44], ], 5: [ [-36, -50], [36, -50], [0, 0], [-36, 50], [36, 50], ], 6: [ [-36, -56], [36, -56], [-36, 0], [36, 0], [-36, 56], [36, 56], ], 7: [ [-36, -62], [36, -62], [0, -24], [-36, 16], [36, 16], [-36, 66], [36, 66], ], 8: [ [-36, -68], [36, -68], [-36, -22], [36, -22], [-36, 22], [36, 22], [-36, 68], [36, 68], ], 9: [ [-38, -70], [38, -70], [-38, -24], [38, -24], [0, 0], [-38, 24], [38, 24], [-38, 70], [38, 70], ], 10: [ [-38, -74], [38, -74], [0, -44], [-38, -14], [38, -14], [-38, 28], [38, 28], [0, 56], [-38, 78], [38, 78], ], }; function renderMinorComposition( suit: Exclude, rank: MinorRank, gold: string, bright: string, secondary: string, sw: number, ) { // Ace (Ász) if (rank === 1) { return ( {/* Radiant astrological rays */} {[0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330].map((deg) => { const r1 = deg % 90 === 0 ? 52 : 56; const r2 = deg % 90 === 0 ? 74 : 67; const rad = (deg * Math.PI) / 180; return ( ); })} {/* Celestial cloud/crown arc below */} ); } // Court cards: Page / Knight / Queen / King if (rank === 'page' || rank === 'knight' || rank === 'queen' || rank === 'king') { return ( {/* Sanctuary arch or heraldic diamond */} {/* Rank-specific crown / heraldry */} {rank === 'page' && ( {/* Messenger feather & twin stars */} )} {rank === 'knight' && ( {/* Winged crest & chevron */} )} {rank === 'queen' && ( {/* Lunar floral diadem */} )} {rank === 'king' && ( {/* Solar 5-point crown */} )} {/* Central figure medallion */} {/* Supporting base pillar lines */} ); } // Numbered pips (2..10) connected with sorsfonalak aspect geometry const coords = PIP_LAYOUTS[rank] || []; return ( {/* Subtle geometric aspect thread connecting pips */} {coords.length >= 2 && ( `${x},${y}`).join(' ')} fill={secondary} fillOpacity="0.04" stroke={secondary} strokeWidth={sw * 0.7} strokeOpacity="0.45" /> )} {coords.length >= 4 && ( )} {coords.map(([x, y], idx) => ( = 8 ? 0.72 : coords.length >= 5 ? 0.82 : 0.95} /> ))} ); } /** Bespoke illustrations for all 22 Major Arcana (0..21) centered in (120, 198) */ function renderMajorSymbol( number: number, gold: string, bright: string, secondary: string, sw: number, ) { switch (number) { case 0: // A Bolond return ( {/* Rising sun in top right */} {[0, 45, 90, 135, 180, 225, 270, 315].map((a) => { const rad = (a * Math.PI) / 180; return ( ); })} {/* Cliff edge */} {/* Poised traveler silhouette + staff + white rose */} {/* White rose / eight-petal star in hand */} {/* Horizon waves */} ); case 1: // A Mágus return ( {/* Lemniscate infinity halo */} {/* Central pillar / "As above, so below" axis */} {/* Altar table & 4 suit tools */} {/* Wand, Cup, Sword, Pentacle markers */} ); case 2: // A FŐPAPNŐ — The Signature Card! return ( {/* Twin Pillars B (dark shadow) and J (luminous gold) */} {/* Left Pillar B */} B {/* Right Pillar J */} J {/* Veil of Pomegranates suspended between pillars */} {/* Pomegranate sacred triangle nodes */} {[ [-32, -44], [32, -44], [-24, -18], [24, -18], [-30, 12], [30, 12], ].map(([px, py], i) => ( ))} {/* Triple-Moon Isis Crown */} {/* Priestess veiled silhouette & solar cross */} {/* Equal-arm cross on chest */} {/* TORA Scroll */} TORA {/* Crescent Moon at her feet */} {/* Subtle water ripples */} ); case 3: // Az Uralkodónő return ( {/* 12-star zodiac crown arc */} {Array.from({ length: 7 }).map((_, i) => { const angle = (-150 + i * 20) * (Math.PI / 180); const sx = Math.cos(angle) * 52; const sy = -16 + Math.sin(angle) * 52; return ; })} {/* Crescent arch & Venusian heart-shield */} {/* Wheat / botanical fronds */} ); case 4: // Az Uralkodó return ( {/* Architectural stone throne */} {/* Aries ram horns emblem */} {/* Ankh scepter & solar orb */} ); case 5: // A Főpap return ( {/* Twin sanctuary columns */} {/* Triple Papal Cross */} {/* Crossed Keys of Heaven & Earth */} ); case 6: // A Szeretők return ( {/* Solar angel radiance at top */} {/* Two interlocking Vesica Piscis circles */} {/* Central flame / union spark */} {/* Mountain peak below */} ); case 7: // A Diadalszekér return ( {/* Starry canopy */} {/* Chariot shield with winged solar disk */} {/* Wheels & opposed crescents */} ); case 8: // Az Erő return ( {/* Lemniscate above */} {/* Solar Lion Mane Geometry */} {/* Gentle floral garland ring */} {[0, 45, 90, 135, 180, 225, 270, 315].map((a) => { const rad = (a * Math.PI) / 180; return ; })} {/* Leo glyph core */} ); case 9: // A Remete return ( {/* Mountain ridge */} {/* Star-lantern raised high */} {/* Hooded sage silhouette & staff */} ); case 10: // A Szerencsekerék return ( {/* Corner cherubic arcs */} {/* 8-spoked Wheel of Fate */} {[0, 45, 90, 135, 180, 225, 270, 315].map((a) => { const rad = (a * Math.PI) / 180; return ( ); })} {/* T A R O cardinal letters */} T A R O ); case 11: // Az Igazságosság return ( {/* Twin pillars */} {/* Upright Sword */} {/* Balanced Scales */} ); case 12: // Az Akasztott Ember return ( {/* Living Tau Cross */} {/* Suspended inverted silhouette */} {/* Radiant Halo around inverted head */} ); case 13: // A Halál return ( {/* Eclipse rising sun between twin horizon towers */} {/* Mystic 5-petal white rose banner */} {[0, 72, 144, 216, 288].map((a) => { const rad = (a * Math.PI) / 180; return ; })} {/* Crescent scythe arc below */} ); case 14: // A Mértékletesség return ( {/* Angel wing arcs */} {/* Two diagonal chalices */} {/* Flowing alchemical water wave */} {/* Solar triangle inside square on chest */} {/* Pool at base */} ); case 15: // Az Ördög return ( {/* Inverted Pentagram */} {/* Horned crescent */} {/* Torch & loose chains */} ); case 16: // A Torony return ( {/* Stone Tower */} {/* Tilted falling Crown */} {/* Golden Lightning Bolt */} {/* Falling sparks */} ); case 17: // A Csillag return ( {/* Main 8-pointed Star of Aquarius */} {/* 7 surrounding Pleiades stars */} {[ [-46, -54], [46, -54], [-54, -14], [54, -14], [-36, 12], [36, 12], [0, -72], ].map(([sx, sy], i) => ( ))} {/* Dual flowing streams into pool */} ); case 18: // A Hold return ( {/* Full moon enclosing crescent profile */} {/* Twin sentinel towers */} {/* Winding path from dark water */} ); case 19: // A Nap return ( {/* Radiant 16-ray Sun */} {Array.from({ length: 16 }).map((_, i) => { const rad = ((i * 22.5) * Math.PI) / 180; const outer = i % 2 === 0 ? 58 : 44; return ( ); })} {/* Stone wall & blooming sunflowers */} {[-32, 0, 32].map((fx, idx) => ( ))} ); case 20: // A Végítélet return ( {/* Trumpet & cross banner from above */} {/* Golden awakening sound rays */} {[-34, -18, 0, 18, 34].map((x, idx) => ( ))} {/* Rising silhouette from sea horizon */} ); case 21: // A Világ default: return ( {/* Four fixed-sign corner stars */} {/* Oval Laurel Wreath */} {/* Top & Bottom infinity ribbons */} {/* Central cosmic dancer / axis */} ); } } /** The face of a card (upside down when reversed: only the picture turns). */ export function TarotCard({ card, reversed = false, className }: { card: TarotCardData; reversed?: boolean; className?: string }) { const glow = useId(); const sw = SW; const secondary = getSuitAccent(card.suit, ELEMENT_COLOR[card.element]); const gold = GOLD; const bright = BRIGHT; const canvasBg = '#0B101D'; return ( {/* Card Substrate */} {/* Outer Hairline Frame */} {/* Inner astrolabe framing */} {( {( {/* Degree ticks around orbital ring */} {Array.from({ length: 36 }).map((_, idx) => { const deg = idx * 10; const rad = (deg * Math.PI) / 180; const inner = deg % 30 === 0 ? 82 : 85; return ( ); })} {/* Subtle cardinal crosshairs */} )} )} {/* Top Cartouche: Numeral + Astrological Glyph */} {( {card.roman ?? card.number} )} {( {card.astroGlyph} )} {/* Main Illustration Layer (flipped 180deg if reversed) */} {card.suit === 'major' ? renderMajorSymbol(card.number, gold, bright, secondary, sw) : renderMinorComposition(card.suit, card.rank!, gold, bright, secondary, sw)} {/* Bottom Cartouche: Title & Element Metadata */} {card.nameHu} {`${card.element.toUpperCase()} · ${card.astroRuler.toUpperCase()}`} ); } /** Symmetrical Card Back echoing the exact sorsfonalak natal chart wheel */ export function TarotCardBack({ className }: { className?: string }) { const gold = GOLD; const bright = BRIGHT; const sw = SW; return ( {/* Top & bottom symmetrical crescents */} {/* Central Sorsfonalak Natal-Wheel Geometry */} {/* 12 Astrological House Spokes */} {Array.from({ length: 12 }).map((_, i) => { const rad = (i * 30 * Math.PI) / 180; return ( ); })} {/* Aspect lines inside inner wheel: blue trigon + copper square */} {/* Central 8-point Polaris Star */} {/* Subtle brand monogram at top & bottom */} SORSFONALAK SORSFONALAK ); }