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
















网友评论0