纯css实现圣诞404页面动画效果
代码语言:html
所属分类:布局界面
代码描述:纯css实现圣诞404页面动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<style>
@import url("https://fonts.googleapis.com/css?family=Varela+Round");html {
width: 100%;
height: 100%;
overflow: hidden;
}
body {
position: relative;
width: 100%;
height: 100%;
background-color: #1c8f8c;
margin: 0;
overflow: hidden;
font-family: "Varela Round", sans-serif;
}
.text-box {
position: relative;
overflow: hidden;
}
.text {
position: relative;
bottom: 50px;
}
.text__error {
position: relative;
bottom: 0;
display: block;
font-size: 25px;
margin: 0;
text-align: center;
box-sizing: border-box;
color: #fefefe;
}
.text__error:first-of-type {
margin-bottom: 20px;
}
.text__error span {
margin: 0 2px;
font-weight: bold;
}
.text__error span:nth-child(1n) {
color: #d40000;
}
.text__error span:nth-child(2n) {
color: #fed429;
}
.text__error span:nth-child(3n) {
color: #008002;
}
.status-code {
position: relative;
display: flex;
justify-content: space-between;
width: 515px;
max-width: 595px;
margin: auto;
}
.status-code p {
font-size: 250px;
margin: 3px 0 0 0;
color: #fefefe;
opacity: 0.8;
}
.zero {
position: absolute;
top: 48px;
left: calc(50% - 85px);
width: 170px;
height: 190px;
}
.zero__top {
position: absolute;
top: 0;
left: 0;
width: 50%;
height: 100%;
box-sizing: border-box;
overflow: hidden;
z-index: 20;
}
.zero__top-inner {
position: absolute;
top: 0;
left: 0;
width: 170px;
height: 100%;
border: 33px solid #fefefe;
box-sizing: border-box;
border-radius: 50%;
opacity: 0.8;
}
.zero__bottom {
position: absolute;
top: 0;
right: 0;
width: 50%;
height: 100%;
overflow: hidden;
}
.zero__bottom-inner {
position: absolute;
top: 0;
right: 0;
width: 170px;
height: 100%;
border: 33px solid #fefefe;
box-sizing: border-box;
border-radius: 50%;
opacity: 0.8;
}
.house {
position: absolute;
bottom: 0;
left: 0;
width: 300px;
height: 309px;
z-index: 0;
overflow: hidden;
}
.house__roof {
position: absolute;
top: 0;
left: 0;
}
.house__roof--trapezoid {
top: -30px;
left: 121px;
width: 112px;
height: 45px;
z-index: 8;
background-color: #660f14;
}
.house__roof--trapezoid:before, .house__roof--trapezoid:after {
content: "";
position: absolute;
top: 0;
border-bottom: 45px solid #660f14;
border-left: 6px solid transparent;
border-right: 0 solid transparent;
}
.house__roof--trapezoid:before {
left: -6px;
border-bottom-width: 45px;
border-left-width: 6px;
border-right-width: 0;
}
.house__roof--trapezoid:after {
right: -20px;
border-bottom-width: 45px;
border-right-width: 20px;
border-left-width: 0;
}
.house__roof--trapezoid .snow {
top: -2px;
left: -2px;
width: 120px;
height: 20px;
border-radius: 8px;
}
.house__roof--trapezoid .snow:before {
top: 8px;
left: 0;
width: 65px;
height: 28px;
border-radius: 0 0 20px 40px;
}
.house__roof--trapezoid .snow:after {
top: 11px;
left: 58px;
width: 66px;
height: 26px;
border-radius: 0px 10px 20px 40px;
-webkit-transform: rotate(-17deg);
transform: rotate(-17deg);
}
.house__roof--triangle {
width: 0;
height: 0;
border-bottom: 95px solid #fe9051;
border-left: 135px solid transparent;
border-right: 135px solid transparent;
}
.house__roof--triangle:before, .house__roof--triangle:after {
content: "";
position: absolute;
border-radius: 10px;
border: none;
background-color: #660f14;
z-index: 8;
}
.house__roof--triangle:before {
top: -34px;
left: -73px;
width: 8px;
height: 177px;
-webkit-transform: rotate(54deg);
transform: rotate(54deg);
}
.house__roof--triangle:after {
top: -35px;
left: 63px;
width: 8px;
height: 177px;
-webkit-transform: rotate(-54deg);
transform: rotate(-54deg);
}
.house__roof--triangle .snow {
width: 0;
height: 0;
}
.house__roof--triangle .snow:before {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
top: -30px;
left: -48px;
height: 128px;
width: 10px;
border-radius: 8px 8px 2px 8px;
}
.house__roof--triangle .snow:after {
content: "";
position: absolute;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
top: -31px;
left: 37px;
height: 128px;
width: 10px;
border-radius: 8px 8px 8px 2px;
}
.house__bottom {
position: absolute;
bottom: 0;
left: 35px;
background-color: #c4996f;
width: 225px;
height: 150px;
}
.house__bottom:before {
content: "";
position: absolute;
bottom: 0;
right: -20px;
width: 0;
height: 0;
border-top: 150px solid #c4996f;
border-right: 20px solid transparent;
border-left: 67px solid transparent;
}
.house__bottom:after {
content: "";
position: absolute;
bottom: 0;
left: -20px;
width: 0;
height: 0;
border-top: 230px solid #c4996f;
border-left: 20px solid transparent;
border-right: 67px solid transparent;
}
.house__bottom .house__window {
top: 50px;
left: 135px;
width: 78px;
height: 50px;
}
.house__bottom .house__window:after {
width: 78px;
height: 4px;
}
.house__window {
position: absolute;
width: 50px;
height: 50px;
background-color: #4f5a46;
overflow: hidden;
border-radius: 5px;
}
.house__window:before, .house__window:after {
content: "";
position: absolute;
background-color: #c4996f;
z-index: 10;
}
.house__window:before {
top: 0;
left: calc(50% - 2px);
width: 4px;
height: 50px;
}
.house__window:after {
top: calc(50% - 2px);
left: 0;
width: 50px;
height: 4px;
}
.house__door {
position: absolute;
bottom: 0;
left: 24px;
width: 60px;
height: 95px;
background-color: #660f14;
z-index: 10;
}
.house__door:before {
content: "";
position: absolute;
top: calc(50% - 4px);
left: 4px;
background-color: #a76c00;
width: 9px;
height: 9px;
border-radius: 50%;
}
.house__chimney {
position: absolute;
top: 5px;
left: 106px;
width: 55px;
height: 90px;
background-color: #660f14;
}
.house__chimney:before {
content: "";
position: absolute;
top: -3px;
left: -2px;
width: 103%;
height: 13px;
border-radius: 7px;
background-color: #fff;
}
.house__chimney .snow {
width: 17px;
height: 14px;
top: 5px;
left: -2px;
border-radius: 0 30px 30px 30px;
}
.house__chimney .snow:before {
width: 43px;
height: 29px;
top: -8px;
left: 16px;
border-radius: 0 10px 30px 30px;
}
.house--first-floor {
left: calc(100% - 300px);
}
.house--first-floor .lease {
top: 115px;
left: 115px;
z-index: 20;
}
.house--first-floor .house__bottom {
background-color: #d97b09;
}
.house--first-floor .house__bottom .house__roof--triangle {
top: -87px;
left: -22px;
border-bottom: 95px solid #d97b09;
border-left-width: 135px;
border-right-width: 135px;
}
.house--first-floor .house__bottom .house__roof--triangle:before {
top: -34px;
left: -73px;
height: 177px;
}
.house--first-floor .house__bottom .house__roof--triangle:after {
top: -35px;
left: 63px;
height: 177px;
}
.house--first-floor .house__bottom .house__roof--triangle .snow:before {
-webkit-transform: rotate(54deg);
transform: rotate(54deg);
top: -45px;
left: -77px;
height: 183px;
}
.house--first-floor .house__bottom .house__roof--triangle .snow:after {
-webkit-transform: rotate(-54deg);
transform: rotate(-54deg);
top: -44px;
left: 66px;
height: 183px;
}
.house--first-floor .house__bottom:before {
border-top-color: #d97b09;
}
.house--first-floor .house__bottom:after {
left: -20px;
border-top: 150px solid #d97b09;
border-left: 20px solid transparent;
border-right: 0 solid transparent;
}
.house--first-floor .house__bottom .house__window {
left: 118px;
width: 95px;
}
.house--first-floor .house__bottom .house__window:before, .house--first-floor .house__bottom .house__window:after {
background-color: #d97b09;
}
.house--first-floor .house__bottom .house__window:after {
width: 95px;
}
.house--first-floor .house__chimney {
top: 71px;
left: 32px;
width: 75px;
}
.house--first-floor .house__chimney .snow {
width: 43px;
height: 27px;
top: 2px;
left: -2px;
border-radius: 0 10px 30px 30px;
}
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0