1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Separate the two reveal-on-scroll examples

Making them easier to understand and copy
This commit is contained in:
Jermolene 2018-05-23 14:17:23 +01:00
parent 05af050cbf
commit 01bdaff005
2 changed files with 33 additions and 30 deletions

View File

@ -3,51 +3,26 @@ tags: $:/tags/dynaviewExamples
caption: Reveal on Scroll
\define indicator(index)
<$reveal state="$:/state/reveal-on-scroll/example$index$" type="match" text="yes">
<$reveal state="$:/state/unreveal-on-scroll/example$index$" type="match" text="yes">
$index$
</$reveal>
\end
\define lorem-ipsum(index)
<div class="tc-dynaview-set-tiddler-when-visible" style="min-height: 75px;" data-dynaview-set-tiddler="$:/state/reveal-on-scroll/example$index$" data-dynaview-set-value="yes">
<div class="tc-dynaview-set-tiddler-when-visible" style="min-height: 75px;" data-dynaview-set-tiddler="$:/state/unreveal-on-scroll/example$index$" data-dynaview-set-value="yes">
<h1>Heading $index$</h1>
<$reveal state="$:/state/reveal-on-scroll/example$index$" type="match" text="yes">
<$reveal state="$:/state/unreveal-on-scroll/example$index$" type="match" text="yes">
(Rendered at <<now "[UTC]YYYY-0MM-0DD 0hh:0mm:0ss.XXX">>) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</$reveal>
</div>
\end
\define lorem-ipsum-unset(index)
<div class="tc-dynaview-set-tiddler-when-visible" style="min-height: 75px;" data-dynaview-set-tiddler="$:/state/reveal-on-scroll/example$index$" data-dynaview-set-value="yes" data-dynaview-unset-tiddler="$:/state/reveal-on-scroll/example$index$" data-dynaview-unset-value="no">
<h1>Heading $index$</h1>
<$reveal state="$:/state/reveal-on-scroll/example$index$" type="match" text="yes">
(Rendered at <<now "[UTC]YYYY-0MM-0DD 0hh:0mm:0ss.XXX">>) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</$reveal>
</div>
\end
<$reveal state="$:/state/dynaview-example/reveal-scroll/unset" type="nomatch" text="yes">
!!!Same example, showing elements when they scroll into view and hiding elements when they scroll out of view:<br>
<$button set="$:/state/dynaview-example/reveal-scroll/unset" setTo="yes">Change Example</$button>
</$reveal>
<$reveal state="$:/state/dynaview-example/reveal-scroll/unset" type="match" text="yes">
!!!Same example, but only showing elements when they scroll into view:<br>
<$button set="$:/state/dynaview-example/reveal-scroll/unset" setTo="no">Change Example</$button>
</$reveal>
This example renders tiddlers as they are scrolled into view.
Visible: <$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16">
<$macrocall $name="indicator" index=<<currentTiddler>>/>
</$list>
<$reveal state="$:/state/dynaview-example/reveal-scroll/unset" type="nomatch" text="yes">
<$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16">
<$macrocall $name="lorem-ipsum" index=<<currentTiddler>>/>
</$list>
</$reveal>
<$reveal state="$:/state/dynaview-example/reveal-scroll/unset" type="match" text="yes">
<$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16">
<$macrocall $name="lorem-ipsum-unset" index=<<currentTiddler>>/>
</$list>
</$reveal>
</$list>

View File

@ -0,0 +1,28 @@
title: $:/plugins/tiddlywiki/dynaview/examples/unreveal-on-scroll
tags: $:/tags/dynaviewExamples
caption: Unreveal on Scroll
\define indicator(index)
<$reveal state="$:/state/reveal-on-scroll/example$index$" type="match" text="yes">
$index$
</$reveal>
\end
\define lorem-ipsum(index)
<div class="tc-dynaview-set-tiddler-when-visible" style="min-height: 75px;" data-dynaview-set-tiddler="$:/state/reveal-on-scroll/example$index$" data-dynaview-set-value="yes" data-dynaview-unset-tiddler="$:/state/reveal-on-scroll/example$index$" data-dynaview-unset-value="no">
<h1>Heading $index$</h1>
<$reveal state="$:/state/reveal-on-scroll/example$index$" type="match" text="yes">
(Rendered at <<now "[UTC]YYYY-0MM-0DD 0hh:0mm:0ss.XXX">>) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</$reveal>
</div>
\end
This example renders tiddlers as they are scrolled into view, and hides them when they scroll out of view again.
Visible: <$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16">
<$macrocall $name="indicator" index=<<currentTiddler>>/>
</$list>
<$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16">
<$macrocall $name="lorem-ipsum" index=<<currentTiddler>>/>
</$list>