auto-animate.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>reveal.js - Auto Animate</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  7. <link rel="stylesheet" href="../dist/reveal.css">
  8. <link rel="stylesheet" href="../dist/theme/black.css" id="theme">
  9. <link rel="stylesheet" href="../plugin/highlight/monokai.css">
  10. </head>
  11. <body>
  12. <div class="reveal">
  13. <div class="slides">
  14. <section data-auto-animate data-auto-animate-unmatched="fade">
  15. <h3>Auto-Animate Example</h3>
  16. <p>This will fade out</p>
  17. <img src="assets/image1.png" style="height: 100px;">
  18. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  19. function Example() {
  20. const [count, setCount] = useState(0);
  21. }
  22. </code></pre>
  23. </section>
  24. <section data-auto-animate data-auto-animate-unmatched="fade">
  25. <h3>Auto-Animate Example</h3>
  26. <p style="opacity: 0.2; margin-top: 100px;">This will fade out</p>
  27. <p>This element is unmatched</p>
  28. <img src="assets/image1.png" style="height: 150px;">
  29. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  30. function Example() {
  31. New line!
  32. const [count, setCount] = useState(0);
  33. }
  34. </code></pre>
  35. </section>
  36. <section data-auto-animate>
  37. <p data-id="text-props" style="background: #555; line-height: 1em; letter-spacing: 0em;">Line Height & Letter Spacing</p>
  38. </section>
  39. <section data-auto-animate>
  40. <p data-id="text-props" style="background: #555; line-height: 3em; letter-spacing: 0.2em;">Line Height & Letter Spacing</p>
  41. </section>
  42. <section>
  43. <section data-auto-animate>
  44. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  45. import React, { useState } from 'react';
  46. function Example() {
  47. const [count, setCount] = useState(0);
  48. return (
  49. ...
  50. );
  51. }
  52. </code></pre>
  53. </section>
  54. <section data-auto-animate>
  55. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  56. function Example() {
  57. const [count, setCount] = useState(0);
  58. return (
  59. &lt;div&gt;
  60. &lt;p&gt;You clicked {count} times&lt;/p&gt;
  61. &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
  62. Click me
  63. &lt;/button&gt;
  64. &lt;/div&gt;
  65. );
  66. }
  67. </code></pre>
  68. </section>
  69. <section data-auto-animate>
  70. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  71. function Example() {
  72. // A comment!
  73. const [count, setCount] = useState(0);
  74. return (
  75. &lt;div&gt;
  76. &lt;p&gt;You clicked {count} times&lt;/p&gt;
  77. &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
  78. Click me
  79. &lt;/button&gt;
  80. &lt;/div&gt;
  81. );
  82. }
  83. </code></pre>
  84. </section>
  85. </section>
  86. <section>
  87. <section data-auto-animate>
  88. <h3>Swapping list items</h3>
  89. <ul>
  90. <li>One</li>
  91. <li>Two</li>
  92. <li>Three</li>
  93. </ul>
  94. </section>
  95. <section data-auto-animate>
  96. <h3>Swapping list items</h3>
  97. <ul>
  98. <li>Two</li>
  99. <li>One</li>
  100. <li>Three</li>
  101. </ul>
  102. </section>
  103. <section data-auto-animate>
  104. <h3>Swapping list items</h3>
  105. <ul>
  106. <li>Two</li>
  107. <li>Three</li>
  108. <li>One</li>
  109. </ul>
  110. </section>
  111. </section>
  112. <section data-auto-animate style="height: 600px">
  113. <h3 style="opacity: 0.3; font-size: 18px;">SLIDE 1</h2>
  114. <h2 data-id="title" style="margin-top: 260px;">Animate Anything</h2>
  115. <div data-id="1" style="background: white; position: absolute; top: 150px; left: 16%; width: 60px; height: 60px;"></div>
  116. <div data-id="2" style="background: white; position: absolute; top: 150px; left: 36%; width: 60px; height: 60px;"></div>
  117. <div data-id="3" style="background: white; position: absolute; top: 150px; left: 56%; width: 60px; height: 60px;"></div>
  118. <div data-id="4" style="background: white; position: absolute; top: 150px; left: 76%; width: 60px; height: 60px;"></div>
  119. </section>
  120. <section data-auto-animate style="height: 600px">
  121. <h3 style="opacity: 0.3; font-size: 18px;">SLIDE 2</h2>
  122. <h2 data-id="title" style="margin-top: 500px">With Auto Animate</h2>
  123. <div data-id="1" style="background: cyan; position: absolute; bottom: 190px; left: 16%; width: 60px; height: 60px;"></div>
  124. <div data-id="2" style="background: magenta; position: absolute; bottom: 190px; left: 36%; width: 60px; height: 160px;"></div>
  125. <div data-id="3" style="background: yellow; position: absolute; bottom: 190px; left: 56%; width: 60px; height: 260px;"></div>
  126. <div data-id="4" style="background: red; position: absolute; bottom: 190px; left: 76%; width: 60px; height: 360px;"></div>
  127. </section>
  128. <section data-auto-animate style="height: 600px">
  129. <h3 style="opacity: 0.3; font-size: 18px;">SLIDE 3</h2>
  130. <h2 data-id="title" style="margin-top: 500px; opacity: 0;">With Auto Animate</h2>
  131. <div data-id="1" style="background: cyan; position: absolute; top: 50%; left: 50%; width: 400px; height: 400px; margin: -200px 0 0 -200px; border-radius: 400px;"></div>
  132. <div data-id="2" style="background: magenta; position: absolute; top: 50%; left: 50%; width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 400px;"></div>
  133. <div data-id="3" style="background: yellow; position: absolute; top: 50%; left: 50%; width: 200px; height: 200px; margin: -100px 0 0 -100px; border-radius: 400px;"></div>
  134. <div data-id="4" style="background: red; position: absolute; top: 50%; left: 50%; width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 400px;"></div>
  135. </section>
  136. <section data-auto-animate style="height: 600px">
  137. <h3 style="opacity: 0.3; font-size: 18px;">SLIDE 3</h2>
  138. <h2 data-id="title" style="margin-top: 500px; opacity: 0;">With Auto Animate</h2>
  139. <div data-id="1" style="background: red; position: absolute; top: 250px; left: 16%; width: 60px; height: 60px;"></div>
  140. <div data-id="2" style="background: yellow; position: absolute; top: 250px; left: 36%; width: 60px; height: 60px;"></div>
  141. <div data-id="3" style="background: magenta; position: absolute; top: 250px; left: 56%; width: 60px; height: 60px;"></div>
  142. <div data-id="4" style="background: cyan; position: absolute; top: 250px; left: 76%; width: 60px; height: 60px;"></div>
  143. </section>
  144. </div>
  145. </div>
  146. <script src="../dist/reveal.js"></script>
  147. <script src="../plugin/highlight/highlight.js"></script>
  148. <script>
  149. Reveal.initialize({
  150. center: true,
  151. hash: true,
  152. plugins: [ RevealHighlight ]
  153. });
  154. </script>
  155. </body>
  156. </html>