Loading Waves

Ocean waves alike animation

by AntowaKartowa

HTML

<!DOCTYPE html>
<html lang="en-US">
    
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CSS animatin, transitions and transforms</title> 
</head>

<body>

    <ul>
        <li>L</li>
        <li>O</li>
        <li>A</li>
        <li>D</li>
        <li>I</li>
        <li>N</li>
        <li>G</li>
    </ul>

</body>
</html>

CSS

body {
 margin: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 height: 100vh;
 font-family: sans-serif;
}

ul {
  margin: 0;
  padding: 0;
  display: flex;
  perspective: 400px;
}

ul li {
  color: blue;
  list-style-type: none;
  font-size: 80px;
  letter-spacing: 20px;
  animation: waves 3s linear infinite;
  
  /* animation-play-state: paused; */
}

@keyframes waves {
  0% {
    transform: rotateY(0) translateX(-40px) scale(0.8);
    letter-spacing: 20px;
    opacity: 0;
  }

  10% {
    transform: rotateY(5deg) translateX(-44px) scale(0.87);
  }

  15% {
    transform: rotateY(9deg) translateX(-47px) scale(0.9);
    letter-spacing: 25px;
    opacity: 1;
    color: blue;
  }

  25% {
    transform: rotateY(15deg) translateX(-50px) scale(0.95);
  }

  35% {
    transform: rotateY(28deg) translateX(-46px) scale(1.1);
    letter-spacing: 15px;
    color: red;
  }

  43% {
    transform: rotateY(38deg) translateX(-27px) scale(1.27);
    letter-spacing: -2px;
  }

  45% {
    transform: rotateY(70deg) translateX(-18px) scale(1.3);
    letter-spacing: -10px;
  }

  50% {
    transform: rotateY(0deg) translateX(-7px) scale(1.27);
    letter-spacing: 0px;
    opacity: 1;
  }

  60% {
    transform: rotateY(-20deg) translateX(7px) scale(1.19);
  }

  75% {
    transform: rotateY(-15deg) translateX(-15px) scale(1);
  }

  90% {
    opacity: 0;
  }

  100% {
    color: blue;
    transform: rotateY(0deg) translateX(-40px) scale(0.8);
    letter-spacing: 20px;
    opacity: 0;
  }
}

ul li:nth-child(1) {
  animation-delay: 0s;
}

ul li:nth-child(2) {
  animation-delay: 0.2s;
}

ul li:nth-child(3) {
  animation-delay: 0.4s;
}

ul li:nth-child(4) {
  animation-delay: 0.6s;
}

ul li:nth-child(5) {
  animation-delay: 0.8s;
}

ul li:nth-child(6) {
  animation-delay: 1s;
}

ul li:nth-child(7) {
  animation-delay: 1.2s;
}