Update rotating-card.md

This commit is contained in:
Angelos Chalaris
2020-10-04 14:24:04 +03:00
committed by GitHub
parent 7c9fd630b8
commit 7ef1b7d7ed

View File

@ -13,14 +13,10 @@ Creates a two sided card which rotates on hover.
```html ```html
<div class="card"> <div class="card">
<div class="card-side front"> <div class="card-side front">
<div> <div>Front Side</div>
Front Side
</div>
</div> </div>
<div class="card-side back"> <div class="card-side back">
<div> <div>Back Side</div>
Back Side
</div>
</div> </div>
</div> </div>
``` ```
@ -28,13 +24,13 @@ Creates a two sided card which rotates on hover.
```css ```css
.card { .card {
perspective: 150rem; perspective: 150rem;
-moz-perspective: 150rem;
position: relative; position: relative;
height: 40rem; height: 40rem;
max-width: 400px; max-width: 400px;
margin: 2rem; margin: 2rem;
box-shadow: none; box-shadow: none;
} }
.card-side { .card-side {
height: 35rem; height: 35rem;
border-radius: 15px; border-radius: 15px;
@ -47,18 +43,22 @@ Creates a two sided card which rotates on hover.
padding:2rem; padding:2rem;
color: white color: white
} }
.card-side.back { .card-side.back {
transform: rotateY(-180deg); transform: rotateY(-180deg);
background-color: #4158D0; background-color: #4158D0;
background-image: linear-gradient(43deg, #4158D0 0%,#C850C0 46%, #FFCC70 100%); background-image: linear-gradient(43deg, #4158D0 0%,#C850C0 46%, #FFCC70 100%);
} }
.card-side.front { .card-side.front {
background-color: #0093E9; background-color: #0093E9;
background-image: linear-gradient(160deg, #0093E9 0%, #80D0C7 100%); background-image: linear-gradient(160deg, #0093E9 0%, #80D0C7 100%);
} }
.card:hover .card-side.front { .card:hover .card-side.front {
transform: rotateY(180deg); transform: rotateY(180deg);
} }
.card:hover .card-side.back { .card:hover .card-side.back {
transform: rotateY(0deg); transform: rotateY(0deg);
} }