css实现宇航员飞天动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现宇航员飞天动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
*,
*:after,
*:before {
box-sizing: border-box;
}
body {
display: flex;
height: 100vh;
background-color: #08121c;
background-image: radial-gradient(white, rgba(255, 255, 255, 0.2) 2px, transparent 10px), radial-gradient(white, rgba(255, 255, 255, 0.15) 1px, transparent 10px), radial-gradient(white, rgba(255, 255, 255, 0.1) 2px, transparent 5px), radial-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1) 2px, transparent 1px);
background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px;
background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
overflow: hidden;
}
.astronaut {
position: relative;
margin: auto;
transform: translatey(-100px);
}
.astronaut:after {
content: "";
position: absolute;
top: 130px;
z-index: -1;
width: 15px;
height: 210px;
border-radius: 0 0 20px 20px;
box-shadow: 30px 0 0 0 #A682FF, 45px 0 0 0 #715AFF, 60px 0 0 0 #5887FF, 75px 0 0 0 #55C1FF, 90px 0 0 0 #a0f8fe;
}
.astronaut:before {
content: "";
position: absolute;
top: 285px;
left: -100px;
z-index: 1;
width: 50px;
height: 50px;
border-radius: 50%;
-webkit-animation: bubbles 0.5s infinite alternate;
animation: bubbles 0.5s infinite alternate;
}
.body {
-webkit-animation: shake 1.5s infinite alternate;
animation: shake 1.5s infinite alternate;
}
.backpack {
background: #ddd;
width: 135px;
height: 100px;
border: 2px solid;
border-radius: 40px;
}
.hands {
position: absolute;
top: 100px;
left: 50%;
background: #ddd;
width: 160px;
height: 90px;
border: 2px solid;
border-radius: 50px;
transform: translate(-50%, -50%);
}
.chest {
position: absolute;
top: 85px;
left: 50%;
background: #fff;
width: 160px;
height: 75px;
border: 2px solid;
border-radius: 30px 30px 0 0;
transform: translate(-50%, -50%);
}
.leg {
position: absolute;
top: 90px;
left: 16px;
background: #fff;
width: 53px;
height: 100px;
border: 2px solid;
border-top: 0;
border-radius: 0 0 50px 50px;
}
.leg.right-leg {
right: 16px;
left: auto;
}
.head {
position: absolute;
top: 41px;
left: 50%;
background: #fff;
width: 100px;
height: 100px;
border: 2px solid;
border-radius: 50%;
transform: translate(-50%, -50%);
}
.head:after {
content: "";
position: absolute;
top: -15px;
left: 50%;
background: #333;
width: 5px;
height: 15px;
transform: translatex(-50%);
}
.head:before {
content: "";
position: absolute;
z-index: 1;
top: -30px;
left: 50%;
background: #62e6b8;
width: 20px;
height: 20px;
border-radius: 50%;
transform: translatex(-50%);
box-shadow: 0 0 0 5px rgba(98, 230, 184, 0.2), 0 0 0 10px rgba(98, 230, 184, 0.1);
}
.head-front {
position: absolute;
top: 50px;
left: 50%;
background: #fff;
width: 100px;
height: 50px;
border: 2px solid;
border-radius: 50%/20% 20% 40% 40%;
transform: translate(-50%, -50%);
}
.head-front:after {
content: "";
position: absolute;
top: -1px;
right: 0;
bottom: 0;
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0