div+css布局绘制立体杯子点击可旋转代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局绘制立体杯子点击可旋转代码

代码标签: div css 布局 绘制 立体 杯子 点击 旋转 代码

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

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
    body{
  background-color: grey;
  overflow: hidden;
}
.wrapperDiv:nth-of-type(2){
  left: 50%;
}
.wrapperDiv:nth-of-type(3){
  left: 75%;
}
.wrapperDiv:nth-of-type(2) .cupDiv, .wrapperDiv:nth-of-type(2) .cupDiv .fillCup{
  background-color: #b11c1c;
}
.wrapperDiv:nth-of-type(2) .handleDiv{
  border: 2vw solid #9b1717;
  border-right: none;
}
.wrapperDiv:nth-of-type(3) .cupDiv, .wrapperDiv:nth-of-type(3) .cupDiv .fillCup{
  background-color: #203c9b;
}
.wrapperDiv:nth-of-type(3) .cupDiv .fillCup::after, .wrapperDiv:nth-of-type(3) .cupDiv .fillCup::before{
  content: '';
  position: absolute;
  left: 40%;
  top: 35%;
  width: 0;
  height: 0;
  border: 0 solid transparent;
  border-right-width: 2vw;
  border-left-width: 2vw;
  border-bottom: 6vw solid #dedede;
}
.wrapperDiv:nth-of-type(3) .cupDiv .fillCup::before{
  -webkit-transform: rotate(180deg) translateY(-2vw);
          transform: rotate(180deg) translateY(-2vw);
}
.wrapperDiv:nth-of-type(3) .handleDiv{
  border: 2vw solid #193286;
  border-right: none;
}
.wrapperDiv{
  position: absolute;
  top: 50%;
  left: 25%;
  height: 24vw;
  width: 8vw;
  margin-top: -12vw;
  margin-left: -4vw;
  -webkit-transform: scale(.7);
          transform: scale(.7);
  transition: all 300ms ease-in-out 0s;
}
.wrapperDiv .innerWrapper{
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-transform-origin: bottom right;
          transform-origin: bottom right;
  -webkit-animation-name: wrapperAnimation;
          animation-name: wrapperAnimation;
  -webkit-animation-duration: 1200ms;
          animation-duration: 1200ms;
  -webkit-animation-timing-function: ease-in-out;
          animation-timing-function: ease-in-out;
  -webkit-animation-play-state: paused;
          animation-play-state: paused;
}
.shadowDiv{
  position: absolute;
  width: 100%;
  height: 30%;
  background-color: #000000;
  opacity: 0.4;
  left: -5%;
  bottom: -5%;
  border-radius: 100%;
  -webkit-filter: blur(.3vw);
          filter: blur(.3vw);
  -webkit-transform: scaleX(2) rotateZ(0deg);
          transform: scaleX(2) rotateZ(0deg);
  -webkit-animation-name: shadowAnimation;
          animation-name: shadowAnimation;
  -webkit-animation-duration: 1000ms;
          animation-duration: 1000ms;
  -webkit-animation-timing-function: ease-in-out;
          animation-timing-function: ease-in-out;
  -webkit-animation-play-state: paused;
          animation-play-state: paused;
}
.shadowDiv div{
  position: absolute;
  width: 150%;
  height: 50%;
  left: -50%;
  top: 25%;
  border-radius: 100%;
  background-color: #000000;
  -webkit-filter: blur(1vw);
          filter: blur(1vw);
}
.wrapperDiv div{
  pointer-events: none;
}
.wrapperDiv .innerWrapper .divBtn{
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -50%;
  z-index: 4;
  cursor: pointer;
  -webkit-transform: scaleX(3);
          transform: scaleX(3);
  pointer-events: all;
}
.wrapperDiv:hover{
  -webkit-filter: brightness(1.1);
          filter: brightness(1.1);
  transition: all 300ms ease-.........完整代码请登录后点击上方下载按钮下载查看

网友评论0