HTML & CSS Loader Code: Full Review and SEO Benefits

custom loader animation that brings some graphical value to your users for blogger and anyone

Introduction

The following HTML and CSS code is a custom loader animation that brings some graphical value to your users while they await the loading of the content. If you use a loader, you ensure that the change between different parts of your site occurs as smoothly as possible, so users believe the site is still very active and there is no problem at all. The sort of animation would prove to be particularly useful in web applications or content-heavy sites where the loading times might cause minor effects on user experience.

html and css pure loader

Code Breakdown

Let's dive into the meat of the code now, discussing why, when, and how to implement it on your site.

1. HTML Structure

The HTML part of the code uses a <div> structure. However, it uses six child elements for defining the loader.

<div class="loader">
  <div class="cusloderview"></div>
  <div class="cusloderview"></div>
  <div class="cusloderview"></div>
  <div class="cusloderview"></div>
  <div class="cusloderview"></div>
  <div class="loader__ball"></div>
</div>

Here's what each represents:

  • loader: This is the parent div used for encapsulating loader's structure.
  • cusloderview: The vertical bars animating in to demonstrate movement.
  • loader__ball: A small round element, each one jumping along the bars in sync, providing dynamic feedback to the user regarding his position. The elements of the loader will then have their style and animation defined in the next part by CSS.
Key Features:
  • Bar and Ball Animations: The bars are scaled up and down while the bouncing ball moves and jumps from the bars.
  • Responsive Behavior: The loader is pretty small, at 75px x 100px. It is also lightweight enough and would appear more apt for any screen size without appearing too intrusive.
  • Color Scheme: Bars are black, and the ball is blue, but they can be easily customized to fit in your site's design.

Animation Highlights: Kissing bars and ball that have very smooth animations through keyframe in code.

Ball Animation (@keyframes ball624):   The ball is translated from the left to the right with bounces up and drops at different height; therefore the whole motion is smooth and gives an amusing effect when using is waiting for its content to load. Bar Animation: The height of the bars changes vertically in accordance with how far up and down the ball travels. This makes the bars seem like they are reacting to the motion of the ball, thus making the animation flow together coherently.

Why Use This Loader?

  1. Boosts User Experience: This indicates to the user that the page or section of the page is taking too long to load. In the absence of the same, a user might consider the website to be slow or even broken. The loader offered here ensures a good aesthetic appeal and professionality of the time while loading hence boosting user experience.

  2. Beauty Appeals:

  • The animation is clean, futuristic, and gives the whole thing a professional look. It is catchy enough not to be too annoying and keeps the user interestingly waiting for content.
  1. Performance Optimization: The loader is super lightweight. Hence, your site will be affected less. CSS animations are accelerated by hardware for most devices, so transitions will be smooth.

  2. SEO Impact: Loaders do not have a direct influence on SEO rankings, but indirectly they do impact the process. Experience of a user is much better when abrupt transitions between pages are absent. Users stay longer on your site, thus reducing the bounce rates that positively influences your SEO.

  • If the loading time of the content is longer, this loader permits keeping the user in place, raising the possibilities of them still being there when the content loads.
  1. Customizable This loader is easily modifiable according to your site's theme. In this, you could easily change the color of the bars and ball according to your branding or change its size for varied usage cases.
  2. Multi-Purpose: This loader can be used in other sections of your website where content loading will be an ongoing process, such as with image galleries, data-heavy pages, or the submission of forms. It is also helpful in SPAs where content is loaded dynamically but no page refresh happens.

Where and When to Use This Loader?

  • Use on Slow-Loading Pages: Whenever pages in your website have heavier content like images or videos, this loader will make the waiting experience for the user better.
  • For Data-Intensive Applications: For those applications wherein a user is waiting for data, be it in forms or even dashboards, this loader will keep the user engaged.
  • As a Preloader: This display occurs when the page has not yet loaded fully, so the visitor can still ascertain that the content is being loaded.

Benefits of Having This Loader on Your Website:

  • Reduces User Frustration: Users get to see that this page is processing which minimizes frustration for waiting without feedback.
  • Enhances User Engagement: This dynamic motion keeps users interested and ensures that they would stick around longer on the page. Offers the User a More Favorable Impression of Site Loading Speed As your website requires some time to download it, this loader is assumed to add the responsive feature, which impacts the users' impression positively. It can easily be customized to suit any theme by changing the color, size, and any other settings as preferred for the branding of the website.

CSS Code

.loader {
  position: relative;
  width: 75px;
  height: 100px;
}

