div+css布局实现睡觉中的圣诞老人效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css布局实现睡觉中的圣诞老人效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
html, body {
width: 100%;
height: 100%;
}
* {
box-sizing: border-box;
}
.snores {
position: absolute;
left: 45%;
top: 45%;
font-family: cursive;
}
.snore {
font-size: 28px;
color: #eeeff1;
position: absolute;
top: 40px;
}
.snore1 {
-webkit-animation: snore-anim 3s linear 0s infinite;
animation: snore-anim 3s linear 0s infinite;
}
.snore2 {
-webkit-animation: snore-anim 3s linear 1s infinite;
animation: snore-anim 3s linear 1s infinite;
}
.snore3 {
-webkit-animation: snore-anim 3s linear 2s infinite;
animation: snore-anim 3s linear 2s infinite;
}
@-webkit-keyframes snore-anim {
0% {
opacity: 1;
transform: translate(0,0) scale(0.5);
}
50% {
opacity: 0.7;
transform: translate(20px, -70px) scale(1.2);
}
100% {
opacity: 0;
transform: translate(50px, -140px) scale(0.5);
}
}
@keyframes snore-anim {
0% {
opacity: 1;
transform: translate(0,0) scale(0.5);
}
50% {
opacity: 0.7;
transform: translate(20px, -70px) scale(1.2);
}
100% {
opacity: 0;
transform: translate(50px, -140px) scale(0.5);
}
}
.disc {
background-color: #c0c4c7;
border-radius: 50%;
width: 285px;
height: 45px;
position: absolute;
left: -55px;
bottom: -35px;
z-index: -2;
}
.circular-bg {
background-color: #EEEEEE;
border-radius: 50%;
width: 500px;height: 500px;
box-shadow: 0 550px 0 -250px #093D55 inset;
border: 1px solid;
position: relative;
z-index: 5;
margin: 20px auto;
}
.moon {
width: 80px;
height: 80px;
box-shadow: -40px 0px 0 0 #fff inset;
border-radius: 50%;
background-color: #093D55;
position: absolute;
right: 130px;
top: 50px;
}
.santa {
position: absolute;
left: 35%;
bottom: 25%;
}
.hat-space {
width: 75px;
height: 100px;
box-shadow: 30px 0 0 0 #fff inset;
border-radius: 50%;
background-color: transparent;
position: absolute;
left: 45px;
bottom: -18px;
transform: rotate(35deg);
}
.hat {
width: 100px;
height: 65px;
background-color: #DA4642;
border-radius: 100% 20% 20% 20%;
position: absolute;
left: -60px;
bottom: 20px;
transform: rotate(-15deg);
}
.furr {
width: 35px;
height: 35px;
border-radius: 50%;
background-color: #fff;
position: absolute;
bottom: -10px;
right: 40px;
}
.face {
width: 60px;
height: 90px;
box-shadow: 30px 0px 0 0 #F5CFC1 inset;
border-radius: 50%;
background-color: transparent;
position: absolute;
left: 10px;
bottom: 10px;
transform: rotate(20deg);
}
.eyebrows {
width: 10px;
height: 23px;
border-radius: 50%;
background-color: transparent;
position: absolute;
transform: .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0