svg+css实现计时器倒计时代码
代码语言:html
所属分类:布局界面
代码描述:svg+css实现计时器倒计时代码,没有一行js代码,全部css和svg实现。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@property --number {
syntax: "<integer>";
inherits: true;
initial-value: 0;
}
body {
margin: 0;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: stretch;
background: #017343;
}
label {
height: 60vh;
pointer-events: none;
}
input {
display: none;
}
svg {
width: 100%;
height: 100%;
}
svg * {
pointer-events: visiblePainted;
cursor: pointer;
}
#p1 {
y: -21px;
fill: #d40000;
rx: 1px;
}
#c {
fill: #c2ced0;
stroke:#000000;
}
use {
display: none;
--pos: pow(2,var(--digit));
}
#d1 {
--digit: mod(var(--number), 10);
}
#d2 {
--digit: round(down,var(--number)/10);
}
:checked + svg {
animation: count 60s steps(60, end);
}
:check.........完整代码请登录后点击上方下载按钮下载查看
网友评论0