3D Transform CSS Style

 3D Transform:-

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{
            margin0;
            padding0;
            displayflex;
            justify-contentcenter;
            align-itemscenter;
            min-height100vh;
            background#36363c;
        }
        .box{
            positionrelative;
            width300px;
            height576px;
            background:url(resources/n3.jpg);
            background-size150%;
            transformrotate(-45degskewY(25deg);
            box-shadow-25px 40px 4px rgba(0,0,0,.2);
            transition.5s;
        }

        .box:hover{
            transformrotate(-45degskewY(25degtranslate(20px,-20px);
            box-shadow-25px 40px 4px rgba(0,0,0,.5);
        }
        .box:before{
            content:'';
            positionabsolute;
            top0;
            left-20px;
            height100%;
            width20px;
            background#e4e4e4;
            box-sizingborder-box;
            border-top576px solid #78db6f;
            transform-origin:right;
            transformskewY(-58deg);
        }
        .box::after{
            content:'';
            positionabsolute;
            bottom-32px;
            left0px;
            height32px;
            width100%;
            background#78db6f;
            box-sizingborder-box;
            transform-origin:top;
            transformskewX(-32deg);
        }
        .box .glass{
            positionabsolute;
            top0;
            left0;
            width100%;
            height100%;
            background:rgba(255,255,255,0,.001);
            box-shadow0 0 10px rgba(0,0,0,0);
            transition:0.5s;
            overflowhidden;
        }
        .box .glass:before{
            content'';
            position:absolute;
            top0;
            left-50%;
            width100%;
            height100%;
            background:rgba(255,255,255,0.05);
            transform:skewX(-5deg);
        }
        .box:hover .glass{
            top-40px;
            left:30px;
            background:rgb(255,255,255,0.05);
            box-shadow:-2px 2px 10px rgba(0,0,0,0.2);
        }
        .box:hover .glass:nth-child(2){
            top-80px;
            left:60px;
            background:rgb(255,255,255,0.05);
            box-shadow:-2px 2px 10px rgba(0,0,0,0.2);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="glass"></div>
        <div class="glass"></div>
    </div>
</body>
</html>



Output:-



Comments

Popular Posts