css布局实现小孩玩滑板动画效果代码
代码语言:html
所属分类:动画
代码描述:css布局实现小孩玩滑板动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
.wrapper {
position: absolute;
width: 150px;
height: 300px;
margin: auto;
top: calc(50% - 150px);
left: calc(50% - 50px);
}
.board {
position: absolute;
left: 15px;
bottom: 48px;
z-index: 10;
transform-style: preserve-3d;
-webkit-animation: board_movie 5s linear infinite;
animation: board_movie 5s linear infinite;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.board__body {
width: 100%;
height: 100%;
transform-style: preserve-3d;
}
.board__body--front {
z-index: 100;
transform: translateY(0);
-webkit-animation: board_front 5s linear infinite;
animation: board_front 5s linear infinite;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.board__body--front .board__center {
background: #525655;
}
.board__body--front .board__side {
background: #525655;
}
.board__body--back {
transform: translateY(1px);
-webkit-animation: board_back 5s linear infinite;
animation: board_back 5s linear infinite;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
z-index: 5;
}
.board__body--back .board__center {
background: #FFC038;
}
.board__body--back .board__side {
background: #FFC038;
}
.board__center {
position: absolute;
top: 0;
left: 0;
display: flex;
width: 150px;
height: 30px;
background: #525655;
overflow: hidden;
text-align: center;
transform-style: preserve-3d;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
justify-content: center;
transform: rotateX(-90deg);
}
.board__side {
position: absolute;
top: -25px;
left: 0;
width: 30px;
height: 40px;
display: flex;
overflow: hidden;
text-align: center;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
justify-content: center;
transform-origin: bottom;
}
.board__side--right {
border-radius: 50% 50% 0 0;
transform: rotateY(90deg) translateZ(135px) rotateX(-65deg);
}
.board__side--left {
border-radius: 50% 50% 0 0;
transform: rotateY(90deg) translateZ(-15px) rotateX(65deg);
}
.board__tires {
position: absolute;
top: 3px;
z-index: 1;
transform-style: preserve-3d;
}
.board__tire {
position: absolute;
top: 15px;
left: 0;
width: 20px;
height: 20px;
border-radius: 50%;
background: #59BBD0;
z-index: 5;
}
.board__tire:before {
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
border-radius: 50%;
background: #59BBD0;
}
.board__tire span {
position: absolute;
top: 2px;
left: 1px;
width: 15px;
height: 15px;
border-left: 2px solid #D3D3D3;
border-right: 1px solid #D3D3D3;
border-radius: 50%;
-webkit-animation: tire_rotate 0.3s linear infinite;
animation: tire_rotate 0.3s linear infinite;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.board__tire span:before {
top: 6px;
right: 4px;
background: #525655;
width: 5px;
height: 5px;
border-radius: 90% 30%;
}
.board__tire:nth-of-type(1) {
transform: translateZ(-5px);
}
.board__tire:nth-of-type(2) {
transform: translateZ(10px);
}
.board__tire:nth-of-type(3) {
left: 120px;
transform: translateZ(-5px);
}
.board__tire:nth-of-type(4) .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0