div布局实现书桌闹钟书本仙人掌效果
代码语言:html
所属分类:布局界面
代码描述:div布局实现书桌闹钟书本仙人掌效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
html {
background: #ECD590;
background-size: cover;
text-align: center;
font-size: 10px;
}
body {
margin: 0;
font-size: 2rem;
display: -webkit-box;
display: flex;
-webkit-box-flex: 1;
flex: 1;
width: 100vw;
min-height: 100vh;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
}
.shelf {
position: relative;
width: 520px;
height: 20px;
border-radius: 1px;
background-color: #5a3f21;
margin-top: 70px;
box-shadow: 0px 0px #e5c564, -1px 1px #e5c564, -2px 2px #e5c564, -3px 3px #e5c564, -4px 4px #e5c564, -5px 5px #e5c564, -6px 6px #e5c564, -7px 7px #e5c564, -8px 8px #e5c564, -9px 9px #e5c564, -10px 10px #e5c564, -11px 11px #e5c564, -12px 12px #e5c564, -13px 13px #e5c564, -14px 14px #e5c564, -15px 15px #e5c564, -16px 16px #e5c564, -17px 17px #e5c564, -18px 18px #e5c564, -19px 19px #e5c564, -20px 20px #e5c564;
}
.clock {
width: 110px;
height: 110px;
border: 10px solid #5AA668;
background-color: #E9E6C9;
border-radius: 50%;
position: absolute;
box-shadow: inset 0 0 3px #6a5757;
left: 30px;
top: -135px;
}
.clock-face {
position: relative;
width: 100%;
height: 100%;
}
.knot {
position: absolute;
background-color: #9d374f;
width: 10px;
height: 10px;
border-radius: 50%;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
z-index: 99;
}
.hand {
width: 4px;
background: #47321A;
position: absolute;
left: 50%;
top: 50%;
-webkit-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transform: translate(-50%, -100%);
transform: translate(-50%, -100%);
}
.hour-hand {
height: 30px;
}
.min-hand {
height: 40px;
}
.second-hand {
height: 47px;
width: 2px;
}
.clock-ear-right, .clock-ear-left {
background-color: #5AA668;
position: absolute;
border-top-left-radius: 90px;
border-top-right-radius: 90px;
left: -38px;
top: -12px;
height: 30px;
width: 60px;
-webkit-transform: rotate(-50deg);
transform: rotate(-50deg);
}
.clock-ear-right:after, .clock-ear-left:after {
content: '';
position: absolute;
background-color: #9d374f;
width: 15px;
height: 8px;
border-top-left-radius: 90px;
border-top-right-radius: 90px;
top: -9px;
left: 23px;
}
.clock-ear-right {
left: auto;
right: -38px;
-webkit-transform: rotate(50deg);
transform: rotate(50deg);
}
.clock-foot-right, .clock-foot-left {
background-color: #47321A;
position: absolute;
border-radius: 50px;
left: 20px;
bottom: -25px;
height: 50px;
width: 12px;
-webkit-transform: rotate(30deg);
transform: rotate(30deg);
z-index: -1;
}
.clock-foot-right {
left: auto;
right: 20px;
-webkit-transform: rotate(-30deg);
transform: rotate(-30deg);
}
.book {
position: absolute;
background-color: #9d374f;
width: 40px;
height: 170px;
left: 210px;
top: -170px;
border-radius: 1px;
}
.book:before {
content: '';
background-color: #E9E6C9;
position: absolute;
width: 100%;
height: 20px;
top: 20px;
left: 0;
}
.book:after {
content: '';
position: absolute;
background-color: rgba(127, 44, 64, 0.3);
height: 100%;
width: 50%;
right: 0;
border-radius: 0 2px 2px 0;
}
.book:nth-of-type(2) {
background-color: #e86830;
left: 250px;
height: 195px;
top: -195px;
}
.book:nth-of-type(2):after {
background-color: rgba(215, 82, 24, 0.3);
}
.book:nth-of-type(3) {
background-color: #5AA668;
left: 290px;
height: 180px;
top: -180px;
}
.book:nth-of-type(3):after {
background-color: rgba(75, 140, 87, 0.3);
}
.cactus {
left: 380px;
position: absolute;
width: 120px;
height: 200px;
top: -120px;
}
.pot {
position: absolute;
-webkit-perspective: 200px;
perspective: 200px;
width: 100px;
height: 105px;
top: 28px;
z-index: 3;
}
.pot-bottom {
-webkit-transform: rotateX(-30deg);
transform: rotateX(-30deg);
background-color: #ce4f17;
width: 100%;
height: 100%;
top: 0px;
}
.pot-top {
position: absolute;
background-color: #a03d12;
width: 130%;
height: 30px;
left: -15%;
top: 0px;
border-radius: 2px;
}
.plant-left, .plant-right {
background-color: #5AA668;
position: absolute;
width: 50px;
height: 100px;
border-radius: 50px;
top: -20px;
left: 0;
}
.plant-right {
right: 20px;
left: auto;
height: 130px;
top: -40px;
}
.spike {
position: absolute;
width: 5px;
height: 1px;
background-color: #ECD590;
}
.spike:nth-of-type(1) {
top: 2px;
left: 25px;
-webkit-transform: rotate(170deg);.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0