css绘制现代房屋大树艺术效果代码

代码语言:html

所属分类:布局界面

代码描述:css绘制现代房屋大树艺术效果代码

代码标签: css 现代 房屋 大树 艺术

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  


  
  
<style>
* {
  box-sizing: border-box;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100vh;
  width: 100%;
  background: #cbe0f4;
}

.road {
  height: calc(4 * 1vmin);
  width: 100%;
  background: #575757;
}

.grass {
  height: calc(2 * 1vmin);
  width: 100%;
  background: #859e53;
}

.building {
  width: calc(1vmin * 29);
  height: calc(1vmin * 32.5);
  border-left: calc(1.5 * 1vmin) solid #fff;
  border-right: calc(1.5 * 1vmin) solid #fff;
  background: #fff;
  position: relative;
}

.roof {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 calc(14.5 * 1vmin) calc(12 * 1vmin) calc(14.5 * 1vmin);
  border-color: transparent transparent #fff transparent;
  position: relative;
}

.roofInner {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 calc(13 * 1vmin) calc(11 * 1vmin) calc(13 * 1vmin);
  border-color: transparent transparent transparent transparent;
  position: absolute;
  top: calc(2 * 1vmin);
  left: 0;
  transform: translateX(-50%);
}

.roofPatch1 {
  width: calc(2 * 1vmin);
  height: 1vmin;
  background: #fff;
  position: absolute;
  left: calc(-13.5 * 1vmin);
  top: calc(12 * 1vmin);
}

.roofPatch2 {
  width: calc(2 * 1vmin);
  height: 1vmin;
  background: #fff;
  position: absolute;
  right: calc(-13.5 * 1vmin);
  top: calc(12 * 1vmin);
}

.roofPatch3 {
  width: 1vmin;
  height: calc(3 * 1vmin);
  background: #fff;
  position: absolute;
  left: calc(-14.05 * 1vmin);
  top: calc(13 * 1vmin);
  z-index: 6;
}

.roofPatch4 {
  width: 1vmin;
  height: calc(3 * 1vmin);
  background: #fff;
  position: absolute;
  right: calc(-14.05 * 1vmin);
  top: calc(13 * 1vmin);
  z-index: 6;
}

.roofPatch5 {
  width: 1vmin;
  height: calc(3 * 1vmin);
  background: #fff;
  position: absolute;
  z-index: 7;
  top: 1vmin;
  left: calc(0.5 * 1vmin);
  transform: rotate(-51deg);
}

.roofPatch6 {
  width: 1vmin;
  height: calc(3 * 1vmin);
  background: #fff;
  position: absolute;
  z-index: 7;
  top: 1vmin;
  left: calc(-1.7 * 1vmin);
  transform: rotate(51deg);
}

.roofShadow1 {
  background: #8f5549;
  height: calc(1.5 * 1vmin);
  width: calc(18.5 * 1vmin);
  transform: rotate(140deg);
  position: absolute;
  top: calc(7.9 * 1vmin);
  left: calc(-15.7 * 1vmin);
  z-index: 5;
}

.roofShadow2 {
  background: #8f5549;
  height: calc(1.5 * 1vmin);
  width: calc(18.5 * 1vmin);
  transform: rotate(-140deg);
  position: absolute;
  top: calc(7.9 * 1vmin);
  right: calc(-15.7 * 1vmin);
  z-index: 5;
}

.topPart {
  width: 100%;
  height: calc(21.5 * 1vmin);
  background-image: linear-gradient(0deg, #af6356 4.55%, #aa5e51 4.55%, #aa5e51 50%, #af6356 50%, #af6356 54.55%, #aa5e51 54.55%, #aa5e51 100%);
  background-size: calc(5 * 1vmin) calc(5 * 1vmin);
  position: absolute;
  top: -8vmin;
  -webkit-clip-path: polygon(50% 0, 50% 0, 100% 50%, 100% 100%, 0 100%, 0% 50%);
          clip-path: polygon(50% 0, 50% 0, 100% 50%, 100% 100%, 0 100%, 0% 50%);
}
.topPart .window1 {
  position: absolute;
  top: calc(9 * 1vmin);
  left: calc(4.5 * 1vmin);
  width: calc(4.4 * 1vmin);
  height: calc(9.5 * 1vmin);
  border: calc(0.4 * 1vmin) solid #fff;
  background: linear-gradient(180deg, #51a8c2 50%, #51a8c2 50%, #1e3e48 50%);
}
.topPart .window1:before {
  content: "";
  width: 100%;
  height: 100%;
  background: linear-gradient(-64deg, transparent 20%, rgba(255, 255, 255, 0.15) 20%, rgba(255, 255, 255, 0.15) 26%, transparent 26%, transparent 60%, rgba(255, 255, 255, 0.15) 60%, rgba(255, 255, 255, 0.15) 66%, transparent 66%);
  position: absolute;
}

.bottomPart {
  width: 100%;
  height: calc(19 * 1vmin);
  background: pink;
  position: relative;
  top: 13.5vmin;
  display: flex;
}

.leftPart {
  width: 50%;
  height: 100%;
  background: #edebe7;
  border-bottom: calc(2 * 1vmin) solid #7d7874;
}

.rightPart {
  width: 50%;
  height: 100%;
  background: linear-gradient(to bottom, #b6b6b6 0vmin, #b6b6b6 calc(2.5 * 1vmin), #d9d7d6 calc(2.5 * 1vmin));
}

.door {
  width: calc(5.5 * 1vmin);
  height: calc(12 * 1vmin);
  background: #4f4132;
  position: absolute;
  bottom: 0;
  right: calc(5.7 * 1vmin);
}
.door:before {
  content: "";
  position: absolute;
  top: 1vmin;
  bottom: 1vmin;
  left: 1vmin;
  right: 1vmin;
  border: calc(0.0675 * 1vmin) solid #5d4f40;
}
.door:after {
  content: "";
  position: absolute;
  top: calc(4.5 * 1vmin);
  right: calc(0.8 * 1vmin);
  width: calc(0.4 * 1vmin);
  height: calc(3.5 * 1vmin);
  background: #d7d8d5;
}

.windowsBottom {
  width: calc(4.8 * 1vmin);
  height: calc(12 * 1vmin);
  background: #fff;
  position: absolute;
  bottom: 0;
  right: calc(1 * 1vmin);
}
.windowsBottom .window1 {
  height: calc(5.4 * 1vmin);
  width: calc(4 * 1vmin);
  background: #51a8c2;
  position: relative;
  top: calc(0.4 * 1vmin);
  left: calc(0.4 * 1vmin);
}
.windowsBottom .window1:before {
  content: "";
  width: 100%;
  height: 100%;
  background: linear-gradient(-64deg, #51a8c2 10%, rgba(255, 255, 255, 0.15) 10%, rgba(255, 255, 255, 0.15) 16%, #51a8c2 16%, #51a8c2 70%, rgba(255, 255, 255, 0.15) 70%, rgba(.........完整代码请登录后点击上方下载按钮下载查看

网友评论0