|
13 | 13 | <meta name="twitter:image" content="http://daniel-lundin.github.io/snabbt.js/assets/snabbt-sharing.png">
|
14 | 14 |
|
15 | 15 | <meta property="og:url" content="http://daniel-lundin.github.io/snabbt.js">
|
16 |
| - <meta property="og:title" content="When Great Minds Don’t Think Alike" /> |
| 16 | + <meta property="og:title" content="snabbt.js" /> |
17 | 17 | <meta property="og:description" content="Minimalistic animation library in javascript. Fast, lightweight and easy-to-use." />
|
18 | 18 | <meta property="og:image" content="http://daniel-lundin.github.io/snabbt.js/assets/snabbt-sharing.png">
|
19 | 19 |
|
@@ -68,16 +68,17 @@ <h3><i class="fa fa-rocket"></i>Fast</h3>
|
68 | 68 | </div>
|
69 | 69 | <div class="four columns">
|
70 | 70 | <h3><i class="fa fa-paper-plane"></i>Light</h3>
|
71 |
| - <p> 4kb minified and gzipped</p> |
| 71 | + <p> ~4kb minified and gzipped</p> |
72 | 72 | </div>
|
73 | 73 | <div class="four columns">
|
74 | 74 | <h3><i class="fa fa-user"></i>Simple</h3>
|
75 | 75 | <p>Write less, animate more</p>
|
76 | 76 | </div>
|
77 | 77 | </div>
|
| 78 | + <p class="shell-command"><code>npm install snabbt.js</code></p> |
| 79 | + <p class="shell-command"><code>bower install snabbt.js</code></p> |
78 | 80 | <a href="https://github.com/daniel-lundin/snabbt.js/releases" class="button button-primary">Download</a>
|
79 | 81 | </div>
|
80 |
| - <p class="warning"><span class="label">Warning:</span> snabbt.js is under development, expect some changes to the API before 1.0.</p> |
81 | 82 | <div id="navbar" class="nav">
|
82 | 83 | <ul>
|
83 | 84 | <li><a href="#intro">Introduction</a></li>
|
@@ -244,6 +245,15 @@ <h3>Spring easing</h3>
|
244 | 245 | });</code></pre>
|
245 | 246 | <button id="spring-example" class="button-primary extra-top-margin">Run example</button>
|
246 | 247 | </section>
|
| 248 | + <!--<section id="event-hooks"> |
| 249 | + <h3>Life cycle events</h3> |
| 250 | + <p>Snabbt provides a number of events which you can to use for get information on the current state of the animation. Adding callbacks to </p> |
| 251 | + <ul> |
| 252 | + <li><strong>start</strong> - Will be called just before the animation starts.</li> |
| 253 | + <li><strong>update</strong> - Will be called for every update of the animation. One parameter is provided which is the current progress between 0 and 1.</li> |
| 254 | + <li><strong>complete</strong> - Will be called for when the animation is completed update of the animation. </li> |
| 255 | + </ul> |
| 256 | + </section>--> |
247 | 257 | <section id="advanced">
|
248 | 258 | <h2>Advanced concepts</h2>
|
249 | 259 | <p>This section describes some of the more advanced usages.</p>
|
@@ -404,15 +414,15 @@ <h2>Matrix API</h2>
|
404 | 414 | <pre><code class="javascript">matrix.translate(100, 0, 0).rotateX(Math.PI);</code></pre>
|
405 | 415 |
|
406 | 416 | <h3 class="extra-top-margin">Freeform transforms</h3>
|
407 |
| - <p>The matrix operations can be used outside of snabbt's animation engine. This could be useful for interactive animations. </p> |
| 417 | + <p>The matrix operations can be used outside of snabbt's animation engine. This could be useful for interactive animations. Check out the <a href="periodic.html">periodic</a> demo for and example of this.</p> |
408 | 418 | <pre><code class="javascript">var matrix = snabbt.createMatrix();
|
409 | 419 | matrix.translate(100, 0, 0);
|
410 | 420 | snabbt.setElementTransform(element, matrix);</code></pre>
|
411 | 421 | </section>
|
412 | 422 |
|
413 | 423 | <section id="api">
|
414 | 424 | <h3>Animation configuration</h3>
|
415 |
| - <p>The following parameters can on the configuration object:</p> |
| 425 | + <p>The following parameters can be used in the configuration object:</p> |
416 | 426 | <table class="hide-mobile">
|
417 | 427 | <thead>
|
418 | 428 | <tr>
|
@@ -483,6 +493,18 @@ <h3>Animation configuration</h3>
|
483 | 493 | <td>0</td>
|
484 | 494 | <td>Number of times to repeat the animation</td>
|
485 | 495 | </tr>
|
| 496 | + <tr> |
| 497 | + <td>start(index, total)</td> |
| 498 | + <td>function</td> |
| 499 | + <td>undefined</td> |
| 500 | + <td>Function to be called just before the animation starts. If multiple elements are animated, this function will be called once for every element with two parameters, index of current element and total elements in the animated collection.</td> |
| 501 | + </tr> |
| 502 | + <tr> |
| 503 | + <td>update(i, index, total)</td> |
| 504 | + <td>function</td> |
| 505 | + <td>undefined</td> |
| 506 | + <td>Function to be called on every progress step of the animation. The first parameter is a value between 0 and 1 and indicates the current progress of the animation. If multiple elements are animated, this function will be called for every progress step for every element in the collection. <em>index</em> indicates the current element and <em>total</em> corresponds to the total number of elements in the colletion.</td> |
| 507 | + </tr> |
486 | 508 | <tr>
|
487 | 509 | <td>complete(index, total)</td>
|
488 | 510 | <td>function</td>
|
|
0 commit comments