Robot with arms

author(s): Arun Kumar M

by Nimeshka Srimal

HTML

<input id="autoplay" type="button" value="Autoply" />
<div class="canvas-view">
  <span class="cylinder-top">
    <span class="inner">
      <span class="small-circle">            
        <div class="scara-arm">
          <div class="level1-circle">
            <div class="level1-gear">
              <div class="level1-dot"></div>
            </div>
            <div class="level1-arm"></div>
            <div class="level2-circle">
              <div class="level2-gear">
                <div class="level2-dot"></div>
              </div>
              <div class="level2-arm"></div>
              <div class="level3-circle">
                <div class="level3-gear">
                  <div class="level3-dot"></div>
                </div>
                <div class="level3-arm"></div>
                <div class="level3-pointer"></div>
              </div>
            </div>
          </div>
        </div>            
      </span>
    </span>
  </span>
  <span class="cylinder"></span>
</div>

CSS

.canvas-view {
  width: 482px;
  height: 482px;
  margin: 20px auto;
  padding: 200px 130px 60px;
  border: 1px solid #000;
  box-sizing: border-box;
}
        
.cylinder-top {
  display: block;
  width: 180px;
  height: 90px;
  background: #1AB8F5;
  border: 1px solid #106E94;
  border-radius: 50%;
  margin-left: 19px;
  position: relative;
  z-index: 1;
  box-shadow: 0px 5px #106E94;
}

.cylinder-top>span.inner {
  display: block;
  width: 124px;
  height: 50px;
  background: #1AB8F5;
  border: 1px solid #106E94;
  border-radius: 50%;
  margin: 16px 27px;
  box-shadow: 0px 3px #106E94;
}

.cylinder-top .small-circle {
  display: block;
  width: 60px;
  height: 30px;
  background: #1AB8F5;
  border: 1px solid #106E94;
  border-radius: 50%;
  margin: 8px 30px;
  box-shadow: 0px 3px #106E94;
}

.cylinder {
  border-left: 1px solid #000000;
  border-right: 1px solid #000000;
  width: 120px;
  height: 120px;
  display: inline-block;
  position: relative;
  background-color: #666;
  margin-left: 50px;
  top: -15px;
}

.cylinder:after {
  content: "";
  display: inline-block;
  width: 120px;
  height: 50px;
  background: #666;
  border: 1px solid #000000;
  border-radius: 50%;
  position: absolute;
  left: -1px;
  bottom: -25px;
  z-index: -1;
}
/*arms css starts here*/

.scara-arm {
  width: 30px;
  height: 30px;
  margin: 1px auto;
  transform: rotate(0deg);
}

.scara-arm.autoplay {
  animation: rotatearm 8s linear infinite;
  -webkit-animation: rotatearm 8s linear infinite;
}

.level1-circle,
.level2-circle,
.level3-circle {
  border-radius: 50%;
  border: 1px solid black;
  background: orange;
  height: 30px;
  width: 30px;
  transform: rotate(0deg);
  transition: transform 1s;
}

.level1-circle:before,
.level2-circle:before,
.level3-circle:before {
  content: '';
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
}

.level1-circle {
  background-color: #1AB8F5;
  position: relative;
 ...

JavaScript

$(document).ready(function() {
  $('#autoplay').click(function() {
    $('.scara-arm').toggleClass('autoplay');
  });
});