纯css实现个白天黑夜切换动画效果代码
代码语言:html
所属分类:动画
代码描述:纯css实现个白天黑夜切换动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { margin: 0; padding: 0; } body { background-color: #3c5913; } .container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 400px; height: 400px; border-radius: 20px; overflow: hidden; } .day, .night { position: relative; width: 100%; height: 100%; transition: 1s; } .day { background: linear-gradient(#fff3a0 20%, #ffc31e 60%, #3a8bc1, #255d82); } .wave { position: absolute; left: 50%; transform: translateX(-50%); width: 200%; height: 200%; z-index: 100; transition: 1s; } .wave1 { top: 60%; border-radius: 45%; background-color: rgba(89, 207, 247, 0.6); animation: rotating 5s linear infinite; } .wave2 { top: 68%; border-radius: 40%; background-color: rgba(37, 130, 206, 0.5); animation: rotating 8s linear infinite; } .wave3 { top: 70%; border-radius: 37%; background-color: rgba(20, 113, 188, 0.5); animation: rotating 12s linear infinite; } @keyframes rotating { 100% { transform: translateX(-50%) rotate(360deg); } } .sun { position: absolute; top: 5%; left: 20%; width: 80px; height: 80px; background-color: #ffcc3e; border-radius: 50%; box-shadow: 0 0 25px #ffcc3e; } .cloud { position: absolute; top: 20%; width: 120px; height: 40px; background-color: #fff; border-radius.........完整代码请登录后点击上方下载按钮下载查看
网友评论0