Advertisement
GIFCITY

ramdons player

Jan 15th, 2024
1,504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. <head>
  2. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.14.0/css/all.css" integrity="sha384-HzLeBuhoNPvSl5KYnjx0BT+WB0QEEqLprO+NBkkk5gbc67FTaL7XIGa2w1L0Xbgc" crossorigin="anonymous">
  3. </head>
  4.  
  5. <style>
  6. #musicplayer{
  7. display:grid;
  8. grid-template-columns:20px auto;
  9. align-items:center;
  10. width: 200px;
  11.  
  12. font-size:20px;
  13. line-height:140%;
  14.  
  15. background:white;
  16.  
  17. border: 1px solid black;
  18. }
  19.  
  20. #musictitle{
  21. overflow: hidden;
  22. white-space: nowrap;
  23. display:inline-block;
  24. width: calc(100% - 10px - 1px);
  25. margin-left: calc(10px + 1px);
  26. }
  27.  
  28. #musicpixel{
  29. width:100%;
  30. padding:5px;
  31. position:relative;
  32.  
  33. min-height: 20px;
  34.  
  35. background:white;
  36.  
  37. border-right: 1px solid black;
  38. }
  39.  
  40. .overlay {
  41. opacity:0;
  42. position:absolute;
  43. top:0;
  44. left:0;
  45. text-align:center;
  46. width:100%;
  47. height:100%;
  48. transition:0.3s ease;
  49.  
  50. background:white;
  51. }
  52.  
  53. #musicplayer:hover .overlay {
  54. opacity: 1;
  55. transition:0.3s ease;
  56. }
  57.  
  58. .playpause{
  59. position: absolute;
  60. top: 50%;
  61. left: 50%;
  62. transform: translate(-50%, -50%);
  63. }
  64.  
  65. .playpause:hover{
  66. cursor:help;
  67. }
  68.  
  69. #musicpixel img{
  70. display:block;
  71. }
  72.  
  73. .marquee{
  74. display: inline-block;
  75. padding-left: 100%;
  76. animation: marquee 5s linear infinite;
  77. }
  78.  
  79. @keyframes marquee{
  80. 0% {
  81. transform: translate(0, 0);
  82. }
  83. 100% {
  84. transform: translate(-100%, 0);
  85. }
  86. }
  87. </style>
  88.  
  89. <div id='musicplayer'>
  90. <div id='musicpixel'>
  91. <img src='https://64.media.tumblr.com/4b8b5edeb93a938b40814b1dd867833c/tumblr_inline_msbtvcHwwB1rkldve.gif'>
  92. <div class='overlay'>
  93. <div class='playpause'><i class="fas fa-play"></i></div>
  94. </div>
  95. </div>
  96. <div id='musictitle'>
  97. <span class='marquee'>windy summer cr ramdons</span>
  98. </div>
  99. </div>
  100.  
  101. <audio id='musicsrc' loop src='URL'></audio>
  102.  
  103. <script>
  104. document.querySelector('.playpause').addEventListener('click', playpause);
  105.  
  106. function playpause(){
  107. if(document.querySelector('.playpause').innerHTML == '<i class="fas fa-play"></i>'){
  108. document.querySelector('#musicsrc').play();
  109. document.querySelector('.playpause').innerHTML = '<i class="fas fa-pause"></i>';
  110. } else{
  111. document.querySelector('#musicsrc').pause();
  112. document.querySelector('.playpause').innerHTML = '<i class="fas fa-play"></i>';
  113. }
  114. }
  115. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement