aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2020-02-28 16:13:28 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2020-02-28 16:13:34 +0100
commite2a2c2c022c7b3676afb243782be36d15e251854 (patch)
treebf9b1e21a7f00e5cc7ef1e5fbd4a7df96e97e2b4 /test
parent345ec01f191675ae06af0eaec62fe3d7068a361c (diff)
downloadfosdem-2021-minimalism-presentation-e2a2c2c022c7b3676afb243782be36d15e251854.tar
fosdem-2021-minimalism-presentation-e2a2c2c022c7b3676afb243782be36d15e251854.tar.gz
refactored and improved auto-animate matcher, supports line-by-line code animations
Diffstat (limited to 'test')
-rw-r--r--test/examples/auto-animate.html35
1 files changed, 33 insertions, 2 deletions
diff --git a/test/examples/auto-animate.html b/test/examples/auto-animate.html
index c81b949..c353748 100644
--- a/test/examples/auto-animate.html
+++ b/test/examples/auto-animate.html
@@ -23,7 +23,7 @@
<h3>Auto-Animate Example</h3>
<p>This will fade out</p>
<img src="assets/image1.png" style="height: 100px;">
- <pre><code class="hljs" data-trim>
+ <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
function Example() {
const [count, setCount] = useState(0);
}
@@ -34,8 +34,9 @@
<p style="opacity: 0.2; margin-top: 200px;">This will fade out</p>
<p>This element is unmatched</p>
<img src="assets/image1.png" style="height: 100px;">
- <pre><code class="hljs" data-trim>
+ <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
function Example() {
+ New line!
const [count, setCount] = useState(0);
}
</code></pre>
@@ -48,6 +49,36 @@
<p data-id="text-props" style="background: #555; line-height: 3em; letter-spacing: 0.2em;">Line Height & Letter Spacing</p>
</section>
+ <section data-auto-animate>
+ <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
+ import React, { useState } from 'react';
+
+ function Example() {
+ const [count, setCount] = useState(0);
+
+ return (
+ ...
+ );
+ }
+ </code></pre>
+ </section>
+ <section data-auto-animate>
+ <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
+ function Example() {
+ const [count, setCount] = useState(0);
+
+ return (
+ &lt;div&gt;
+ &lt;p&gt;You clicked {count} times&lt;/p&gt;
+ &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
+ Click me
+ &lt;/button&gt;
+ &lt;/div&gt;
+ );
+ }
+ </code></pre>
+ </section>
+
<section>
<section data-auto-animate>
<h3>Swapping list items</h3>