css实现日出日落阴影动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现日出日落阴影动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; color: whitesmoke; margin: 0; padding: 0; } body { align-items: center; display: flex; height: 100vh; justify-content: center; } main { background: #8338ec; height: 80vh; width: 80vh; z-index: 0; } .wrapper{ align-items: center; cursor: pointer; display: flex; flex-direction: column; height: 100%; justify-content: center; padding: 10vh; } .sky{ animation: animate-sky 4s ease-in-out infinite; background: #38b0de; border-radius: 50%; height: 100%; overflow: hidden; position: relative; width: 100%; } @media only screen and (max-width: 380px) { .sky{ height: 90vw; width: 90vw; } } .sand{ background: #c2b280; height: 100%; position: absolute; top: 60%; width: 100%; } .sun{ animation: animate-sun 4s ease-in-out infinite; background: #f9d71c; border-radius: 50%; height: 20%; left: 50%; position: absolute; top: 0%; transform-origin: 0 400%; width: 20%; } @keyframes animate-sun { 0%{ transform: rotate(-60deg); } 30%{ transform: rotate(-28deg); } 70%{ transform: rotate(28deg); } 100%{ transform: rotate(60deg); } } @keyframes animate-sky { 0%{ background: #2093bf; } 30%{ background: #38b0de; } 70%{ background: #38b0de; } 100%{ background: #2093bf; } } .........完整代码请登录后点击上方下载按钮下载查看
网友评论0