css实现垂直滑块拖动炫酷数字动画效果代码
代码语言:html
所属分类:其他
代码描述:css实现垂直滑块拖动炫酷数字动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> html, body, div, datalist, output, section { display: grid; } html { height: 100%; } body { overflow-x: hidden; /* because range input takes up space horizontally before rotation */ background: #1f1f1f; } @supports (line-height: tan(45deg)) { body { --trig: none ; } } @supports (color: color-mix(in lch, red 1%, tan)) { body { --cmix: none ; } } .wrap { --rng: calc(var(--max) - var(--min)); /* range between max and min values */ --prg: calc((var(--val) - var(--min))/var(--rng)); /* decimal progress */ --prc: calc(var(--prg)*100%); /* percentage progress */ --pos: calc(var(--val)*1rem); /* position from 1st ruler line (from val = min) */ grid-gap: 1.25rem; /* space out ruler, track, thumb, output value */ grid-template-columns: -webkit-max-content 0.1875rem 1.25rem -webkit-max-content; grid-template-columns: max-content 0.1875rem 1.25rem max-content; place-self: center; color: #f43e75; /*fallback */ font: 1em trebuchet ms, ubuntu, verdana, arial, sans-serif; transition: 0.35s; /* focus/ hover transition */ } @supports (color: color-mix(in lch, red 1%, tan)) { .wrap { color: color-mix(in lch, #f43e75 var(--prc), #daff47); } } .wrap:not(:focus-within):not(:hover) { filter: sepia(1); } .wrap::before, .wrap::after { /* making up visual track */ --pos-x: calc(100% + 1.875rem); /* x position of middle rounding circle centre */ --pos-y: calc(var(--pos) + 7.4375rem); /* y position considering vertical overflow */ --sl: transparent calc(100% + -.5px), red calc(100% + .5px); /* mask gradient stop list */ grid-area: 1/1/span 1/span 2; /* cover first two columns */ place-self: center end; /* attach to middle right of rightmost cell they cover */ z-index: 1; /* both on top of ruler */ width: 5.5625rem; /* make it wide enough to contain the glow */ height: calc(100% + 2*7.4375rem); /* long enough to contain the glow at min/ max */ transform: scaley(-1); /* ugh... maybe I could have flipped the gradients instead */ content: ""; } .wrap::before { background: radial-gradient(circle 7.4375rem at va.........完整代码请登录后点击上方下载按钮下载查看
网友评论0