.container,
.row,
.cube {
  position: relative;
}

.container {
  height: 100vh;
  overflow: hidden;
}

.row {
  display: inline-flex;
  margin-top: -45px;
}

.row:nth-child(even) {
  margin-top: -45px;
  margin-left: -75px;
}

.cube {
  width: 150px;
  height: 150px;
}

.cube > span {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  
  background-color: #fff;

  transition: 2s;

  animation: cube-animation 10s linear infinite;
}

@keyframes cube-animation {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}

.cube:hover > span {
  background-color: #03a9f4;
  transition: 0s;
}

.cube > span:nth-child(1) {
  clip-path: polygon(50% 0%, 100% 25%, 50% 50%, 0% 25%);
}

.cube > span:nth-child(2) {
  clip-path: polygon(0% 75%, 50% 100%, 50% 50%, 0% 25%);
}

.cube > span:nth-child(2)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.1);
  
  clip-path: polygon(0% 75%, 50% 100%, 50% 50%, 0% 25%);
}

.cube > span:nth-child(3) {
  clip-path: polygon(100% 75%, 50% 100%, 50% 50%, 100% 25%);
}

.cube > span:nth-child(3)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.05);
  
  clip-path: polygon(100% 75%, 50% 100%, 50% 50%, 100% 25%);
}