Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

42 строки
717 B

  1. <style>
  2. body {
  3. padding: 50px;
  4. }
  5. button {
  6. padding: 15px 25px;
  7. }
  8. </style>
  9. <button>Button</button>
  10. <script src="../build/build.js"></script>
  11. <script>
  12. var Tween = require('tween');
  13. var raf = require('component-raf');
  14. var button = document.querySelector('button');
  15. var tween = Tween({ rotate: 0, opacity: 0 })
  16. .ease('out-bounce')
  17. .to({ rotate: 360, opacity: 1 })
  18. .duration(800);
  19. tween.update(function(o){
  20. button.style.opacity = o.opacity;
  21. button.style.webkitTransform = 'rotate(' + (o.rotate | 0) + 'deg)';
  22. });
  23. tween.on('end', function(){
  24. animate = function(){};
  25. });
  26. function animate() {
  27. raf(animate);
  28. tween.update();
  29. }
  30. animate();
  31. </script>