CSS folded corner takes over the whole panel - html

I am having quite a hard time trying to get a folded corner spread over the entire surface of my panel.
I don't want to set up a specific size for the folded corner as I want it to cover the entire surface, whatever the size of the panel (as it would show on mobile, tablet or desktop.
I can't figure out an easy solution to achieve this.
Here is my code :
.panel-default1 {
padding-top: 10px;
border-radius: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.10);
height: 400px;
width: 100%;
overflow: hidden;
margin: 0 auto;
position: relative;
}
.amg-corner-button_wrap {
display: block;
position: absolute;
bottom: 0;
right: 0;
width: 40px;
height: 40px;
}
.amg-corner-button_wrap:hover {
width: 120px;
height: 120px;
}
.amg-corner-button_wrap:hover div {
width: 120px;
height: 120px;
}
.amg-corner-button {
display: block;
position: absolute;
bottom: 0;
right: 0;
width: 40px;
height: 40px;
background-color: #46982b;
-webkit-transition: width 300ms, height 300ms;
-moz-transition: width 300ms, height 300ms;
-ms-transition: width 300ms, height 300ms;
-o-transition: width 300ms, height 300ms;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
}
.amg-corner-button:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-width: 0 0 120px 120px;
border-style: solid;
border-color: #46982b #fff;
}
.amg-corner-button_text {
font-size: 14px;
font-size: 1.4rem;
width: 120px;
position: absolute;
top: 60px;
right: 0;
left: 0;
-webkit-transform-origin: center top;
-moz-transform-origin: center top;
-ms-transform-origin: center top;
transform-origin: center top;
-webkit-transform-origin: center top center;
-moz-transform-origin: center top center;
-ms-transform-origin: center top center;
-o-transform-origin: center top center;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
text-align: center;
color: #ffffff;
}
<div class="panel panel-default1">
<div class="panel-body">
<div class='amg-corner-button_wrap'>
<div class='amg-corner-button'></div>
<span class='amg-corner-button_text'>Text Goes Here</span>
</div>
</div>
<!-- panel body -->
</div>
<!-- panel default -->
Any help on this would be very much appreciated.

Try using this as your css instead.
.panel-default1 {
padding-top: 10px;
border-radius: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.10);
height: 400px;
width: 100%;
overflow: hidden;
margin: 0 auto;
position: relative;
}
.amg-corner-button_wrap {
display: block;
position: absolute;
bottom: 0;
right: 0;
width: 40px;
height: 40px;
}
.amg-corner-button_wrap:hover {
width: 100%;
height: 100%;
}
.amg-corner-button_wrap:hover div {
width: 100%;
height: 100%;
}
.amg-corner-button {
display: block;
position: absolute;
bottom: 0;
right: 0;
width: 40px;
height: 40px;
background-color: #46982b;
-webkit-transition: width 300ms, height 300ms;
-moz-transition: width 300ms, height 300ms;
-ms-transition: width 300ms, height 300ms;
-o-transition: width 300ms, height 300ms;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
}
.amg-corner-button:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-width: 0 0 120px 120px;
border-style: solid;
border-color: #46982b #fff;
}
.amg-corner-button:hover::before {
border-width: 0;
}
.amg-corner-button_text {
font-size: 14px;
font-size: 1.4rem;
width: 120px;
position: absolute;
top: 60px;
right: 0;
left: 0;
-webkit-transform-origin: center top;
-moz-transform-origin: center top;
-ms-transform-origin: center top;
transform-origin: center top;
-webkit-transform-origin: center top center;
-moz-transform-origin: center top center;
-ms-transform-origin: center top center;
-o-transform-origin: center top center;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
text-align: center;
color: #ffffff;
}
We did two things. We updated .amg-corner-button_wrap:hover and .amg-corner-button_wrap:hover div to have a width and height of 100%. This way the panel would take up 100% of the panel.
The second change was adding:
.amg-corner-button:hover::before {
border-width: 0;
}
Without this we would be left with an extra triangle in panel. We need this triangle to create the green pocket shape we have in the bottom-right hand corner.

Related

overflow: hidden doesn't work on :after and :before pseudo elements

I am making this rounded scroll down button with an arrow inside. On hover I wanted to apply an animation that makes the arrow go from above to below the rounded div, and it should be hidden when outside the div.
I tried using overflow: hidden but for some reason it doesn't work. Does anyone has a solution for this please?
Codepen: https://codepen.io/RaphaelleD/pen/vYpqxpm
#keyframes tipUp {
0% {
transform: translateY(-10px) rotateZ(225deg);
}
100% {
transform: translateY(100px) rotateZ(225deg);
}
}
#keyframes lineUp {
0% {
transform: translateY(-10px);
}
100% {
transform: translateY(100px);
}
}
.scrolldown {
position: relative;
margin: 0 auto;
}
.scrolldown p {
font-size: 1rem;
font-weight: 600;
padding-bottom: 0.8rem;
text-align: center;
}
.scrolldown__arrow {
width: 6rem;
height: 6rem;
border: 6px solid black;
border-radius: 50%;
margin: 0 auto;
overflow: hidden;
}
.scrolldown__arrow:before {
position: absolute;
display: inline-block;
content: "";
background: black;
width: 10px;
height: 45px;
top: 50%;
left: 50%;
margin-top: -50px;
margin-left: -5px;
transform: translateY(50px);
}
.scrolldown__arrow:after {
position: absolute;
display: inline-block;
content: "";
width: 22px;
height: 22px;
color: black;
border-top: 9px solid;
border-left: 9px solid;
transform: rotateZ(45deg);
top: 50%;
left: 50%;
margin-top: -30px;
margin-left: -15.5px;
transform: translateY(50px) rotateZ(225deg);
}
.scrolldown__arrow:hover:before {
animation: lineUp 1s cubic-bezier(0, 0.6, 1, 0.4) infinite 0.5s;
}
.scrolldown__arrow:hover:after {
animation: tipUp 1s cubic-bezier(0, 0.6, 1, 0.4) infinite 0.5s;
}
}
}
<body>
<div class="scrolldown">
<p>SCROLL DOWN</p>
<div class="scrolldown__arrow"></div>
</div>
</body>
I believe this is because of position: absolute, which takes the arrow out of the normal flow. In order to kinda preserve it in the flow, I've added position: relative to the arrow parent, and had to adjust top position as well, seems to work as expected:
#keyframes tipUp {
0% {
transform: translateY(-10px) rotateZ(225deg);
}
100% {
transform: translateY(100px) rotateZ(225deg);
}
}
#keyframes lineUp {
0% {
transform: translateY(-10px);
}
100% {
transform: translateY(100px);
}
}
.scrolldown {
position: relative;
margin: 0 auto;
}
.scrolldown p {
font-size: 1rem;
font-weight: 600;
padding-bottom: 0.8rem;
text-align: center;
}
.scrolldown__arrow {
width: 6rem;
height: 6rem;
border: 6px solid black;
border-radius: 50%;
margin: 0 auto;
overflow: hidden;
position: relative;
}
.scrolldown__arrow:before {
position: absolute;
display: inline-block;
content: "";
background: black;
width: 10px;
height: 45px;
top: 25%;
left: 50%;
margin-top: -50px;
margin-left: -5px;
transform: translateY(50px);
}
.scrolldown__arrow:after {
position: absolute;
display: inline-block;
content: "";
width: 22px;
height: 22px;
color: black;
border-top: 9px solid;
border-left: 9px solid;
transform: rotateZ(45deg);
top: 25%;
left: 50%;
margin-top: -30px;
margin-left: -15.5px;
transform: translateY(50px) rotateZ(225deg);
}
.scrolldown__arrow:hover:before {
animation: lineUp 1s cubic-bezier(0, 0.6, 1, 0.4) infinite 0.5s;
}
.scrolldown__arrow:hover:after {
animation: tipUp 1s cubic-bezier(0, 0.6, 1, 0.4) infinite 0.5s;
}
}
}
<body>
<div class="scrolldown">
<p>SCROLL DOWN</p>
<div class="scrolldown__arrow"></div>
</div>
</body>

CSS Sliding panel from left to right

