overview.html 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Targets - Overview</title>
  7. <link rel="stylesheet" href="../demo.css">
  8. <style>
  9. .code-block {
  10. background: #111;
  11. padding: 20px;
  12. border-radius: 6px;
  13. font-family: 'Roboto Mono', monospace;
  14. font-size: 13px;
  15. color: #abb2bf;
  16. position: relative;
  17. }
  18. .code-highlight {
  19. border: 1px solid #333;
  20. padding: 2px 4px;
  21. border-radius: 4px;
  22. display: inline-block;
  23. }
  24. .annotation {
  25. color: #E69F3C;
  26. font-size: 12px;
  27. margin-left: 10px;
  28. position: absolute;
  29. }
  30. .annotation::before {
  31. content: '— ';
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div class="container">
  37. <div style="font-size: 10px; font-weight: bold; letter-spacing: 1px; color: #ff4b4b; margin-bottom: 20px;">ANIMATION > TARGETS</div>
  38. <h1>Targets</h1>
  39. <p class="description">Specify the elements to which property value changes are applied.<br>
  40. Animation targets are defined in the first argument of the <code class="inline">animate()</code> function.</p>
  41. <div class="box-container" style="margin-top: 30px;">
  42. <div class="code-view active" style="background: #161616; padding: 40px;">
  43. <span class="kwd">const</span> $ <span class="punc">=</span> <span class="fun">xjs</span>;<br><br>
  44. <span class="fun">xjs</span>(<span class="str">'.square'</span>)<span class="annotation">Targets</span>.<span class="fun">animate</span>(<br>
  45. &nbsp;&nbsp;{<br>
  46. &nbsp;&nbsp;&nbsp;&nbsp;x: <span class="num">100</span>,<br>
  47. &nbsp;&nbsp;&nbsp;&nbsp;scale: <span class="num">2</span>,<br>
  48. &nbsp;&nbsp;&nbsp;&nbsp;opacity: <span class="num">.5</span>,<br>
  49. &nbsp;&nbsp;&nbsp;&nbsp;duration: <span class="num">400</span>,<br>
  50. &nbsp;&nbsp;&nbsp;&nbsp;delay: <span class="num">250</span>,<br>
  51. &nbsp;&nbsp;&nbsp;&nbsp;easing: <span class="str">'ease-out'</span>,<br>
  52. &nbsp;&nbsp;&nbsp;&nbsp;loop: <span class="num">3</span>,<br>
  53. &nbsp;&nbsp;&nbsp;&nbsp;direction: <span class="str">'alternate'</span>,<br>
  54. &nbsp;&nbsp;&nbsp;&nbsp;autoplay: <span class="kwd">false</span>,<br>
  55. &nbsp;&nbsp;&nbsp;&nbsp;<span class="fun">begin</span>: () => {},<br>
  56. &nbsp;&nbsp;&nbsp;&nbsp;<span class="fun">update</span>: () => {},<br>
  57. &nbsp;&nbsp;&nbsp;&nbsp;<span class="fun">complete</span>: () => {},<br>
  58. &nbsp;&nbsp;}<br>
  59. );
  60. </div>
  61. </div>
  62. <div style="margin-top: 40px; border-top: 1px solid #222; padding-top: 20px;">
  63. <div style="color: #666; font-size: 14px;">In this section</div>
  64. <ul style="list-style: none; padding: 0; margin-top: 15px; color: #888;">
  65. <li style="margin-bottom: 8px;">CSS Selector</li>
  66. <li style="margin-bottom: 8px;">DOM Elements</li>
  67. <li style="margin-bottom: 8px;">JavaScript Objects</li>
  68. <li style="margin-bottom: 8px;">Array of targets</li>
  69. </ul>
  70. </div>
  71. </div>
  72. </body>
  73. </html>