.cusloderview {
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 50%;
  background: rgb(0, 0, 0);
  transform-origin: center bottom;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

.cusloderview:nth-child(1) {
  left: 0px;
  transform: scale(1, 0.2);
  -webkit-animation: barUp1 4s infinite;
  animation: barUp1 4s infinite;
}

.cusloderview:nth-child(2) {
  left: 15px;
  transform: scale(1, 0.4);
  -webkit-animation: barUp2 4s infinite;
  animation: barUp2 4s infinite;
}

.cusloderview:nth-child(3) {
  left: 30px;
  transform: scale(1, 0.6);
  -webkit-animation: barUp3 4s infinite;
  animation: barUp3 4s infinite;
}

.cusloderview:nth-child(4) {
  left: 45px;
  transform: scale(1, 0.8);
  -webkit-animation: barUp4 4s infinite;
  animation: barUp4 4s infinite;
}

.cusloderview:nth-child(5) {
  left: 60px;
  transform: scale(1, 1);
  -webkit-animation: barUp5 4s infinite;
  animation: barUp5 4s infinite;
}

.loader__ball {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 10px;
  height: 10px;
  background: rgb(44, 143, 255);
  border-radius: 50%;
  -webkit-animation: ball624 4s infinite;
  animation: ball624 4s infinite;
}

@keyframes ball624 {
  0% {
    transform: translate(0, 0);
  }

  5% {
    transform: translate(8px, -14px);
  }

  10% {
    transform: translate(15px, -10px);
  }

  17% {
    transform: translate(23px, -24px);
  }

  20% {
    transform: translate(30px, -20px);
  }

  27% {
    transform: translate(38px, -34px);
  }

  30% {
    transform: translate(45px, -30px);
  }

  37% {
    transform: translate(53px, -44px);
  }

  40% {
    transform: translate(60px, -40px);
  }

  50% {
    transform: translate(60px, 0);
  }

  57% {
    transform: translate(53px, -14px);
  }

  60% {
    transform: translate(45px, -10px);
  }

  67% {
    transform: translate(37px, -24px);
  }

  70% {
    transform: translate(30px, -20px);
  }

  77% {
    transform: translate(22px, -34px);
  }

  80% {
    transform: translate(15px, -30px);
  }

  87% {
    transform: translate(7px, -44px);
  }

  90% {
    transform: translate(0, -40px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@-webkit-keyframes barUp1 {
  0% {
    transform: scale(1, 0.2);
  }

  40% {
    transform: scale(1, 0.2);
  }

  50% {
    transform: scale(1, 1);
  }

  90% {
    transform: scale(1, 1);
  }

  100% {
    transform: scale(1, 0.2);
  }
}

@keyframes barUp1 {
  0% {
    transform: scale(1, 0.2);
  }

  40% {
    transform: scale(1, 0.2);
  }

  50% {
    transform: scale(1, 1);
  }

  90% {
    transform: scale(1, 1);
  }

  100% {
    transform: scale(1, 0.2);
  }
}

@-webkit-keyframes barUp2 {
  0% {
    transform: scale(1, 0.4);
  }

  40% {
    transform: scale(1, 0.4);
  }

  50% {
    transform: scale(1, 0.8);
  }

  90% {
    transform: scale(1, 0.8);
  }

  100% {
    transform: scale(1, 0.4);
  }
}

@keyframes barUp2 {
  0% {
    transform: scale(1, 0.4);
  }

  40% {
    transform: scale(1, 0.4);
  }

  50% {
    transform: scale(1, 0.8);
  }

  90% {
    transform: scale(1, 0.8);
  }

  100% {
    transform: scale(1, 0.4);
  }
}

@-webkit-keyframes barUp3 {
  0% {
    transform: scale(1, 0.6);
  }

  100% {
    transform: scale(1, 0.6);
  }
}

@keyframes barUp3 {
  0% {
    transform: scale(1, 0.6);
  }

  100% {
    transform: scale(1, 0.6);
  }
}

@-webkit-keyframes barUp4 {
  0% {
    transform: scale(1, 0.8);
  }

  40% {
    transform: scale(1, 0.8);
  }

  50% {
    transform: scale(1, 0.4);
  }

  90% {
    transform: scale(1, 0.4);
  }

  100% {
    transform: scale(1, 0.8);
  }
}

@keyframes barUp4 {
  0% {
    transform: scale(1, 0.8);
  }

  40% {
    transform: scale(1, 0.8);
  }

  50% {
    transform: scale(1, 0.4);
  }

  90% {
    transform: scale(1, 0.4);
  }

  100% {
    transform: scale(1, 0.8);
  }
}

@-webkit-keyframes barUp5 {
  0% {
    transform: scale(1, 1);
  }

  40% {
    transform: scale(1, 1);
  }

  50% {
    transform: scale(1, 0.2);
  }

  90% {
    transform: scale(1, 0.2);
  }

  100% {
    transform: scale(1, 1);
  }
}

@keyframes barUp5 {
  0% {
    transform: scale(1, 1);
  }

  40% {
    transform: scale(1, 1);
  }

  50% {
    transform: scale(1, 0.2);
  }

  90% {
    transform: scale(1, 0.2);
  }

  100% {
    transform: scale(1, 1);
  }
}

JavaScript Code

//no used

Conclusion

This is perfect loading animation with HTML and CSS in terms of aesthetics and functionality. It loads content in a manner that the experience is friendly for users, light enough to avoid performance hits, and the design can easily be customized according to the web's design. From an SEO point of view, it ensures that users will not bounce away as much since they see content being generated - thereby also supporting better SEO rankings.

This loader will add a nice, sleek look to your website and contribute positively to user retention, hence indirectly helping out in efforts towards better SEO.

Post a Comment