CSS Isometric Glass Layered Image Hover
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div class="box">
<div class="glass"></div>
<div class="glass"></div>
</div>
</body>
</html>
<style type="text/css">
body{
margin: 0px;
padding: 0px;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #36363c;
}
.box{
position: relative;
width: 300px;
height: 576px;
background: url(img.jpg);
transform: rotate(-45deg) skewY(25deg);
box-shadow: -25px 40px 4px rgba(0, 0, 0, 0.2);
transition: 0.5s;
}
.box:hover{
transform: rotate(-45deg) skewY(25deg) translate(20px,-20px);
box-shadow: -60px 100px 60px rgba(0, 0, 0, 0.5);}
.box:before{
content: '';
position: absolute;
top: 0px;
left: -20px;
height: 100%;
width: 20px;
box-sizing: border-box;
border-top: 80px solid #ad3c3c;
background-color: #e4e4e4;
transform-origin: right;
transform: skewY(-58deg);
}
.box:after{
content: '';
position: absolute;
bottom: -32px;
left: 0px;
height: 32px;
width: 100%;
box-sizing: border-box;
background-color: #919191;
transform-origin: top;
transform: skewX(-32deg);
}
.box .glass{
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.001);
transition: 0.5s;
overflow: hidden;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0);
}
.box:hover .glass{
left: 30px;
top: -40px;
background: rgba(255, 255, 255, 0.05);
box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
}
.box:hover .glass:nth-child(2){
left: 60px;
top: -80px;
background: rgba(255, 255, 255, 0.05);
box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
}
</style>
Comments
Post a Comment