|
1 | 1 | <html>
|
2 | 2 | <head>
|
3 | 3 | <title></title>
|
| 4 | + <style> |
| 5 | + #hello { |
| 6 | + width: 400px; |
| 7 | + height: 400px; |
| 8 | + background: #eee; |
| 9 | + } |
| 10 | + |
| 11 | + .animated { |
| 12 | + -webkit-animation-duration: 1s; |
| 13 | + -moz-animation-duration: 1s; |
| 14 | + -o-animation-duration: 1s; |
| 15 | + animation-duration: 1s; |
| 16 | + -webkit-animation-fill-mode: both; |
| 17 | + -moz-animation-fill-mode: both; |
| 18 | + -o-animation-fill-mode: both; |
| 19 | + animation-fill-mode: both; |
| 20 | +} |
| 21 | + |
| 22 | + @-webkit-keyframes bounce { |
| 23 | + 0%, 20%, 50%, 80%, 100% {-webkit-transform: translateY(0);} |
| 24 | + 40% {-webkit-transform: translateY(-30px);} |
| 25 | + 60% {-webkit-transform: translateY(-15px);} |
| 26 | + } |
| 27 | + |
| 28 | + @-moz-keyframes bounce { |
| 29 | + 0%, 20%, 50%, 80%, 100% {-moz-transform: translateY(0);} |
| 30 | + 40% {-moz-transform: translateY(-30px);} |
| 31 | + 60% {-moz-transform: translateY(-15px);} |
| 32 | + } |
| 33 | + |
| 34 | + @-o-keyframes bounce { |
| 35 | + 0%, 20%, 50%, 80%, 100% {-o-transform: translateY(0);} |
| 36 | + 40% {-o-transform: translateY(-30px);} |
| 37 | + 60% {-o-transform: translateY(-15px);} |
| 38 | + } |
| 39 | + @keyframes bounce { |
| 40 | + 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} |
| 41 | + 40% {transform: translateY(-30px);} |
| 42 | + 60% {transform: translateY(-15px);} |
| 43 | + } |
| 44 | + |
| 45 | + .bounce { |
| 46 | + -webkit-animation-name: bounce; |
| 47 | + -moz-animation-name: bounce; |
| 48 | + -o-animation-name: bounce; |
| 49 | + animation-name: bounce; |
| 50 | + } |
| 51 | + |
| 52 | + </style> |
4 | 53 | </head>
|
5 | 54 | <body>
|
6 | 55 |
|
| 56 | +<div id='hello' class='animated'><p> hi there </p></div> |
7 | 57 | <script src='../build/build.js' type='text/javascript'></script>
|
8 | 58 | <script>
|
9 |
| - var transitionEnd = require('animate'); |
10 |
| - console.log(transitionEnd); |
| 59 | + var animate = require('animate-css'); |
| 60 | + var div = document.getElementById('hello'); |
| 61 | + animate(div, 'bounce', function(el){ |
| 62 | + console.log(el); |
| 63 | + }); |
| 64 | + |
11 | 65 | </script>
|
12 | 66 |
|
13 | 67 | </body>
|
|
0 commit comments