Advertisement
MarkUa

LOADER

Apr 11th, 2020
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <script src = "https://cdn.jsdelivr.net/spinjs/1.3.0/spin.min.js"></script>
  7. <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/3.1.0/superhero/bootstrap.min.css" />
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  9.  
  10. <style>
  11. body{
  12. padding-top: 50px;
  13. }
  14. #spin-area{
  15. margin-top:20px;
  16. height:500px;
  17. width:500px;
  18. border-radius: 3px;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23.  
  24. <div class="container">
  25. <button class="btn btn-default" onclick="toggleSpin();">Spin it!</button>
  26. <div id="spin-area"></div>
  27. </div>
  28.  
  29.  
  30. <script>
  31. var target = document.getElementById('spin-area');
  32. var spinner;
  33. var spinning = false;
  34.  
  35. var opts = {
  36. lines: 12, // The number of lines to draw
  37. length: 7, // The length of each line
  38. width: 5, // The line thickness
  39. radius: 50, // The radius of the inner circle
  40. color: '#000', // #rbg or #rrggbb
  41. speed: 1, // Rounds per second
  42. trail: 100, // Afterglow percentage
  43. shadow: true // Whether to render a shadow
  44. };
  45.  
  46. function toggleSpin(){
  47. spinning ? spinner.stop() : spinner = new Spinner(opts).spin(target);
  48. spinning = !spinning;
  49. }
  50. </script>
  51.  
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement