1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
.box {
width : 200px ;
height : 200px ;
background : aqua ;
-webkit-transform: perspective( 1px ) translateZ( 0 );
transform: perspective( 1px ) translateZ( 0 );
box-shadow: 0 0 1px rgba( 0 , 0 , 0 , 0 );
position : relative ;
-webkit-transition-duration: 0.3 s;
transition-duration: 0.3 s;
-webkit-transition-property: transform;
transition-property: transform;
&::before {
pointer-events: none ;
position : absolute ;
z-index : -1 ;
content : "" ;
top : 100% ;
left : 5% ;
height : 10px ;
width : 90% ;
opacity: 0 ;
background : -webkit-radial-gradient(
center ,
ellipse,
rgba( 0 , 0 , 0 , 0.35 ) 0% ,
rgba( 0 , 0 , 0 , 0 ) 80%
);
background : radial-gradient(
ellipse at center ,
rgba( 0 , 0 , 0 , 0.35 ) 0% ,
rgba( 0 , 0 , 0 , 0 ) 80%
);
/* W3C */
-webkit-transition-duration: 0.3 s;
transition-duration: 0.3 s;
-webkit-transition-property: transform, opacity;
transition-property: transform, opacity;
}
}
.box:hover,
.box:focus,
.box:active {
-webkit-transform: translateY( -5px );
transform: translateY( -5px );
&::before {
opacity: 1 ;
-webkit-transform: translateY( 5px );
transform: translateY( 5px );
}
}
|