{# @description A paragraph that starts dim and lights up a word at a time as it is scrolled through. Reads at full strength where the browser cannot do it. #} {# @prop text:text | required | description:"The paragraph. Plain words: it is split on its spaces." #} {# @prop dim:number | default:"0.25" | description:"How faint a word is before it is reached, from 0 to 1" #} {# @prop start:number | default:"0.1" | description:"How far up the screen the paragraph has come when the first word lights, from 0 at the bottom edge to 1 once it has left the top" #} {# @prop end:number | default:"0.5" | description:"How far up the screen it has come when the last word lights. 0.5 is the middle." #} {# @prop class:text | description:"Extra classes on the paragraph. Its size and weight go here." #} {% comment %} `firstof` escapes the text once, however it was passed, so each word is written out as it stands. Every word shares the paragraph's timeline and takes its turn from its number (docs/adr/0006-reveals-follow-the-scroll-position.md). {% endcomment %} {% firstof text as escaped %} {% with words=escaped.split %}

{# djlint:off #} {% for word in words %}{{ word|safe }}{% if not forloop.last %} {% endif %}{% endfor %} {# djlint:on #}

{% endwith %}