Saints-Tarot / index.html
awacke1's picture
Update index.html
96b914a verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Saints Tarot Reading</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap" rel="stylesheet">
<style>
/* --- Basic Setup & Theming --- */
:root {
--bg-color: #1a1a2e;
--card-bg: #f4f4f9;
--card-border: #e0e0e0;
--primary-text: #ffffff;
--secondary-text: #333333;
--accent-color: #ffd700;
--shadow-color: rgba(0, 0, 0, 0.2);
--card-back-bg: linear-gradient(145deg, #4d4d7a, #333355);
}
body {
font-family: 'Lora', serif;
background-color: var(--bg-color);
color: var(--primary-text);
margin: 0;
padding: 2rem;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
text-align: center;
}
h1 {
font-family: 'Merriweather', serif;
font-weight: 700;
color: var(--accent-color);
text-shadow: 2px 2px 4px var(--shadow-color);
margin-bottom: 1rem;
}
p#instructions {
max-width: 600px;
margin-bottom: 2rem;
font-style: italic;
opacity: 0.9;
}
/* --- Main Layout --- */
#table {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
width: 100%;
}
#controls {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
}
button {
font-family: 'Merriweather', serif;
padding: 0.8rem 1.5rem;
font-size: 1rem;
border: 2px solid var(--accent-color);
background-color: transparent;
color: var(--accent-color);
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(255, 215, 0, 0.1);
}
button:hover, button:focus {
background-color: var(--accent-color);
color: var(--bg-color);
box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
transform: translateY(-2px);
}
/* --- Card Slots and Reading Area --- */
#card-slots {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 1.5rem;
perspective: 1200px;
width: 100%;
min-height: 450px; /* Ensure space for cards */
}
.card-slot {
width: 300px;
height: 450px;
position: relative;
}
.card-slot .placeholder {
width: 100%;
height: 100%;
border: 2px dashed rgba(255, 255, 255, 0.2);
border-radius: 15px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-style: italic;
opacity: 0.7;
}
.placeholder span {
font-size: 1.2rem;
font-weight: bold;
}
/* --- Card Styling & Flip Animation --- */
.card {
width: 100%;
height: 100%;
position: absolute;
transform-style: preserve-3d;
transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
cursor: pointer;
}
.card.is-flipped {
transform: rotateY(180deg);
}
.card-face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 15px;
box-shadow: 0 10px 25px var(--shadow-color);
overflow: hidden;
display: flex;
flex-direction: column;
}
.card-back {
background: var(--card-back-bg);
border: 5px solid #fff;
display: flex;
justify-content: center;
align-items: center;
}
.card-back-design {
width: 80%;
height: 90%;
border: 2px solid var(--accent-color);
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
font-size: 4rem;
color: var(--accent-color);
opacity: 0.8;
}
.card-front {
background-color: var(--card-bg);
color: var(--secondary-text);
transform: rotateY(180deg);
padding: 1rem;
text-align: left;
overflow-y: auto;
}
/* --- Card Content Styling --- */
.card-header {
text-align: center;
border-bottom: 2px solid var(--card-border);
padding-bottom: 0.5rem;
margin-bottom: 1rem;
}
.card-header h2 {
margin: 0;
font-family: 'Merriweather', serif;
font-size: 1.2rem;
color: #444;
}
.card-header .tarot-title {
font-style: italic;
font-size: 1rem;
color: #666;
margin-top: 0.25rem;
}
.card-body {
font-size: 0.9rem;
line-height: 1.5;
}
.card-body p {
margin: 0 0 0.75rem 0;
}
.card-body strong {
color: #1a1a2e;
}
.story {
font-style: italic;
background-color: rgba(230, 230, 240, 0.5);
padding: 0.5rem;
border-radius: 8px;
border-left: 3px solid var(--accent-color);
}
</style>
</head>
<body>
<h1>Saints Tarot Reading</h1>
<p id="instructions">A three-card spread for Past, Present, and Future. Click the button to draw your cards, then click each card to reveal its meaning.</p>
<div id="controls">
<button id="draw-button">Draw Cards</button>
<button id="reset-button">Reset</button>
</div>
<div id="table">
<div id="card-slots">
<!-- Card slots will be populated by JavaScript -->
</div>
</div>
<script>
// --- Data: Saints Information ---
const saints_data = [
{"id":1,"name":"Adalbert of Prague","card":"Five of Wands","classifier":"Wands - Fire - Creativity","emojis":"🛶, 🙏","continent":"Europe","story":"A Bishop of Prague who struggled with conflict and resistance while trying to reform his diocese. He was ultimately martyred trying to bring his faith to a hostile land, embodying a narrative of struggle and striving for a higher cause against opposition.","virtues":"Missionary Zeal, Perseverance, Courage, Faith","gender":"Male","location":"Prague, Bohemia (Czech Rep.)","canon":"Vita Sancti Adalberti (Life of St. Adalbert)"},
{"id":2,"name":"Agnes of Rome","card":"The Star (XVII)","classifier":"Major Arcana","emojis":"🐑, ✨","continent":"Europe","story":"A young girl who became a beacon of pure faith and hope in a time of dark persecution. Her story, filled with miracles protecting her, represents divine inspiration and serenity in the face of mortal danger, much like the Star's gentle light.","virtues":"Purity, Courage, Faithfulness, Steadfastness","gender":"Female","location":"Rome, Italy","canon":"The Golden Legend, Pope Damasus I's inscriptions"},
{"id":3,"name":"Ambrose of Milan","card":"The Hierophant (V)","classifier":"Major Arcana","emojis":"🏛️, 🐝","continent":"Europe","story":"A governor who became a bishop, a master of tradition, and a teacher of orthodox doctrine. He was a pillar of the Church, mentoring St. Augustine and establishing the authority of spiritual institutions over temporal power, embodying the Hierophant's role as a conduit of sacred knowledge.","virtues":"Leadership, Justice, Wisdom, Fortitude","gender":"Male","location":"Milan, Italy","canon":"On the Duties of the Clergy, Life of Ambrose by Paulinus the Deacon"},
{"id":4,"name":"Andrew of Crete","card":"Eight of Cups","classifier":"Cups - Water - Emotional","emojis":"🎼, 🙏","continent":"Asia","story":"A bishop and hymnographer most famous for his Great Canon, a masterpiece of penitential reflection. This work represents a deep spiritual journey inward, a turning away from worldly attachment to seek a more profound, emotional connection with God.","virtues":"Penance, Liturgy, Eloquence, Poetry","gender":"Male","location":"Crete, Greece","canon":"The Great Canon of St. Andrew of Crete"},
{"id":5,"name":"Anselm of Canterbury","card":"King of Swords","classifier":"Swords - Air - Reason","emojis":"🧠, ⚖️","continent":"Europe","story":"A brilliant theologian and philosopher who became Archbishop of Canterbury. His use of logic (the ontological argument) and his defense of the Church's intellectual and legal rights against kings mark him as a master of reason, law, and intellectual authority.","virtues":"Intellect, Faith, Reason, Fortitude","gender":"Male","location":"Canterbury, England","canon":"Proslogion, Cur Deus Homo, Monologion"},
{"id":6,"name":"Anthony of Egypt","card":"The Hermit (IX)","classifier":"Major Arcana","emojis":"🏜️, 🏮","continent":"Africa","story":"The quintessential hermit who withdrew from society into the desert to seek spiritual truth. He battled his inner demons and found profound wisdom in solitude, lighting the way for countless others who followed his path of introspection.","virtues":"Asceticism, Perseverance, Spiritual Warfare, Solitude","gender":"Male","location":"Egyptian Desert","canon":"Life of Antony by Athanasius of Alexandria"},
{"id":7,"name":"Anthony of Padua","card":"Ace of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🥖, 📖","continent":"Europe","story":"A beloved saint associated with tangible results: finding lost items, providing bread for the poor. The Ace of Pentacles represents a seed of opportunity and prosperity in the material world, mirroring his ability to manifest grace in practical, earthly ways.","virtues":"Eloquence, Charity, Knowledge, Humility","gender":"Male","location":"Padua, Italy","canon":"Legenda Assidua (The First Life)"},
{"id":8,"name":"Athanasius of Alexandria","card":"Five of Swords","classifier":"Swords - Air - Reason","emojis":"🛡️, ✝️","continent":"Africa","story":"A champion of orthodoxy who was exiled five times for his unwavering theological stance against Arianism. His life was one of constant conflict and intellectual battle, representing a victory of principle, albeit one achieved through great strife and argument.","virtues":"Orthodoxy, Fortitude, Perseverance, Conviction","gender":"Male","location":"Alexandria, Egypt","canon":"On the Incarnation, Life of Antony, Four Orations Against the Arians"},
{"id":9,"name":"Augustine of Hippo","card":"The Devil (XV)","classifier":"Major Arcana","emojis":"📚,⛓️","continent":"Africa","story":"A man who famously struggled with and wrote about his bondage to worldly pleasures and intellectual pride before his conversion. His story is the ultimate archetype of confronting and breaking free from the chains of addiction and materialism represented by this card.","virtues":"Perseverance, Faith, Intellect, Repentance","gender":"Male","location":"Hippo Regius (Annaba, Algeria)","canon":"Confessions, City of God, On Christian Doctrine"},
{"id":10,"name":"Basil of Caesarea","card":"Ten of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🕊️, 🏥","continent":"Asia","story":"A bishop who established the Basiliad, a massive complex with a hospital and hospice that served the poor and sick. He created a lasting structure of communal wealth, charity, and physical care, perfectly embodying the establishment of a prosperous and stable legacy.","virtues":"Charity, Leadership, Orthodoxy, Governance","gender":"Male","location":"Caesarea, Cappadocia (Turkey)","canon":"On the Holy Spirit, Address to Young Men, Asketikon"},
{"id":11,"name":"Bede the Venerable","card":"Four of Swords","classifier":"Swords - Air - Reason","emojis":"📜, monastery","continent":"Europe","story":"A monk who spent his life in the quiet contemplation and intellectual rest of the monastery. He produced his great historical work not from battle, but from a state of scholarly retreat, study, and mental recuperation, aligning with this card's theme of restful contemplation.","virtues":"Scholarship, Humility, Diligence, Piety","gender":"Male","location":"Jarrow, England","canon":"Ecclesiastical History of the English People"},
{"id":12,"name":"Benedict of Nursia","card":"Temperance (XIV)","classifier":"Major Arcana","emojis":"⚖️, 🙏","continent":"Europe","story":"The author of the Rule, a masterful guide that synthesizes prayer, work, and study into a balanced and moderate way of life. He is the archetype of Temperance, blending spiritual and practical elements to create a stable, harmonious path.","virtues":"Order, Stability, Prayerfulness, Moderation","gender":"Male","location":"Nursia / Monte Cassino, Italy","canon":"The Rule of Saint Benedict, Dialogues of Pope Gregory the Great"},
{"id":13,"name":"Bernadette of Lourdes","card":"Page of Cups","classifier":"Cups - Water - Emotional","emojis":"💧, 🌹","continent":"Europe","story":"A simple, uneducated girl who was open and intuitive enough to receive a divine message. She embodies the Page of Cups' qualities of innocence, emotional purity, and being a messenger from the spiritual or unconscious realms.","virtues":"Humility, Simplicity, Faith, Obedience","gender":"Female","location":"Lourdes, France","canon":"Eyewitness testimonies, Church investigation records"},
{"id":14,"name":"Bernard of Clairvaux","card":"Knight of Wands","classifier":"Wands - Fire - Creativity","emojis":"🐝, 🔥","continent":"Europe","story":"An abbot of immense energy and passion. He revitalized his order, preached the Second Crusade, and pursued his goals with a fiery zeal that could inspire thousands. He embodies the Knight of Wands' archetype of being charming, energetic, and charging ahead on a quest.","virtues":"Zeal, Devotion, Persuasion, Mysticism","gender":"Male","location":"Clairvaux, France","canon":"On Loving God, Sermons on the Song of Songs"},
{"id":15,"name":"Bonaventure of Bagnoregio","card":"Two of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🦉, ⚖️","continent":"Europe","story":"As Minister General of the Franciscans, he had to expertly balance the spiritual ideals of St. Francis with the practical, administrative needs of a large, growing order. This act of balancing two important priorities is the essence of this card.","virtues":"Intellect, Devotion, Governance, Wisdom","gender":"Male","location":"Bagnoregio, Italy","canon":"The Journey of the Mind into God, The Life of St. Francis"},
{"id":16,"name":"Brendan of Clonfert","card":"The Moon (XVIII)","classifier":"Major Arcana","emojis":"⛵️, 🐋","continent":"Europe","story":"A navigator who sailed into the unknown, on a journey guided by faith rather than maps. His voyage into a world of illusion, strange creatures, and mystery perfectly reflects the themes of journeying through the unconscious and the unknown found in the Moon card.","virtues":"Faith, Courage, Adventure, Perseverance","gender":"Male","location":"Clonfert, Ireland","canon":"Navigatio Sancti Brendani Abbatis (The Voyage of Saint Brendan the Abbot)"},
{"id":17,"name":"Bridget of Sweden","card":"Three of Swords","classifier":"Swords - Air - Reason","emojis":"✍️, 💔","continent":"Europe","story":"A widowed mystic whose divine revelations often contained painful truths and sorrowful critiques of the Church and its leaders. The swords of piercing truth and the heartbreak over the state of the world are central to her prophetic mission.","virtues":"Mysticism, Piety, Reform, Prophecy","gender":"Female","location":"Finsta, Sweden / Rome, Italy","canon":"Revelations of St. Bridget"},
{"id":18,"name":"Catherine of Alexandria","card":"Queen of Swords","classifier":"Swords - Air - Reason","emojis":"⚙️, 👑","continent":"Africa","story":"A princess and scholar who used her sharp intellect and clear, incisive logic to debate and defeat fifty pagan philosophers. She is the archetype of the Queen of Swords: intelligent, articulate, truthful, and unafraid of intellectual confrontation.","virtues":"Wisdom, Eloquence, Faithfulness, Courage","gender":"Female","location":"Alexandria, Egypt","canon":"The Golden Legend"},
{"id":19,"name":"Catherine of Genoa","card":"Six of Cups","classifier":"Cups - Water - Emotional","emojis":"🏥, ❤️‍🩹","continent":"Europe","story":"A mystic who gave herself over completely to the simple, innocent charity of caring for the sick. Her work represents a selfless, nostalgic love reminiscent of childhood purity and a deep, compassionate connection to others' suffering.","virtues":"Charity, Self-Denial, Service, Mysticism","gender":"Female","location":"Genoa, Italy","canon":"Treatise on Purgatory, Spiritual Dialogue"},
{"id":20,"name":"Catherine of Siena","card":"Justice (XI)","classifier":"Major Arcana","emojis":"⚜️, ⚖️","continent":"Europe","story":"A mystic who wielded immense influence to correct a great imbalance, persuading the Pope to return to Rome from Avignon. Her life was a quest for truth and righteousness, seeking to restore divine order and justice to the Church on Earth.","virtues":"Wisdom, Fortitude, Persuasion, Mysticism","gender":"Female","location":"Siena, Italy","canon":"The Dialogue of Divine Providence, The Letters of Catherine of Siena"},
{"id":21,"name":"Clare of Assisi","card":"The Sun (XIX)","classifier":"Major Arcana","emojis":"✨, ☀️","continent":"Europe","story":"Her name means 'light,' and as the founder of the Poor Clares, she radiated joy, clarity, and unwavering faith. She defended her convent with the light of the Eucharist, embodying the vibrancy, purity, and triumphant joy of the Sun card.","virtues":"Poverty, Faith, Courage, Devotion","gender":"Female","location":"Assisi, Italy","canon":"The Rule of St. Clare, The Life of St. Clare by Thomas of Celano"},
{"id":22,"name":"Columba of Iona","card":"Six of Wands","classifier":"Wands - Fire - Creativity","emojis":"🇮🇪, 🕊️","continent":"Europe","story":"A successful missionary who established a thriving and influential monastery at Iona, which became a beacon of faith and learning. This card represents public recognition, victory, and the success of a spiritual campaign, perfectly matching his achievement.","virtues":"Evangelism, Leadership, Scholarship, Diplomacy","gender":"Male","location":"Iona, Scotland","canon":"Vita Columbae (Life of Columba) by Adomnán of Iona"},
{"id":23,"name":"Cuthbert of Lindisfarne","card":"Four of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🙏, 🏝️","continent":"Europe","story":"A hermit who sought stability and control over his spiritual life by retreating to a remote island. He embodies the conservation of spiritual energy and the establishment of firm boundaries to protect his contemplative treasures from the outside world.","virtues":"Piety, Humility, Solitude, Gentleness","gender":"Male","location":"Lindisfarne, England","canon":"Life of St. Cuthbert by Bede"},
{"id":24,"name":"Cyril of Alexandria","card":"Seven of Swords","classifier":"Swords - Air - Reason","emojis":"📜, 🛡️","continent":"Africa","story":"A brilliant but controversial theologian who used sharp political and rhetorical strategies to defeat his opponents at the Council of Ephesus. His methods were complex and sometimes seen as cunning, reflecting this card's themes of strategy and intellectual maneuvering.","virtues":"Orthodoxy, Tenacity, Polemics, Wisdom","gender":"Male","location":"Alexandria, Egypt","canon":"Commentaries on John and Luke, Against Nestorius"},
{"id":25,"name":"Cyril of Jerusalem","card":"Page of Swords","classifier":"Swords - Air - Reason","emojis":"catechism, 📖","continent":"Asia","story":"His fame rests on his Catechetical Lectures, a work of immense clarity for new students of the faith. He embodies the Page of Swords, a messenger and student of truth, eager to learn and communicate new ideas with curiosity and mental energy.","virtues":"Teaching, Orthodoxy, Patience, Fortitude","gender":"Male","location":"Jerusalem","canon":"Catechetical Lectures of St. Cyril of Jerusalem"},
{"id":26,"name":"Dominic of Guzmán","card":"Ace of Wands","classifier":"Wands - Fire - Creativity","emojis":"🐶, 🔥","continent":"Europe","story":"He founded the Order of Preachers, sparking a new, energetic movement of missionary and intellectual activity. This act was a pure burst of inspiration and creative spiritual energy, the very essence of the Ace of Wands, which represents a new passion or enterprise.","virtues":"Truth, Preaching, Study, Zeal","gender":"Male","location":"Caleruega, Spain","canon":"Libellus de principiis Ordinis Praedicatorum by Jordan of Saxony"},
{"id":27,"name":"Elizabeth of Hungary","card":"The Empress (III)","classifier":"Major Arcana","emojis":"👑, 🥖","continent":"Europe","story":"A princess and queen who embodied maternal care and earthly abundance through her radical charity, famously baking bread for the poor. She represents the archetype of the nurturing mother, fertility, and compassion in the physical world.","virtues":"Charity, Humility, Compassion, Service","gender":"Female","location":"Kingdom of Hungary","canon":"The Life of St. Elizabeth of Hungary by Dietrich of Apolda"},
{"id":28,"name":"Elizabeth of Portugal","card":"Two of Cups","classifier":"Cups - Water - Emotional","emojis":"🕊️, 🤝","continent":"Europe","story":"A queen known as 'The Peacemaker' for her remarkable ability to forge partnerships and reconcile warring family members. Her life's work was the creation of union, truce, and mutual respect, which are the core meanings of this card.","virtues":"Peacemaking, Charity, Diplomacy, Piety","gender":"Female","location":"Kingdom of Portugal","canon":"Papal Bull of Canonization by Pope Urban VIII"},
{"id":29,"name":"Ferdinand III of Castile","card":"The Emperor (IV)","classifier":"Major Arcana","emojis":"⚔️, 🏰","continent":"Europe","story":"A just and pious king who unified kingdoms, established laws, and built a stable, structured society. He is a perfect archetype of the Emperor, a figure of worldly authority, structure, and fatherly rule who brings order out of chaos.","virtues":"Justice, Leadership, Piety, Fortitude","gender":"Male","location":"Castile, Spain","canon":"Chronica latina regum Castellae (Latin Chronicle of the Kings of Castile)"},
{"id":30,"name":"Frances of Rome","card":"Nine of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"😇, 🏡","continent":"Europe","story":"A noblewoman who found spiritual discipline and independence within her domestic life. She organized women for charity while managing her household, embodying the grace, self-reliance, and abundant discipline found in a well-tended garden.","virtues":"Charity, Service, Piety, Patience","gender":"Female","location":"Rome, Italy","canon":"Papal Bull of Canonization by Pope Paul V"},
{"id":31,"name":"Francis of Assisi","card":"The Fool (0)","classifier":"Major Arcana","emojis":"🐾, ☀️","continent":"Europe","story":"He abandoned a life of wealth to take a radical leap of faith into the unknown, embracing poverty and trusting completely in divine providence. His journey is the ultimate embodiment of the Fool's archetype: beginning a new path with pure faith and innocence.","virtues":"Humility, Poverty, Charity, Love for Creation","gender":"Male","location":"Assisi, Italy","canon":"Canticle of the Sun, The Little Flowers of Saint Francis"},
{"id":32,"name":"Francis de Sales","card":"Strength (VIII)","classifier":"Major Arcana","emojis":"💌, ❤️‍🔥","continent":"Europe","story":"A bishop known for his gentle spirit and patient persuasion. He demonstrated that true strength lies not in force but in compassion, courage, and taming the wild passions with a gentle hand, perfectly reflecting the meaning of the Strength card.","virtues":"Gentleness, Patience, Spiritual Direction, Charity","gender":"Male","location":"Thorens-Glières, France","canon":"Introduction to the Devout Life, Treatise on the Love of God"},
{"id":33,"name":"George of Lydda","card":"Seven of Wands","classifier":"Wands - Fire - Creativity","emojis":"🐉, 🛡️","continent":"Asia","story":"The legendary dragon-slayer who stands alone, defending the innocent against a great threat. This card represents courage, challenge, and maintaining one's position against all odds, a perfect match for his archetypal battle.","virtues":"Courage, Chivalry, Faith, Protection","gender":"Male","location":"Lydda, Palestine (Lod, Israel)","canon":"The Golden Legend, Hagiographies, Acts of Saint George"},
{"id":34,"name":"Gertrude of Nivelles","card":"Three of Cups","classifier":"Cups - Water - Emotional","emojis":"🐈, 🏡","continent":"Europe","story":"An abbess renowned for her warm hospitality, creating a joyful and supportive community for pilgrims and missionaries. Her life reflects the camaraderie, celebration, and friendship central to the Three of Cups.","virtues":"Hospitality, Piety, Prudence, Charity","gender":"Female","location":"Nivelles, Belgium","canon":"Vita Sanctae Geretrudis (Life of Saint Gertrude)"},
{"id":35,"name":"Gregory of Nazianzus","card":"Ten of Swords","classifier":"Swords - Air - Reason","emojis":"🗣️, 😥","continent":"Asia","story":"A brilliant but reluctant bishop who felt the crushing weight and painful betrayal of ecclesiastical politics. He ultimately resigned his prestigious post in Constantinople, hitting a low point that forced a new beginning, as depicted in this card of painful endings.","virtues":"Eloquence, Theology, Humility, Contemplation","gender":"Male","location":"Nazianzus, Cappadocia (Turkey)","canon":"Five Theological Orations, Philocalia"},
{"id":36,"name":"Gregory of Nyssa","card":"Page of Wands","classifier":"Wands - Fire - Creativity","emojis":"🤔, 🔥","continent":"Asia","story":"A philosophical theologian who explored new frontiers of thought, particularly on the spiritual life (The Life of Moses). He represents the Page of Wands' energy of exploring new creative and spiritual ideas with passion and inspiration.","virtues":"Intellect, Mysticism, Philosophy, Orthodoxy","gender":"Male","location":"Nyssa, Cappadocia (Turkey)","canon":"The Life of Moses, On the Soul and the Resurrection, Great Catechetical Oration"},
{"id":37,"name":"Gregory the Great","card":"King of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🎶, 👑","continent":"Europe","story":"A Pope who was a master administrator, managing vast papal estates, organizing liturgies (Gregorian Chant), and sending missionaries. He created stability and material security for the Church, embodying the King of Pentacles' mastery of the earthly realm.","virtues":"Leadership, Reform, Evangelism, Humility","gender":"Male","location":"Rome, Italy","canon":"Pastoral Rule, Dialogues, Moralia in Job"},
{"id":38,"name":"Hedwig of Silesia","card":"Queen of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"👣, 👑","continent":"Europe","story":"A duchess who used her immense wealth and position to be a down-to-earth nurturer of the poor, founding monasteries and hospitals. Her practical, charitable, and motherly nature makes her the archetype of the Queen of Pentacles.","virtues":"Charity, Piety, Austerity, Humility","gender":"Female","location":"Duchy of Silesia (Poland)","canon":"Vita beatae Hedwigis (Life of the Blessed Hedwig)"},
{"id":39,"name":"Helena of Constantinople","card":"Three of Wands","classifier":"Wands - Fire - Creativity","emojis":"☦️, 🗺️","continent":"Asia","story":"In her old age, she embarked on a great expedition to the Holy Land, looking out to a new horizon for the now-Christian empire. Her pilgrimage to discover the True Cross represents foresight, exploration, and the beginning of a great enterprise.","virtues":"Faith, Piety, Discovery, Perseverance","gender":"Female","location":"Constantinople (Istanbul, Turkey)","canon":"Hagiographies by Eusebius of Caesarea and Ambrose of Milan"},
{"id":40,"name":"Hildegard of Bingen","card":"The High Priestess (II)","classifier":"Major Arcana","emojis":"🎶, 🌿","continent":"Europe","story":"A powerful abbess, mystic, and visionary who was a conduit for profound, intuitive, and divine knowledge. She represents the archetype of the High Priestess, the keeper of sacred secrets and a bridge between the seen and unseen worlds.","virtues":"Wisdom, Creativity, Prophecy, Knowledge","gender":"Female","location":"Bingen am Rhein, Germany","canon":"Scivias, Ordo Virtutum, Physica"},
{"id":41,"name":"Hugh of Lincoln","card":"Six of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🦢, 🪙","continent":"Europe","story":"A bishop renowned for his immense charity and justice, especially his defense of the poor and the Jewish community. He embodies the spirit of generous giving, patronage, and the balanced distribution of wealth and power.","virtues":"Justice, Courage, Piety, Tenderness","gender":"Male","location":"Lincoln, England","canon":"Magna Vita Sancti Hugonis (The Great Life of St. Hugh)"},
{"id":42,"name":"Ignatius of Loyola","card":"Wheel of Fortune (X)","classifier":"Major Arcana","emojis":"✝️, 🎯","continent":"Europe","story":"A cannonball injury completely changed the trajectory of his life, turning him from a vain soldier into the founder of the Jesuits. His story is a perfect example of a major turn of fate, a pivotal moment of destiny that sets a soul on an entirely new path.","virtues":"Discernment, Obedience, Zeal, Self-Discipline","gender":"Male","location":"Loyola, Basque Country, Spain","canon":"Spiritual Exercises of St. Ignatius, The Autobiography of St. Ignatius"},
{"id":43,"name":"Irenaeus of Lyons","card":"Two of Swords","classifier":"Swords - Air - Reason","emojis":"🗣️, ⚔️","continent":"Europe","story":"A bishop who had to make a difficult intellectual choice, creating a clear line between orthodoxy and the Gnosticism he fought in Against Heresies. He represents the need to create a truce through intellectual stalemate, blocking out confusion to establish truth.","virtues":"Orthodoxy, Teaching, Apologetics, Faithfulness","gender":"Male","location":"Lyons, France","canon":"Against Heresies (Adversus Haereses)"},
{"id":44,"name":"Isidore of Seville","card":"The Magician (I)","classifier":"Major Arcana","emojis":"💾, 📚","continent":"Europe","story":"An encyclopedist who gathered all the knowledge of his era ('as above, so below') and manifested it into a single, powerful work, the Etymologiae. He is the archetype of the Magician, who takes resources from the divine/intellectual realm and makes them manifest on Earth.","virtues":"Knowledge, Scholarship, Order, Wisdom","gender":"Male","location":"Seville, Spain","canon":"Etymologiae, History of the Goths, Vandals, and Suebi"},
{"id":45,"name":"James of the Marches","card":"Eight of Wands","classifier":"Wands - Fire - Creativity","emojis":"⭐️, ✈️","continent":"Europe","story":"A tireless preacher who traveled with great speed and energy across Central and Eastern Europe. He represents the swift action, travel, and rapid delivery of messages that characterize the Eight of Wands.","virtues":"Zeal, Preaching, Austerity, Reform","gender":"Male","location":"March of Ancona, Italy","canon":"Hagiographies by Venantius of Fabriano"},
{"id":46,"name":"Joan of Arc","card":"The Chariot (VII)","classifier":"Major Arcana","emojis":"🇫🇷, ⚔️","continent":"Europe","story":"A peasant girl who, through sheer willpower and divine conviction, harnessed the opposing forces of the French army and led them to victory. She is the ultimate Charioteer, a figure of external conquest driven by an unstoppable inner will.","virtues":"Courage, Faith, Patriotism, Fortitude","gender":"Female","location":"Domrémy-la-Pucelle, France","canon":"Trial transcripts, letters, historical chronicles"},
{"id":47,"name":"John of Damascus","card":"Knight of Swords","classifier":"Swords - Air - Reason","emojis":"🖼️, ✍️","continent":"Asia","story":"A brilliant and assertive defender of the faith, particularly of icons. He charged into theological debate with sharp logic and cutting arguments to defend sacred tradition, embodying the focused, intellectual power of the Knight of Swords.","virtues":"Orthodoxy, Courage, Eloquence, Wisdom","gender":"Male","location":"Damascus, Syria","canon":"Fountain of Knowledge, On the Divine Images"},
{"id":48,"name":"John of God","card":"Knight of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"❤️‍🩹, 🏥","continent":"Europe","story":"A man who, after his conversion, worked tirelessly and methodically to build a real, physical institution to care for the sick. He is the Knight of Pentacles: hardworking, dependable, and dedicated to the slow, practical work of service.","virtues":"Compassion, Charity, Hospitality, Humility","gender":"Male","location":"Montemor-o-Novo, Portugal","canon":"Life of John of God by Francisco de Castro"},
{"id":49,"name":"John of the Cross","card":"Knight of Cups","classifier":"Cups - Water - Emotional","emojis":"🌌, ❤️‍🔥","continent":"Europe","story":"A mystic poet whose entire life was a romantic, spiritual quest for union with God. He followed his heart through the 'dark night,' driven by an emotional and intuitive calling, making him the archetype of the questing Knight of Cups.","virtues":"Mysticism, Perseverance, Poeticism, Fortitude","gender":"Male","location":"Fontiveros, Spain","canon":"Dark Night of the Soul, Ascent of Mount Carmel, Spiritual Canticle"},
{"id":50,"name":"Joseph of Arimathea","card":"Seven of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🏺, tomb","continent":"Asia","story":"A man who invested in a long-term project—his own tomb—and then patiently waited for the right moment to use it for a sacred purpose. This act of patience, investment, and assessing the results of one's labor aligns perfectly with this card.","virtues":"Courage, Faith, Charity, Discipleship","gender":"Male","location":"Arimathea, Judea","canon":"The New Testament (Gospels of Matthew, Mark, Luke, John)"},
{"id":51,"name":"Joseph of Cupertino","card":"Ace of Cups","classifier":"Cups - Water - Emotional","emojis":"🕊️, ☁️","continent":"Europe","story":"A simple friar whose prayer was so profound that he would overflow with divine love and begin to levitate. His life represents the pure, uninhibited outpouring of spiritual and emotional energy that is the Ace of Cups.","virtues":"Humility, Piety, Ecstasy, Simplicity","gender":"Male","location":"Cupertino, Italy","canon":"Life of St. Joseph of Cupertino by Robert Nuti"},
{"id":52,"name":"Juan Diego","card":"Seven of Cups","classifier":"Cups - Water - Emotional","emojis":"🇲🇽, 🌹","continent":"North America","story":"A humble man presented with a powerful, divine vision and a choice of how to respond. The story of the apparition on his tilma is one of otherworldly options and dreams being made manifest, reflecting the visionary choices of the Seven of Cups.","virtues":"Humility, Faith, Simplicity, Obedience","gender":"Male","location":"Cuautitlán, Mexico","canon":"Nican Mopohua"},
{"id":53,"name":"Juliana of Norwich","card":"Nine of Cups","classifier":"Cups - Water - Emotional","emojis":"🥜, 😊","continent":"Europe","story":"An anchoress who, through her mystical visions, arrived at a place of profound spiritual contentment and satisfaction, summarized in her famous saying, 'All shall be well.' She embodies the emotional and spiritual fulfillment promised by this card.","virtues":"Hope, Contemplation, Trust, Mysticism","gender":"Female","location":"Norwich, England","canon":"Revelations of Divine Love (A Book of Showings)"},
{"id":54,"name":"Kateri Tekakwitha","card":"Eight of Swords","classifier":"Swords - Air - Reason","emojis":"⚜️, 🙏","continent":"North America","story":"A young woman who felt isolated and trapped by her community for her beliefs. She made a conscious choice to escape this restriction to live her faith freely, overcoming the sense of powerlessness and isolation that this card depicts.","virtues":"Purity, Faith, Perseverance, Courage","gender":"Female","location":"Ossernenon (Auriesville, NY)","canon":"Jesuit Relations, biographies by Catholic missionaries"},
{"id":55,"name":"Lawrence of Brindisi","card":"Ace of Swords","classifier":"Swords - Air - Reason","emojis":"multilingual, 💡","continent":"Europe","story":"A brilliant linguist and theologian whose sharp intellect cut through confusion. He represents the breakthrough of a new, powerful idea, a moment of clarity and intellectual triumph that is the core of the Ace of Swords.","virtues":"Knowledge, Eloquence, Diplomacy, Zeal","gender":"Male","location":"Brindisi, Italy","canon":"Sermons, autobiographical notes"},
{"id":56,"name":"Lawrence of Rome","card":"Nine of Wands","classifier":"Wands - Fire - Creativity","emojis":"🔥, 🪙","continent":"Europe","story":"A deacon who, having endured immense persecution, made one last stand of defiance and faith by presenting the poor as the Church's true treasure. He represents resilience, perseverance, and holding one's ground when battered and wounded.","virtues":"Courage, Charity, Humor, Fortitude","gender":"Male","location":"Rome, Italy","canon":"Hagiographies by St. Ambrose and Prudentius"},
{"id":57,"name":"Leo the Great","card":"Four of Wands","classifier":"Wands - Fire - Creativity","emojis":"📜, 🤝","continent":"Europe","story":"A Pope who brought stability and peace by persuading Attila the Hun to spare Rome. His diplomatic victory created a moment of celebration, harmony, and community safety, reflecting the primary meaning of this card.","virtues":"Leadership, Diplomacy, Courage, Orthodoxy","gender":"Male","location":"Rome, Italy","canon":"Tome of Leo, Sermons, Letters"},
{"id":58,"name":"Louis IX of France","card":"King of Cups","classifier":"Cups - Water - Emotional","emojis":"⚜️, ❤️‍⚖️","continent":"Europe","story":"While he was a king (Emperor archetype), his rule was defined by compassion, charity, and emotional balance. He controlled his realm not just with law, but with a deep sense of paternal love and care, making him a master of the emotional realm.","virtues":"Justice, Piety, Charity, Humility","gender":"Male","location":"Poissy, France","canon":"Life of St. Louis by Jean de Joinville"},
{"id":59,"name":"Margaret of Antioch","card":"The World (XXI)","classifier":"Major Arcana","emojis":"🐉, चक्र","continent":"Asia","story":"A legendary saint whose story involves defeating a dragon from within, representing a total victory over evil and a successful completion of a great spiritual cycle. Her immense popularity shows her as an integrated, whole archetype of triumph.","virtues":"Faithfulness, Purity, Perseverance, Fortitude","gender":"Female","location":"Antioch, Pisidia (Turkey)","canon":"The Golden Legend"},
{"id":60,"name":"Margaret of Scotland","card":"Page of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🏴󠁧󠁢󠁳󠁣󠁴󠁿, 📚","continent":"Europe","story":"A queen who brought new learning, reform, and practical charity to her kingdom. She embodies the Page of Pentacles, a student of the world dedicated to manifesting new opportunities for learning and tangible well-being.","virtues":"Piety, Reform, Charity, Gentleness","gender":"Female","location":"Kingdom of Scotland","canon":"Life of St. Margaret, Queen of Scotland by Turgot of Durham"},
{"id":61,"name":"Martin de Porres","card":"Page of Cups","classifier":"Cups - Water - Emotional","emojis":"🧹, 🐭","continent":"South America","story":"A saint of profound humility and gentle compassion, especially to the lowly and animals. His intuitive and loving nature, unconcerned with status, reflects the open-hearted innocence and emotional purity of the Page of Cups.","virtues":"Humility, Charity, Interracial Justice, Compassion","gender":"Male","location":"Lima, Peru","canon":"Papal Bull of Canonization by Pope John XXIII"},
{"id":62,"name":"Martin of Tours","card":"Two of Wands","classifier":"Wands - Fire - Creativity","emojis":"⚔️, 🧥","continent":"Europe","story":"His defining moment was a choice between two worlds: the Roman military and the service of Christ. After his vision, he stood with personal power and foresight, planning a new future path, which is the essence of the Two of Wands.","virtues":"Charity, Humility, Evangelism, Generosity","gender":"Male","location":"Tours, France","canon":"Vita Martini (Life of Martin) by Sulpicius Severus"},
{"id":63,"name":"Mary of Magdala","card":"Judgment (XX)","classifier":"Major Arcana","emojis":"💧, 🌅","continent":"Asia","story":"The first witness to the Resurrection, she was called to a higher purpose: to announce the risen Christ. Her story is one of absolution, rebirth, and answering a divine calling, which are the core themes of Judgment.","virtues":"Faithfulness, Devotion, Repentance, Evangelism","gender":"Female","location":"Magdala, Galilee","canon":"The New Testament (Gospels of Matthew, Mark, Luke, John)"},
{"id":64,"name":"Nicholas of Myra","card":"Six of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🎁, 🤫","continent":"Asia","story":"The original secret Santa, whose stories all revolve around anonymous, generous charity to those in need. He is the ultimate archetype of the patron who gives freely from his resources to restore balance and relieve poverty.","virtues":"Generosity, Charity, Protection, Kindness","gender":"Male","location":"Myra, Asia Minor (Demre, Turkey)","canon":"The Golden Legend, Hagiographies by St. Andrew of Crete"},
{"id":65,"name":"Patrick of Ireland","card":"Ace of Wands","classifier":"Wands - Fire - Creativity","emojis":"☘️, 🔥","continent":"Europe","story":"A missionary who brought a spark of immense creative and spiritual energy to Ireland, transforming the nation. His mission was a bold, new enterprise fueled by passion and divine inspiration, perfectly mirroring the Ace of Wands.","virtues":"Faith, Evangelism, Forgiveness, Courage","gender":"Male","location":"Ireland","canon":"Confessio of Saint Patrick, Letter to the Soldiers of Coroticus"},
{"id":66,"name":"Paul of Thebes","card":"Nine of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🌴, 🐦","continent":"Africa","story":"The first hermit who lived a life of complete self-sufficiency and discipline in the desert, fed by a raven. He represents the solitary abundance and independence gained through discipline, much like the woman in her well-tended garden.","virtues":"Solitude, Asceticism, Prayerfulness, Simplicity","gender":"Male","location":"Theban Desert, Egypt","canon":"Vita Pauli Primi Eremitae (The Life of Paul the First Hermit) by St. Jerome"},
{"id":67,"name":"Peter of Verona","card":"Ten of Swords","classifier":"Swords - Air - Reason","emojis":"🩸, ✍️","continent":"Europe","story":"An inquisitor martyred for his faith. His story ends in the ultimate betrayal and finality, yet with a final act of belief ('Credo'). This card's image of a definitive, painful ending that nevertheless cannot extinguish the spirit is reflected in his death.","virtues":"Courage, Faith, Forgiveness, Martyrdom","gender":"Male","location":"Verona, Italy","canon":"Biographies by Thomas of Leontino, Papal Bull of Canonization"},
{"id":68,"name":"Raymond of Penyafort","card":"Justice (XI)","classifier":"Major Arcana","emojis":"⚖️, 📚","continent":"Europe","story":"A master of canon law who compiled the Decretals, bringing clarity, cause and effect, and fairness to Church law. He is an archetype of Justice, dedicated to truth, law, and ensuring that actions have clear and fair consequences.","virtues":"Prudence, Justice, Diligence, Humility","gender":"Male","location":"Penyafort, Catalonia (Spain)","canon":"Papal Bull of Canonization by Pope Clement VIII"},
{"id":69,"name":"Rita of Cascia","card":"Five of Cups","classifier":"Cups - Water - Emotional","emojis":"🙏, 🥀","continent":"Europe","story":"A saint who endured immense personal loss—the death of her difficult husband and two sons—yet found a way to turn from her grief toward God. She represents the sorrow and regret of this card, but also the potential for hope that remains.","virtues":"Patience, Forgiveness, Perseverance, Prayerfulness","gender":"Female","location":"Cascia, Italy","canon":"Papal Bull of Canonization by Pope Leo XIII"},
{"id":70,"name":"Roch of Montpellier","card":"Eight of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"🐕, ❤️‍🩹","continent":"Europe","story":"A saint who dedicated himself to the repetitive, diligent work of caring for plague victims. He represents the apprenticeship and mastery of a craft—in his case, the craft of healing and charity—through dedication and hard work.","virtues":"Charity, Healing, Perseverance, Compassion","gender":"Male","location":"Montpellier, France","canon":"The Golden Legend, Acta breviora"},
{"id":71,"name":"Rose of Lima","card":"Four of Cups","classifier":"Cups - Water - Emotional","emojis":"🌹, 🤔","continent":"South America","story":"A mystic who deliberately withdrew from worldly society and offers of marriage to focus on a life of contemplation and penance. This turning inward, rejecting what is offered by the world to seek something more, is the essence of this card.","virtues":"Piety, Purity, Mortification, Devotion","gender":"Female","location":"Lima, Peru","canon":"Papal Bull of Canonization by Pope Clement X"},
{"id":72,"name":"Stephen of Hungary","card":"The Emperor (IV)","classifier":"Major Arcana","emojis":"🇭🇺, 👑","continent":"Europe","story":"The first King of Hungary, who established the structure of a Christian nation, bringing order, law, and a stable foundation to his people. He is a clear archetype of the worldly ruler and father figure of the Emperor card.","virtues":"Leadership, Faith, Justice, Nation-building","gender":"Male","location":"Kingdom of Hungary","canon":"Hartvic's Life of St. Stephen"},
{"id":73,"name":"Teresa of Ávila","card":"Queen of Cups","classifier":"Cups - Water - Emotional","emojis":"🏰, ❤️","continent":"Europe","story":"A master of mystical theology who mapped the 'Interior Castle' of the soul. She was emotionally and spiritually intuitive, compassionate, and in control of the deep waters of contemplation, making her the archetype of the Queen of Cups.","virtues":"Prayerfulness, Determination, Reform, Mysticism","gender":"Female","location":"Ávila, Spain","canon":"The Interior Castle, The Way of Perfection, The Life of Teresa of Jesus"},
{"id":74,"name":"Teresa of Calcutta","card":"Ten of Cups","classifier":"Cups - Water - Emotional","emojis":"💙, 😊","continent":"Asia","story":"While her work was in a place of great suffering, her ultimate goal was to restore divine love and harmony to the 'poorest of the poor.' She sought to create moments of radiant emotional fulfillment and connection, the very picture of the Ten of Cups.","virtues":"Compassion, Service, Charity, Humility","gender":"Female","location":"Calcutta (Kolkata), India","canon":"Letters, Constitutions of the Missionaries of Charity, press coverage"},
{"id":75,"name":"Thérèse of Lisieux","card":"The Lovers (VI)","classifier":"Major Arcana","emojis":"🥀, ❤️","continent":"Europe","story":"Her 'Little Way' is all about making a conscious, heartfelt choice to align oneself with divine love in every small action. Her life reflects the core meaning of the Lovers card: establishing personal values and achieving union through a profound choice.","virtues":"Humility, Simplicity, Love, Spiritual Childhood","gender":"Female","location":"Lisieux, France","canon":"The Story of a Soul (L'histoire d'une âme)"},
{"id":76,"name":"Thomas Aquinas","card":"King of Swords","classifier":"Swords - Air - Reason","emojis":"🐂, 🧠","continent":"Europe","story":"One of the greatest intellectual minds in history, his Summa Theologica is a monument to reason, logic, and intellectual authority. He is the ultimate master of the realm of thought, embodying the intellectual power and clarity of the King of Swords.","virtues":"Intellect, Wisdom, Humility, Diligence","gender":"Male","location":"Aquino (Roccasecca), Italy","canon":"Summa Theologica, Summa contra Gentiles"},
{"id":77,"name":"Thomas Becket","card":"The Hanged Man (XII)","classifier":"Major Arcana","emojis":"🩸, ⛪","continent":"Europe","story":"The Archbishop who willingly sacrificed his power, comfort, and ultimately his life by suspending himself in opposition to the king. His martyrdom was an act of surrender to a higher principle, seeing the world from a different, spiritual perspective.","virtues":"Fortitude, Principle, Justice, Martyrdom","gender":"Male","location":"Canterbury, England","canon":"Biographies by Edward Grim and William Fitzstephen"},
{"id":78,"name":"Vincent de Paul","card":"Three of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"❤️‍🩹, 🤝","continent":"Europe","story":"A master organizer who excelled at teamwork and collaboration, founding the Vincentians and co-founding the Daughters of Charity. He represents the material success that comes from working together on a meaningful project.","virtues":"Charity, Compassion, Service, Organization","gender":"Male","location":"Pouy, France","canon":"Correspondence, conference notes, biographies"},
{"id":79,"name":"Vincent Ferrer","card":"The Tower (XVI)","classifier":"Major Arcana","emojis":"🔥, 🗣️","continent":"Europe","story":"An apocalyptic preacher known as the 'Angel of the Apocalypse' who traveled Europe warning of divine judgment. His sermons were designed to be like lightning bolts, shattering old assumptions and bringing about sudden, dramatic change in his listeners.","virtues":"Preaching, Repentance, Zeal, Miracles","gender":"Male","location":"Valencia, Spain","canon":"Sermons, biographies by Peter Ranzano"},
{"id":80,"name":"Wenceslaus of Bohemia","card":"Knight of Pentacles","classifier":"Pentacles - Earth - Physical","emojis":"👑, ❄️","continent":"Europe","story":"The 'Good King' of the carol who undertook a practical, physical journey through the snow to bring aid to a poor peasant. He is an archetype of dutiful service, reliability, and the patient, hardworking nature of this knight.","virtues":"Piety, Justice, Good Governance, Faith","gender":"Male","location":"Duchy of Bohemia (Czech Rep.)","canon":"Christian's Legend (Vita et passio sancti Venceslai et sancte Ludmile ave eius)"}
];
// --- DOM Elements ---
const drawButton = document.getElementById('draw-button');
const resetButton = document.getElementById('reset-button');
const cardSlotsContainer = document.getElementById('card-slots');
let drawnCards = [];
// --- Functions ---
/**
* Shuffles an array in place using the Fisher-Yates algorithm.
* @param {Array} array The array to shuffle.
*/
function shuffle(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
/**
* Creates the HTML for a single card.
* @param {Object} saintData The data for the saint.
* @param {string} position The position in the reading (e.g., 'Past').
* @returns {HTMLElement} The card element.
*/
function createCardElement(saintData, position) {
const card = document.createElement('div');
card.className = 'card';
card.innerHTML = `
<div class="card-face card-back">
<div class="card-back-design">
<span>⚜️</span>
</div>
</div>
<div class="card-face card-front">
<div class="card-header">
<h2>${saintData.name} ${saintData.emojis}</h2>
<p class="tarot-title">${saintData.card}</p>
</div>
<div class="card-body">
<p><strong>Position:</strong> ${position}</p>
<p><strong>Classifier:</strong> <em>${saintData.classifier}</em></p>
<p><strong>Virtues:</strong> ${saintData.virtues}</p>
<p class="story"><strong>Story:</strong> ${saintData.story}</p>
</div>
</div>
`;
card.addEventListener('click', () => {
card.classList.toggle('is-flipped');
});
return card;
}
/**
* Draws three cards and places them in the slots.
*/
function drawReading() {
if (drawnCards.length > 0) return; // Prevent re-drawing
shuffle(saints_data);
drawnCards = saints_data.slice(0, 3);
const positions = ['The Past', 'The Present', 'The Future'];
cardSlotsContainer.innerHTML = ''; // Clear placeholders
drawnCards.forEach((saint, index) => {
const slot = document.createElement('div');
slot.className = 'card-slot';
const cardElement = createCardElement(saint, positions[index]);
slot.appendChild(cardElement);
cardSlotsContainer.appendChild(slot);
});
}
/**
* Resets the reading to its initial state.
*/
function resetReading() {
drawnCards = [];
cardSlotsContainer.innerHTML = '';
setupPlaceholders();
}
/**
* Sets up the initial placeholder slots.
*/
function setupPlaceholders() {
const positions = ['The Past', 'The Present', 'The Future'];
for (let i = 0; i < 3; i++) {
const placeholder = document.createElement('div');
placeholder.className = 'card-slot';
placeholder.innerHTML = `
<div class="placeholder">
<span>${positions[i]}</span>
</div>
`;
cardSlotsContainer.appendChild(placeholder);
}
}
// --- Event Listeners ---
drawButton.addEventListener('click', drawReading);
resetButton.addEventListener('click', resetReading);
// --- Initial Setup ---
window.onload = setupPlaceholders;
</script>
</body>
</html>