Advertisement
izuemis

munequita music player

Feb 19th, 2023
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. <div id='musicplayer'>
  2. <div id='musicpixel'>
  3. <img src='https://media.discordapp.net/attachments/1011654476983177419/1076918588788715620/3a8d8f51.png'>
  4. <div class='overlay'>
  5. <div class='playpause'><i class="fas fa-play"></i></div>
  6. </div>
  7. </div>
  8. <div id='musictitle'>
  9. <span class='marquee'>this is draggable on desktop . . .</span>
  10. </div>
  11. </div>
  12.  
  13. <audio id='musicsrc' loop src='https://cdn.discordapp.com/attachments/1011654612551487558/1020593805671542815/Knights_the_Phantom_Thief.mp3'></audio>
  14.  
  15. <style>
  16.  
  17. #musicplayer{
  18. display:grid;
  19. grid-template-columns:20px auto;
  20. align-items:center;
  21. width: 90px;
  22. font-family:handy;
  23. font-size:11px;
  24. color:#8ba9da;
  25. line-height:140%;
  26. border: 1px solid #8ba9da;
  27. border-radius: 3px;
  28. background:white;
  29. }
  30.  
  31. #musictitle{
  32. font-family:handy;
  33. overflow: hidden;
  34. white-space: nowrap;
  35. display:inline-block;
  36. width: calc(100% - 10px - 1px);
  37. margin-left: calc(10px + 1px);
  38. }
  39.  
  40. #musicpixel{
  41. width:120%;
  42. paddin-top:0px;
  43. position:relative;
  44. min-height: 15px;
  45. background:white;
  46. border-right: 1px solid #8ba9da;
  47. }
  48.  
  49. .overlay {
  50. opacity:0;
  51. position:absolute;
  52. top:0;
  53. left:0;
  54. text-align:center;
  55. width:100%;
  56. height:100%;
  57. transition:0.3s ease;
  58. background: white;
  59. }
  60.  
  61. #musicplayer:hover .overlay {
  62. opacity: 1;
  63. transition:0.3s ease;
  64. }
  65.  
  66. .playpause{
  67. position: absolute;
  68. top: 50%;
  69. left: 50%;
  70. transform: translate(-40%, -50%);
  71. }
  72.  
  73. .playpause:hover{
  74. cursor:help;
  75. }
  76.  
  77. #musicpixel img{
  78. display:block;
  79. }
  80.  
  81. .marquee{
  82. display: inline-block;
  83. padding-left: 100%;
  84. animation: marquee 5s linear infinite;
  85. }
  86.  
  87. @keyframes marquee{
  88. 0% {
  89. transform: translate(0, 0);
  90. }
  91. 100% {
  92. transform: translate(-100%, 0);
  93. }
  94. }
  95.  
  96. /* end of music player */
  97.  
  98. </style>
  99.  
  100. <script>
  101. document.querySelector('.playpause').addEventListener('click', playpause);
  102.  
  103. function playpause(){
  104. if(document.querySelector('.playpause').innerHTML == '<i class="fas fa-play"></i>'){
  105. document.querySelector('#musicsrc').play();
  106. document.querySelector('.playpause').innerHTML = '<i class="fas fa-pause"></i>';
  107. } else{
  108. document.querySelector('#musicsrc').pause();
  109. document.querySelector('.playpause').innerHTML = '<i class="fas fa-play"></i>';
  110. }
  111.  
  112. }
  113. </script>
  114.  
  115. <link rel="stylesheet" href="//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css">
  116. <link rel="stylesheet" href="/resources/demos/style.css">
  117. <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
  118. <script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"></script>
  119. <script>
  120. $( function() {
  121. $( "#musicplayer" ).draggable();
  122. } );
  123. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement