div+css实现可爱小鸡跑起来动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现可爱小鸡跑起来动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Tiny5&display=swap");
.tiny5-regular {
font-family: "Tiny5", sans-serif;
font-weight: 400;
font-style: normal;
}
.title {
color: white;
font-size: 4rem;
text-align: center;
padding: 0rem 1.5rem;
transform: translateY(-5rem);
}
.container {
background-color: #2b7cff;
width: 100dvw;
height: 100dvh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.chicky {
--rotate-x: -10deg;
--rotate-y: -15deg;
position: relative;
transform-style: preserve-3d;
-webkit-animation: full-body 500ms ease-out infinite;
animation: full-body 500ms ease-out infinite;
}
.chicky .head {
position: absolute;
transform: translateZ(-3.5rem);
transform-style: preserve-3d;
}
.chicky .head .hair {
position: absolute;
transform: translate3d(-0.5rem, -4rem, 3rem);
}
.chicky .head .hair.cube {
transform-style: preserve-3d;
}
.chicky .head .hair.cube .front {
background-color: #ffea03;
width: 1rem;
height: 2rem;
position: absolute;
transform: translateZ(1rem);
transform-style: preserve-3d;
}
.chicky .head .hair.cube .rear {
background-color: #cfbe00;
width: 1rem;
height: 2rem;
position: absolute;
transform-style: preserve-3d;
}
.chicky .head .hair.cube .top {
background-color: #fff583;
width: 1rem;
height: 1rem;
position: absolute;
transform: rotateX(90deg);
transform-style: preserve-3d;
transform-origin: top left;
}
.chicky .head .hair.cube .bottom {
background-color: #cfbe00;
width: 1rem;
height: 1rem;
position: absolute;
transform: translateY(2rem) rotateX(90deg);
transform-style: preserve-3d;
transform-origin: top left;
}
.chicky .head .hair.cube .left {
background-color: #fff050;
width: 1rem;
height: 2rem;
position: absolute;
transform: rotateY(-90deg);
transform-style: preserve-3d;
transform-origin: top left;
}
.chicky .head .hair.cube .right {
background-color: #e9d500;
width: 1rem;
height: 2rem;
position: absolute;
transform: translateX(1rem) rotateY(-90deg);
transform-style: preserve-3d;
transform-origin: top left;
}
.chicky .head .top {
position: absolute;
transform: translate3d(-2.5rem, -2rem, 2rem);
}
.chicky .head .top.cube {
transform-style: preserve-3d;
}
.chicky .head .top.cube .front {
background-color: #ffea03;
width: 5rem;
height: 1rem;
position: absolute;
transform: translateZ(3rem);
transform-style: preserve-3d;
}
.chicky .head .top.cube .rear {
background-color: #cfbe00;
width: 5rem;
height: 1rem;
position: absolute;
transform-style: preserve-3d;
}
.chicky .head .top.cube .top {
background-color: #fff583;
width: 5rem;
height: 3rem;
position: absolute;
transform: rotateX(90deg);
transform-style: preserve-3d;
transform-origin: top left;
}
.chicky .head .top.cube .bottom {
background-color: #cfbe00;
width: 5rem;
height: 3rem;
position: absolute;
transform: translateY(1rem) rotateX(90deg);
transform-style: preserve-3d;
transform-origin: top left;
}
.chicky .head .top.cube .left {
background-color: #fff050;
width: 3rem;
height: 1rem;
position: absolute;
transform: rotateY(-90deg);
transform.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0