In this example below you will see how to do a elle-square-2 with some HTML / CSS and Javascript

This awesome code was written by paulwagner, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright paulwagner ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
      <link rel="stylesheet" href="css/style.css">



  <div class="spinner"></div>



/*Downloaded from https://www.codeseek.co/paulwagner/elle-square-2-JRBJvE */
.spinner {
  width: 40px;
  height: 40px;
  border: 1px solid #000;
  margin: 100px auto;
  -webkit-animation: sk-rotateplane 0.6s infinite ease-in-out;
  animation: sk-rotateplane 0.6s infinite ease-in-out;

@-webkit-keyframes sk-rotateplane {
  0% { -webkit-transform: perspective(120px) }
  50% { -webkit-transform: perspective(120px) rotateY(180deg) }
  100% { -webkit-transform: perspective(120px) rotateY(180deg)  rotateX(180deg) }

@keyframes sk-rotateplane {
  0% { 
    transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg) 
  } 50% { 
    transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg) 
  } 100% { 
    transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);