<!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来解决这个需求,超级简单的,思路就是获取了当...