svg+css+js实现玻璃磨砂中性音乐播放器代码

代码语言:html

所属分类:多媒体

代码描述:svg+css+js实现玻璃磨砂中性音乐播放器代码

代码标签: svg css js 玻璃 磨砂 中性 音乐 播放器 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oxygen:wght@300;400;700&display=swap" rel="stylesheet">

  
  
<style>
* {
  box-sizing: border-box;
  padding: 0px;
  margin: 0px;
}

body {
  background: #000;
  background-image: url("//repo.bfw.wiki/bfwrepo/image/66ecf0f6844e7.png");
  background-position: center center;
  background-size: cover;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Oxygen", sans-serif;
}

.container {
  width: calc(100% - 32px);
  min-width: 320px;
  max-width: 400px;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(to right top, #313131aa, #efefef55);
  backdrop-filter: blur(12px);
  border: 1px solid #f0f0f025;
  overflow: hidden;
  font-family: "Oxygen", sans-serif;
  gap: 24px;
}

.container .header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  width: 100%;
}

.container .title {
  font-size: 16px;
  line-height: 16px;
  letter-spacing: 0.4px;
}

.container .cantor {
  font-size: 14px;
  color: #ddd;
}

.container .view {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.container .view .duration,
.container .view .current-time {
  min-width: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container .view input {
  flex-grow: 1;
}

.input {
  --input-width: 0%;
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  overflow-y: visible;
  bottom: -1px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background-color: #33333355;
  height: 6px;
  border-radius: 6px;
  position: relative;
  z-index: 10;
  user-select: none;
  pointer-events: none;
  cursor: default;
    position: absolute;
  top: 50%;
  transform: translatey(-50%)
}

.input::before {
  content: "";
  width: calc(var(--input-width));
  background: white;
  height: 6px;
  display: block;
  position: absolute;
  top: calc(50%);
  left: 0px;
  transform: translateY(-50%);
  z-index: 20;
  border-radius: 6px;
  transition: --input-width 0.1s ease-in-out;
}

.input::after {
  content: "";
  background: #fff;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: calc(var(--input-width, 0%) - 1px);
  z-index: 1000;
  display: block;
  position: absolute;
  top: 50%;
  transform: translatey(-50%);
    transition: left 0.1s ease-in-out;
  flex-shrink: 0px;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  width: 100%;
  transition: --input-width 0.1s ease-in-out;
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  -webkit-appearance: none;
  display: none;
}

.container .controllers {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.container .controllers .group-buttons {
  display: flex;
  gap: 6px;
}

.container .controllers button {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 42px;
  height: 42px;
  flex-shrink: 0;
  padding: 12px;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 4px;
}

.container .controllers button:hover {
  background: #33333355;
  color: #f0f0f0f0;
}

.container .controllers button svg path {
  stroke: #ddd;
}

.container .group-buttons button.btn-start{
  background: #333333a1;
  border-radius: 50%;
}

.container #icon-start{
  fill: #ddd;
}

.btn-next {
  transform: scale(-1);
}
</style>

  
</head>

<body translate="no">

<div class="container">
  <div class="header">
    <h1 class="title">Lofi Relax - Travel by Lofium</h1>
    <p class="cantor">Lofium</p>
  </div>
  <div class="view">
     <span class="current-time">0:0</span>
    <div class="input"><input step="0.01" class="state-bar" type="range" value="0.0"/></div>

       <span class="duration">0:0</span>
  </div>
  <div class="controllers">
    <button class="btn-radom">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">
    <path d="M19.5576 4L20.4551 4.97574C20.8561 5.41165 21.0566 5.62961 20.9861 5.81481C20.9155 6 20.632 6 20.0649 6C18.7956 6 17.2771 5.79493 16.1111 6.4733C15.3903 6.89272 14.8883 7.62517 14.0392 9M3 18H4.58082C6.50873 18 7.47269 18 8.2862 17.5267C9.00708 17.1073 9.50904 16.3748 10.3582 15" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M19.5576 20L20.4551 19.0243C20.8561.........完整代码请登录后点击上方下载按钮下载查看

网友评论0