Skip to main content

Bulb Animation in HTML/CSS


 

Learn how to create an animated spot light bulb using HTML and CSS in this step-by-step tutorial. Watch as we guide you through the process of coding the animation to bring your design to life. Perfect for beginners looking to enhance their web development skills! 

index.html 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SpotLight</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
 
    <input id="checkbox" type="checkbox">
    <label class="switch" for="checkbox">
        <img class="img" src="image/bulb.svg" alt="bulb">
    </label>

</body>
</html>

style.css


body{
    background: black;
    margin-left: 400px;
    margin-top: 300px;
}
#checkbox{
    display: none;
}
.img{
    border-radius: 50%;
    width: 2.2em;
}
.switch{
    position: relative;
    width: 70px;
    height: 70px;
    background-color: rgb(99,99,99);
    border-radius: 50%;
    z-index: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgb(126,126,126);
    box-shadow: 0px 0px 3px rgb(2,2,2);
}
#checkbox:checked +.swith{
    box-shadow: 0px 0px 1px rgb(151,243,255)inset,
    0px 0px 8px rgb(151,243,255) inset, 0px 0px 10px rgb(183, 229, 235)inset,
    0px 0px 40px rgb(151,243,255),0px 0px 100px rgb(151,243,255),
    0px 0px 5px rgb(146,180,184);

}
#checkbox:checked + .switch {
    filter: drop-shadow(0px 0px 25px rgb(213, 233, 236));

}
#checkbox:checked + .switch img {
    fill: rgb(255,255,255);
}
















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

HTML & CSS Envelope Animation: Unveiling the Digital Elegance!

Step into the enchanting world of web development as we bring you a delightful animation of an envelope, crafted entirely with HTML and CSS. 🎨✉️ Watch in awe as pixels transform into a digital masterpiece, showcasing the beauty of code and creativity. 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 Envelop[ </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body >     < div class = "letter-image" >         < div class = "animated-mail" >           < div class = "back-fold" ></ div >           < div class = "letter" >             < div class = "letter-border" ></ div >             < div class =

How to Create a Image Slider Using HTML, CSS and JS

    🎥 Ready to level up your web development skills? Join us in this tutorial where we guide you through the process of creating a dynamic Image Slider using HTML, CSS, and JavaScript! 🚀 Explore the magic of coding as we break down each step, empowering both beginners and seasoned developers to enhance their projects with a stunning image carousel. From seamless transitions to customizable features, this tutorial covers it all. Elevate your website's visual appeal and engage your audience with an eye-catching image slider. Let's bring your designs to life! 💻🌟 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