<div class="mega-wrapper"> 
  <div class="wrapper">
    <div class="big-cube"></div>
    <div class="small-cube"></div>
  </div>
</div>
.mega-wrapper {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.big-cube {
  border: 8px solid black;
  width: 6.25em;
  height: 6.25em;
  margin: 0 auto;
  margin-top: 35%;
  z-index: 0;
}

.small-cube {
  width: 4.375em;
  height: 4.375em;
  border: 8px solid black;
  background-color: #f15922;
  z-index: 10;
  margin-top: -42%;
  margin-left: 58%;
  
  animation: clock 1.5s linear infinite;
}

@keyframes clock {
  0% {
    transform: rotate(0deg);
    background-color: #fff;
  }
  
  25% {
    transform: rotate(180deg);
    background: #fff;
  }
  
  50% {
    transform: rotate(180deg);
    background: #f15922;
  }
  
  75% {
    transform: rotate(360deg);
    background: #f15922;
  }
  
  100% {
    transform: rotate(360deg);
    background: #fff;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.