I have this code working from right to left sliding.
#panel {
position: absolute;
right: 0;
width: 180px;
top: 0;
bottom: 0;
box-shadow: 0px 0px 15px black;
background: white;
padding: 10px;
-webkit-transform-origin: 100% 50%;
-webkit-transform: scaleX(0.00001);
-webkit-transition: -webkit-transform 0.2s ease-in-out;
outline: 0;
}
#panel:target {
-webkit-transform: scaleX(1);
}
<div>☰</div>
<p><a id="panel" href="#">This is the side panel.</a></p>
Now I like to have this sliding from left to right. I changed right:0; to left, then it is sliding from the center to the left. I did read almost all posts and tried a lot of different things but nothing worked. Can somebody help me? Thanks a lot.
Not sure, what exactly you are looking for. But perhaps you should be using translate property instead of scale, though you can achieve the same using scale as well.
#panel {
position: absolute;
left: 0;
width: 180px;
top: 0;
bottom: 0;
box-shadow: 0px 0px 15px black;
background: white;
padding: 10px;
-webkit-transform-origin: 100% 50%;
-webkit-transform: translateX(-100%);
-webkit-transition: -webkit-transform 0.2s ease-in-out;
outline: 0;
}
#panel:target {
-webkit-transform: translateX(0%);
}
<div>☰</div>
<p><a id="panel" href="#">This is the side panel.</a></p>
This is because of
-webkit-transform-origin
Is this what you're looking for ?
#panel {
position: absolute;
left: 0;
width: 180px;
top: 0;
bottom: 0;
box-shadow: 0px 0px 15px black;
background: white;
padding: 10px;
-webkit-transform-origin: 0% 50%;
-webkit-transform: scaleX(0.00001);
-webkit-transition: -webkit-transform 0.2s ease-in-out;
outline: 0;
}
#panel:target {
-webkit-transform: scaleX(1);
}
<div>☰</div>
<p><a id="panel" href="#">This is the side panel.</a></p>
You have also to change -webkit-transform-origin: 100% 50%; and make it -webkit-transform-origin: 0% 100%; to open it from left, check the snippet:
#panel {
position: absolute;
left: 0;
width: 180px;
top: 0;
bottom: 0;
box-shadow: 0px 0px 15px black;
background: white;
padding: 10px;
-webkit-transform-origin: 0% 100%;
-webkit-transform: scaleX(0.00001);
-webkit-transition: -webkit-transform 0.2s ease-in-out;
outline: 0;
}
#panel:target {
-webkit-transform: scaleX(1);
}
<div>
☰
</div>
<p>
<a id="panel" href="#">This is the side panel.</a>
</p>
You were correct to change right to left, but you also need to change the X axis of the transform-origin to zero:
#panel {
position: absolute;
left: 0;
width: 180px;
top: 0;
bottom: 0;
box-shadow: 0px 0px 15px black;
background: white;
padding: 10px;
-webkit-transform-origin: 0 50%;
-webkit-transform: scaleX(0.00001);
-webkit-transition: -webkit-transform 0.2s ease-in-out;
outline: 0;
}
#panel:target {
-webkit-transform: scaleX(1);
}
<div>☰</div>
<p><a id="panel" href="#">This is the side panel.</a></p>

CSS - How to remove thin white line between :after element and blue border on hover on image

