perf: pre-generate Bible verse data and reduce DOM via conditional rendering
All checks were successful
CI / update (push) Successful in 1m34s
All checks were successful
CI / update (push) Successful in 1m34s
- Extract Bible lookup logic into shared src/lib/server/bible.ts module - Add build script to pre-generate all 20 mystery verse lookups as static data, eliminating runtime API calls on rosary page load - Update Prayer.svelte to pass showLatin/urlLang as snippet parameters; all 14 prayer components now conditionally render only visible language elements instead of hiding via CSS - Extract 4 inline mystery selector SVGs into MysteryIcon.svelte component - Remove unused CSS selectors from angelus page
This commit is contained in:
@@ -5,32 +5,34 @@
|
||||
</script>
|
||||
|
||||
<Prayer>
|
||||
{#snippet children(showLatin, urlLang)}
|
||||
<p>
|
||||
<v lang="la">Ave <i><sup>⚬</sup></i>María, grátia plena. Dóminus tecum,</v>
|
||||
<v lang="de">Gegrüsset seist du <i><sup>⚬</sup></i>Maria, voll der Gnade; der Herr ist mit dir;</v>
|
||||
<v lang="en">Hail <i><sup>⚬</sup></i>Mary, full of grace. The Lord is with thee.</v>
|
||||
<v lang="la">benedícta tu in muliéribus,</v>
|
||||
<v lang="de">du bist gebenedeit unter den Frauen,</v>
|
||||
<v lang="en">Blessed art thou amongst women,</v>
|
||||
<v lang="la">et benedíctus fructus ventris tui, {#if !mysteryLatin}<i><sup>⚬</sup></i>Jesus.{/if}</v>
|
||||
<v lang="de">und gebenedeit ist die Frucht deines Leibes, {#if !mystery}<i><sup>⚬</sup></i>Jesus.{/if}</v>
|
||||
<v lang="en">and blessed is the fruit of thy womb, {#if !mysteryEnglish}<i><sup>⚬</sup></i>Jesus.{/if}</v>
|
||||
{#if mysteryLatin}
|
||||
{#if showLatin}<v lang="la">Ave <i><sup>⚬</sup></i>María, grátia plena. Dóminus tecum,</v>{/if}
|
||||
{#if urlLang === 'de'}<v lang="de">Gegrüsset seist du <i><sup>⚬</sup></i>Maria, voll der Gnade; der Herr ist mit dir;</v>{/if}
|
||||
{#if urlLang === 'en'}<v lang="en">Hail <i><sup>⚬</sup></i>Mary, full of grace. The Lord is with thee.</v>{/if}
|
||||
{#if showLatin}<v lang="la">benedícta tu in muliéribus,</v>{/if}
|
||||
{#if urlLang === 'de'}<v lang="de">du bist gebenedeit unter den Frauen,</v>{/if}
|
||||
{#if urlLang === 'en'}<v lang="en">Blessed art thou amongst women,</v>{/if}
|
||||
{#if showLatin}<v lang="la">et benedíctus fructus ventris tui, {#if !mysteryLatin}<i><sup>⚬</sup></i>Jesus.{/if}</v>{/if}
|
||||
{#if urlLang === 'de'}<v lang="de">und gebenedeit ist die Frucht deines Leibes, {#if !mystery}<i><sup>⚬</sup></i>Jesus.{/if}</v>{/if}
|
||||
{#if urlLang === 'en'}<v lang="en">and blessed is the fruit of thy womb, {#if !mysteryEnglish}<i><sup>⚬</sup></i>Jesus.{/if}</v>{/if}
|
||||
{#if showLatin && mysteryLatin}
|
||||
<v lang="la" class="mystery-text"><i><sup>⚬</sup></i>{mysteryLatin}</v>
|
||||
{/if}
|
||||
{#if mystery}
|
||||
{#if urlLang === 'de' && mystery}
|
||||
<v lang="de" class="mystery-text"><i><sup>⚬</sup></i>{mystery}</v>
|
||||
{/if}
|
||||
{#if mysteryEnglish}
|
||||
{#if urlLang === 'en' && mysteryEnglish}
|
||||
<v lang="en" class="mystery-text"><i><sup>⚬</sup></i>{mysteryEnglish}</v>
|
||||
{/if}
|
||||
</p>
|
||||
<p>
|
||||
<v lang="la">Sancta <i><sup>⚬</sup></i>María, mater Dei, ora pro nobis peccatóribus,</v>
|
||||
<v lang="de">Heilige <i><sup>⚬</sup></i>Maria, Mutter Gottes, bitte für uns Sünder</v>
|
||||
<v lang="en">Holy <i><sup>⚬</sup></i>Mary, Mother of God, pray for us sinners,</v>
|
||||
<v lang="la">nunc, et in hora mortis nostræ. Amen.</v>
|
||||
<v lang="de">jetzt und in der Stunde unseres Todes. Amen.</v>
|
||||
<v lang="en">now and at the hour of our death. Amen.</v>
|
||||
{#if showLatin}<v lang="la">Sancta <i><sup>⚬</sup></i>María, mater Dei, ora pro nobis peccatóribus,</v>{/if}
|
||||
{#if urlLang === 'de'}<v lang="de">Heilige <i><sup>⚬</sup></i>Maria, Mutter Gottes, bitte für uns Sünder</v>{/if}
|
||||
{#if urlLang === 'en'}<v lang="en">Holy <i><sup>⚬</sup></i>Mary, Mother of God, pray for us sinners,</v>{/if}
|
||||
{#if showLatin}<v lang="la">nunc, et in hora mortis nostræ. Amen.</v>{/if}
|
||||
{#if urlLang === 'de'}<v lang="de">jetzt und in der Stunde unseres Todes. Amen.</v>{/if}
|
||||
{#if urlLang === 'en'}<v lang="en">now and at the hour of our death. Amen.</v>{/if}
|
||||
</p>
|
||||
{/snippet}
|
||||
</Prayer>
|
||||
|
||||
Reference in New Issue
Block a user