Advertisement
Guest User

icie music player

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