This is my structure:
<div class="parent">
<a href="#">
<p class="carousel_img">
<span class="img"></span>
Some text
</p>
</a>
and this is my style:
.parent{
height: 270px;
width: 270px;
}
.img {
background-image: url(http://frontendtest.ru/anit/img/ps_3.jpg);
background-size: cover;
display: block;
height: 250px;
overflow: hidden;
border-radius: 50%;
-webkit-transform: scale(1.3);
-ms-transform: scale(1.3);
transform: scale(1.3);
-webkit-transition: -webkit-transform 0.3s;
transition: -webkit-transform 0.3s;
transition: transform 0.3s;
transition: transform 0.3s, -webkit-transform 0.3s;
background-repeat: no-repeat;
}
.carousel_img {
border-radius: 50%;
border: 4px solid #f6e9d6;
height: 260px;
width: 260px;
overflow: hidden;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
position: relative;
margin: 0 auto;
}
a:hover .carousel_img {
border-color: #2e8ce4;
}
.carousel_img:before {
height: 15px;
width: 15px;
border-left: 2px solid #fff;
border-bottom: 2px solid #fff;
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
margin: auto;
bottom: 20px;
z-index: 2;
}
.carousel_img:after {
content: '';
position: absolute;
left: 0;
right: 0;
display: none;
}
.carousel_img:after {
bottom: 0;
height: 56px;
background: #2e8ce4;
}
a:hover .carousel_img:before, a:hover .carousel_img:after {
display: block;
}
In Chrome, Firefox, Edge we can see a thin white line between blue :after element and blue border on bottom of picture when we :hover on image. This is a link on my pen http://codepen.io/DmitryShutov/pen/JKovYb.
How can I remove thin white line?

Placing an image centrally over another image with responsive width and height

How to place an image centrally over another image?
I tried the answers from so many similar questions, but none of them work for me.
Basically I need the 2 images to become 1 and
it MUST be RESPONSIVE(so the size changes automatically when different screen size devices access the web page.)
The heart and ring should remain the same position to each other when user resize his or her screen(or web page window size etc.)
I am trying to use css to draw both the ring and the heart, but it is okay if you really need the picture to replace the ring or heart.
Here is my code, I have been working on it for hours but haven't got any good luck.
http://jsfiddle.net/4u6tfacw/
Thank you.
Here is my code
<div id="logo">
<div id="heart-container">
</div>
<div id="heart">
</div>
</div>
#logo {
width: 50%;
height: 50%;
}
#heart {
display: block;
position: absolute;
top: 70px;
left: 30px;
z-index: 1;
width: 70%;
height: 70%;
}
#heart-container {
display: block;
position: absolute;
top: 0;
left: 0;
/*bottom:0;
right:0;*/
z-index: 1;
width: 70%;
height: 70%;
}
#heart-container {
border-radius: 50%;
behavior: url(PIE.htc);
width: 220px;
height: 220px;
padding: 8px;
background: #fff;
border: 2px solid #666;
color: #666;
text-align: center;
font: 32px Arial, sans-serif;
}
#heart:before,
#heart:after {
position: absolute;
content: "";
left: 90px;
top: 0;
width: 90px;
height: 130px;
background: red;
-moz-border-radius: 50px 50px 0 0;
border-radius: 50px 50px 0 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
-moz-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
-o-transform-origin: 0 100%;
transform-origin: 0 100%;
}
#heart:after {
left: 0;
box-shadow: 10px 10px 100px #6d0019;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
Well, here is my attempt to satisfy the requirements of the question — which is not only about putting an image/element over another one, but about achieving that in a responsive manner.
Key points
Using a percentage value on bottom padding to make elements' heights respect their width1.
Using percentage values on top, right, left, bottom offsets as well as width and height properties2.
Using a high value in pixels on border-radius instead of percentage — for instance 1000px.
And number four... well, the last step is trial and error!
Example on JSFiddle.
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html, body {
margin: 0;
height: 100%;
width: 100%;
}
#logo {
width: 50%;
/* height: 50%; */
position: relative;
}
#logo:after {
content: "";
display: block;
padding-bottom: 70%;
}
#heart {
position: absolute;
top: 26%;
left: 35%;
z-index: 1;
width: 70%;
height: 100%;
}
#heart-container {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 70%;
/* height: 70%; */
border-radius: 50%;
behavior: url(PIE.htc);
background: #fff;
border: 2px solid #666;
color: #666;
text-align: center;
font: 32px Arial, sans-serif;
}
#heart-container:after {
content: "";
display: block;
padding-bottom: 100%;
}
#heart:before,
#heart:after {
position: absolute;
content: "";
left: 0;
top: 0;
width: 39.130434782608695652173913043478%;
height: 56.521739130434782608695652173913%;
background: red;
-moz-border-radius: 1000px 1000px 0 0;
border-radius: 1000px 1000px 0 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
-moz-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
-o-transform-origin: 0 100%;
transform-origin: 0 100%;
}
#heart:after {
left: -38.9%;
box-shadow: 10px 10px 100px #6d0019;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
<div id="logo">
<div id="heart-container"></div>
<div id="heart"></div>
</div>
1 Have a look at Responsive Container section of this topic.
2 To find exact values, we can position/size things in an absolute length — like px — and then just measure things relative to each other.
If you want to go responsive, you'd have to drop all the fixed (pixel) units and use percentages unless you plan to have several versions depending on the screen size and in that case you can use media queries.
So, the idea is to use percentages for paddings, margins, etc... and I've replaced the fixed width/height definitions you had with percentual padding, which made the circle responsive. See if you can do the same for the heart (I think using an image might save you a lot of time here).
#logo {
width: 50%;
height: 50%;
position: relative;
}
#heart {
display: block;
position: absolute;
margin: 18% 14%;
z-index: 1;
width: 70%;
height: 70%;
}
#heart-container {
display: block;
position: absolute;
top: 0;
left: 0;
/*bottom:0;
right:0;*/
z-index: 1;
padding: 50%;
}
#heart-container {
border-radius: 50%;
behavior: url(PIE.htc);
padding: 50%;
background: #fff;
border: 2px solid #666;
color: #666;
text-align: center;
font: 32px Arial, sans-serif;
}
#heart:before,
#heart:after {
position: absolute;
content: "";
left: 90px;
top: 0;
width: 90px;
height: 130px;
background: red;
-moz-border-radius: 50px 50px 0 0;
border-radius: 50px 50px 0 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
-moz-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
-o-transform-origin: 0 100%;
transform-origin: 0 100%;
}
#heart:after {
left: 0;
box-shadow: 10px 10px 100px #6d0019;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
<div id="logo">
<div id="heart-container">
</div>
<div id="heart">
</div>
</div>
And the fiddle: http://jsfiddle.net/fzgd6cv8/
Let me know if you have trouble doing the same thing for the heart.
UPDATE
Here's my attempt for the heart, probably needs a bit of number tweaking:
#logo {
width: 50%;
height: 50%;
position: relative;
}
#heart {
display: block;
position: absolute;
margin: 20% 14% 0 9%;
z-index: 1;
width: 70%;
height: 70%;
}
#heart-container {
display: block;
position: absolute;
top: 0;
left: 0;
/*bottom:0;
right:0;*/
z-index: 1;
padding: 50%;
}
#heart-container {
border-radius: 50%;
behavior: url(PIE.htc);
padding: 50%;
background: #fff;
border: 2px solid #666;
color: #666;
text-align: center;
font: 32px Arial, sans-serif;
}
#heart:before,
#heart:after {
position: absolute;
content: "";
left: 60%;
top: 0;
width: 60%;
padding-top: 100%;
background: red;
-moz-border-radius: 150% 150% 0 0;
border-radius: 150% 150% 0 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
-moz-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
-o-transform-origin: 0 100%;
transform-origin: 0 100%;
}
#heart:after {
left: 0;
box-shadow: 10px 10px 100px #6d0019;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
<div id="logo">
<div id="heart-container">
</div>
<div id="heart"></div>
</div>
http://jsfiddle.net/fzgd6cv8/2/

