css实现狂风吹落叶动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现狂风吹落叶动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { --leaf: green; } body { height: 100vh; background: linear-gradient(180deg, #1100ff 0%, #21a7cb 70%, #4e8a1e 70.1%, #152d01 100%); overflow: hidden; margin: 0px; } .leaf { --duration: 3s; --width: 10vw; --scaley: 1; --top: 50%; --top-step: 0%; background-color: var(--leaf); width: var(--width); height: var(--width); left:calc(0px - (var(--width) * 2)); position: absolute; border-top-right-radius: 78%; border-bottom-left-radius: 78%; transform-origin: 50% 50%; animation-name: rotating; animation-duration: var(--duration); animation-iteration-count: infinite; animation-timing-function: linear; z-index: 100; } .leaf:nth-child(3) { --width: 12vw; --top: 25%; --top-step: 40%; background: linear-gradient(225deg, #00873d 0%, #53961f 49%, #53961f 51%, #00873d 100%); animation-delay: 0.5s; } .leaf:nth-child(4) { --width: 15vw; --top: 45%; --top-step: 30%; background: linear-gradient(225deg, #005828 0%, #53961f 49%, #53961f 51%, #005828 100%); animation-delay: 1.5s; } .leaf:nth-child(5) { --width: 15vw; --top: 55%; --top-step: -10%; animation-delay: 0.5s; animation-name: loop; background: linear-gradient(225deg, #a28f01 0%, #53961f 49%, #53961f 51%, #a28f01 100%); } .leaf:nth-child(6) { --width: 12vw; --scaley: 1.3; --top: 45%; --top-step: -30%; background: linear-gradient(225deg,#a93927 0%, #53961f 45%, #53961f 55%, #a93927 100%); animation-delay: 1s; animation-name: turning; } .leaf:nth-child(7) { --width: 8vw; --scaley: 1.1; --top: 85%; background: linear-gradient(225deg,#a93927 0%, #73ff00 45%, #73ff00 55%, #a93927 100%); animation-delay: 1.5s; animation-name: loop; } .leaf:nth-child(8) { --width: 8vw; --scaley: 1.1; --top: 35%; background: linear-gradient(225deg,#a93927 0%, #a0c400 45%, #a0c400 55%, #a93927 100%); animation-delay: 0.5s; animation-name: turning; } .leaf:nth-child(9) { --width: 9vw; --scaley: 1.1; --duration: 2.7s; --top: 75%; --top-step: -30%; background: linear-gradient(225deg,#a93927 0%, #c44e00 45%, #c44e00 55%, #a93927 100%); animation-delay: 1.5s; animation-name: loop; } .leaf:nth-child(10) { --width: 11vw; --duration: 2.7s; --top: 58%; --top-step: -10%; animation-name: turning; } .leaf:nth-child(10) { --width: 12.5vw; --scaley: 1.5; --top: 65%; background: linear-gradient(225deg,#a93927 0%, #800303 45%, #800303 55%, #a93927 100%); animation-delay: 2.5s; animation-name: turning; } .leaf:before { content: " "; height: 0.5vw; width: calc(var(--width) * 1.13); position: absolute; top: -2vw; left: -2vw; transform: rotate(45deg); background: linear-gradient(90deg, rgb(140 49 0) 0%, rgb(140 241 102) 100%); t.........完整代码请登录后点击上方下载按钮下载查看
网友评论0