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: -150p.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0