Advertisement
ruesha

headphone emoji floating music player

Jul 16th, 2024 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style>
  4. div.song {
  5. position: absolute;
  6. bottom: 60px;
  7. right: 28px;
  8. width: auto;
  9. animation-name: floating;
  10. animation-duration: 3s;
  11. animation-iteration-count: infinite;
  12. animation-timing-function: ease-in-out;
  13. z-index: 2;
  14. }
  15.  
  16. @keyframes floating {
  17. 0% { transform: translate(0, 0px); }
  18. 50% { transform: translate(0, 3px); }
  19. 100% { transform: translate(0, -0px); }
  20. }
  21.  
  22. </style>
  23. </head>
  24. <body>
  25.  
  26. <div class="song">
  27. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
  28.  
  29. <center>
  30. <audio id="audio" src="https://dl.dropbox.com/s/40ldfrh5q2wod30/Stardew%20Valley%20OST%20-%20Fall%20%28The%20Smell%20of%20Mushroom%29.mp3"></audio>
  31. <img id="img" src="https://dl.dropbox.com/scl/fi/vgz5mcbpxpcor4o08i87h/a5dfd1f7342e92e2ae99c7eba67a18.webp?rlkey=rrk0r1kly4hp5dhxe5dz022fg&st=neg7coir&dl=0" width=50px height=auto class="animate__animated">
  32. </center>
  33.  
  34. <script>
  35. document.getElementById("img").addEventListener("click", function(){
  36. document.getElementById("audio").play();
  37. });
  38. </script>
  39. </div>
  40.  
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement