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 >     ...

Build a Simple Calculator Using HTML, CSS and JavaScript | Step-by-Step Tutorial

    You'll learn how to create a fully functional calculator using #html #css and #javascript . Follow along as we break down the process into easy-to-understand steps, from designing the user interface with HTML and CSS to adding interactive functionality with JavaScript. 🔹 Learn the fundamentals of HTML, CSS, and JavaScript. 🔹 Design a sleek and user-friendly calculator interface. 🔹 Implement basic arithmetic operations, including addition, subtraction, multiplication, and division. 🔹 Handle user input and display results in real-time. 🔹 Enhance the calculator with clear functionality. 🔹 Perfect for web development beginners and anyone looking to sharpen their skills. By the end of this tutorial, you'll have your very own #calculator that you can showcase in your web development portfolio. index.html <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport...