How to create a light to dark mode for HTML CSS & Vanilla Javascript 2021

How to create a light to dark mode for HTML CSS & Vanilla Javascript

Coding BD given here How to create a light to dark mode for HTML CSS & Vanilla Javascript 2021 . Our creative light to dark mode styles are the most important part Of dark mode switch css , html and javascript. We created an expanded css3 effects animation tutorial. We have given more importance to the dark mode html. We have used javascript effects because they need Highly effects. Thank you so much.

Create a Payoneer Account & Earn 25$:→  https://www.payoneer.com/raf/?rid=75EACA0E-2937-4D6B-A225-4255EB9B758A 

Create a Fiverr Account & Earn 100$:→ http://www.fiverr.com/s2/83f49a18f7 

😍😍 If You like this video Please like, share and subscribe This video.😍😍 

😍😍 Check Others Programming Video👇

➡️How To Create Login Form In HTML and CSS: https://www.youtube.com/watch?v=51t-kR8MUvY 

➡️ contact page design with map using html css: https://www.youtube.com/watch?v=RC2-bq4fBYI 

➡️  Pure sliding tabs using html and css: https://www.youtube.com/watch?v=QonCizKyHrs

➡️ Animated Background Image Loop Animation: https://www.youtube.com/watch?v=7HyTFr5kNSU&t=284s 

➡️  water wave background animation effects: https://www.youtube.com/watch?v=dnCfBet94r8&t=49s 

➡️ How to Download Source code in Coding BD: https://www.youtube.com/watch?v=WXAZ-BScKBE&t=3s  

➡️ Responsive website html css javascript | part( 1 ): https://www.youtube.com/watch?v=g0ART2Jc3yw&t=3s 

➡️ Responsive Services Section:  https://www.youtube.com/watch?v=wvLkyrkoS_w&t=69s 

➡️ Plane animation only html css: https://www.youtube.com/watch?v=XcYlfp8sFX0 

➡️ CSS Responsive CARD Hover Effects & Adding Stroke to Text | Html5 CSS3 2021: https://www.youtube.com/watch?v=QVMJ5PdX7Ag&t=14s 

➡️  Neon Light Button Animation Effects on Hover | CSS Snake Border: https://www.youtube.com/watch?v=GtVSF-efdJQ&t=102s 

➡️ Responsive Box Model Web Design Using CSS Flexbox: https://www.youtube.com/watch?v=03RuVB6B5KQ&t=0s 

➡️ Digital Clock with Animated Progress-bar | HTML CSS & Vanilla Javascript:  https://www.youtube.com/watch?v=6A6HpxMmfX4&t=0s 

➡️ How to create a light to dark mode for HTML CSS & Vanilla Javascript 2021: https://www.youtube.com/watch?v=43FbR6ailIk&t=28s   

➡️Scroll top button : https://www.youtube.com/watch?v=9fDEJkXQIIs&t=77s 

Source code here: ( How to create a light to dark mode for HTML CSS & Vanilla Javascript )

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>How to create a light to dark mode for HTML CSS & Vanilla Javascript</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
        integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div class="view_mode" data-mode='light' onclick="changedMode(this)">
        <i class="fa fa-moon-o" aria-hidden="true"></i>
    </div>
    <div class="container">
        <div class="section_title text-center">
            <h1>Main content</h1>
        </div>
        <div class="row">
            <div class="col-12 col-md-6">
                <div class="d-flex align-items-center p-3 box-shadow">
                    <div class="icon-box">
                        <i class="fa fa-tree" aria-hidden="true"></i>
                    </div>
                    <div class="content-box">
                        <h2>Inovation</h2>
                        <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nihil iusto placeat sit quibusdam
                            tenetur itaque tempora at asperiores, numquam minus ea qui harum dicta velit.</p>
                    </div>
                </div>
            </div>
            <div class="col-12 col-md-6">
                <div class="d-flex align-items-center p-3 box-shadow">
                    <div class="icon-box">
                        <i class="fa fa-apple" aria-hidden="true"></i>
                    </div>
                    <div class="content-box">
                        <h2>Iphone</h2>
                        <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nihil iusto placeat sit quibusdam
                            tenetur itaque tempora at asperiores, numquam minus ea qui harum dicta velit.</p>
                    </div>
                </div>
            </div>
            <div class="col-12 col-md-6">
                <div class="d-flex align-items-center p-3 box-shadow">
                    <div class="icon-box">
                        <i class="fa fa-android" aria-hidden="true"></i>
                    </div>
                    <div class="content-box">
                        <h2>Android</h2>
                        <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nihil iusto placeat sit quibusdam
                            tenetur itaque tempora at asperiores, numquam minus ea qui harum dicta velit.</p>
                    </div>
                </div>
            </div>
            <div class="col-12 col-md-6">
                <div class="d-flex align-items-center p-3 box-shadow"">
                    <div class="icon-box">
                        <i class="fa fa-flask" aria-hidden="true"></i>
                    </div>
                    <div class="content-box">
                        <h2>Flask</h2>
                        <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nihil iusto placeat sit quibusdam
                            tenetur itaque tempora at asperiores, numquam minus ea qui harum dicta velit.</p>
                    </div>
                </div>
            </div>
            <div class="col-12 col-md-6">
                <div class="d-flex align-items-center p-3 box-shadow"">
                    <div class="icon-box">
                        <i class="fa fa-money" aria-hidden="true"></i>
                    </div>
                    <div class="content-box">
                        <h2>Money</h2>
                        <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nihil iusto placeat sit quibusdam
                            tenetur itaque tempora at asperiores, numquam minus ea qui harum dicta velit.</p>
                    </div>
                </div>
            </div>
            <div class="col-12 col-md-6">
                <div class="d-flex align-items-center p-3 box-shadow"">
                    <div class="icon-box">
                        <i class="fa fa-book" aria-hidden="true"></i>
                    </div>
                    <div class="content-box">
                        <h2>Book</h2>
                        <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nihil iusto placeat sit quibusdam
                            tenetur itaque tempora at asperiores, numquam minus ea qui harum dicta velit.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="./script.js"></script>
