Tarot Spread Architect
Design. Divinate. Document.
Spread Type: 3-Card Overview
Daily Guidance
Querent: Self
Question: What do I need to know today?
Date: Oct 31, 2023
Deck Used: Rider-Waite Smith
Visual Layout
Interpretation & Insights
Synthesis / Notes
Consider the elemental balance of the spread.
Generated via Tarot Spread Architect
Design Your Spread
Define the positions of your spread (e.g., "The Past", "The Challenge").
Log the Reading
Card Interpretations
${pos.interp || "No notes added."}
`; outputs.interpList.appendChild(row); }); } // --- 5. EVENTS --- // Add Position document.getElementById('btn-add-pos').addEventListener('click', () => { trtData.positions.push({ name: "", card: "", interp: "" }); renderPositionEditor(); }); // Remove Position (Global) window.removePosition = function(idx) { trtData.positions.splice(idx, 1); renderPositionEditor(); }; // Meta Inputs Listeners Object.values(inputs).forEach(inp => { inp.addEventListener('input', () => { // Update data object trtData.meta.spreadName = inputs.spreadName.value; trtData.meta.querent = inputs.querent.value; trtData.meta.date = inputs.date.value; trtData.meta.question = inputs.question.value; trtData.meta.deck = inputs.deck.value; trtData.meta.synthesis = inputs.synthesis.value; updatePreview(); }); }); // --- 6. TABS --- window.trtSwitchTab = function(tabId) { // If switching TO Reading from Design, ensure inputs are generated if(tabId === 'tab-reading') { renderReadingInputs(); } // If switching TO Preview, ensure everything is fresh if(tabId === 'tab-preview') { updatePreview(); } document.querySelectorAll('.trt-tab-pane').forEach(p => p.classList.remove('active')); document.querySelectorAll('.trt-tab-btn').forEach(b => b.classList.remove('active')); document.getElementById(tabId).classList.add('active'); document.querySelector(`.trt-tab-btn[data-tab="${tabId}"]`).classList.add('active'); document.getElementById('tarot-tool-wrapper').scrollIntoView({behavior: 'smooth'}); }; document.querySelectorAll('.trt-tab-btn').forEach(btn => { btn.addEventListener('click', function() { trtSwitchTab(this.dataset.tab); }); }); // --- 7. PDF EXPORT --- const btnDown = document.getElementById('trt-download-btn'); if(btnDown) { btnDown.addEventListener('click', function() { const element = document.getElementById('trt-render-area'); const opt = { margin: 0.3, filename: `Tarot_Reading_${trtData.meta.date}.pdf`, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' } }; const orig = btnDown.innerText; btnDown.innerText = "Manifesting PDF..."; html2pdf().set(opt).from(element).save().then(() => { btnDown.innerText = orig; }); }); } // Init init(); });