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

Parallax Scrolling Website Effect Using HTML CSS

  Welcome to our step-by-step tutorial on creating Parallax Scrolling Website Effect using #html  & #css  . In this video, we'll guide you through the process of building a simple yet effective Parallax Effect 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 this effect 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 > Parallax Scrolling Website </ title >     ...

Create Cool Hover Effects for Cards with HTML & CSS (2024)

  Learn how to create stylish hover effects for cards using HTML and CSS in this tutorial. Watch step-by-step as we implement eye-catching animations to make your website's cards stand out. Perfect for web developers looking to enhance user experience and add a touch of interactivity to their projects. Get ready to impress with cool hover effects for cards!  Stay tuned for more web development tutorials. index.html  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Card </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body >     < div class = "card" >         < img src = "Image/paris_eiffeltower_ssk500.jpeg" alt = "EiffelTower" >         < div class = "...

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