123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- $duration: 0.35s;
- $bounce: cubic-bezier(0.375, 1.495, 0.610, 0.780);
- $height: 300px;
- $width: 200px;
- .flipper-card {
- box-shadow: 0 10px 5px -5px rgba(#000, 0.2);
- height: $height;
- left: 50%;
- line-height: $height;
- margin: -($height / 2) 0 0 -($width / 2);
- perspective: 500px;
- position: absolute;
- text-align: center;
- top: 50%;
- transform: translateZ(0);
- width: $width;
-
-
- span {
- background: #202020;
- color: #f8f8f8;
- display: block;
- font-size: 250px;
- left: 0;
- position: absolute;
- top: 0;
- text-shadow: 0 1px 0 (#000 + 40), 0 2px 0 (#000 + 30), 0 3px 0 (#000 + 20), 0 4px 0 (#000 + 10), 0 5px 0 #000, 0 0 10px rgba(#000, 0.8);
- transform-origin: 0 150px 0;
- width: 100%;
-
- &:before {
- border-bottom: 2px solid #000;
- content: '';
- left: 0;
- position: absolute;
- width: 100%;
- }
-
- &:after {
- box-shadow: inset 0 0 60px rgba(#000, 0.35);
- content: '';
- height: 100%;
- left: 0;
- position: absolute;
- top: 0;
- width: 100%;
- }
- }
-
- .small {
- font-size: 175px;
- }
- .top {
-
-
-
- border-top-left-radius: 11px;
- border-top-right-radius: 11px;
-
- box-shadow: inset 0 2px rgba(#000, 0.9), inset 0 3px 0 rgba(#fff, 0.4);
-
-
- height: 50%;
- overflow: hidden;
- &:before {
- bottom: 0;
- }
- &:after {
-
- background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
- border-top-left-radius: 11px;
- border-top-right-radius: 11px;
- }
- }
- .bottom {
-
-
-
-
- border-radius: 10px;
- height: 100%;
- &:before {
- top: 50%;
- }
- &:after {
- border-radius: 10px;
- background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0));
- }
- }
-
- &.down {
- .top {
-
- border-top-left-radius: 11px;
- border-top-right-radius: 11px;
- height: 50%;
- &.current {
-
- transform-style: flat;
- z-index: 3;
- }
- &.next {
-
- transform: rotate3d(1, 0, 0, -90deg);
- z-index: 4;
- }
- }
- .bottom {
- border-radius: 10px;
- &.current {
- z-index: 2;
- }
- &.next {
- z-index: 1;
- }
- }
- &.changing {
- .bottom.current {
- box-shadow: 0 75px 5px -20px rgba(#000, 0.3);
- transform: rotate3d(1, 0, 0, 90deg);
-
- transition: transform 0.35s ease-in, box-shadow 0.35s ease-in;
- }
- }
- &.changing,
- &.changed {
- .top.next {
-
- transition: transform 0.35s ease-out 0.35s;
- transform: none;
- }
- }
- }
- &.up {
- .top {
- height: 50%;
- &.current {
- z-index: 4;
- }
- &.next {
- z-index: 3
- }
- }
- .bottom {
- &.current {
- z-index: 1;
- }
- &.next {
- box-shadow: 0 75px 5px -20px rgba(#000, 0.3);
-
- transform: rotate3d(1, 0, 0, 90deg);
- z-index: 2;
- }
- }
- &.changing {
- .top.current {
-
- transform: rotate3d(1, 0, 0, -90deg);
-
- transition: transform 0.2625s ease-in, box-shadow 0.2625s ease-in;
- }
- }
- &.changing,
- &.changed {
- .bottom.next {
- box-shadow: 0 0 0 0 rgba(#000, 0);
-
- transition: box-shadow 0.175s cubic-bezier(0.375, 1.495, 0.61, 0.78) 0.35s, transform 0.35s cubic-bezier(0.375, 1.495, 0.61, 0.78) 0.35s;
- transform: rotate3d(1, 0, 0, 0);
- }
- }
- }
- &.changed {
- .top.current,
- .bottom.current {
- display: none;
- }
- }
- }
|