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}