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

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

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

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