M/s VIKASH TECH - We Write Imaginations to Codes..!!

Animated Gradient Shiny Loader with HTML CSS & JavaScript

Hello readers, Today in this blog you’ll learn how to create an Animated Gradient Shiny Loader or Preloader in HTML CSS & JavaScript. E
Preloaders are what you inspect on the screen while the rest of the page’s content is still loading. Preloaders or loaders are often easy or complex animations that are used to keep visitors entertained while server operations finish processing.

At first, this loader is in the initial stage, where there is a loader and 0% text or number at the center on the webpage. But when you click on that center text or number, the loader will be activated and it starts to rotates as well as the center percentage also starts to increase from 0% to 100%. When it completed 100%, the loader stops to rotating.

If you’re feeling difficulty to understanding what I’m saying then you can Try the code below to check the output yourself.Still facing issues? Feel free to mail us your queries on info@vikashtech.com


<!DOCTYPE html>
<!-- Created By Praveen kumar -->
<html lang="en" dir="ltr">
    <meta charset="utf-8">
    <title>Gradient Ring or Loader</title>
    <link rel="stylesheet" href="blog.css">
    <div class="outer">
<div class="inner">
<!-- This is Javascript Code -->
      let outer = document.querySelector(".outer");
      let inner = document.querySelector(".inner");
      let percent = document.querySelector("span");
      let count = 0;
      inner.addEventListener('click', function(){
        let loading = setInterval(function(){
          if(count == 100){
            count = count + 1;
            percent.textContent = count + '%';

    <!-- This is Jquery Code you can use this code also
      instead of Javascript Code -->
      <!-- <script>
          var count = 0;
              if(count == 100){
                count = count + 1;
                $('span').text(count + '%');
            }, 200);
      </script> -->



  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-family: sans-serif;
  background: #240f52;
  overflow: hidden;
  height: 300px;
  width: 300px;
  background: linear-gradient(135deg,#FEED07 0%,#FE6A50 5%,#ED00AA 15%,#2FE3FE 50%,#8900FF 100%);
  border-radius: 50%;
  position: absolute;
  width: 275px;
  height: 275px;
  text-align: center;
  line-height: 275px;
  background: #240f52;
  border-radius: 50%;
  cursor: default;
  /* opacity: 0; */
.inner span{
  font-size: 60px;
  font-weight: 800;
  background: linear-gradient(135deg,#FEED07 0%,#FE6A50 5%,#ED00AA 15%,#2FE3FE 50%,#8900FF 100%);
  color: transparent;
  -webkit-background-clip: text;
  background-size: 300%;
  animation: rotate 2s ease infinite;
@keyframes rotate {
    transform: rotate(360deg);
  animation: rotate2 3s ease;
@keyframes rotate2 {
    transform: rotate(360deg);
Category :


No comments found.

Leave a Reply

Latest Posts

telegram bot

How to send message via Telegram Bot using PHP - Telegram API

Telegram is a great platform for chat and communication purposes. Having a large community and large user base, it is…

SuiteCRM, an open source tool for startups to use from an early stage.

When we talk about businesses in their early stage, it's quite a big deal to choose good management and sales…

How to Implement Google QAuth Authentication | Google Login - PHP MySQL

PHP Google OAuth API allows users to login into a website with their Google credentials. A user with a Google…

How to use Google Two Factor Authentication in your project?

At our end we take security at a priority, implementation of different ways to secure website should be the priority…

%d bloggers like this: