kf.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Lungo Flexbox - SDK</title>
  6. <meta name="description" content="">
  7. <meta name="author" content="Javier Jiménez Villar (@soyjavi)">
  8. <meta name="HandheldFriendly" content="True">
  9. <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  10. <meta name="apple-mobile-web-app-capable" content="yes">
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  12. <meta name="format-detection" content="telephone=no">
  13. <meta http-equiv="cleartype" content="on">
  14. <style>
  15. div {
  16. width: 200px;
  17. height: 200px;
  18. background: red;
  19. position: absolute;
  20. /*-webkit-transform: translateX(100px);*/
  21. }
  22. body {
  23. -webkit-perspective: 800px;
  24. -webkit-transform-style: preserve-3d;
  25. }
  26. .moveme {
  27. -webkit-animation-name: kf;
  28. -webkit-animation-duration: 5s;
  29. -webkit-animation-timing-function: linear;
  30. -webkit-animation-iteration-count:1 ;
  31. }
  32. @-webkit-keyframes kf {
  33. from {
  34. -webkit-transform: translateX(100px) rotateX(100deg);
  35. }
  36. to {
  37. -webkit-transform: translateX(0px) rotateX(0deg);
  38. }
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div id="el" ></div>
  44. <script>
  45. var el = document.getElementById("el");
  46. el.className = "moveme";
  47. var animEvents = ["animationend", "webkitAnimationEnd", "oanimationend", "MSAnimationEnd"];
  48. document.addEventListener(animEvents[1], function() {
  49. alert("End!");
  50. });
  51. </script>
  52. </body>
  53. </html>