3d progress bar animation

How we can create a 3D perspective loading/progress bar using normal HTML CSS JS? Solution: See this 3D Progress Bar Animation with CSS JavaScript, Perspective Loading Bar.

Previously I have shared many progress bars related programs, but this is a three-dimensional perspective loading bar animation. Basically, a progress bar visualizes the progression of the operation. Also, we know as a loading bar, it helps to identify the loaded part and how much part is left. We can style or customize the bar in many ways, like gradient, image fill, 3D perspective, etc.

Today you will learn to create Perspective Loading Bar using HTML, CSS, and JavaScript. Basically, there are 2 progress bars with the same effect and animation. Two bars to show the straight bar and the perspective bar. When you will click on the bar it will switch to 3D perspective shape. There is a toggle effect to switch between normal and perspective. At the bottom, you will see a text “Restart” to restarting the loading fill animation.

So, Today I am sharing 3D Progress Bar Animation with CSS JavaScript. There I have used CSS to create the whole program, but the restart animation function based on JavaScript. This will a pure CSS program if we remove the restart button. The program is an excellent example of how we can create amazing things using only HTML and CSS. You can use this progress bar on your website to show the process to users.

If you are thinking now how this animated perspective loading bar actually is, then see the preview given below.

Preview Of Perspective Loading Bar

See this video preview to getting an idea of how this loading bar animation looks like.

Live Demo

Now you can see this visually, also you can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

3D Progress Bar Animation with CSS JavaScript Source Code

Before sharing source code, let’s talk about it. First I have created a label with class name “loading” and put an input, div, two spans, and a list inside it. The spans for the texts and the list has 11 items for perspective view. And the input is checkbox type to switch the bar’s style. I have copied and pasted the same block of codes for creating the 2nd bar, but the checkbox input is checked for show perspective view by default. Also, placed a hyperlink tag to restart function.

Now using CSS I have placed all the items in the right place, as you can see in the preview. There I have used CSS variables ( --var ) to store and pass data easily, also it helps in the calculation. I have placed and stylize each list item to creating the perspective model. For selecting list items separately, I used CSS nth-child() command. I also used the transform command and @keyframe to create the animation.

JavaScript handling here only the restart feature in this program. Used JS querySelectorAll() command to select all elements as a selector, and used .addEventListener command to detect click. Left all other things you will understand after getting the whole source code, I can’t explain all things here.

For creating this program, you have to create 3 files. First file for HTML, second file for CSS, and the third file for JavaScript. Follow the steps to creating this program without any trouble.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

The final step, create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created 3D Progress Bar Animation with CSS JavaScript, Perspective Loading Bar. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

2 COMMENTS

  1. Hi
    You have very good quality of code and fantastic demos, but your website remembering me 90’s design. Please improve this in future like tympanus, smashingmagazine …

    Appreciating your hard work. 🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here