input.flip#checkbox(type="checkbox")
.checkbox
label(for="checkbox")
.wrapper
h1 day one.
.card
.side.front
.dot
.dot.active
.dot
p Hey you.
.side.back
.dot.active
p Go make some stuff.
.shameless-plug
p hey come check me ouuuutttt.
a(href="https://twitter.com/xdesro", target="_blank")
.icon(data-icon="ei-sc-twitter",
data-size="s")
a(href="https://github.com/xdesro", target="_blank")
.icon(data-icon="ei-sc-github",
data-size="s")
a(href="https://henry.codes", target="_blank")
.icon(data-icon="ei-link",
data-size="s")
View Compiled
$tan: #FFEFE5;
$green: #34CBAE;
$blue: #3B465C;
$grey: #DDDCC8;
$transition: all 0.2s ease;
body {
font-family: "futura";
overflow: hidden;
}
.wrapper {
display: flex;
flex-direction: row;
width: 100vw;
height: 100vh;
padding: 1vh;
transition: $transition;
background: #FFEFE5;
align-items: center;
justify-content: space-evenly;
h1 {
font-size: 12vh;
position: relative;
z-index: 2;
transition: $transition;
text-align: center;
color: $green;
}
&:before {
position: absolute;
z-index: 0;
left: 0;
content: url(https://res.cloudinary.com/xdesro/image/upload/v1507078457/flourish_xebj81.svg);
transition: $transition;
}
&:after {
position: absolute;
right: 0;
content: url(https://res.cloudinary.com/xdesro/image/upload/q_48/v1507128037/flourish-blue_wkuqd1.svg);
transition: $transition;
transform: translateX(5vh);
opacity: 0;
}
}
.card {
position: relative;
z-index: 2;
width: 40vh;
height: 70vh;
transition: $transition;
}
.side {
position: absolute;
width: 100%;
height: 100%;
transition: all 0.4s ease;
border: 2vh solid white;
animation-fill-mode: both;
transform-style: preserve-3d;
backface-visibility: hidden;
perspective: 600px;
p {
font-size: 24px;
font-weight: lighter;
font-style: italic;
padding: 2vh;
text-transform: lowercase;
}
}
.front {
transform: rotateX(0) rotateY(0deg);
background: $tan;
opacity: 1;
p {
color: $green;
}
}
.back {
overflow: hidden;
opacity: 0;
transform: rotateX(0) rotateY(180deg);
background-color: $blue;
background-image: url(https://res.cloudinary.com/xdesro/image/upload/q_37/v1507161529/flourish-blue-vert_lilazi.png);
background-position: -78% 74%;
background-size: 120%;
p {
color: $grey;
}
}
.dot {
position: absolute;
width: 12vh;
height: 12vh;
padding: 0;
border-radius: 100%;
.front & {
background: linear-gradient(to bottom, $green, darken($green, 15%));
&:before {
z-index: 2;
transform: scaleX(-1);
}
&:after {
position: absolute;
z-index: 0;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: "";
border-radius: 100%;
background: url(https://res.cloudinary.com/xdesro/image/upload/q_36/v1507165531/flourish-green-vert_ojslrs.png);
background-size: 50vh;
}
}
.back & {
background: $grey;
background-image: url(https://res.cloudinary.com/xdesro/image/upload/v1507161431/rotated-grey_p9bx0a.png);
background-size: cover;
}
&.active {
top: 50%;
right: 0;
left: 0;
width: 90%;
height: auto;
margin: 0 auto;
padding-bottom: 90%;
transform: translateY(-50%);
&:before {
position: absolute;
right: 0;
bottom: 0;
left: 0;
width: 100%;
padding-bottom: 100%;
content: "";
border-radius: 0 0 100% 100%;
background-image: url(https://res.cloudinary.com/xdesro/image/upload/q_49/v1507162121/dear_d1gwj5.png);
background-size: cover;
}
}
.front & {
&:first-of-type {
top: 2vh;
right: 2vh;
&:after {
transform: rotate(125deg);
background-position: 50% 50%;
background-size: 40vh;
}
}
&:last-of-type {
bottom: 2vh;
left: 2vh;
&:after {
background-position: 25% 50%;
background-size: 40vh;
}
}
}
}
.flip {
position: absolute;
z-index: 30;
bottom: 1vh;
left: 1vh;
visibility: hidden;
width: 10vh;
height: 3vh;
~ .checkbox {
position: absolute;
z-index: 2;
bottom: 2vh;
left: 1vh;
display: block;
width: 22px;
height: 22px;
cursor: pointer;
transition: all 0.4s ease;
&:before {
content: "click this guy.";
display: block;
position: absolute;
width: 100vh;
bottom: 3vh;
left: 1vh;
color: $green;
transition: $transition;
}
&:after {
position: absolute;
top: 14px;
left: 14px;
width: 52px;
height: 2px;
content: "";
border-radius: 50px;
background: #DBCDC3;
}
label {
position: absolute;
z-index: 1;
top: 4px;
left: 4px;
display: block;
width: 22px;
height: 22px;
cursor: pointer;
transition: all 0.4s ease;
border-radius: 50px;
background: white;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.3);
&:after {
position: absolute;
top: 6px;
left: 6px;
width: 10px;
height: 10px;
content: "";
border-radius: 50px;
background: $green;
box-shadow: inset 0 1px 1px rgba(0,0,0,1), 0 1px 0 rgba(255,255,255,0.9);
}
}
}
&:checked {
+ .checkbox {
&:before {
color: $grey;
}
&:after {
background: darken($blue, 10%);
}
label {
left: 54px;
&:after {
background: $grey;
}
}
}
~ .wrapper {
background: $blue;
&:before {
transform: translateX(-5vh);
opacity: 0;
}
&:after {
transform: translateX(0);
opacity: 1;
}
h1 {
color: $grey;
}
.side {
&.front {
transform: rotateX(0) rotateY(180deg);
opacity: 0;
}
&.back {
opacity: 1;
transform: rotateX(0) rotateY(0deg);
}
}
}
~ .shameless-plug {
color: #222937;
.icon {
fill: #222937;
}
}
}
}
.shameless-plug {
position: absolute;
right: 0;
bottom: 0;
display: flex;
width: 50%;
color: #DCCDC3;
align-items: center;
justify-content: flex-end;
.icon {
fill: #DCCDC3;
}
}
@media (max-width: 860px) {
.wrapper {
flex-direction: column;
h1 {
font-size: 10vw;
}
}
.flip {
z-index: 101;
~.checkbox {
z-index: 100;
}
}
}
View Compiled