auto-animate.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>reveal.js - Auto Animate</title>
  6. <meta
  7. name="viewport"
  8. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
  9. />
  10. <link rel="stylesheet" href="../dist/reveal.css" />
  11. <link rel="stylesheet" href="../dist/theme/black.css" id="theme" />
  12. <link rel="stylesheet" href="../dist/plugin/highlight/monokai.css" />
  13. </head>
  14. <body>
  15. <div class="reveal">
  16. <div class="slides">
  17. <section data-auto-animate data-auto-animate-unmatched="fade">
  18. <h3>Auto-Animate Example</h3>
  19. <p>This will fade out</p>
  20. <img src="assets/image1.png" style="height: 100px" />
  21. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  22. function Example() {
  23. const [count, setCount] = useState(0);
  24. }
  25. </code></pre>
  26. </section>
  27. <section data-auto-animate data-auto-animate-unmatched="fade">
  28. <h3>Auto-Animate Example</h3>
  29. <p style="opacity: 0.2; margin-top: 100px">This will fade out</p>
  30. <p>This element is unmatched</p>
  31. <img src="assets/image1.png" style="height: 150px" />
  32. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  33. function Example() {
  34. New line!
  35. const [count, setCount] = useState(0);
  36. }
  37. </code></pre>
  38. </section>
  39. <section data-auto-animate>
  40. <p data-id="text-props" style="background: #555; line-height: 1em; letter-spacing: 0em">
  41. Line Height & Letter Spacing
  42. </p>
  43. </section>
  44. <section data-auto-animate>
  45. <p data-id="text-props" style="background: #555; line-height: 3em; letter-spacing: 0.2em">
  46. Line Height & Letter Spacing
  47. </p>
  48. </section>
  49. <section>
  50. <section data-auto-animate>
  51. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  52. import React, { useState } from 'react';
  53. function Example() {
  54. const [count, setCount] = useState(0);
  55. return (
  56. ...
  57. );
  58. }
  59. </code></pre>
  60. </section>
  61. <section data-auto-animate>
  62. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  63. function Example() {
  64. const [count, setCount] = useState(0);
  65. return (
  66. &lt;div&gt;
  67. &lt;p&gt;You clicked {count} times&lt;/p&gt;
  68. &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
  69. Click me
  70. &lt;/button&gt;
  71. &lt;/div&gt;
  72. );
  73. }
  74. </code></pre>
  75. </section>
  76. <section data-auto-animate>
  77. <pre data-id="code"><code data-line-numbers class="hljs" data-trim>
  78. function Example() {
  79. // A comment!
  80. const [count, setCount] = useState(0);
  81. return (
  82. &lt;div&gt;
  83. &lt;p&gt;You clicked {count} times&lt;/p&gt;
  84. &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
  85. Click me
  86. &lt;/button&gt;
  87. &lt;/div&gt;
  88. );
  89. }
  90. </code></pre>
  91. </section>
  92. </section>
  93. <section>
  94. <section data-auto-animate>
  95. <h3>Swapping list items</h3>
  96. <ul>
  97. <li>One</li>
  98. <li>Two</li>
  99. <li>Three</li>
  100. </ul>
  101. </section>
  102. <section data-auto-animate>
  103. <h3>Swapping list items</h3>
  104. <ul>
  105. <li>Two</li>
  106. <li>One</li>
  107. <li>Three</li>
  108. </ul>
  109. </section>
  110. <section data-auto-animate>
  111. <h3>Swapping list items</h3>
  112. <ul>
  113. <li>Two</li>
  114. <li>Three</li>
  115. <li>One</li>
  116. </ul>
  117. </section>
  118. </section>
  119. <section data-auto-animate style="height: 600px">
  120. <h3 style="opacity: 0.3; font-size: 18px">SLIDE 1</h3>
  121. <h2 data-id="title" style="margin-top: 260px">Animate Anything</h2>
  122. <div
  123. data-id="1"
  124. style="
  125. background: white;
  126. position: absolute;
  127. top: 150px;
  128. left: 16%;
  129. width: 60px;
  130. height: 60px;
  131. "
  132. ></div>
  133. <div
  134. data-id="2"
  135. style="
  136. background: white;
  137. position: absolute;
  138. top: 150px;
  139. left: 36%;
  140. width: 60px;
  141. height: 60px;
  142. "
  143. ></div>
  144. <div
  145. data-id="3"
  146. style="
  147. background: white;
  148. position: absolute;
  149. top: 150px;
  150. left: 56%;
  151. width: 60px;
  152. height: 60px;
  153. "
  154. ></div>
  155. <div
  156. data-id="4"
  157. style="
  158. background: white;
  159. position: absolute;
  160. top: 150px;
  161. left: 76%;
  162. width: 60px;
  163. height: 60px;
  164. "
  165. ></div>
  166. </section>
  167. <section data-auto-animate style="height: 600px">
  168. <h3 style="opacity: 0.3; font-size: 18px">SLIDE 2</h3>
  169. <h2 data-id="title" style="margin-top: 500px">With Auto Animate</h2>
  170. <div
  171. data-id="1"
  172. style="
  173. background: cyan;
  174. position: absolute;
  175. bottom: 190px;
  176. left: 16%;
  177. width: 60px;
  178. height: 60px;
  179. "
  180. ></div>
  181. <div
  182. data-id="2"
  183. style="
  184. background: magenta;
  185. position: absolute;
  186. bottom: 190px;
  187. left: 36%;
  188. width: 60px;
  189. height: 160px;
  190. "
  191. ></div>
  192. <div
  193. data-id="3"
  194. style="
  195. background: yellow;
  196. position: absolute;
  197. bottom: 190px;
  198. left: 56%;
  199. width: 60px;
  200. height: 260px;
  201. "
  202. ></div>
  203. <div
  204. data-id="4"
  205. style="
  206. background: red;
  207. position: absolute;
  208. bottom: 190px;
  209. left: 76%;
  210. width: 60px;
  211. height: 360px;
  212. "
  213. ></div>
  214. </section>
  215. <section data-auto-animate style="height: 600px">
  216. <h3 style="opacity: 0.3; font-size: 18px">SLIDE 3</h3>
  217. <h2 data-id="title" style="margin-top: 500px; opacity: 0">With Auto Animate</h2>
  218. <div
  219. data-id="1"
  220. style="
  221. background: cyan;
  222. position: absolute;
  223. top: 50%;
  224. left: 50%;
  225. width: 400px;
  226. height: 400px;
  227. margin: -200px 0 0 -200px;
  228. border-radius: 400px;
  229. "
  230. ></div>
  231. <div
  232. data-id="2"
  233. style="
  234. background: magenta;
  235. position: absolute;
  236. top: 50%;
  237. left: 50%;
  238. width: 300px;
  239. height: 300px;
  240. margin: -150px 0 0 -150px;
  241. border-radius: 400px;
  242. "
  243. ></div>
  244. <div
  245. data-id="3"
  246. style="
  247. background: yellow;
  248. position: absolute;
  249. top: 50%;
  250. left: 50%;
  251. width: 200px;
  252. height: 200px;
  253. margin: -100px 0 0 -100px;
  254. border-radius: 400px;
  255. "
  256. ></div>
  257. <div
  258. data-id="4"
  259. style="
  260. background: red;
  261. position: absolute;
  262. top: 50%;
  263. left: 50%;
  264. width: 100px;
  265. height: 100px;
  266. margin: -50px 0 0 -50px;
  267. border-radius: 400px;
  268. "
  269. ></div>
  270. </section>
  271. <section data-auto-animate style="height: 600px">
  272. <h3 style="opacity: 0.3; font-size: 18px">SLIDE 3</h3>
  273. <h2 data-id="title" style="margin-top: 500px; opacity: 0">With Auto Animate</h2>
  274. <div
  275. data-id="1"
  276. style="
  277. background: red;
  278. position: absolute;
  279. top: 250px;
  280. left: 16%;
  281. width: 60px;
  282. height: 60px;
  283. "
  284. ></div>
  285. <div
  286. data-id="2"
  287. style="
  288. background: yellow;
  289. position: absolute;
  290. top: 250px;
  291. left: 36%;
  292. width: 60px;
  293. height: 60px;
  294. "
  295. ></div>
  296. <div
  297. data-id="3"
  298. style="
  299. background: magenta;
  300. position: absolute;
  301. top: 250px;
  302. left: 56%;
  303. width: 60px;
  304. height: 60px;
  305. "
  306. ></div>
  307. <div
  308. data-id="4"
  309. style="
  310. background: cyan;
  311. position: absolute;
  312. top: 250px;
  313. left: 76%;
  314. width: 60px;
  315. height: 60px;
  316. "
  317. ></div>
  318. </section>
  319. <section data-auto-animate data-auto-animate-id="a">
  320. <h2>data-auto-animate-id="a"</h2>
  321. <h3>A1</h3>
  322. </section>
  323. <section data-auto-animate data-auto-animate-id="a">
  324. <h2>data-auto-animate-id="a"</h2>
  325. <h3>A1</h3>
  326. <h3>A2</h3>
  327. </section>
  328. <section data-auto-animate data-auto-animate-id="b">
  329. <h2>data-auto-animate-id="b"</h2>
  330. <h3>B1</h3>
  331. </section>
  332. <section data-auto-animate data-auto-animate-id="b">
  333. <h2>data-auto-animate-id="b"</h2>
  334. <h3>B1</h3>
  335. <h3>B2</h3>
  336. </section>
  337. <section>
  338. <section id="stacked-slide-1" data-auto-animate>
  339. <a href="#/stacked-slide-1">Slide 1</a><br />
  340. <a href="#/stacked-slide-2">Slide 2</a><br />
  341. <a href="#/stacked-slide-3">Slide 3</a><br />
  342. <a href="#/stacked-slide-4">Slide 4</a><br />
  343. <div
  344. data-id="anim"
  345. style="
  346. background: indigo;
  347. padding: 8px;
  348. width: 50px;
  349. height: 50px;
  350. position: absolute;
  351. left: 0px;
  352. "
  353. >
  354. A
  355. </div>
  356. </section>
  357. <section id="stacked-slide-2" data-auto-animate>
  358. <a href="#/stacked-slide-1">Slide 1</a><br />
  359. <a href="#/stacked-slide-2">Slide 2</a><br />
  360. <a href="#/stacked-slide-3">Slide 3</a><br />
  361. <a href="#/stacked-slide-4">Slide 4</a><br />
  362. <div
  363. data-id="anim"
  364. style="
  365. background: indigo;
  366. padding: 8px;
  367. width: 50px;
  368. height: 50px;
  369. position: absolute;
  370. left: 25%;
  371. "
  372. >
  373. A
  374. </div>
  375. </section>
  376. <section id="stacked-slide-3" data-auto-animate>
  377. <a href="#/stacked-slide-1">Slide 1</a><br />
  378. <a href="#/stacked-slide-2">Slide 2</a><br />
  379. <a href="#/stacked-slide-3">Slide 3</a><br />
  380. <a href="#/stacked-slide-4">Slide 4</a><br />
  381. <div
  382. data-id="anim"
  383. style="
  384. background: indigo;
  385. padding: 8px;
  386. width: 50px;
  387. height: 50px;
  388. position: absolute;
  389. left: 50%;
  390. "
  391. >
  392. A
  393. </div>
  394. </section>
  395. <section id="stacked-slide-4" data-auto-animate>
  396. <a href="#/stacked-slide-1">Slide 1</a><br />
  397. <a href="#/stacked-slide-2">Slide 2</a><br />
  398. <a href="#/stacked-slide-3">Slide 3</a><br />
  399. <a href="#/stacked-slide-4">Slide 4</a><br />
  400. <div
  401. data-id="anim"
  402. style="
  403. background: indigo;
  404. padding: 8px;
  405. width: 50px;
  406. height: 50px;
  407. position: absolute;
  408. left: 75%;
  409. "
  410. >
  411. A
  412. </div>
  413. </section>
  414. </section>
  415. </div>
  416. </div>
  417. <script src="../dist/reveal.js"></script>
  418. <script src="../dist/plugin/highlight.js"></script>
  419. <script>
  420. Reveal.initialize({
  421. center: true,
  422. hash: true,
  423. plugins: [RevealHighlight],
  424. });
  425. </script>
  426. </body>
  427. </html>