awacke1 commited on
Commit
7f4a36e
·
verified ·
1 Parent(s): b85ea82

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +315 -19
index.html CHANGED
@@ -1,19 +1,315 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Angel Tarot Card App</title>
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ font-family: Arial, sans-serif;
11
+ display: flex;
12
+ background: #222;
13
+ color: #fff;
14
+ }
15
+ #canvas-container {
16
+ flex: 1;
17
+ height: 100vh;
18
+ border-right: 2px solid #444;
19
+ }
20
+ #canvas {
21
+ display: block;
22
+ }
23
+ #sidebar {
24
+ width: 300px;
25
+ padding: 20px;
26
+ overflow-y: auto;
27
+ background: #333;
28
+ }
29
+ #sidebar h2 {
30
+ margin-top: 0;
31
+ color: #ffd700;
32
+ }
33
+ #svg-preview {
34
+ width: 100%;
35
+ height: 400px;
36
+ background: #fff;
37
+ border: 2px solid #ffd700;
38
+ margin-bottom: 10px;
39
+ }
40
+ #download-link {
41
+ display: block;
42
+ margin: 10px 0;
43
+ padding: 10px;
44
+ background: #ffd700;
45
+ color: #000;
46
+ text-align: center;
47
+ text-decoration: none;
48
+ border-radius: 5px;
49
+ }
50
+ #download-link:hover {
51
+ background: #ffeb3b;
52
+ }
53
+ #card-details {
54
+ font-size: 14px;
55
+ }
56
+ </style>
57
+ </head>
58
+ <body>
59
+ <div id="canvas-container">
60
+ <canvas id="canvas"></canvas>
61
+ </div>
62
+ <div id="sidebar">
63
+ <h2>Selected Card</h2>
64
+ <div id="svg-preview"></div>
65
+ <a id="download-link" href="#" download="card.svg">Download SVG</a>
66
+ <div id="card-details">Select a card to view details.</div>
67
+ </div>
68
+ <script>
69
+ // Tarot deck data with updated names
70
+ const majorArcanaNames = [
71
+ "The Dreamer", "The Magician", "The High Priestess", "The Empress", "The Emperor",
72
+ "The Hierophant", "The Lovers", "The Chariot", "Strength", "The Hermit",
73
+ "Wheel of Fortune", "Justice", "The Hanged Man", "Death", "Temperance",
74
+ "The Devil", "The Tower", "The Star", "The Moon", "The Sun",
75
+ "Judgement", "The World"
76
+ ];
77
+ const minorArcanaRanks = ["Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Page", "Knight", "Queen", "King"];
78
+ const cards = [
79
+ { name: "0 - The Dreamer", baseName: "Ariel", description: "Oversees nature, environmental balance", quotes: ["Guides wildlife harmony", "Protects earth’s balance", "Instinctive environmental wisdom"], type: "Major", suit: "", number: 0 },
80
+ { name: "1 - The Magician", baseName: "Gabriel", description: "Delivers divine messages", quotes: ["Delivers divine revelations", "Speaks truth clearly", "Inspired communicative clarity"], type: "Major", suit: "", number: 1 },
81
+ { name: "2 - The High Priestess", baseName: "Haniel", description: "Enhances intuition, feminine energy", quotes: ["Unveils hidden truths", "Honors intuitive guidance", "Radiant spiritual joy"], type: "Major", suit: "", number: 2 },
82
+ { name: "3 - The Empress", baseName: "Chamuel", description: "Fosters love, harmonious relationships", quotes: ["Builds peaceful bonds", "Promotes compassionate unity", "Loving relational grace"], type: "Major", suit: "", number: 3 },
83
+ { name: "4 - The Emperor", baseName: "Michael", description: "Protects against evil", quotes: ["Defeats cosmic evil", "Upholds divine justice", "Courageous protective strength"], type: "Major", suit: "", number: 4 },
84
+ { name: "5 - The Hierophant", baseName: "Metatron", description: "Records life events, ascension", quotes: ["Chronicles spiritual journeys", "Teaches sacred wisdom", "Divinely ordered insight"], type: "Major", suit: "", number: 5 },
85
+ { name: "6 - The Lovers", baseName: "Zadkiel", description: "Promotes forgiveness, spiritual growth", quotes: ["Heals relational rifts", "Advocates merciful love", "Forgiving spiritual grace"], type: "Major", suit: "", number: 6 },
86
+ { name: "7 - The Chariot", baseName: "Raphael", description: "Heals body, mind, spirit", quotes: ["Restores holistic health", "Guides healing paths", "Compassionate restorative power"], type: "Major", suit: "", number: 7 },
87
+ { name: "8 - Strength", baseName: "Uriel", description: "Illuminates wisdom, prophecy", quotes: ["Reveals prophetic light", "Guides with wisdom", "Resilient divine clarity"], type: "Major", suit: "", number: 8 },
88
+ { name: "9 - The Hermit", baseName: "Raziel", description: "Reveals divine mysteries", quotes: ["Unlocks esoteric mysteries", "Seeks divine knowledge", "Mystical insightful depth"], type: "Major", suit: "", number: 9 },
89
+ { name: "10 - Wheel of Fortune", baseName: "Sandalphon", description: "Carries prayers, nurtures music", quotes: ["Elevates human prayers", "Harmonizes cosmic rhythms", "Musical spiritual flow"], type: "Major", suit: "", number: 10 },
90
+ { name: "11 - Justice", baseName: "Raguel", description: "Ensures justice, fairness", quotes: ["Restores angelic harmony", "Upholds cosmic justice", "Equitable divine balance"], type: "Major", suit: "", number: 11 },
91
+ { name: "12 - The Hanged Man", baseName: "Jeremiel", description: "Assists life reviews, transformation", quotes: ["Guides soul reviews", "Encourages inner growth", "Transformative spiritual insight"], type: "Major", suit: "", number: 12 },
92
+ { name: "13 - Death", baseName: "Azrael", description: "Transitions souls, embraces change", quotes: ["Guides departing souls", "Embraces life’s cycles", "Gentle transitional peace"], type: "Major", suit: "", number: 13 },
93
+ { name: "14 - Temperance", baseName: "Jophiel", description: "Inspires creativity, divine wisdom", quotes: ["Inspires divine art", "Cultivates aesthetic harmony", "Creative spiritual balance"], type: "Major", suit: "", number: 14 },
94
+ { name: "15 - The Devil", baseName: "Temptation", description: "Challenges morality, tests resolve", quotes: ["Exposes inner shadows", "Confronts personal ethics", "Resilient moral strength"], type: "Major", suit: "", number: 15 },
95
+ { name: "16 - The Tower", baseName: "Disruption", description: "Breaks illusions, sparks awakening", quotes: ["Shatters false beliefs", "Demands honest reflection", "Courageous transformative clarity"], type: "Major", suit: "", number: 16 },
96
+ { name: "17 - The Star", baseName: "Hope", description: "Guides through darkness, inspires faith", quotes: ["Illuminates hopeful paths", "Fosters unwavering trust", "Radiant optimistic spirit"], type: "Major", suit: "", number: 17 },
97
+ { name: "18 - The Moon", baseName: "Intuition", description: "Reveals subconscious, guides dreams", quotes: ["Unveils hidden insights", "Trusts inner wisdom", "Mystical intuitive depth"], type: "Major", suit: "", number: 18 },
98
+ { name: "19 - The Sun", baseName: "Joy", description: "Radiates vitality, celebrates life", quotes: ["Spreads boundless light", "Embraces pure happiness", "Vibrant joyful energy"], type: "Major", suit: "", number: 19 },
99
+ { name: "20 - Judgement", baseName: "Awakening", description: "Calls for renewal, reckoning", quotes: ["Ignites spiritual rebirth", "Judges with fairness", "Redemptive divine clarity"], type: "Major", suit: "", number: 20 },
100
+ { name: "21 - The World", baseName: "Completion", description: "Unifies all, fulfills destiny", quotes: ["Completes cosmic cycles", "Honors universal unity", "Holistic divine harmony"], type: "Major", suit: "", number: 21 },
101
+ { name: "Ace of Fire", baseName: "Uriel", description: "Ignites wisdom, prophetic light", quotes: ["Reveals divine truth", "Guides with clarity", "Fiery spiritual insight"], type: "Minor", suit: "Fire", number: 1 },
102
+ { name: "Two of Fire", baseName: "Jophiel", description: "Sparks creative inspiration", quotes: ["Inspires artistic beauty", "Cultivates aesthetic truth", "Creative divine spark"], type: "Minor", suit: "Fire", number: 2 },
103
+ { name: "Three of Fire", baseName: "Sachiel", description: "Fuels wealth, charity", quotes: ["Attracts abundant prosperity", "Shares generous wealth", "Charitable fiery spirit"], type: "Minor", suit: "Fire", number: 3 },
104
+ { name: "Four of Fire", baseName: "Barachiel", description: "Ignites divine blessings", quotes: ["Distributes sacred gifts", "Spreads divine favor", "Blessed fiery grace"], type: "Minor", suit: "Fire", number: 4 },
105
+ { name: "Five of Fire", baseName: "Camael", description: "Burns with courage", quotes: ["Strengthens bold resolve", "Upholds fearless honor", "Courageous fiery spirit"], type: "Minor", suit: "Fire", number: 5 },
106
+ { name: "Six of Fire", baseName: "Lugh", description: "Radiates heroic light", quotes: ["Leads with skill", "Honors heroic duty", "Fiery heroic valor"], type: "Minor", suit: "Fire", number: 6 },
107
+ { name: "Seven of Fire", baseName: "Thor", description: "Strikes with power", quotes: ["Defends with might", "Protects with strength", "Powerful fiery resolve"], type: "Minor", suit: "Fire", number: 7 },
108
+ { name: "Eight of Fire", baseName: "Pele", description: "Erupts with volcanic force", quotes: ["Transforms through fire", "Respects nature’s power", "Fiery creative energy"], type: "Minor", suit: "Fire", number: 8 },
109
+ { name: "Nine of Fire", baseName: "Indra", description: "Commands thunderous energy", quotes: ["Wields cosmic storms", "Leads with authority", "Thunderous fiery might"], type: "Minor", suit: "Fire", number: 9 },
110
+ { name: "Ten of Fire", baseName: "Kū", description: "Fuels warlike passion", quotes: ["Drives fierce strength", "Honors warrior code", "Fiery martial spirit"], type: "Minor", suit: "Fire", number: 10 },
111
+ { name: "Page of Fire", baseName: "Valkyrie", description: "Explores fiery paths", quotes: ["Guides warrior souls", "Seeks bold truth", "Fiery adventurous spirit"], type: "Minor", suit: "Fire", number: 11 },
112
+ { name: "Knight of Fire", baseName: "Xian", description: "Pursues transformative quests", quotes: ["Seeks divine immortality", "Follows fiery path", "Questing fiery soul"], type: "Minor", suit: "Fire", number: 12 },
113
+ { name: "Queen of Fire", baseName: "Freyja", description: "Rules with passionate magic", quotes: ["Weaves love’s fire", "Guides with passion", "Fiery magical grace"], type: "Minor", suit: "Fire", number: 13 },
114
+ { name: "King of Fire", baseName: "Odin", description: "Masters fiery wisdom", quotes: ["Leads with insight", "Rules with honor", "Fiery divine wisdom"], type: "Minor", suit: "Fire", number: 14 },
115
+ { name: "Ace of Air", baseName: "Gabriel", description: "Initiates divine communication", quotes: ["Delivers sacred messages", "Speaks divine truth", "Clear airy wisdom"], type: "Minor", suit: "Air", number: 1 },
116
+ { name: "Two of Air", baseName: "Raguel", description: "Balances cosmic fairness", quotes: ["Restores angelic justice", "Ensures equitable truth", "Airy balanced clarity"], type: "Minor", suit: "Air", number: 2 },
117
+ { name: "Three of Air", baseName: "Anael", description: "Inspires intellectual love", quotes: ["Fosters loving thoughts", "Guides relational truth", "Airy romantic wisdom"], type: "Minor", suit: "Air", number: 3 },
118
+ { name: "Four of Air", baseName: "Tennin", description: "Carries celestial messages", quotes: ["Guides with grace", "Shares divine insights", "Airy celestial lightness"], type: "Minor", suit: "Air", number: 4 },
119
+ { name: "Five of Air", baseName: "Morrígan", description: "Foretells intellectual fate", quotes: ["Predicts strategic outcomes", "Honors fated truth", "Airy prophetic vision"], type: "Minor", suit: "Air", number: 5 },
120
+ { name: "Six of Air", baseName: "Yéil", description: "Tricks with cleverness", quotes: ["Weaves cunning plans", "Values sharp wit", "Airy trickster mind"], type: "Minor", suit: "Air", number: 6 },
121
+ { name: "Seven of Air", baseName: "Nanabozho", description: "Teaches through stories", quotes: ["Shares wise tales", "Teaches through wit", "Airy narrative wisdom"], type: "Minor", suit: "Air", number: 7 },
122
+ { name: "Eight of Air", baseName: "Susanoo", description: "Stirs intellectual storms", quotes: ["Drives dynamic thoughts", "Challenges with truth", "Airy stormy intellect"], type: "Minor", suit: "Air", number: 8 },
123
+ { name: "Nine of Air", baseName: "Devas", description: "Enlightens with divine ideas", quotes: ["Illuminates cosmic truths", "Guides with clarity", "Airy divine insight"], type: "Minor", suit: "Air", number: 9 },
124
+ { name: "Ten of Air", baseName: "Raqib", description: "Records intellectual deeds", quotes: ["Chronicles good thoughts", "Values honest records", "Airy truthful scribe"], type: "Minor", suit: "Air", number: 10 },
125
+ { name: "Page of Air", baseName: "Álfar", description: "Explores airy realms", quotes: ["Seeks ethereal truths", "Honors airy freedom", "Airy curious spirit"], type: "Minor", suit: "Air", number: 11 },
126
+ { name: "Knight of Air", baseName: "Atid", description: "Pursues truthful records", quotes: ["Tracks honest deeds", "Upholds truthful justice", "Airy diligent scribe"], type: "Minor", suit: "Air", number: 12 },
127
+ { name: "Queen of Air", baseName: "Amaterasu", description: "Illuminates with clarity", quotes: ["Shines divine light", "Guides with truth", "Airy radiant wisdom"], type: "Minor", suit: "Air", number: 13 },
128
+ { name: "King of Air", baseName: "Gitchi Manitou", description: "Masters airy spirit", quotes: ["Guides cosmic intellect", "Rules with wisdom", "Airy divine clarity"], type: "Minor", suit: "Air", number: 14 },
129
+ { name: "Ace of Water", baseName: "Raphael", description: "Initiates emotional healing", quotes: ["Heals heart’s wounds", "Guides compassionate paths", "Watery healing grace"], type: "Minor", suit: "Water", number: 1 },
130
+ { name: "Two of Water", baseName: "Chamuel", description: "Deepens loving connections", quotes: ["Fosters heartfelt bonds", "Promotes loving unity", "Watery compassionate love"], type: "Minor", suit: "Water", number: 2 },
131
+ { name: "Three of Water", baseName: "Zadkiel", description: "Flows with forgiveness", quotes: ["Heals through mercy", "Advocates forgiving love", "Watery merciful grace"], type: "Minor", suit: "Water", number: 3 },
132
+ { name: "Four of Water", baseName: "Haniel", description: "Stirs intuitive depths", quotes: ["Reveals inner truths", "Honors intuitive flow", "Watery spiritual joy"], type: "Minor", suit: "Water", number: 4 },
133
+ { name: "Five of Water", baseName: "Apsaras", description: "Dances with emotional grace", quotes: ["Guides soul’s dance", "Embraces emotional beauty", "Watery graceful spirit"], type: "Minor", suit: "Water", number: 5 },
134
+ { name: "Six of Water", baseName: "Brigid", description: "Nurtures emotional healing", quotes: ["Heals with poetry", "Fosters emotional peace", "Watery poetic grace"], type: "Minor", suit: "Water", number: 6 },
135
+ { name: "Seven of Water", baseName: "Lono", description: "Soothes with peace", quotes: ["Brings tranquil harmony", "Cultivates peaceful flow", "Watery serene spirit"], type: "Minor", suit: "Water", number: 7 },
136
+ { name: "Eight of Water", baseName: "Orca Spirit", description: "Guides emotional depths", quotes: ["Navigates soul’s waters", "Protects emotional truth", "Watery guardian spirit"], type: "Minor", suit: "Water", number: 8 },
137
+ { name: "Nine of Water", baseName: "Nafanua", description: "Empowers emotional strength", quotes: ["Inspires warrior heart", "Honors emotional courage", "Watery fierce spirit"], type: "Minor", suit: "Water", number: 9 },
138
+ { name: "Ten of Water", baseName: "Lailah", description: "Guards emotional dreams", quotes: ["Protects nightly visions", "Nurtures soul’s dreams", "Watery dreamy grace"], type: "Minor", suit: "Water", number: 10 },
139
+ { name: "Page of Water", baseName: "Aos Sí", description: "Explores emotional realms", quotes: ["Guides heart’s paths", "Honors emotional truth", "Watery mystical spirit"], type: "Minor", suit: "Water", number: 11 },
140
+ { name: "Knight of Water", baseName: "Gandharvas", description: "Pursues emotional harmony", quotes: ["Sings soul’s music", "Shares emotional beauty", "Watery melodic grace"], type: "Minor", suit: "Water", number: 12 },
141
+ { name: "Queen of Water", baseName: "Ngen", description: "Rules emotional nature", quotes: ["Protects watery realms", "Guides with care", "Watery nurturing spirit"], type: "Minor", suit: "Water", number: 13 },
142
+ { name: "King of Water", baseName: "Vishnu", description: "Masters emotional preservation", quotes: ["Preserves cosmic balance", "Protects with love", "Watery divine grace"], type: "Minor", suit: "Water", number: 14 },
143
+ { name: "Ace of Earth", baseName: "Ariel", description: "Grounds with nature’s balance", quotes: ["Protects earth’s harmony", "Honors natural balance", "Earthy environmental wisdom"], type: "Minor", suit: "Earth", number: 1 },
144
+ { name: "Two of Earth", baseName: "Sandalphon", description: "Anchors prayers to earth", quotes: ["Carries grounded prayers", "Harmonizes earthly rhythms", "Earthy musical spirit"], type: "Minor", suit: "Earth", number: 2 },
145
+ { name: "Three of Earth", baseName: "Cassiel", description: "Stabilizes with discipline", quotes: ["Guides steady resolve", "Upholds patient duty", "Earthy disciplined strength"], type: "Minor", suit: "Earth", number: 3 },
146
+ { name: "Four of Earth", baseName: "Tzadkiel", description: "Roots in righteousness", quotes: ["Upholds divine justice", "Honors righteous path", "Earthy moral strength"], type: "Minor", suit: "Earth", number: 4 },
147
+ { name: "Five of Earth", baseName: "Kāne", description: "Creates earthly life", quotes: ["Fosters life’s growth", "Nurtures earthly creation", "Earthy generative spirit"], type: "Minor", suit: "Earth", number: 5 },
148
+ { name: "Six of Earth", baseName: "Viracocha", description: "Builds cosmic foundations", quotes: ["Shapes earthly order", "Honors cosmic stability", "Earthy divine structure"], type: "Minor", suit: "Earth", number: 6 },
149
+ { name: "Seven of Earth", baseName: "Inti", description: "Radiates earthly vitality", quotes: ["Illuminates earthly life", "Honors solar truth", "Earthy radiant spirit"], type: "Minor", suit: "Earth", number: 7 },
150
+ { name: "Eight of Earth", baseName: "Kakunupmawa", description: "Anchors solar stability", quotes: ["Guides earthly cycles", "Honors solar balance", "Earthy solar wisdom"], type: "Minor", suit: "Earth", number: 8 },
151
+ { name: "Nine of Earth", baseName: "Breath Maker", description: "Grounds spiritual essence", quotes: ["Breathes life’s spirit", "Nurtures earthly soul", "Earthy vital spirit"], type: "Minor", suit: "Earth", number: 9 },
152
+ { name: "Ten of Earth", baseName: "Shen", description: "Protects earthly realms", quotes: ["Guards natural order", "Honors earthly harmony", "Earthy protective spirit"], type: "Minor", suit: "Earth", number: 10 },
153
+ { name: "Page of Earth", baseName: "Disir", description: "Explores earthly paths", quotes: ["Guides ancestral ways", "Honors earthy roots", "Earthy ancestral wisdom"], type: "Minor", suit: "Earth", number: 11 },
154
+ { name: "Knight of Earth", baseName: "Coyote", description: "Pursues earthly cunning", quotes: ["Navigates earthy tricks", "Values clever survival", "Earthy cunning spirit"], type: "Minor", suit: "Earth", number: 12 },
155
+ { name: "Queen of Earth", baseName: "Corn Mother", description: "Nurtures earthly sustenance", quotes: ["Provides life’s bounty", "Nurtures earthy growth", "Earthy fertile grace"], type: "Minor", suit: "Earth", number: 13 },
156
+ { name: "King of Earth", baseName: "Tagaloa", description: "Masters earthly creation", quotes: ["Shapes cosmic earth", "Rules with stability", "Earthy divine order"], type: "Minor", suit: "Earth", number: 14 }
157
+ ];
158
+
159
+ // Canvas setup
160
+ const canvas = document.getElementById('canvas');
161
+ const ctx = canvas.getContext('2d');
162
+ const container = document.getElementById('canvas-container');
163
+ canvas.width = container.clientWidth;
164
+ canvas.height = container.clientHeight;
165
+
166
+ // Scroll variables
167
+ let scrollY = 0;
168
+ const cardHeight = 120;
169
+ const cardWidth = canvas.width - 20;
170
+ const cardSpacing = 10;
171
+ let selectedCard = null;
172
+
173
+ // Generate SVG for a card
174
+ function generateSVG(card) {
175
+ const bgColor = card.type === "Major" ? "#FFD700" : (card.suit === "Fire" ? "#FF4500" : card.suit === "Air" ? "#87CEEB" : card.suit === "Water" ? "#1E90FF" : "#228B22");
176
+ const name = card.name.replace(/"/g, '"'); // Escape quotes
177
+ const halfCircle = card.type === "Major" ? `
178
+ <path d="M50 30 A50 50 0 0 1 150 30 L150 0 L50 0 Z" fill="#000" stroke="#FFF" stroke-width="1"/>
179
+ <text x="100" y="25" font-family="Arial" font-size="14" font-weight="bold" text-anchor="middle" fill="#FFF">${card.number}</text>
180
+ ` : '';
181
+ return `
182
+ <svg width="200" height="300" xmlns="http://www.w3.org/2000/svg">
183
+ <rect x="0" y="0" width="200" height="300" fill="${bgColor}" stroke="#000" stroke-width="2"/>
184
+ <rect x="10" y="30" width="180" height="260" fill="#FFF" stroke="#000" stroke-width="1"/>
185
+ ${halfCircle}
186
+ <text x="100" y="60" font-family="Arial" font-size="16" font-weight="bold" text-anchor="middle">${name}</text>
187
+ <text x="100" y="90" font-family="Arial" font-size="12" text-anchor="middle">${card.description}</text>
188
+ <text x="100" y="130" font-family="Arial" font-size="10" text-anchor="middle">Merits: ${card.quotes[0]}</text>
189
+ <text x="100" y="150" font-family="Arial" font-size="10" text-anchor="middle">Morals: ${card.quotes[1]}</text>
190
+ <text x="100" y="170" font-family="Arial" font-size="10" text-anchor="middle">Virtues: ${card.quotes[2]}</text>
191
+ ${card.suit ? `<text x="100" y="200" font-family="Arial" font-size="12" text-anchor="middle">Suit: ${card.suit}</text>` : ''}
192
+ </svg>`;
193
+ }
194
+
195
+ // Update sidebar with selected card
196
+ function updateSidebar(card) {
197
+ if (!card) {
198
+ document.getElementById('svg-preview').innerHTML = '';
199
+ document.getElementById('download-link').style.display = 'none';
200
+ document.getElementById('card-details').textContent = 'Select a card to view details.';
201
+ return;
202
+ }
203
+ const svg = generateSVG(card);
204
+ document.getElementById('svg-preview').innerHTML = svg;
205
+ const blob = new Blob([svg], { type: 'image/svg+xml' });
206
+ const url = URL.createObjectURL(blob);
207
+ const downloadLink = document.getElementById('download-link');
208
+ downloadLink.href = url;
209
+ downloadLink.download = `${card.name.replace(/\s+/g, '_')}.svg`;
210
+ downloadLink.style.display = 'block';
211
+ document.getElementById('card-details').innerHTML = `
212
+ <strong>Name:</strong> ${card.name}<br>
213
+ <strong>Base Name:</strong> ${card.baseName}<br>
214
+ <strong>Description:</strong> ${card.description}<br>
215
+ <strong>Merits:</strong> ${card.quotes[0]}<br>
216
+ <strong>Morals:</strong> ${card.quotes[1]}<br>
217
+ <strong>Virtues:</strong> ${card.quotes[2]}<br>
218
+ ${card.suit ? `<strong>Suit:</strong> ${card.suit}` : ''}
219
+ `;
220
+ }
221
+
222
+ // Draw cards on canvas
223
+ function drawCards() {
224
+ ctx.fillStyle = '#222';
225
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
226
+
227
+ cards.forEach((card, index) => {
228
+ const y = index * (cardHeight + cardSpacing) - scrollY;
229
+ if (y + cardHeight < 0 || y > canvas.height) return; // Skip off-screen cards
230
+
231
+ // Draw card background
232
+ ctx.fillStyle = card.type === "Major" ? '#FFD700' : (card.suit === "Fire" ? '#FF4500' : card.suit === "Air" ? '#87CEEB' : card.suit === "Water" ? '#1E90FF' : '#228B22');
233
+ ctx.fillRect(10, y, cardWidth, cardHeight);
234
+ ctx.strokeStyle = '#000';
235
+ ctx.strokeRect(10, y, cardWidth, cardHeight);
236
+
237
+ // Draw half-circle for Major Arcana
238
+ if (card.type === "Major") {
239
+ ctx.beginPath();
240
+ ctx.arc(canvas.width / 2, y + 15, 20, Math.PI, 0); // Half-circle
241
+ ctx.lineTo(canvas.width / 2 + 20, y);
242
+ ctx.lineTo(canvas.width / 2 - 20, y);
243
+ ctx.closePath();
244
+ ctx.fillStyle = '#000';
245
+ ctx.fill();
246
+ ctx.strokeStyle = '#FFF';
247
+ ctx.stroke();
248
+ ctx.fillStyle = '#FFF';
249
+ ctx.font = '12px Arial';
250
+ ctx.textAlign = 'center';
251
+ ctx.fillText(card.number, canvas.width / 2, y + 20);
252
+ }
253
+
254
+ // Draw card text
255
+ ctx.fillStyle = '#000';
256
+ ctx.font = 'bold 16px Arial';
257
+ ctx.textAlign = 'left';
258
+ ctx.fillText(card.name, 20, y + 40);
259
+ ctx.font = '12px Arial';
260
+ ctx.fillText(card.description, 20, y + 60);
261
+ ctx.fillText(`Merits: ${card.quotes[0]}`, 20, y + 80);
262
+ ctx.fillText(`Morals: ${card.quotes[1]}`, 20, y + 100);
263
+ if (card.suit) {
264
+ ctx.fillText(`Suit: ${card.suit}`, 20, y + 120);
265
+ }
266
+ });
267
+ }
268
+
269
+ // Scroll handling
270
+ let isDragging = false;
271
+ let startY = 0;
272
+ canvas.addEventListener('mousedown', (e) => {
273
+ isDragging = true;
274
+ startY = e.clientY;
275
+ });
276
+ canvas.addEventListener('mousemove', (e) => {
277
+ if (isDragging) {
278
+ const deltaY = startY - e.clientY;
279
+ scrollY = Math.max(0, Math.min(scrollY + deltaY, cards.length * (cardHeight + cardSpacing) - canvas.height));
280
+ startY = e.clientY;
281
+ drawCards();
282
+ }
283
+ });
284
+ canvas.addEventListener('mouseup', () => {
285
+ isDragging = false;
286
+ });
287
+ canvas.addEventListener('wheel', (e) => {
288
+ scrollY = Math.max(0, Math.min(scrollY + e.deltaY, cards.length * (cardHeight + cardSpacing) - canvas.height));
289
+ drawCards();
290
+ });
291
+
292
+ // Click to select card
293
+ canvas.addEventListener('click', (e) => {
294
+ const rect = canvas.getBoundingClientRect();
295
+ const y = e.clientY - rect.top + scrollY;
296
+ const index = Math.floor(y / (cardHeight + cardSpacing));
297
+ if (index >= 0 && index < cards.length) {
298
+ selectedCard = cards[index];
299
+ updateSidebar(selectedCard);
300
+ }
301
+ });
302
+
303
+ // Initial draw
304
+ drawCards();
305
+ updateSidebar(null);
306
+
307
+ // Handle window resize
308
+ window.addEventListener('resize', () => {
309
+ canvas.width = container.clientWidth;
310
+ canvas.height = container.clientHeight;
311
+ drawCards();
312
+ });
313
+ </script>
314
+ </body>
315
+ </html>