JSFiddle - React, Tailwind, and code Playground

by trolleymusic

HTML

<div class="clock">
    <div class="on">
        <div class="spin"></div> 
    </div>
</div>

CSS

.clock {
 background-image: url("http://localhost:8888/img/clock_off.png");
  background-size: 362px 362px;
  background-repeat: no-repeat;
  background-position: top left;
  height: 362px;
  position: absolute;
  width: 362px;
  left: 0;
  top: 0;
}

.clock .on {
    border-radius: 0 362px 362px 0;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;

    clip:rect(0px,362px,362px,175px);
}

.spin {
  background-image: url("http://localhost:8888/img/clock.png");
  background-size: 362px 362px;
  background-repeat: no-repeat;
  background-position: 0 0;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    -webkit-animation: clockin 2s 1 steps(20);
}




  @-webkit-keyframes clockin {
    0% { -webkit-transform: rotate(-120deg); }
    100% { -webkit-transform: rotate(0deg); }
  }