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 Create Animate Mic Logo

    Embark on a design and coding adventure with our tutorial on creating and animating a microphone logo using HTML and CSS. In this concise yet comprehensive guide, we'll navigate logo design principles, emphasizing simplicity and visual balance. Seamlessly transitioning to animation, we'll bring the mic logo to life, making it dynamic and engaging. What sets this tutorial apart is its accessibility—no complex software, just the power of code.🎙️✨ #logoanimation #designtutorial #webdevelopment 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! Like Us On Facebook:    / codingwithnexusofficial   Follow Us On Instagram:    / coding_with_nexus   Follow Us On TikTok:    / coding.with.nexus  index.html <! DOCTYPE html > < ...

How To Create Loading Animation Using HTML & CSS

    we'll show you how to create a captivating animation loading screen using HTML and CSS. If you want to make your website more engaging and user-friendly. 1.Create a New Folder 2.Open the Folder in Vs Code  3.Create index.html and style.css Files  4.Begin Coding    index.html  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Animation Loading Button </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body > < section >     < div class = "loader" >         < h1 > Loading </ h1 >         < span style = " --i:1;" ></ span >         < span style = " --i:2;" ></ span >     ...

How Create Simple Animated Search Bar Using HTML & CSS

    In this tutorial, we'll show you how to create an eye-catching animated search bar using just HTML and CSS. Whether you're a beginner or an experienced web developer, you'll learn step-by-step how to build a stylish and functional search bar that will enhance the user experience on your website. Join us to explore the world of web design and improve your coding skills. 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" >     < link rel = "stylesheet" href = "style.css" >     < script src = "https://kit.fontawesome.com/b186863b7d.js"       ...