/* Check my videoblog: https://www.youtube.com/watch?v=dQw4w9WgXcQ */

html,
body {
  margin: 0;
  padding: 0;
  cursor: pointer;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-transition: 1s -webkit-filter ease-in;
  transition: 1s -webkit-filter ease-in;
  -o-transition: 1s filter ease-in;
  transition: 1s filter ease-in;
  transition: 1s filter ease-in, 1s -webkit-filter ease-in;
  background-color: #111;
}

.body--invert {
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
}

canvas {
  margin: auto;
  width: 100%;
}

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.super-block {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -150px;
  margin-top: -150px;
  width: 300px;
  height: 300px;
  background-color: #fff;
  clip-path: polygon(0 0, 50% 0, 100% 0, 100% 50%, 100% 100%, 50% 100%, 0 100%, 0 50%);
  animation: clipik 6s ease-in-out infinite;
  transition: 0.4s transform;
}

.super-block::after {
  content: "";
  position: absolute;
  width: 50%;
  height: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #111;
  box-shadow: 0px 0px 9px 0px #111;
  animation: clipik 6s ease-in-out infinite;
  animation-direction: reverse;
  opacity: 0;
  transition: 0.4s opacity;
}

.super-block--elite::after {
  opacity: 1;
}

@keyframes clipik {
  0% {
    clip-path: polygon(0 0, 50% 0, 100% 0, 100% 50%, 100% 100%, 50% 100%, 0 100%, 0 50%);
  }

  20% {
    clip-path: polygon(0 0, 50% 0, 75% 25%, 100% 50%, 100% 100%, 50% 100%, 20% 70%, 0 50%);
  }

  40% {
    clip-path: polygon(25% 25%, 50% 0, 75% 25%, 100% 50%, 75% 75%, 50% 100%, 20% 70%, 0 50%);
  }

  60% {
    clip-path: polygon(25% 25%, 50% 0, 50% 50%, 100% 50%, 75% 75%, 50% 100%, 50% 50%, 0 50%);
  }

  80% {
    clip-path: polygon(0 100%, 50% 0, 50% 50%, 100% 50%, 100% 0, 50% 100%, 50% 50%, 0 50%);
  }

  100% {
    clip-path: polygon(0 0, 50% 0, 100% 0, 100% 50%, 100% 100%, 50% 100%, 0 100%, 0 50%);
  }
}