<div class="container">
  <div class="scene">
    <div class="sides">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
					    </div>
  </div>
  <img class="eye" src="https://askd.github.io/codepen/eye.png" width="64" height="40" alt="">
</div>
.container {
  position: relative;
  width: 420px;
  height: 360px;
  margin: 20px auto 0;
}

.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  perspective: 400px;
  perspective-origin: 50% 50%;
  animation: example-scene 20s linear infinite;
}

.sides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  display: flex;
  flex-wrap: wrap;
}

.sides div {
  width: 120px;
  height: 100px;
  margin: 10px;
  background: #6988BE;
}

.sides div:first-child,
.sides div:last-child {
  margin: 10px 150px;
}

.sides div:first-child {
  transform: rotateX(-30deg);
}
.sides div:nth-child(2) {
  transform: rotateY(30deg);
}
.sides div:nth-child(4) {
  transform: rotateY(-30deg);
}
.sides div:last-child {
  transform: rotateX(30deg);
}

@keyframes example-scene {
  0% { perspective-origin: 50% 50%; }
	10% { perspective-origin: 0 50%; }
	20% { perspective-origin: 0 0; }
	30% { perspective-origin: 50% 0; }
	40% { perspective-origin: 100% 0; }
	50% { perspective-origin: 100% 50%; }
	60% { perspective-origin: 100% 100%; }
	70% { perspective-origin: 50% 100%; }
	80% { perspective-origin: 0 100%; }
	90% { perspective-origin: 0 50%; }
	100% { perspective-origin: 50 50%; }
}

.eye {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -22px 0 0 -32px;
  animation: example-eye 20s linear infinite;
}

@keyframes example-eye {
  0% { left: 50%; top: 50%; }
	10% { left: 0; top: 50%; }
	20% { left: 0; top: 0; }
	40% { left: 100%; top: 0; }
	60% { left: 100%; top: 100%; }
	80% { left: 0; top: 100%; }
	90% { left: 0; top: 50%; }
	100% { left: 50%; top: 50%; }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.