Button Slide and Light Effect With CSS

 Button Slide and Light Effect:-

Code:-

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            margin:0;
            padding:0;
            background:#292929;
        }
        .center{
            positionabsolute;
            top50%;
            left50%;
            transformtranslate(-50%,-50%);
        }
        input[type="checkbox"]
        {
            positionrelative;
            width120px;
            height:40px;
            -webkit-appearance:none;
            background:linear-gradient(0deg#333#000);
            outlinenone;
            border-radius:20px;
            box-shadow0 0 0 4px #3535350 0 0 5px #3e3e3einset 0 0 10px rgba(0,0,0,1), 0 5px 20px rgba(0,0,0,.5), inset 0 0 15px rgba(0,0,0,.2);
        }
        input:checked[type="checkbox"]{
                    background:linear-gradient(0deg#6dd1ff#20b7ff);
                    box-shadow:0 0 2px #6dd1ff ,0 0 0 4px #3535350 0 0 5px #3e3e3einset 0 0 10px rgba(0,0,0,1), 0 5px 20px rgba(0,0,0,.5), inset 0 0 15px rgba(0,0,0,.2);

        }
        input[type="checkbox"]:before{
            content'';
            positionabsolute;;
            top:0;
            left:0;
            width80px;
            height:40px;
            backgroundlinear-gradient(0deg#000#6b6b6b);
            border-radius20px;
            box-shadow:  0 0 0 1px #232323;
            transformscale(.98,.96);
            transition.5s;
        }
        input:checked[type="checkbox"]::before{
            left40px;
        }
        input[type="checkbox"]:after{
            content'';
            positionabsolute;
            top:calc(50% - 2px);
            left:65px;
            width4px;
            height:4px;
            background:linear-gradient(0deg#6b6b6b#000);
            border-radius50%;
            transition.5s;
        }
        input:checked[type="checkbox"]:after{
            background#63cdff;
            left105px;
            box-shadow0 0 5px #13b3ff0 0 15px #13b3ff;
        }

    </style>
</head>
<body>
    <div class="center">
        <input type="checkbox" name="">
    </div>
</body>
</html>

Output:-



Comments

Popular Posts