Any idea what is causing the slight movement at the top of the image when hovering?

I have the following HTML:
<figure>
<img src="http://lorempixel.com/200/200/" alt="">
<figcaption>This is the caption</figcaption>
</figure>
And the following CSS:
figure {
background: #ddd;
display: inline-block;
height: 200px;
margin: 50px;
position: relative;
width: 200px;
vertical-align: top;
}
figure:hover img {
box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
transform: perspective(1000px) rotateX(45deg);
transform-origin: 50% 0;
}
img {
position: relative;
transition: .2s;
vertical-align: top;
z-index: 10;
}
figcaption {
bottom: 0;
box-sizing: border-box;
padding: 6px;
position: absolute;
text-align: center;
width: 100%;
}
Here is a live example: http://codepen.io/joshnh/pen/FlvJr
Despite setting the transform-origin to the top of the image, it still moves down slightly when hovering. What is causing this, and how do I prevent it?
Take a look: http://jsfiddle.net/cQphE/
The problem was that you were transitioning, along with the transform property, the transform-origin. On hover it was going from the default 50% 50% to the 50% 0; you set.
You have this:
img {
transition: 0.2s;
}
figure:hover img {
box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
transform: perspective(1000px) rotateX(45deg);
transform-origin: 50% 0;
}
Which is the same as having this:
img {
box-shadow: none;
transform: perspective(0) rotateX(0);
transform-origin: 50% 50%;
transition: 0.2s;
}
figure:hover img {
box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
transform: perspective(1000px) rotateX(45deg);
transform-origin: 50% 0;
}
What you should have is this:
img {
transform-origin: 50% 0;
transition: 0.2s;
}
figure:hover img {
box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
transform: perspective(1000px) rotateX(45deg);
}