diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-03-12 17:08:20 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-03-12 17:08:20 +0100 |
commit | bff9bfb101763ed960cb8e5de7152da8d366f2af (patch) | |
tree | d1db61e3be4b4968dac2c1137bebba31fd006c6e /demo.html | |
parent | 5a5a5c9a6c47ae166e75cd09b950f34727f12e9f (diff) | |
download | fosdem-2021-minimalism-presentation-bff9bfb101763ed960cb8e5de7152da8d366f2af.tar fosdem-2021-minimalism-presentation-bff9bfb101763ed960cb8e5de7152da8d366f2af.tar.gz |
add support for automatically scrolling code highlights into view
Diffstat (limited to 'demo.html')
-rw-r--r-- | demo.html | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -102,7 +102,7 @@ <section data-auto-animate> <h2 data-id="code-title">With animations</h2> - <pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4|4,8-11"> + <pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4,8-11|17|22-24"> import React, { useState } from 'react'; function Example() { @@ -117,6 +117,19 @@ </div> ); } + + function SecondExample() { + const [count, setCount] = useState(0); + + return ( + <div> + <p>You clicked {count} times</p> + <button onClick={() => setCount(count + 1)}> + Click me + </button> + </div> + ); + } </code></pre> </section> |