/*
  Copyright (c) 2021-2026 Littleton Robotics
  http://github.com/Mechanical-Advantage

  Use of this source code is governed by a BSD
  license that can be found in the LICENSE file
  at the root directory of this project.
*/

body {
  margin: 0;
  overflow: hidden;
  background-color: transparent;
}

div.container {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  border: none;
}

canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Source: https://freecodez.com/post/7pt17rk */

div.spinner-cubes-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(50%);
  user-select: none;
  transition: all 0.1s ease-in-out;
  opacity: 0;
}

div.spinner-cubes-container.visible {
  transform: translate(-50%, -50%) scale(100%);
  opacity: 1;
}

div.spinner-cubes {
  width: 44px;
  height: 44px;
  transform-style: preserve-3d;
}

div.spinner-cubes-container.animating div.spinner-cubes {
  animation: spinner-cubes 6s infinite ease-in-out;
}

div.spinner-cubes > div {
  height: 100%;
  position: absolute;
  width: 100%;
  background-color: #00aaff33;
  border: 2px solid #00aaff;
  box-sizing: border-box;
}

div.spinner-cubes div:nth-of-type(1) {
  transform: translateZ(-22px) rotateY(180deg);
}

div.spinner-cubes div:nth-of-type(2) {
  transform: rotateY(-270deg) translateX(50%);
  transform-origin: top right;
}

div.spinner-cubes div:nth-of-type(3) {
  transform: rotateY(270deg) translateX(-50%);
  transform-origin: center left;
}

div.spinner-cubes div:nth-of-type(4) {
  transform: rotateX(90deg) translateY(-50%);
  transform-origin: top center;
}

div.spinner-cubes div:nth-of-type(5) {
  transform: rotateX(-90deg) translateY(50%);
  transform-origin: bottom center;
}

div.spinner-cubes div:nth-of-type(6) {
  transform: translateZ(22px);
}

@keyframes spinner-cubes {
  0% {
    transform: rotate(0deg) rotateX(-35deg) rotateY(45deg);
  }

  25% {
    transform: rotate(180deg) rotateX(-215deg) rotateY(-135deg);
  }

  50% {
    transform: rotate(0deg) rotateX(-35deg) rotateY(45deg);
  }

  75% {
    transform: rotate(180deg) rotateX(145deg) rotateY(225deg);
  }

  100% {
    transform: rotate(0deg) rotateX(-35deg) rotateY(45deg);
  }
}
