div+css实现飞吹落叶动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现飞吹落叶动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; margin: 0; padding: 0; } main { height: 100vh; display: flex; justify-content: center; align-items: center; } #wind-wrap { position: relative; margin: 0px auto; padding: 0; width: 900px; height: 500px; overflow: hidden; background: #fff; background: linear-gradient( 126deg, rgb(45 253 226 / 77%) 0%, rgb(156 255 230 / 59%) 33%, rgb(255 245 204 / 17%) 100% ); } .tree { position: relative; z-index: 1; width: 250px; height: 250px; margin-top: 125px; margin-left: -60px; border-radius: 85% 75% 0% 75%; background: linear-gradient(to right, #53ad71, #77ed9e); transform: rotate(-130deg); box-shadow: inset 5px -5px 30px 5px #3a9659, -7px 5px 0 1px #3f8456, -10px 30px 50px -20px #3a5d46; } .tree::after { content: ""; display: block; width: 55px; height: 220px; border: 20px solid #623204; border-bottom: none; border-right: none; border-top: none; border-radius: 100% 100% 100% 10%; transform: rotate(128deg); position: absolute; top: -30px; left: 5px; box-shadow: inset -30px -60px 0px -30px #623204, -30px -60px 0px -30px #623204, -30px -55px 33px -25px #3a5d46; } .tree::before { content: ""; display: block; width: 30px; height: 30px; background: none; border-radius: 100% 100% 100% 10%; transform: rotate(-60deg); position: absolute; z-index: 1; top: 0px; left: 0px; box-shadow: -40px 233px 0 -8px #53ad71, -70px 263px 0 -10px #53ad71, -80px 243px 0 -12px #53ad71, -95px 255px 0 -13px #53ad71, -60px 185px 0px 1px #53ad71, -63px 186px 0px 1px #77ed9e, -68px 189px 10px 1px #2c653f, -72px 207px 0px -2px #77ed9e, -75px 209px 10px 0px #2c653f, -80px 185px 0 10px #3a9659, -84px 186px 0 10px #2c653f, -90px 189px 10px 10px #3f8456, -85px 140px 0px 2px #77ed9e, -90px 141px 0px 2px #3f8456, -93px 143px 10px 2px #2c653f, -96px 115px 0px 20px #53ad71, -101px 115px 0px 20px #3f8456, -105px 117px 15px 18px #3a5d46, -150px 165px 0 -10px #53ad71, -130px 165px 0 -11px #53ad71, -140px 185px 0 -12px #53ad71, -140px 165px 0px 25px #77ed9e, -145px 167px 0px 25px #3f8456, -149px 170px 15px 23px #3a5d46; animation: 2.5s ease-in-out 0s infinite tree; } @keyframes tree { 0%, 100% { transform: rotate(-60deg); } 50% { transform: rotate(-62deg); } } .grass { position: absolute; bottom: -45px; left: 0px; height: 100px; width: 200px; border-radius: 0 100% 0 0; background-color: #3f8456; box-shadow: inset -10px 10px 20px 10px #3a5d46, 0 0 0px 3px #3a5d46, 100px 25px 0px 3px #3a5d46, 85px 0px 15px -3px #3f8456, 100px -5px 0px 10px #3a5d46, -50px -10px 0px 30px #3b5243, inset 0px 0px 50px -10px #77ed9e, 0px 0px 150px -10px red, 80px -100px 150px 50px rgb(253 187 45); } ul.leaf-wrap { list-style: none; position: absolute; height: 50px; width: 100%; margin-top: -200px; z-index: 0; animation: 1.5s ease-in 0s 1 fade-in; } @keyframes fade-in { 0% { left: -50px; opacity: 0; } 100% { left: 0; opacity: 1; } } .leaf { position: absolute; z-index: 0; width: 50px; height: 50px; border-radius: 75% 75% 0.........完整代码请登录后点击上方下载按钮下载查看
网友评论0