div+css实现天气预报动画卡片效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现天气预报动画卡片效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> @import url("https://fonts.googleapis.com/css?family=Open+Sans"); * { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } .center { position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; background: #397187; height: 300px; width: 300px; box-shadow: 3px 5px 20px 2px rgba(0, 0, 0, 0.4); font-family: "Open Sans", sans-serif; } .scene__contain { position: relative; height: 300px; width: 100%; overflow: hidden; background: #0a0811; animation: lightup-scene 10s linear infinite; } .moon { position: absolute; top: 20px; left: 30px; width: 75px; height: 75px; background: #dfddab; border-radius: 50%; box-shadow: 0px 0px 10px 0 #dfddab; animation: moonrise 1.5s ease-in-out; } .crater-1, .crater-8, .crater-7, .crater-6, .crater-5, .crater-4, .crater-3, .crater-2 { position: absolute; top: 15px; left: 20px; width: 10px; height: 10px; border-radius: 50%; background: #c9c89c; } .crater-2 { top: 35px; left: 50px; width: 5px; height: 5px; } .crater-3 { top: 10px; left: 45px; width: 6px; height: 6px; } .crater-4 { width: 15px; height: 15px; top: 50px; left: 25px; } .crater-5 { width: 7px; height: 7px; top: 30px; left: 30px; } .crater-6 { width: 7px; height: 7px; top: 40px; left: 10px; } .crater-7 { width: 4px; height: 4px; top: 20px; left: 65px; } .crater-8 { width: 5px; height: 5px; top: 55px; left: 60px; } .hill-fg-1, .hill-bg-1, .hill-bg-2, .hill-fg-3, .hill-fg-2 { width: 250px; height: 250px; background: #2b2342; position: absolute; bottom: -190px; left: -75px; border-radius: 50%; z-index: 2; animation: lightup-fg 10s linear infinite; } .hill-fg-2 { bottom: -180px; left: 75px; } .hill-fg-3 { bottom: -165px; left: 200px; } .hill-bg-1, .hill-bg-2 { bottom: -150px; left: -60px; background: #141020; z-index: 1; animation: lightup-bg 10s linear infinite; } .hill-bg-2 { bottom: -135px; left: 115px; } .footer { width: 100%; height: 100px; background: white; padding: 25px; display: flex; justify-content: space-between; align-items: center; z-index: 32; font-size: 0.8em; } .left { display: flex; align-items: center; } .left__left { font-size: 2.5em; margin-right: 10px; } .right { display: flex; flex-direction: column; align-items: flex-end; } .drop--big-1, .drop--small-10, .drop--med-10, .drop--small-9, .drop--med-9, .drop--small-8, .drop--med-8, .drop--small-7, .drop--med-7, .drop--small-6, .drop--med-6, .drop--small-5, .drop--med-5, .drop--small-4, .drop--med-4, .drop--small-3, .drop--med-3, .drop--small-2, .drop--med-2, .drop--small-1, .drop--med-1 { position: absolute; bottom: 100px; left: 35px; width: 8px; height: 8px; background: #5FA4D0; border-radius: 5px; transform: rotate(30deg); z-index: 4; animation: raining 1s linear -5s infinite; } .drop--big-1:before, .drop--small-10:before, .drop--med-10:before, .drop--small-9:before, .drop--med-9:before, .drop--small-8:before, .drop--med-8:before, .drop--small-7:before, .drop--med-7:before, .drop--small-6:before, .drop--med-6:before, .drop--small-5:before, .drop--med-5:before, .drop--small-4:before, .drop--med-4:before, .drop--small-3:before, .drop--med-3:before, .drop--small-2:before, .drop--med-2:before, .drop--small-1:before, .drop--med-1:before { content: ""; position: absolute; top: -2px; left: 1px; height: 6px; width: 6px; border-radius: 3px; background: #5FA4D0; } .drop--big-1:after, .drop--small-10:after, .drop--med-10:after, .drop--small-9:after, .drop--med-9:after, .drop--small-8:after, .drop--med-8:after, .drop--small-7:after, .drop--med-7:after, .drop--small-6:after, .drop--med-6:after, .drop--small-5:after, .drop--med-5:after, .drop--small-4:after, .drop--med-4:after, .drop--small-3:after, .drop--med-3:after, .drop--small-2:after, .drop--med-2:after, .drop--small-1:after, .drop--med-1:after { content: ""; position: absolute; top: -5px; left: 2px; width: 4px; height: 10px; background: #5FA4D0; border-radius: 50%; } .drop--med-1 { left: 35px; width: 6px; height: 6px; background: #52819f; animation: raining 1.2s linear -7s infinite; } .drop--med-1:before { width: 4px; height: 4px; border-radius: 50%; background: #52819f; } .drop--med-1:after { width: 2px; height: 6px; border-radius: 50%; background: #52819f; } .drop--small-1 { width: 3px; height: 3px; left: 35px; border-radius: 50%; background: #3d6178; animation: none; animation: raining 1.5s linear -5s infinite; } .drop--small-1:before { width: 2px; height: 2px; border-radius: 50%; background: #3d6178; } .drop--small-1:after { width: 1px; height: 4px; border-radius: 50%; background: #3d6178; } .drop--big-2 { position: absolute; bottom: 100px; left: 70px; width: 8px; height: 8px; background: #5FA4D0; border-radius: 5px; transform: rotate(30deg); z-index: 4; animation: raining 1s linear -8s infinite; } .drop--big-2:before { content: ""; position: absolute; top: -2px; left: 1px; height: 6px; width: 6px; border-radius: 3px; background: #5FA4D0; } .drop--big-2:after { content: ""; position: absolute; top: -5px; left: 2px; width: 4px; height: 10px; background: #5FA4D0; border-radius: 50%; } .drop--med-2 { left: 70px; width: 6px; height: 6px; background: #52819f; animation: raining 1.3s linear -8s infinite; } .drop--med-2:before { width: 4px; height: 4px; border-radius: 50%; background: #52819f; } .drop--med-2:after { width: 2px; height: 6px; border-radius: 50%; background: #52819f; } .drop--small-2 { width: 3px; height: 3px; left: 70px; border-radius: 50%; background: #3d6178; animation: none; animation: raining 1.4s linear -5s infinite; } .drop--small-2:before { width: 2px; height: 2px; border-radius: 50%; background: #3d6178; } .drop--small-2:after { width: 1px; height: 4px; border-radius: 50%; background: #3d6178; } .drop--big-3 { position: absolute; bottom: 100px; left: 105px; width: 8px; height: 8px; background: #5FA4D0; border-radius: 5px; transform: rotate(30deg); z-index: 4; animation: raining 0.9s linear -8s infinite; } .drop--big-3:before { content: ""; position: absolute; top: -2px; left: 1px; height: 6px; width: 6px; border-radius: 3px; background: #5FA4D0; } .drop--big-3:after { content: ""; position: absolute; top: -5px; left: 2px; width: 4px; height: 10px; background: #5FA4D0; border-radius: 50%; } .drop--med-3 { left: 105px; width: 6px; height: 6px; background: #52819f; animation: raining 1.1s linear -7s infinite; } .drop--med-3:before { width: 4px; height: 4px; border-radius: 50%; background: #52819f; } .drop--med-3:after { width: 2px; height: 6px; border-radius: 50%; background: #52819f; } .drop--small-3 { width: 3px; height: 3px; left: 105px; border-radius: 50%; background: #3d6178; animation: none; animation: raining 1.5s linear -7s infinite; } .drop--small-3:before { width: 2px; height: 2px; border-radius: 50%; background: #3d6178; } .drop--small-3:after { width: 1px; height: 4px; border-radius: 50%; background: #3d6178; } .drop--big-4 { position: absolute; bottom: 100px; left: 140px; width: 8px; height: 8px; background: #5FA4D0; border-radius: 5px; transform: rotate(30deg); z-index: 4; animation: raining 0.9s linear -6s infinite; } .drop--big-4:before { content: ""; position: absolute; top: -2px; left: 1px; height: 6px; width: 6px; border-radius: 3px; background: #5FA4D0; } .drop--big-4:after { content: ""; position: absolute; top: -5px; left: 2px; width: 4px; height: 10px; background: #5FA4D0; border-radius: 50%; } .drop--med-4 { left: 140px; width: 6px; height: 6px; background: #52819f; animation: raining 1.3s linear -9s infinite; } .drop--med-4:before { width: 4px; height: 4px; border-radius: 50%; background: #52819f; } .drop--med-4:after { width: 2px; height: 6px; border-radius: 50%; background: #52819f; } .drop--small-4 { width: 3px; height: 3px; left: 140px; border-radius: 50%; background: #3d6178; animation: none; animation: raining 1.5s linear -8s infinite; } .drop--small-4:before { width: 2px; height: 2px; border-radius: 50%; background: #3d6178; } .drop--small-4:after { width: 1px; height: 4px; border-radius: 50%; background: #3d6178; } .drop--big-5 { position: absolute; bottom: 100px; left: 175px; width: 8px; height: 8px; background: #5FA4D0; border-radius: 5px; transform: rotate(30deg); z-index: 4; animation: raining 0.9s linear -9s infinite; } .drop--big-5:before { content: ""; position: absolute; top: -2px; left: 1px; height: 6px; width: 6px; border-radius: 3px; background: #5FA4D0; } .drop--big-5:after { content: ""; position: absolute; top: -5px; left: 2px; width: 4px; height: 10px; background: #5FA4D0; border-radius: 50%; } .drop--med-5 { left: 175px; width: 6px; height: 6px; background: #52819f; animation: raining 1.2s linear -7s infinite; } .drop--med-5:before { width: 4px; height: 4px; border-radius: 50%; background: #52819f; } .drop--med-5:after { width: 2px; height: 6px; border-radius: 50%; background: #52819f; } .drop--small-5 { width: 3px; height: 3px; left: 175px; border-radius: 50%; background: #3d6178; animation: none; animation: raining 1.5s linear -7s infinite; } .drop--small-5:before { width: 2px; height: 2px; border-radius: 50%; background: #3d6178; } .drop--small-5:after { width: 1px; height: 4px; border-radius: 50%; background: #3d6178; } .drop--big-6 { position: absolute; bottom: 100px; left: 210px; width: 8px; height: 8px; background: #5FA4D0; border-radius: 5px; transform: rotate(30deg); z-index: 4; animation: raining 0.8s linear -8s infinite; } .drop--big-6:before { content: ""; position: absolute; top: -2px; left: 1px; height: 6px; width: 6px; border-radius: 3px; background: #5FA4D0; } .drop--big-6:after { content: ""; position: absolute; top: -5px; left: 2px; width: 4px; height: 10px; background: #5FA4D0; border-radius: 50%; } .drop--med-6 { left: 210px; width: 6px; height: 6px; background: #52819f; animation: raining 1.1s linear -8s infinite; } .drop--med-6:before { width: 4px; height: 4px; border-radius: 50%; background: #52819f; } .drop--med-6:after { width: 2px; height: 6px; border-radius: 50%; background: #52819f; } .drop--small-6 { width: 3px; height: 3px; left: 210px; border-radius: 50%; background: #3d6178; animation: none; animation: raining 1.5s linear -7s infinite; } .drop--small-6:before { width: 2px; height: 2px; border-radius: 50%; background: #3d61.........完整代码请登录后点击上方下载按钮下载查看
网友评论0