Skip to main content

Creating a Dark and Light Mode Toggle Button

 

#dark #light #mode #html #css #foryou #world #happy # website #webdesign #webdeveloper #how to #howto #trending #viral #srilanka #youtube #tiktok #blog  #howtocreate #Javascript #image #imageuploader #toggle 


In this #tutorial , we'll guide you through the process of creating a stylish #dark and #light Mode #toggle Button #foryourwebsite. Dark mode is not only visually appealing but also helps reduce eye strain in low-light conditions. We'll show you step by step how to implement this feature, making your website more user-friendly. By the end of this video, you'll have a fully functional Dark and Light Mode Toggle Button that enhances your website's user experience.

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>Dark Light Mode</title>
</head>
<body>
     <div>
        <input type="checkbox" class="checkbox">
     </div>
</body>
</html>



style.css

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    display: grid;
    height: 100vh;
    place-items: center;
    background-color: black;
}
.checkbox{
    height: 200px;
    background-color: rgb(149,124,124);
    border-radius: 100px;
    width: 400px;
    appearance: none;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.5),
    inset 0 10px 16px rgba(0,0,0,0.5),
    inset 0 -5px 20px rgba(0,0,0,0.5);
    outline: none;
    cursor: pointer;
    position: relative;
    transition: 0.5s;
    background-image: url(Image/nightsky.jpeg);
    background-size: cover;
}
.checkbox::before{
    height: 150px;
    width: 150px;
    position: absolute;
    top: 25px;
    left: 25px;
    content: '';
    background-color: linear-gradient(to bottom, black, black);
    border-radius: 50%;
    transition: 0.5s;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5),
    inset 4px 4px rgba(255,255,255,0.2),
    inset -4px  4px rgba(255,255,255,0.2);
    background-image: url(Image/sun.svg);
    background-size: cover;
}
.checkbox:checked{
    background-color: #fff;
    box-shadow: inset 0 20px 60px rgba(0,0,0,0.1),
    inset 0 2px 8px rgba(0,0,0,0.1),
    inset 0 4px 4px rgba(0,0,0,0.05);
    background-image: url(Image/sunshine.jpg);
    background-size: cover;
}
.checkbox:checked::before{
    left: 225px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1),
    inset 4px 4px rgba(255,255,255,0.5),
    inset -4px 4px rgba(255,255,255,0.5);
    background-color: linear-gradient(to bottom white , white);
    background-image: url(Image/moon.svg);
    background-size: cover;
}
.checkbox::after{
    content: '';
    position: absolute;
    height: 110vh;
    width: 100rem;
    background: black;
    top: 80px;
    left: 190px;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: 0.5s;
}
.checkbox:checked::after{
    background: white;
}























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

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