css+js实现中性立体液态彩色温度滑竿效果代码
代码语言:html
所属分类:拖放
代码描述:css+js实现中性立体液态彩色温度滑竿效果代码
代码标签: css js 中性 立体 液态 彩色 温度 滑竿
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@charset "UTF-8";
@supports (background: paint(foo)) {
@property --progress {
syntax: "<percentage>";
inherits: true;
initial-value: 0%;
}
@property --x {
syntax: "<percentage>";
inherits: true;
initial-value: 0%;
}
@property --y {
syntax: "<percentage>";
inherits: true;
initial-value: 0%;
}
}
:root {
--c1: #00adff;
--c2: #39d469;
--c3: #ffeb00;
--c4: #ff8100;
--c5: #b50f0f;
--surface: #fffeff;
--on-surface: #636571;
--outline: #000001;
--background: #112;
--v: 1;
}
.thermostat {
height: 24vmin;
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 1vmin;
position: relative;
place-items: center;
}
.liquid {
position: absolute;
inset: 0;
border-radius: 10vmin;
overflow: hidden;
isolation: isolate;
}
.liquid .bg {
position: absolute;
inset: 0;
}
.liquid .bg:before, .liquid .bg:after {
content: "";
position: absolute;
inset: 0;
--gp: calc(100% - var(--progress));
background: linear-gradient(to bottom, var(--c5) calc(5% - var(--gp)), var(--c4) calc(25% - var(--gp)), var(--c3) calc(50% - var(--gp)), var(--c2) calc(75% - var(--gp)), var(--c1) calc(100% - var(--gp)));
transform: translateY(calc(100% - var(--progress)));
-webkit-animation: wave 1s linear infinite;
animation: wave 1s linear infinite;
transition: all 0.3s linear;
filter: saturate(0.65);
}
.liquid .bg:after {
transform: scaleX(-1) translateY(calc(100% - var(--progress)));
opacity: 0;
--o: 0.6;
-webkit-animation-delay: 0.55s;
animation-delay: 0.55s;
}
@-webkit-keyframes wave {
from {
opacity: var(--o, 1);
-webkit-clip-path: polygon(100% 100%, 0% 100%, 0% 27.83%, 7.14% 28.61%, 14.29% 28.98%, 21.43% 28.9%, 28.57% 28.4%, 35.71% 27.49%, 42.86% 26.22%, 50% 24.65%, 57.14% 22.86%, 64.29% 20.95%, 71.43% 19%, 78.57% 17.12%, 85.71% 15.4%, 92.86% 13.92%, 100% 12.77%);
clip-path: polygon(100% 100%, 0% 100%, 0% 27.83%, 7.14% 28.61%, 14.29% 28.98%, 21.43% 28.9%, 28.57% 28.4%, 35.71% 27.49%, 42.86% 26.22%, 50.........完整代码请登录后点击上方下载按钮下载查看
网友评论0