纯css实现盒子伸展动画
代码语言:html
所属分类:动画
代码描述:纯css实现盒子伸展动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
.truck {
width: 612px;
height: 612px;
transform: rotate(45deg);
position: absolute;
right: 50%;
top: 50%;
margin-top: -306px;
margin-right: -306px;
}
.box {
width: 100px;
height: 100px;
position: relative;
float: right;
margin: 1px;
}
.box:before {
content: "";
position: absolute;
border-bottom: 51px solid #035a81;
border-left: 0 solid transparent;
border-right: 0 solid transparent;
height: 0;
width: 100%;
bottom: 0;
box-sizing: border-box;
animation-name: saskiaeffect;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-timing-function: ease;
}
.box:after {
content: "";
position: absolute;
border-top: 51px solid #035a81;
border-left: 0 solid transparent;
border-right: 0 solid transparent;
height: 0;
width: 100%;
top: 0;
box-sizing: border-box;
animation-name: saskiaeffect;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-timing-function: ease;
}
@keyframes saskiaeffect {
0% {
border-left: 0 solid transparent;
border-right: 0 solid transparent;
}
50% {
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
100% {
border-left: 0 solid transparent;
border-right: 0 solid transparent;
}
}
@-moz-keyframes saskiaeffect {
0% {
border-left: 0 solid transparent;
border-right.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0