纯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; } #sky .bird .wind:nth-child(3) { -webkit-transform: translate3d(110px, -56px, 61px) rotateY(90deg); transform: translate3d(110px, -56px, 61px) rotateY(90deg); } #sky .bird .wind:nth-child(3)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 114, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); transform: translateY(-300px); -webkit-animation: wind 1257ms 2675ms linear infinite; animation: wind 1257ms 2675ms linear infinite; } #sky .bird .wind:nth-child(4) { -webkit-transform: translate3d(69px, -32px, 27px) rotateY(90deg); transform: translate3d(69px, -32px, 27px) rotateY(90deg); } #sky .bird .wind:nth-child(4)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 13, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); transform: translateY(-300px); -webkit-animation: wind 2933ms 1983ms linear infinite; animation: wind 2933ms 1983ms linear infinite; } #sky .bird .wind:nth-child(5) { -webkit-transform: translate3d(-23px, 148px, 87px) rotateY(90deg); transform: translate3d(-23px, 148px, 87px) rotateY(90deg); } #sky .bird .wind:nth-child(5)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 12, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); transform: translateY(-300px); -webkit-animation: wind 2658ms 3162ms linear infinite; animation: wind 2658ms 3162ms linear infinite; } #sky .bird .wind:nth-child(6) { -webkit-transform: translate3d(24px, -130px, -50px) rotateY(90deg); transform: translate3d(24px, -130px, -50px) rotateY(90deg); } #sky .bird .wind:nth-child(6)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 146, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); transform: translateY(-300px); -webkit-animation: wind 1529ms 3296ms linear infinite; animation: wind 1529ms 3296ms linear infinite; } #sky .bird .wind:nth-child(7) { -webkit-transform: translate3d(179px, -132px, 15px) rotateY(90deg); transform: translate3d(179px, -132px, 15px) rotateY(90deg); } #sky .bird .wind:nth-child(7)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 60, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); transform: translateY(-300px); -webkit-animation: wind 2937ms 1435ms linear infinite; animation: wind 2937ms 1435ms linear infinite; } #sky .bird .wind:nth-child(8) { -webkit-transform: translate3d(89px, -83px, 36px) rotateY(90deg); transform: translate3d(89px, -83px, 36px) rotateY(90deg); } #sky .bird .wind:nth-child(8)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 219, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); transform: translateY(-300px); -webkit-animation: wind 2080ms 4793ms linear infinite; animation: wind 2080ms 4793ms linear infinite; } #sky .bird .wind:nth-child(9) { -webkit-transform: translate3d(110px, 64px, -77px) rotateY(90deg); transform: translate3d(110px, 64px, -77px) rotateY(90deg); } #sky .bird .wind:nth-child(9)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 82, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); transform: translateY(-300px); -webkit-animation: wind 1729ms 4008ms linear infinite; animation: wind 1729ms 4008ms linear infinite; } #sky .bird .wind:nth-child(10) { -webkit-transform: translate3d(-33px, 97px, -50px) rotateY(90deg); transform: translate3d(-33px, 97px, -50px) rotateY(90deg); } #sky .bird .wind:nth-child(10)::before { content: ''; position: absolute; width: 4px; height: 300px; background: rgba(100, 200, 90, 0.3); border-radius: 999px; -webkit-transform: translateY(-300px); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0