Dancing Cactus by

Krystal Campioni

On: 26 Jul 2016

Personal site: http://www.krystalcampioni.com

<div class="environment">
  <div class="floor">
    <ul class="mountain"> 
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>
    <ul class="mountain mountain--tall"> 
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>
    <ul class="mountain mountain--short"> 
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>
  </div>
  <div class="cactus">
    <div class="cactus__eyes"></div>
    <div class="cactus__arm-right-top"></div>
    <div class="cactus__arm-right-bottom"></div>
    <div class="cactus__arm-left-top"></div>
    <div class="cactus__arm-left-bottom"></div>
    <div class="cactus__mouth"></div>
  </div>
  <div class="shadow"></div>
</div>
@-webkit-keyframes skew {
  from {
    -webkit-transform: skew(-5deg, 0deg);
    transform: skew(-5deg, 0deg);
  }
  to {
    -webkit-transform: skew(5deg, 0deg);
    transform: skew(5deg, 0deg);
  }
}
@keyframes skew {
  from {
    -webkit-transform: skew(-5deg, 0deg);
    transform: skew(-5deg, 0deg);
  }
  to {
    -webkit-transform: skew(5deg, 0deg);
    transform: skew(5deg, 0deg);
  }
}
@-webkit-keyframes rotate {
  from {
    -webkit-transform: rotate(-10deg);
    transform: rotate(-10deg);
  }
  to {
    -webkit-transform: rotate(10deg);
    transform: rotate(10deg);
  }
}
@keyframes rotate {
  from {
    -webkit-transform: rotate(-10deg);
    transform: rotate(-10deg);
  }
  to {
    -webkit-transform: rotate(10deg);
    transform: rotate(10deg);
  }
}
@-webkit-keyframes blink {
  90% {
    -webkit-transform: rotateX(0deg);
    transform: rotateX(0deg);
  }
  95% {
    -webkit-transform: rotateX(90deg);
    transform: rotateX(90deg);
  }
}
@keyframes blink {
  90% {
    -webkit-transform: rotateX(0deg);
    transform: rotateX(0deg);
  }
  95% {
    -webkit-transform: rotateX(90deg);
    transform: rotateX(90deg);
  }
}
body {
  margin: 0;
  padding: 0;
}

