纯css实现纸鸽子逆风飞行效果
代码语言:html
所属分类:动画
代码描述:纯css实现纸鸽子逆风飞行效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
background: #eef;
height: 100vh;
overflow: hidden;
display: -webkit-box;
display: flex;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
}
#sky {
margin-top: -60px;
-webkit-perspective: 400px;
perspective: 400px;
-webkit-filter: drop-shadow(0px 150px 10px rgba(0, 0, 0, 0.2));
filter: drop-shadow(0px 150px 10px rgba(0, 0, 0, 0.2));
}
@-moz-document url-prefix() {
#sky {
filter: none;
}
}
#sky div {
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
#sky .bird {
-webkit-animation: fly 10000ms linear infinite;
animation: fly 10000ms linear infinite;
}
#sky .bird .wind {
position: absolute;
left: 50%;
width: 4px;
height: 200px;
margin-left: -2px;
border-radius: 999px;
overflow: hidden;
}
#sky .bird .wind:nth-child(1) {
-webkit-transform: translate3d(-156px, 96px, 61px) rotateY(90deg);
transform: translate3d(-156px, 96px, 61px) rotateY(90deg);
}
#sky .bird .wind:nth-child(1)::before {
content: '';
position: absolute;
width: 4px;
height: 300px;
background: rgba(100, 200, 155, 0.3);
border-radius: 999px;
-webkit-transform: translateY(-300px);
transform: translateY(-300px);
-webkit-animation: wind 2959ms 4169ms linear infinite;
animation: wind 2959ms 4169ms linear infinite;
}
#sky .bird .wind:nth-child(2) {
-webkit-transform: translate3d(-53px, -13px, -22px) rotateY(90deg);
transform: translate3d(-53px, -13px, -22px) rotateY(90deg);
}
#sky .bird .wind:nth-child(2)::before {
content: '';
position: absolute;
width: 4px;
height: 300px;
background: rgba(100, 200, 11, 0.3);
border-radius: 999px;
-webkit-transform: translateY(-300px);
transform: translateY(-300px);
-webkit-animation: wind 1270ms 3482ms linear infinite;
animation: wind 1270ms 3482ms linear infinite;
}
#sk.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0