css+js实现皮革上的滑块滑竿拖动效果代码

代码语言:html

所属分类:拖放

代码描述:css+js实现皮革上的滑块滑竿拖动效果代码

代码标签: css js 皮革 滑块 滑竿 拖动

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

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

<head>
  <meta charset="UTF-8">
  


<style>
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2em;
  min-height: 100vh;
  background-color: #343434;
  background-image: radial-gradient(circle at 50% 0%, #fff, #222), url("//repo.bfw.wiki/bfwrepo/image/648bba38270a8.png");
  background-blend-mode: overlay, normal;
  font-size: 2em;
  background-position: 50% 50%;
}

.slider-wrapper {
  --slider-value: 0;
  border-radius: 3.125em;
  padding: 0.1875em;
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.4), inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

.slider-container {
  border-radius: 3.125em;
  padding: 0.1875em;
  background-image: linear-gradient(#151616, #232728);
}

.slider-track {
  display: flex;
  align-items: center;
  position: relative;
  border-radius: inherit;
  height: 0.25em;
  width: 9.375em;
  background-image: linear-gradient(#040809, #232728);
  box-shadow: inset 0 0.1875em 0.125em rgba(0, 0, 0, 0.2), 0 0 0 0.0625em #141617, 0 calc(0.0625em + 1px) 0 #5f6060;
}

.slider-track-fill {
  border-radius: inherit;
  width: calc(var(--slider-value) * 1%);
  height: 100%;
  background-color: red;
  filter: brightness(1.2);
}
.slider-wrapper:nth-child(1) .slider-track-fill {
  background-image: linear-gradient(to right, #097dd6, #13dcf1);
  box-shadow: inset 0 0.1875em 0.125em rgba(0, 0, 0, 0.2), 0 0 0.75em 0.125em rgba(14, 173, 228, 0.5);
}
.slider-wrapper:nth-child(2) .slider-track-fill {
  background-image: linear-gradient(to right, #178f27, #18ffff);
  box-shadow: inset 0 0.1875em 0.125em rgba(0, 0, 0, 0.2), 0 0 0.75em 0.125em rgba(24, 199, 147, 0.5);
}
.slider-wrapper:nth-child(3) .slider-track-fill {
  background-image: linear-gradient(to right, #db2811, #ffff0d);
  box-shadow: inset 0 0.1875em 0.125em rgba(0, 0, 0, 0.2), 0 0 0.75em 0.125em rgba(237, 148, 15, 0.5);
}

.slider-thumb {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: calc(var(--slider-value) / 100 * (100% - 0.25em) + 0.25em / 2);
  transform: translateX(-50%);
  border-radius: 50%;
  width: 1.5em;
  height: 1.5em;
  background-image: repeating-conic-gradient(#fff 0deg, #dff5ff 25deg, #a0b6cc 55deg, #7d96af 75deg, #dff5ff 90deg, #7d96af 105deg, #a0b6cc 125deg, #dff5ff 155deg, #fff 180deg);
  box-shadow: 0 -0.5em 0.5em -0.5em rgba(255, 255, 255, 0.8), 0 0.5em 0.25em rgba(0, 0, 0, 0.2), inset 0 0 0 0.125em rgba(125, 150, 175, 0.8), inset 0 0.0625em 0.0625em 0.1875em rgba(255, 255, 255,.........完整代码请登录后点击上方下载按钮下载查看

网友评论0