div+css实现天气预报动态卡片效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现天气预报动态卡片效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css?family=Overlock");
body {
background: #643a7a;
}
.frame {
position: absolute;
top: 50%;
left: 50%;
width: 400px;
height: 400px;
margin-top: -200px;
margin-left: -200px;
border-radius: 2px;
box-shadow: 0.5rem 0.5rem 1rem rgba(0, 0, 0, 0.6);
background-image: linear-gradient(to top, #40334f, #2f273c, #272232, #201c29);
color: #4b384c;
font-family: "overlock", Helvetica, sans-serif;
font-weight: 300;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
overflow: hidden;
}
.moon {
position: absolute;
width: 6rem;
height: 6rem;
top: 45px;
left: 55px;
border-radius: 50px;
background-image: linear-gradient(to left top, #b1b1c5, #928fa3, #746f82, #575162, #3c3444);
box-shadow: 0 0 3rem rgba(177, 177, 197, 0.2);
-webkit-animation: rise 1s ease-out;
animation: rise 1s ease-out;
}
.moon:hover {
transform: scale(1.2);
transition: 3s;
}
.moon-crater1 {
position: absolute;
width: 1.7rem;
height: 1.7rem;
border-radius: 50%;
border: 4px solid rgba(60, 52, 68, 0.1);
top: 1rem;
left: 0.8rem;
}
.moon-crater2 {
position: absolute;
width: 1.4rem;
height: 1.4rem;
border-radius: 50%;
background: rgba(60, 52, 68, 0.15);
top: 3.4rem;
left: 2.8rem;
}
.hill-bg-1, .hill-bg-2, .hill-fg-1, .hill-fg-2, .hill-fg-3 {
position: absolute;
z-index: 2;
width: 337px;
height: 281px;
top: 201px;
left: -57px;
background: #503760;
border-radius: 50%;
box-shadow: -0.5rem 0 0.8rem rgba(0, 0, 0, 0.3);
}
.hill-bg-2 {
top: 177px;
left: 177px;
}
.hill-fg-1, .hill-fg-2, .hill-fg-3 {
background: #695b93;
top: 228px;
left: -137px;
}
.hill-fg-2 {
top: 251px;
left: 63px;
}
.hill-fg-3 {
top: 218px;
left: 292px;
}
.front {
position: absolute;
z-index: 10;
width: 400px;
height: 140px;
left: 0;
bottom: -53px;
background: #fff;
box-shadow: -1rem 0 1rem rgba(0, 0, 0, 0.5);
-webkit-animation: slide 1s;
animation: slide 1s;
transition: 1s ease-in-out;
z-index: 1000;
}
.front:hover {
bottom: 0;
}
@-webkit-keyframes slide {
0%, 45% {
transform: translateY(90px);
}
to {
transform: translateY(0px);
}
}
@keyframes slide {
0%, 45% {
transform: translateY(90px);
}
to {
transform: translateY(0px);
}
}
.front .temperature {
float: left;
margin-left: 20px;
font-size: 45px;
line-height: 90px;
}
.front .info {
float: left;
margin: 2rem 0 0 3rem;
font-size: 1.2rem;
line-height: 20px;
}
.icons {
position: absolute;
top: 2rem;
left: 7rem;
line-height: 20px;
}
.front .preview {
float: right;
font-weight: 400;
text-align: right;
font-size: 1.2rem;
line-height: 20px;
margin: 25px 20px 0 0;
}
.front .preview td {
padding: 0 3px;
text-transform: uppercase;
}
.drop-big-1, .drop-medium-1, .drop-small-1, .drop-medium-2, .drop-small-2, .drop-medium-3, .drop-small-3, .drop-medium-4, .drop-small-4, .drop-medium-5, .drop-small-5, .drop-medium-6, .drop-small-6, .drop-medium-7, .drop-small-7, .drop-medium-8, .drop-small-8, .drop-medium-9, .drop-small-9, .drop-medium-10, .drop-small-10 {
position: absolute;
z-index: 20;
left: 18px;
bottom: 90px;
width: 8px;
height: 8px;
border-radius: 50%;
background: #7FC1F9;
-webkit-animation: drop 0.9s linear 1.04s infinite;
animation: drop 0.9s linear 1.04s infinite;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
transform-origin: 50% 100%;
}
.drop-big-1:before, .drop-medium-1:before, .drop-small-1:before, .drop-medium-2:before, .drop-small-2:before, .drop-medium-3:before, .drop-small-3:before, .drop-medium-4:before, .drop-small-4:before, .drop-medium-5:before, .drop-small-5:before, .drop-medium-6:before, .drop-small-6:before, .drop-medium-7:before, .drop-small-7:before, .drop-medium-8:before, .drop-small-8:before, .drop-medium-9:before, .drop-sma.........完整代码请登录后点击上方下载按钮下载查看
网友评论0