jquery-ui实现房子拖拽盖高楼效果代码

代码语言:html

所属分类:拖放

代码描述:jquery-ui实现房子拖拽盖高楼效果代码

代码标签: jquery-ui 拖拽 盖房子 盖楼

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

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

<head>

  <meta charset="UTF-8">

  
<style>
::-moz-selection {
  background: #ff8c2b;
  color: #ffd1aa;
}

::selection {
  background: #ff8c2b;
  color: #ffd1aa;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
}

.scene {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  grid: "sky sky sky" 1fr "side-l building side-r" auto "street street street" 60px/1fr auto 1fr;
  background-image: linear-gradient(to top, #bdc2e8 0%, #bdc2e8 1%, #e6dee9 100%);
  background-image: linear-gradient(-20deg, #fc6076 0%, #ff9a44 100%);
}
.scene:before {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  background: #ff9a44;
  mix-blend-mode: screen;
  opacity: 0.3;
  z-index: 1;
  -webkit-animation: overlay 10s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
          animation: overlay 10s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
}

.sky {
  grid-area: sky;
  position: relative;
  padding: 0 10px;
}
.sky h1 {
  font-size: 1.6rem;
  color: #1a1a1a;
  text-align: right;
  margin: 10px 0;
}
.sky p {
  text-align: right;
  margin: 0;
}

.side-l {
  grid-area: side-l;
  position: relative;
}
.side-l:before {
  content: "";
  display: block;
  position: absolute;
  width: calc(100% - 130px);
  height: 2px;
  background: #629dd2;
  right: 100px;
  top: 0;
  z-index: 99;
  opacity: 0.5;
}
.side-l .price {
  padding: 10px 20px;
  background: rgba(98, 157, 210, 0.7);
  border-radius: 10px 0 10px 10px;
  margin: 0 20px;
  display: inline-block;
  color: #fed330;
  font-size: 1.4rem;
  letter-spacing: 2px;
  position: relative;
  z-index: 100;
}

.side-r {
  grid-area: side-r;
  position: relative;
}

.building-wrap {
  grid-area: building;
  position: relative;
}
.building-wrap:before {
  content: "";
  display: block;
  position: absolute;
  width: calc(100% + 20px);
  height: 10px;
  background: #a5754a;
  top: -10px;
  left: -10px;
  box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.1);
}
.building-wrap:after {
  content: "";
  display: block;
  position: absolute;
  width: calc(100% + 10px);
  height: 5px;
  background: #936942;
  top: 0;
  left: -5px;
  box-shadow: inset 0 1px 0 0 rgba(100, 100, 100, 0.5);
}
.building-wrap .building {
  display: grid;
  grid-template-rows: 40px;
  align-content: end;
  background: #fe994c;
  padding-bottom: 40px;
  min-height: 60px;
  box-shadow: inset 0 10px 0 0 rgba(0, 0, 0, 0.2), inset 5px 0 0 0 #fff, inset -5px 0 0 0 #fff, inset 6px 0 0 0 rgba(0, 0, 0, 0.2), inset -6px 0 0 0 rgba(0, 0, 0, 0.2), inset 0 -5px 6px 0 rgba(0, 0, 0, 0.2), inset 0 -20px 0 0 #655246, inset 0 -21px 0 0 rgba(255, 255, 255, 0.3);
  padding-left: 10px;
  padding-right: 10px;
}
.building-wrap .building:before {
  content: "";
  display: block;
  position: absolute;
  width: calc(100% + 40px);
  height: 5px;
  top: -15px;
  left: -20px;
  background: #b38256;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
}
.building-wrap .building:after {
  content: "";
  display: block;
  position: absolute;
  width: 20px;
  height: 10px;
  background: #473a31;
  left: -20px;
  bottom: 0;
  box-shadow: -20px 0 0 0 #473a31, 0 -10px 0 0 #473a31, 0 -60px 0 0 #655246;
}

.street {
  grid-area: street;
  background: #483f38;
  box-shadow: inset 0 20px 0 0 #3a322d, inset 0 21px 0 0 #483f38, inset 0 30px 0 0 #2b2622, inset 0 31px 0 0 #0f0d0b;
  border-top: 1px solid #0f0d0b;
  position: relative;
}

.floor {
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: 40px;
  grid-auto-flow: column;
  padding-top: 20px;
  height: 60px;
  box-sizing: border-box;
  position: relative;
}
.floor:before {
  content: "";
  display: block;
  position: absolute;
  width: calc(100% + 30px);
  background: #fff;
  height: 4px;
  left: -15px;
  bottom: -5px;
  box-shadow: 0 1px 0 0 #d9d9d9;
}
.floor:after {
  content: "";
  display: block;
  position: absolute;
  width: calc(100% + 10px);
  background: #fff;
  height: 4px;
  left: -5px;
  bottom: -10px;
  box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2);
}
.floor:first-child {
  padding-top: 0;
}
.floor:first-child:before {
  bottom: 15px;
}
.floor:first-child:after {
  bottom: 10px;
}
.floor .window {
  width: 40px;
  margin: 0 10px;
  background: .........完整代码请登录后点击上方下载按钮下载查看

网友评论0