Skip to main content

How to Create a Circular Progress Bar | HTML & CSS

#html #css #foryou #world #happy # website #webdesign #webdeveloper #how to #howto #trending #viral #srilanka #youtube #tiktok #blog  #howtocreate #Javascript #image #imageuploader $progressbar #howtocreateprogressbar #circular

 

Dive into the world of web design with our latest tutorial! 🌐✨ Learn how to create a sleek Circular Progress Bar using HTML and CSS from scratch. In this step-by-step guide, we break down the process to make it easy for beginners while providing valuable insights for those looking to refine their coding skills. Watch as we unveil the secrets behind designing and coding a visually dynamic progress bar that adds a touch of sophistication to your web projects. Elevate your UI/UX game with this simple yet impactful element! 💻⚙️ #webdesign #html #css #progressbar Don't forget to like, share, and subscribe for more web development tutorials and tips. If you have any questions or need further assistance, feel free to leave a comment, and we'll be happy to help you out. Happy coding!


                            index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Circular Progression Bar</title>
</head>
<body>  
<div class="card">
    <div class="value">
        <h2> <span class="counter" data-target="90">90%
            <br> Success
        </span></h2>
        <div class="block"></div>
    </div>
</div>

<div class="card2">
    <div class="value2">
        <h2> <span class="counter2" data-target="10">10%
            <br> Fail
        </span></h2>
        <div class="block2"></div>
    </div>
</div>

<script src="script.js"></script>
</body>
</html>

                            style.css

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&family=Poppins:wght@100;200;300;400;500;700&family=Roboto+Slab&display=swap');

*{
    font-family: 'Poppins',sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(#444 , #222);
}
.card{
    position: relative;
    width: 200px;
    height: 200px;
    margin-right: 25px;
}
.card .value{
    position: relative;
    height: 100%;
    width: 100%;
    background-color: #3333;
    border-radius: 100%;
}
.card .value .block{
    position: absolute;
    width: 2px;
    height: 15px;
    background: black;
    opacity: 0;
    left: 50%;
    transform-origin: 50% 100px;
    animation: animate 1s linear forwards;
}
@keyframes animate
{
    to{
        opacity: 1;
    }
}
.card .value .block:nth-child(-n+91){
    background: green;
    box-shadow: 0 0 15px rgb(21,187,21) , 0 0 30px rgb(21,187,21);
}
.card .value h2{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50% , -50%);
    color: #fff;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
}
.card .value h2 span{
    font-weight: 700;
    font-size: 2em;
}
/***********************************/
.card2{
    position: relative;
    width: 200px;
    height: 200px;
    margin-right: 25px;
}
.card2 .value2{
    position: relative;
    height: 100%;
    width: 100%;
    background-color: #3333;
    border-radius: 100%;
}
.card2 .value2 .block2{
    position: absolute;
    width: 2px;
    height: 15px;
    background: black;
    opacity: 0;
    left: 50%;
    transform-origin: 50% 100px;
    animation: animate 1s linear forwards;
}
@keyframes animate
{
    to{
        opacity: 1;
    }
}
.card2 .value2 .block2:nth-child(+n+91){
    background: red;
    box-shadow: 0 0 15px rgb(239,11,45) , 0 0 30px rgb(239,11,45);
}
.card2 .value2 h2{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50% , -50%);
    color: #fff;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
}
.card2 .value2 h2 span{
    font-weight: 700;
    font-size: 2em;
}


                            script.js

const value = document.getElementsByClassName('value')[0];
const block = document.getElementsByClassName('block');

for(var i = 1; i < 100; i++){
    value.innerHTML += "<div class = 'block'></div>";
    block[i].style.transform = "rotate("+3.6 * i + "deg)";
    block[i].style.animationDelay = `${i/100}s`;
}  


/*********************** */
const value2 = document.getElementsByClassName('value2')[0];
const block2 = document.getElementsByClassName('block2');

for(var i = 1; i < 100; i++){
    value2.innerHTML += "<div class = 'block2'></div>";
    block2[i].style.transform = "rotate("+3.6 * i + "deg)";
    block2[i].style.animationDelay = `${i/100}s`;
}


























Like Us On Facebook:   / codingwithnexusofficial   Follow Us On Instagram:   / coding_with_nexus   Follow Us On TikTok:   / coding.with.nexus   Visit For Full Codes: https://codingwithnexusofficial.blogs...






Comments

Popular posts from this blog

How to Build Your Own Image Uploader using HTML, CSS, and JS Tutorial

    Welcome to our step-by-step tutorial on creating your own image uploader using #html  , #css  , and JavaScript. In this video, we'll guide you through the process of building a simple yet effective image uploader for your web projects. With just a few lines of code, you'll learn how to create a user-friendly interface that allows users to upload images seamlessly. Whether you're a beginner or an experienced developer looking to enhance your skills, this tutorial is perfect for you. Follow along and empower yourself to create dynamic web applications with ease! Don't forget to like, share, and subscribe for more coding tutorials. Let's get started!  index.html   <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Drag & Drop Image Uploader </ title >...

Create an Animated Switch with HTML and CSS in 2024

  Create an Animated Switch with HTML and CSS in 2024 Learn how to create an animated switch using HTML and CSS in 2024! This tutorial will guide you through the process of building a sleek and modern switch element for your website. Enhance your web development skills and stay up-to-date with the latest design trends by mastering this technique. Watch now to level up your front-end development game!  index.html  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Document </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body >     < label class = "switch" >         < input type = "checkbox" checked = "checked" >         < div class = "button" >  ...

Animated Switch

    index.html <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Document </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body >     < label class = "switch" >         < input class = "cb" type = "checkbox" />         < span class = "toggle" >           < span class = "left" > off </ span >           < span class = "right" > on </ span >         </ span >       </ label >       </ body > </ html > style.css  /* The switch - the box around the slider */ .switch {     font-size : 17px ; ...