css实现网页滚动数字圆环进度条显示效果代码
代码语言:html
所属分类:进度条
代码描述:css实现网页滚动数字圆环进度条显示效果代码,滚动鼠标的滚轮来滚动网页,右侧显示进度条。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
/* REGISTER VAR TO BE ANIMATABLE*/
@property --percentage {
initial-value: 0;
inherits: false;
syntax: '<number>';
}
/* animating the custom prop*/
@keyframes updatePerc {
to {
--percentage: 100;
}
}
:root {
animation: updatePerc linear;
animation-timeline: scroll();
/* create some custom props to derive different effects*/
--primary-color: hsl(calc(var(--percentage, 0) * 3.6), 45%, 56%);
--angle: calc(var(--percentage, 0) * 3.6deg);
--txt: calc(var(--percentage));
}
/* Drawing the arc */
.progress:after {
background: conic-gradient(
var(--primary-color) var(--angle),
transparent var(--angle)
);
}
/* Number as.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0