<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Gooey倒计时</title>
<style>
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: inherit;
}
body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
box-sizing: border-box;
background-color: hsl(210, 5%, 12%);
}
svg {
margin: auto;
width: 100vmin;
}
g > text {
text-anchor: middle;
font-size: 400px;
font-family: Overpass Mono, monospace;
fill: hsl(210, 100%, 75%);
opacity: 0;
-webkit-animation-name: opac;
animation-name: opac;
-webkit-animation-duration: 11s;
animation-duration: 11s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
g > text:nth-child(1) {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}
g > text:nth-child(2) {
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
g > text:nth-child(3) {
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
g > text:nth-child(4) {
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
@-webkit-keyframes opac {
0% {
opacity: 0;
}
7.5% {
opacity: 1;
}
10% {
opacity: 1;
}
15% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes opac {
0% {
opacity: 0;
}
7.5% {
opacity: 1;
}
10% {
opacity: 1;
}
15% {
opacity: 0;
}
100% {
opacity: 0;
}
}
</style>
</head>
<body>
<svg viewBox="-500 -500 1000 1000" width="100%" height="100%" preserveAspectRatio="xMidYMin slice">
<defs>
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur"></feGaussianBlur>
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -5" result="goo"></feColorMatrix>
<feComposite in="SourceGraphic" in2="goo" operator="atop"></feComposite>
</filter>
</defs>
<circle fill="hsla(0, 100%, 50%, 0.25)" cx="0" cy="0" r="300"></circle>
<g filter="url(#goo)">
<text x="0" y="150">3</text>
<text x="0" y="150">2</text>
<text x="0" y="150">1</text>
<text x="0" y="150">GO</text>
</g>
</svg>
</body>
</html>
SVG 3秒倒计时
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 一般来说,喜欢站立的人,比喜欢躺着或或坐着的人,身材更好。与躺着的姿势相比,站姿所消耗的能量要多出10%。而单腿站...
- 做电商的会遇到秒杀的活动,然后会有倒计时开始抢购的需求,写了个demo来解决这个需求,超级简单的,思路就是获取了当...