js+css实现可拖拽质感数值旋钮调节效果代码

代码语言:html

所属分类:拖放

代码描述:js+css实现可拖拽质感数值旋钮调节效果代码

代码标签: js css 拖拽 质感 数值 旋钮 调节

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

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

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


  
<style>
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@200;400;500&display=swap");
@layer properties {
  @property --value {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
  }
}
:root {
  --bg-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  --bg-color: hsl(229deg 29% 10%);
  --glow-color-opacity: 0;
  --glow-color: oklch(82.6% 0.185 76.24 / calc(var(--glow-color-opacity) * 1%));
}

@supports (color: color(display-p3 0 0 0)) {
  :root {
    --glow-color-opacity: 100;
    --glow-color-luminance: 10;
    --glow-color-p3: 0.99 0.71 0.18;
    --glow-color: color-mix(
      in lch,
      color(
        display-p3 var(--glow-color-p3) / calc(var(--glow-color-opacity) * 1%)
      ),
      white calc(var(--glow-color-luminance) * 1%)
    );
  }
}
*,
*:before,
*:after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background-color: var(--bg-color);
  background-image: radial-gradient(ellipse at 50% 0%, white, rgba(0, 0, 0, 0.4)), repeating-radial-gradient(circle at center, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6) 14px, rgba(255, 255, 255, 0) 18px, rgba(255, 255, 255, 0.3) 18px, rgba(0, 0, 0, 0.6) 21px);
  font-family: "Sora", sans-serif;
  background-blend-mode: soft-light;
  background-size: 100% 100%;
  display: grid;
  place-items: center;
}
body:before {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, transparent 50%, rgba(7, 8, 24, 0.6));
}
body:after {
  position: absolute;
  display: block;
  content: "";
  width: 100%;
  height: 100%;
  background: var(--bg-grain) repeat top left/300px;
  z-index: 10;
  opacity: 0.15;
  mix-blend-mode: color-dodge;
  pointer-events: none;
}

main {
  width: 500px;
  max-width: 100%;
  aspect-ratio: 1/1;
  border-radius: 1000000px;
  background: radial-gradient(ellipse at 50% 0%, #1f1a23, #0a090c);
  position: relative;
  display: block;
  align-items: center;
  justify-content: center;
}
main *, main *:before, main *:after {
  will-change: transform, filter, background;
}
main:after {
  content: "";
  position: absolute;
  width: 80%;
  height: 80%;
  background: #131320;
  display: block;
  border-radius: inherit;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.8), inset 0 -4px 6px -1px rgba(255, 255, 255, 0.1);
  z-index: inherit;
  margin: auto;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}
main:before {
  content: "";
  display: block;
  position: absolute;
  width: 60%;
  aspect-ratio: 1/1;
  box-sha.........完整代码请登录后点击上方下载按钮下载查看

网友评论0