From a4a715d1a15f9a2517ef0d0f776957c17e8f3f08 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sun, 22 Feb 2026 21:42:26 +0100 Subject: [PATCH] rosary: move mystery title to pater noster as a separate card Each mystery now starts with its own title + Pater Noster card, before the Ave Maria decade card. Transition cards (Gloria Patri + Fatima Prayer) no longer contain the Pater Noster. Mystery image column stays on the current mystery during transition prayers (including the final Gloria/Fatima after decade 5) and only advances to the next mystery at the Pater Noster card. The new secret{N}_pater section IDs are tracked and mapped to their corresponding large bead via svgActiveSection, so both transition and pater sections highlight the correct large bead. CSS :has rules updated for no-JS fallback. Co-Authored-By: Claude Sonnet 4.6 --- .../[rosary=rosaryLang]/+page.svelte | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte b/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte index 2762849..043639b 100644 --- a/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte +++ b/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte @@ -112,6 +112,13 @@ let activeSection = $state("cross"); let sectionElements = {}; let svgContainer; +// Map pater sections to the large bead they share (so SVG highlights correctly) +const svgActiveSection = $derived( + activeSection === 'secret1_pater' ? 'lbead2' : + activeSection.endsWith('_pater') ? `secret${parseInt(activeSection[6]) - 1}_transition` : + activeSection +); + // Whether the rosary has mystery images (stable, doesn't change during scroll) const hasMysteryImages = $derived(showImages && (allMysteryImages[selectedMystery]?.size ?? 0) > 0); @@ -121,8 +128,11 @@ function getMysteryScrollTarget(section) { const secretMatch = section.match(/^secret(\d)/); if (secretMatch) { const num = parseInt(secretMatch[1]); - return section.includes('_transition') ? num + 1 : num; + // _transition (Gloria + Fatima) stays on the current mystery image; + // _pater and plain decade both show the mystery they belong to + return num; } + if (section === 'final_transition') return 5; if (section.startsWith('final_')) return 'after'; return 'before'; } @@ -456,10 +466,15 @@ onMount(() => { .rosary-layout:has(#lbead1:target) :global(.large-bead[data-section="lbead1"]), .rosary-layout:has(#lbead2:target) :global(.large-bead[data-section="lbead2"]), +.rosary-layout:has(#secret1_pater:target) :global(.large-bead[data-section="lbead2"]), .rosary-layout:has(#secret1_transition:target) :global(.large-bead[data-section="secret1_transition"]), +.rosary-layout:has(#secret2_pater:target) :global(.large-bead[data-section="secret1_transition"]), .rosary-layout:has(#secret2_transition:target) :global(.large-bead[data-section="secret2_transition"]), +.rosary-layout:has(#secret3_pater:target) :global(.large-bead[data-section="secret2_transition"]), .rosary-layout:has(#secret3_transition:target) :global(.large-bead[data-section="secret3_transition"]), +.rosary-layout:has(#secret4_pater:target) :global(.large-bead[data-section="secret3_transition"]), .rosary-layout:has(#secret4_transition:target) :global(.large-bead[data-section="secret4_transition"]), +.rosary-layout:has(#secret5_pater:target) :global(.large-bead[data-section="secret4_transition"]), .rosary-layout:has(#final_transition:target) :global(.large-bead[data-section="final_transition"]), .rosary-layout:has(#final_paternoster:target) :global(.large-bead[data-section="final_paternoster"]) { fill: var(--nord13) !important; @@ -755,7 +770,7 @@ h1 {
- +
@@ -868,12 +883,22 @@ h1 { >

{labels.gloriaPatri}

-

{labels.ourFather}

- {#each [1, 2, 3, 4, 5] as decadeNum} + +
+

{decadeNum}. {labels.decade}: {currentMysteryTitles[decadeNum - 1]}

+

{labels.ourFather}

+ +
+
-

{decadeNum}. {labels.decade}: {currentMysteryTitles[decadeNum - 1]}

- {#if showImages && allMysteryImages[selectedMystery]?.get(decadeNum)} {@const img = allMysteryImages[selectedMystery].get(decadeNum)}
@@ -914,7 +937,7 @@ h1 {
- + {#if decadeNum < 5}
{labels.fatimaPrayer} ({labels.optional}) - -

{labels.ourFather}

-
{/if} {/each}