</body>

</html>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    --body-color: #F5F7FD;
    --icon-background: #000;
    --text-color: #000;
    --box-shadow: rgb(36 36 36 / 6%);
    --box-background: #fff;
    --border: none;
}

[data-theme=dark]{
    --body-color: #000;
    --icon-background: #fff;
    --text-color: #fff;
    --box-shadow: 0 4px 20px 30px #ffffff;
    --box-background: #000;
    --border: 1px solid rgba(0,0,0,.1);
}

body{
    background: var(--body-color);
    transition: .5s;
    font-family: 'Poppins', sans-serif;
    -webkit-transition: .5s;
    -moz-transition: .5s;
    -ms-transition: .5s;
    -o-transition: .5s;
}

.view_mode{
    position: fixed;
    right: 4rem;
    bottom: 4rem;
    width: 80px;
    height: 80px;
    z-index: 11;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .5s;
    color: #5DC511;
    border-radius: 50%;
    background: var(--icon-background);
    cursor: pointer;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    -webkit-transition: .5s;
    -moz-transition: .5s;
    -ms-transition: .5s;
    -o-transition: .5s;
}

.box-shadow{
    box-shadow: 0 0.2rem 2.8rem var(--box-shadow);
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid rgba(223, 223, 223, 0.1);
    background: var(--box-background);
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    -ms-border-radius: 6px;
    -o-border-radius: 6px;
}

.section_title{
    padding: 30px 0;
    text-transform: uppercase;
    color: var( --text-color);
    transition: .5s;
    -webkit-transition: .5s;
    -moz-transition: .5s;
    -ms-transition: .5s;
    -o-transition: .5s;
}
.icon-box{
    min-width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #5DC511;
    border-radius: 50%;
    background: var(--icon-background);
    transition: .5s;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    -webkit-transition: .5s;
    -moz-transition: .5s;
    -ms-transition: .5s;
    -o-transition: .5s;
}
.fa{
    font-size: 22px;
    font-weight: bold;
}

.content-box{
    padding: 0 20px;
    padding-top: 10px;
    color: var( --text-color);
    transition: .5s;
    -webkit-transition: .5s;
    -moz-transition: .5s;
    -ms-transition: .5s;
    -o-transition: .5s;
}
const changedMode = (theme) => {
    if(theme.dataset.mode == "light"){
        document.documentElement.setAttribute("data-theme", "dark");
        theme.dataset.mode = "dark";
    }else {
        document.documentElement.setAttribute("data-theme", "light");
        theme.dataset.mode = "light";

    }
}

Don’t Forget to Follow me on all Social Network,

Facebook Page: https://www.facebook.com/codingbd816 

LinkedIn: https://www.linkedin.com/in/sajjat8383/ 

Instagram: https://www.instagram.com/codingbd/ 
GitHub: https://github.com/cgsaleh8383

You can see CSS Responsive CARD Hover Effects

Leave a Comment

Your email address will not be published.