javascript progress bar

Want to know how to create a clock with a progress indicator using JavaScript, HTML, CSS? Solution: See this JavaScript Progress Clock with day, hour, minute, second, progression. 

Previously I have shared some clock programs using JavaScript, but this is a little bit different and advanced. Basically, This is a fully functional clock, it will show Date, Month, Day, Time all things. Also, there are some circular progress indicators to show the values of time in hours, minutes, and seconds. It is completely based on pure JavaScript, with no library and plugin used.

Today you will learn to create a progress clock using JavaScript, HTML, and CSS. Basically, there are 3 info: Date, Day, Time, and 4 circular progression donut bars. These circle bars are for showing the progression of seconds, minutes, hours, and the whole day. The program is with good UI design and colorful elements. You should place this on your website if you want to show the date and time.

So, I am sharing this pure Javascript, HTML, CSS clock program, it will help you to create a clock and learn JS better. I have HTML to create the structure and added some JS values using inline commands. Used CSS for styling and UI design. And JavaSript for the whole functioning. You can see all the codes for creating and learning to make this type of clock program easily.

Preview Of JS Clock With Progression Animation

See this video preview to getting an idea of how this program looks like.

Live Demo

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

You May Also Like:

JavaScript Progress Clock Source Code

Before sharing the source code, let’s talk a little bit about the program. First, using HTML I have created some button and span to show values, and some SVG elements to show the progression. Mostly used <svg> command to create all the elements, and later using CSS gave style and js to change values dynamically.

Now using CSS I have placed all the elements in the right place, as you can see on the preview. For color, I used HSL values and added in HTML and CSS. HSL for dynamic color change by changing its percent values. Added Data-* command to store color and hover values. Also used Media query to change theme on dark background.

JavaScript handling here the time, date values, progression bar values, and animation. There using JS command got the date and time values from the system/device and create the whole changing and progressing event. Also used case and return commands for changing month and day names.

Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First file for HTML, second for CSS, and the third file for JavaScript. Follow the steps to creating this program without any error.

index.html

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

2 COMMENTS

  1. Hi,
    Nice Script for time.

    I need the timing-based timescale running in a horizontal style. The scale should be labeled with hours and minutes and days and months and years. Those scale values should keep moving following with seconds scale. Could you provide a detailed script on this?

    regards

LEAVE A REPLY

Please enter your comment!
Please enter your name here