diff --git a/tarotcard-flip.css b/tarotcard-flip.css index e69de29..314f3fe 100644 --- a/tarotcard-flip.css +++ b/tarotcard-flip.css @@ -0,0 +1,30 @@ +:root { + --min-flip-card-height: 80vh; +} + +.tarot-card--flip-on-hover { + min-height: var(--min-flip-card-height); + perspective: 1000px; +} + +.tarot-card--flip-on-hover:hover .tarot-card__content { + transform: rotateY(180deg); +} + +.tarot-card--flip-on-hover .tarot-card__content { + transition: transform 800ms; + transform-style: preserve-3d; +} + +.tarot-card__side { + position: absolute; + + width: 100%; + height: 100%; + + backface-visibility: hidden; +} + +.tarot-card__side--back { + transform: rotateY(180deg); +} diff --git a/tarotcard.css b/tarotcard.css index a1bbe4e..0caa6ca 100644 --- a/tarotcard.css +++ b/tarotcard.css @@ -2,7 +2,8 @@ --tarot-card-title-background-color: rgb(234, 191, 99); } -* { +*, *::before, *::after { + margin: 0; box-sizing: border-box; } diff --git a/test/index.html b/test/index.html index e6597c9..9d0a0c0 100644 --- a/test/index.html +++ b/test/index.html @@ -23,6 +23,11 @@ justify-content: space-evenly; align-items: center; } + + #flip-card-back { + height: 100%; + background: white; + } @@ -33,6 +38,7 @@
+ + -
+
@@ -79,8 +88,11 @@

The Flip Card.

+
-

This is the back side of The Flip Card.

+
+

This is the back side of The Flip Card.

+