CSS Loading Animation 1


HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
    <link rel="stylesheet" type="text/css" href="1.page.css">
</head>
<body>

    <div class="loader"><span>Loading</span></div>
    
</body>
</html>

CSS CODE:

body{
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: sans-serif;
  background:#000000
}
.loader{
  position: relative;
  font-size: 2em;
  background-color:#000000;
  color: #000;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: .5em;
  padding: 10px;
}
.loader span{
  color: #fff;
  mix-blend-mode: difference;
}
.loader:before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 100%;
  background-color: #fff;
  animation: ani 2s linear infinite;
}
@keyframes ani{
  0%{
    left: 0;
  }
  50%{
    left: calc(100% - 80px);
  }
  100%{
    left: 0;
  }
}

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started