Advertisement
1xptolevitico69

Animation Onload.

Nov 11th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.13 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title></title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width">
  7. <link rel="stylesheet" type="text/css" href=".css">
  8. <script src=".js"></script>
  9. <style>
  10.  
  11. .wheel { width:200px;height:200px;border:5px solid;border-radius:50%; }
  12. .sp1 {  width:200px;border:2.5px solid;display:inline-block;
  13.         margin-top:95px;  }
  14. .sp2 {  width:200px;border:2.5px solid;display:inline-block;
  15.         transform:rotate(90deg)translate(-15px,5px);  }
  16.  
  17. </style>
  18. </head>
  19. <body>
  20.  
  21.  
  22. <div id='wheel' class='wheel'>
  23. <span class='sp1'></span>
  24. <span class='sp2'></span>
  25. </div>
  26.  
  27. <h1 id='h1'>Starting in: 0</h1>
  28.  
  29. <script>
  30. i=5;
  31. onload=()=>{
  32. x=setInterval(function(){
  33. h1.innerHTML='Starting in: '+i;
  34. i--;
  35. if(i==-1){clearInterval(x);
  36. i=10;
  37. }
  38. },1000);
  39.  
  40. setTimeout(()=>{        
  41. a=setInterval(function(){
  42. h1.innerHTML='Finishing in: '+i;
  43. i--;
  44. if(i==-1){clearInterval(a);
  45. }
  46. },1000);
  47. },5000);
  48.  
  49. setTimeout(()=>{
  50. z=setInterval(()=>{
  51. wheel.style.transform+='rotate(2deg)';
  52. setTimeout(()=>{  
  53. clearInterval(z);  
  54. },10000);
  55. },50);
  56. },6000);
  57. }
  58.  
  59. </script>
  60. </body>
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement