Advertisement
MarkUa

Untitled

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