.environment {
  background-image: -webkit-radial-gradient(50% 50%, circle, #fbf9b8 10%, #f7ed9b 30%, #00b7ff);
  background-image: -webkit-radial-gradient(  50% 50% circle, #fbf9b8 10%, #f7ed9b 30%, #00b7ff);
  background-image: radial-gradient(  circle at 50% 50%, #fbf9b8 10%, #f7ed9b 30%, #00b7ff);
  float: left;
  height: 100%;
  margin: 0;
  padding: 0;
  position: absolute;
  width: 100%;
}

.floor {
  background: #533c34;
  bottom: 0;
  height: 100px;
  position: absolute;
  width: 100%;
}

.cactus {
  -webkit-animation: skew 2s infinite alternate ease-in-out;
          animation: skew 2s infinite alternate ease-in-out;
  background: #76ca1a;
  border-radius: 300px 260px 50px 50px;
  bottom: 62px;
  box-shadow: 0 0 10px 5px #5c9d14 inset;
  height: 200px;
  left: 50%;
  margin-left: -20px;
  position: absolute;
  -webkit-transform-origin: bottom;
          transform-origin: bottom;
  width: 40px;
  z-index: 10;
}
.cactus::after {
  border-left: 3px solid #5c9d14;
  border-radius: 300px 260px 50px 50px;
  border-right: 3px solid #5c9d14;
  bottom: 0;
  content: ' ';
  height: 200px;
  left: 27px;
  margin-left: -20px;
  position: absolute;
  width: 19px;
}
.cactus__eyes {
  background: #76ca1a;
  border-radius: 300px;
  height: 35px;
  margin-left: -10px;
  margin-top: 30px;
  padding-left: 2px;
  padding-top: 5px;
  width: 60px;
}
.cactus__eyes::before {
  -webkit-animation: blink 4s ease-in-out infinite;
          animation: blink 4s ease-in-out infinite;
  background: #76ca1a;
  border: 12px solid #0c1926;
  border-radius: 50%;
  box-shadow: 1px 4px 6px 0 #5c9d14;
  content: ' ';
  height: 4px;
  position: absolute;
  width: 4px;
  z-index: 20;
}
.cactus__eyes::after {
  -webkit-animation: blink 4s ease-in-out .5s infinite;
          animation: blink 4s ease-in-out .5s infinite;
  background: #76ca1a;
  border: 12px solid #0c1926;
  border-radius: 50%;
  box-shadow: 1px 4px 6px 0 #5c9d14;
  content: ' ';
  height: 4px;
  margin-left: 30px;
  position: absolute;
  width: 4px;
  z-index: 20;
}
.cactus__arm-right-top {
  -webkit-animation: rotate 1s infinite alternate ease-in-out;
          animation: rotate 1s infinite alternate ease-in-out;
  background: #76ca1a;
  border-radius: 300px 260px 250px 250px;
  bottom: 6px;
  box-shadow: 0 0 10px 5px #5c9d14 inset;
  height: 80px;
  left: 59px;
  position: relative;
  -webkit-transform-origin: bottom;
          transform-origin: bottom;
  width: 25px;
  z-index: 0;
}
.cactus__arm-right-top::after {
  background: #76ca1a;
  border-left: 3px solid #5c9d14;
  border-radius: 300px 260px;
  border-right: 3px solid #5c9d14;
  bottom: 1px;
  content: ' ';
  height: 78px;
  left: 6px;
  position: absolute;
  width: 9px;
  z-index: 0;
}
.cactus__arm-right-bottom {
  background: #76ca1a;
  border-radius: 300px 230px;
  bottom: 47px;
  box-shadow: -18px 1px 10px 5px #5c9d14 inset;
  content: ' ';
  height: 25px;
  left: 30px;
  position: absolute;
  width: 53px;
  z-index: -10;
}
.cactus__arm-right-bottom::after {
  background: #76ca1a;
  border-bottom: 3px solid #5c9d14;
  border-radius: 300px 230px;
  border-top: 3px solid #5c9d14;
  bottom: 4px;
  content: ' ';
  height: 10px;
  left: 6px;
  position: absolute;
  width: 40px;
}
.cactus__arm-left-top {
  -webkit-animation: rotate 1s infinite alternate ease-in-out;
          animation: rotate 1s infinite alternate ease-in-out;
  background: #76ca1a;
  border-radius: 300px 260px 250px 250px;
  bottom: 103px;
  box-shadow: 0 0 10px 5px #5c9d14 inset;
  height: 88px;
  left: -47px;
  position: relative;
  -webkit-transform-origin: bottom;
          transform-origin: bottom;
  width: 25px;
  z-index: 0;
}
.cactus__arm-left-top::after {
  background: #76ca1a;
  border-left: 3px solid #5c9d14;
  border-radius: 300px 260px;
  border-right: 3px solid #5c9d14;
  bottom: 2px;
  content: ' ';
  height: 85px;
  left: 6px;
  position: absolute;
  width: 9px;
  z-index: 0;
}
.cactus__arm-left-bottom {
  background: #76ca1a;
  border-radius: 300px 230px;
  bottom: 61px;
  box-shadow: 0 0 10px 5px #5c9d14 inset;
  content: ' ';
  height: 25px;
  left: -47px;
  position: absolute;
  width: 55px;
  z-index: -10;
}
.cactus__arm-left-bottom::after {
  background: #76ca1a;
  border-bottom: 3px solid #5c9d14;
  border-radius: 300px 230px;
  border-top: 3px solid #5c9d14;
  bottom: 4px;
  content: ' ';
  height: 10px;
  left: 7px;
  position: absolute;
  width: 40px;
}
.cactus__mouth {
  background: #735347;
  border: 3px solid #5c9d14;
  border-radius: 20px 20px 150% 150%;
  bottom: 100px;
  box-shadow: inset 0 7px 7px 1px #000;
  height: 20px;
  margin-left: 2px;
  position: absolute;
  width: 29px;
  z-index: 100;
}

.shadow {
  -webkit-animation: skew 2s infinite alternate ease-in-out;
          animation: skew 2s infinite alternate ease-in-out;
  background: #342520;
  border-radius: 50%;
  bottom: 51px;
  height: 20px;
  left: 50%;
  margin-left: -60px;
  opacity: .7;
  position: absolute;
  -webkit-transform-origin: bottom;
          transform-origin: bottom;
  width: 120px;
  z-index: 1;
}

.mountain {
  list-style: none;
  position: relative;
  margin-left: -100px;
}
.mountain li:nth-of-type(1) {
  width: 202px;
  height: 50px;
  background: #735347;
  bottom: 15px;
  position: absolute;
  border-radius: 250% 100% 0 0;
  left: 300px;
}
.mountain li:nth-of-type(2) {
  width: 202px;
  height: 100px;
  background: #735347;
  bottom: 15px;
  position: absolute;
  border-radius: 250% 100% 0 0;
  left: 600px;
}
.mountain li:nth-of-type(3) {
  width: 202px;
  height: 150px;
  background: #735347;
  bottom: 15px;
  position: absolute;
  border-radius: 250% 100% 0 0;
  left: 900px;
}
.mountain li:nth-of-type(4) {
  width: 202px;
  height: 200px;
  background: #735347;
  bottom: 15px;
  position: absolute;
  border-radius: 250% 100% 0 0;
  left: 1200px;
}
.mountain li:nth-of-type(5) {
  width: 202px;
  height: 250px;
  background: #735347;
  bottom: 15px;
  position: absolute;
  border-radius: 250% 100% 0 0;
  left: 1500px;
}
.mountain--tall {
  left: -200px;
  -webkit-transform: scale(1, 1.5);
          transform: scale(1, 1.5);
  bottom: -7px;
}
.mountain--short {
  left: -100px;
  -webkit-transform: scale(2.5, 0.5);
          transform: scale(2.5, 0.5);
  bottom: 8px;
}

15