svg+js实现圆弧状时间滑动拖动取值器代码

代码语言:html

所属分类:拖放

代码描述:svg+js实现圆弧状时间滑动拖动取值器代码

代码标签: svg js 圆弧 时间 滑动 拖动 取值器 代码

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

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

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


 
<style>
@import url("https://fonts.googleapis.com/css2?family=Inter&display=swap");
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  min-height: 100vh;
  background-color: #f2f2f3;
  font-family: "Inter", sans-serif;
  font-size: 2em;
}

.slider-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 12.5em;
  max-width: 100%;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.slider-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slider-thumb {
  --color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  z-index: 1;
  left: calc(var(--slider-value) / 100 * (100% - var(--slider-height)) + var(--slider-height) / 2);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  width: 1.25em;
  height: 1.25em;
  background-image: linear-gradient(to bottom, #f0f0f2, #d9dade);
  box-shadow: 0 0.0625em 0.0625em rgba(0, 0, 0, 0.3);
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: none;
  cursor: pointer;
}
.slider-thumb::before {
  content: "";
  position: absolute;
  border-radius: inherit;
  w.........完整代码请登录后点击上方下载按钮下载查看

网友评论0