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 a Sign Up Form Using HTML & CSS

    In this tutorial, we'll guide you through the process of creating a standard sign-up form using HTML and CSS. It's a fundamental skill for anyone interested in web development or design. This tutorial is suitable for beginners and provides a solid foundation for understanding how to create a sign-up form. If you're interested in web development or web design, this is a crucial skill to master. If you find this video helpful, please consider liking and subscribing for more web development tutorials. Let's start building your sign-up form together!  1.Create a New Folder 2.Open the Folder in Vs Code  3.Create index.html and style.css Files  4.Create Image Folder and download  Background picture to Image folder 5.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" >

How to Create Solar System Using HTML & CSS

  🌟 Explore the Universe: Building a Solar System with HTML and CSS! 🌟 Welcome to another mind-blowing adventure on @Coding With Nexus ! 🚀 Join us as we embark on an interstellar journey to create our very own solar system using nothing but HTML and CSS. 🌌 First Create a New Folder, Then 1.Open the folder in Vs Code 2.Create index.html and style.css Files 3.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" >     < link rel = "stylesheet" href = "style.css" >     < title > Solar System </ title > </ head > < body >     < div class = "container" >         < div class = "sun" ></ div >         < div class = "earth" >             < div class = "moon" ></

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 > < html lang = "en" > < head >     < meta