Advertisement
peachygirl

spin music icon player

Jan 7th, 2022
2,719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <head>
  2. <script src="https://kit.fontawesome.com/8119dfca45.js" crossorigin="anonymous"></script>
  3. </head>
  4.  
  5. <style>
  6.  
  7. #music-player {
  8. display: flex;
  9. align-items: center;
  10. justify-content: center;
  11. }
  12. #music-player {
  13. height: 1em;
  14. width: 1em;
  15. font-size: 1.5em;
  16. padding: 0.125em;
  17. background: #C4D4FD;
  18. border-radius: 50%;
  19. background: -webkit-linear-gradient(-90deg, #fff 30%, #E8CDFF 70%, #C7AFC7 95%);
  20. -webkit-background-clip: text;
  21. -webkit-text-fill-color: transparent;
  22. -webkit-filter: drop-shadow(0px 0px 1.5px #000);
  23. -webkit-animation: spin 2s linear infinite;
  24. -webkit-animation:spin 4s linear infinite;
  25. -moz-animation:spin 4s linear infinite;
  26. animation:spin 4s linear infinite;
  27. }
  28. @-moz-keyframes spin {
  29. 100% { -moz-transform: rotate(360deg);}
  30. }
  31. @-webkit-keyframes spin {
  32. 100% { -webkit-transform: rotate(360deg); }
  33. }
  34. @keyframes spin {
  35. 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); }
  36. }
  37. #music-player:hover {
  38. -webkit-animation: pop 0.3s ease;
  39. }
  40. </style>
  41.  
  42. <div id="music-player"><i class="fas fa-music" style="font-size: .75em;"></i></div>
  43.  
  44. <audio id="audio" src="https://drive.google.com/uc?export=download&id=1w_GUyvPEEwIvmggJi1qSpvrR6W80ISJg"></audio>
  45.  
  46. <script>
  47. document.getElementById("music-player").onclick = function() {
  48. var audio = document.getElementById("audio");
  49. if (audio.paused) audio.play();
  50. else audio.pause();
  51. };
  52. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement