css实现一个带毫秒的倒计时动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现一个带毫秒的倒计时动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link href='https://fonts.googleapis.com/css?family=Aldrich' rel='stylesheet' type='text/css'>
<style>
body{
padding-top: 200px;
}
/* Play with speed and easing of the animation */
/* =========================================== */
.digit {
display: inline-block;
font-size: 200px;
color: rgba(0, 0, 0, 0.25);
height: 180px;
line-height: 1;
}
.time-part-wrapper {
display: inline-block;
margin-right: 50px;
position: relative;
}
.time-part-wrapper:not(:last-child):after {
content: ":";
display: block;
width: 30px;
height: 230px;
position: absolute;
top: 0px;
right: -30px;
color: rgba(0, 0, 0, 0.25);
font-size: 200px;
line-height: 0.9;
}
.time-part {
width: 140px;
text-align: center;
height: 180px;
overflow: hidden;
display: inline-block;
margin-left: -5px;
box-sizing: border-box;
}
.time-part .digit-wrapper {
animation-timing-function: cubic-bezier(1, 0, 1, 0);
}
.time-part.minutes.tens .digit-wrapper {
animation-name: minutes-tens;
animation-duration: 3600s;
animation-iteration-count: 1;
}
.time-part.minutes.ones .digit-wrapper {
animation-name: minutes-ones;
animation-duration: 600s;
animation-iteration-count: 6;
}
.time-part.seconds.tens .digit-wrapper {
animation-name: seconds-tens;
animation-duration: 60s;
animation-iteration-count: 60;
}
.time-part.seconds.ones .digit-wrapper {
animation-name: seconds-ones;
animation-duration: 10s;
animation-iteration-count: 360;
}
.time-part.hundredths.tens .digit-wrapper {
animation-name: hundredths-tens;
animation-duration: 1s;
animation-iteration-count: 3600;
}
.time-part.hundredths.ones .digit-wrapper {
animation-name: hundredths-ones;
animation-duration: 0.1s;
animation-iteration-count.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0