CSS Loading Progress Bar Animation

CSS Loading Progress Bar Animation
Code Snippet:Loader
Author: Jovan John Magallon
Published: January 19, 2024
Last Updated: January 22, 2024
Downloads: 986
License: MIT
Edit Code online: View on CodePen
Read More

This code provides a CSS Loading Progress Bar Animation. It creates a stylish progress bar for visual loading feedback. The core method here animates a loading bar with text, enhancing user experience during page loading.

You can use this code in your website or web application to add an attractive loading progress bar. It improves user experience by providing visual feedback during page loading, making your site feel more responsive and professional.

How to Create CSS Loading Progress Bar Animation

1. Start by adding the necessary HTML structure to your web page. Insert the following code inside the <body> section of your HTML file. This code sets up the basic structure for the loading progress bar.

<div class="bar">
  <div class="loading-text">Loading...</div>
  <div class="progress"></div>
</div>

2. In the <head> section of your HTML file, add a link to the CSS styles needed for the animation. You can use the following code to style the progressbar:

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap');

body{
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  background-color: #7fa7b8;
}
::-webkit-scrollbar{
  display: none;
}

.bar{
  height: 50px;
  min-width: 500px;
  background-color: none;
  display: flex;
  align-items: center;
  position: relative;
  border-radius: 40px;
  overflow: hidden;
  box-shadow:  7px 7px 14px #4b636d,
             -7px -7px 14px #b3ebff;
  cursor: pointer;
}
.loading-text{
  margin: auto;
  color: #507686;
  letter-spacing: 2px;
  font-weight: 300;
  font-size: 20px;
}
.progress{
  height: 50px;
  animation-name: animate;
  background: #97d7f2;
  position: absolute;
  z-index: 1;
  animation-duration: 4s;
  animation-iteration-count: infinite;
  justify-self: start;
  overflow: hidden;
  border-radius: 10px;
  opacity: 0.5;
}
@keyframes animate {
  0%   {width: 0%;}
  25%  {width: 10%;}
  50%  {width: 40%;}
  75%  {width: 50%;}
  100% {width: 100%;}
}

You can further customize the loading bar to match your website’s design. Modify the CSS code in your “style.css” file to adjust colors, sizes, fonts, and other visual elements to your liking.

That’s all! hopefully, you have successfully created a loading progress bar animation. If you have any questions or suggestions, feel free to comment below.

Leave a Comment

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

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X