css实现盒子组装成的小狗跳动动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现盒子组装成的小狗跳动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
html,body {
height: 100%;
width: 100%;
overflow: hidden
}
html {
box-sizing: border-box
}
*,*:before,*:after {
box-sizing: inherit
}
body {
position: relative;
background: #f0f0f0;
padding: 0;
margin: 0
}
.container {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
display: flex;
align-items: center;
justify-content: center;
width: 600px;
height: 420px
}
* {
position: absolute
}
* *:before,* *:after {
content: "";
position: absolute
}
.box {
background-color: #d1585d;
width: 50%;
height: 45%;
left: 25%;
bottom: 0;
border-radius: 20px;
transform-origin: center bottom;
-webkit-animation: bigBox 8s linear infinite;
animation: bigBox 8s linear infinite
}
.box:before {
background-color: #f79568;
width: 70%;
height: 100%;
bottom: 0;
border-radius: 20px
}
.box:after {
background-color: #ffbd31;
height: 100%;
width: 11%;
right: 10%
}
.box .sign {
width: 36px;
height: 36px;
border-radius: 6px;
border: 3px solid #d1585d;
left: 150px;
top: 10%
}
.box .sign:after {
width: 3px;
height: 20px;
left: 13px;
top: 6px;
background-color: #d1585d
}
.box .sign:before {
width: 9px;
height: 9px;
left: 10px;
top: 6px;
border: 3px solid #d1585d;
border-left: 0;
border-bottom: 0;
transform: rotate(-45deg)
}
.dog {
bottom: 45%;
height: 45%;
width: 45%;
-webkit-animation: dog-bounce 8s linear infinite;
animation: dog-bounce 8s linear infinite;
transform-origin: center bottom
}
.dog-group {
width: 100%;
height: 100%;
top: 0;
left: 0;
-webkit-animation: dog-jump 8s linear infinite;
animation: dog-jump 8s linear infinite;
transform-origin: center bottom
}
.body-group {
z-index: 2;
width: 52%;
height: 38%;
bottom: 0;
left: 25%
}
.body-group .dog-box {
width: 100%;
height: 100%;
border-radius: 0 7px 7px;
overflow: hidden;
z-index: 3;
background: #f79568;
background: linear-gradient(90deg,#f79568 0,#f79568 67%,#d1585d 67%,#d1585d 100%)
}
.body-group .dog-box .dog-box-sign {
width: 30px;
height: 30px;
border-radius: 6px;
border: 3px solid #d1585d;
left: 35%;
top: 15%
}
.body-group .dog-box .dog-box-sign:after {
width: 70%;
height: 3px;
border-radius: 10px;
background-color: #d1585d;
left: 15%;
top: 5px;
box-shadow: 0 6px #d1585d
}
.body-group .dog-box .dog-box-sign:before {
width: 45%;
height: 3px;
border-radius: 10px;
background-color: #d1585d;
left: 39%;
top: 17px
}
.body-group .dog-box .bottom-shadow {
width: 100%;
height: 20px;
background-color: #a53942;
bottom: -13px;
transform: rotate(-2deg);
-webkit-animation: shadows 8s linear infinite;
an.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0