CSS
body {
position: relative;
padding: 0;
margin: 0;
width: 100%;
height: 100vh;
background: radial-gradient(#5E802B, #2F4016);
font-family: sans-serif;
text-align: center;
}
body h2,
body h3,
body p {
color: white;
}
.wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
}
.cell {
flex-grow: 1;
flex-basis: 50%;
margin: 0 20px;
display: flex;
flex-direction: column;
}
.cell div {
margin-top: auto;
}
/****************
* Burger Styles *
*****************/
.burger {
position: relative;
width: 60px;
height: 60px;
padding: 0;
border: none;
background-color: transparent;
}
.burger__bar {
height: 10%;
border-radius: 2px;
width: 80%;
background-color: white;
display: block;
position: absolute;
left: 50%;
animation-timing-function: ease-in-out;
animation-play-state: paused;
animation-duration: 0.4s;
animation-fill-mode: both;
}
.burger__bar:nth-child(1) {
top: 25%;
transform: translate(-50%, 0%);
}
.burger__bar:nth-child(2) {
top: 50%;
transform: translate(-50%, -50%);
}
.burger__bar:nth-child(3) {
bottom: 25%;
transform: translate(-50%, 0%);
}
.burger.close .burger__bar {
animation-direction: reverse;
}
.burger.open .burger__bar {
animation-direction: normal;
}
.burger.animate .burger__bar {
animation-play-state: running;
}
.burger.animate .burger__bar:nth-child(1) {
animation-name: default-top;
}
.burger.animate .burger__bar:nth-child(2) {
animation-name: default-middle;
}
.burger.animate .burger__bar:nth-child(3) {
animation-name: default-bottom;
}
.burger--merge.animate .burger__bar {
animation-duration: 0.6s;
animation-timing-function: ease;
}
.burger--merge.animate .burger__bar:nth-child(1) {
animation-name: merge-top;
}
.burger--merge.animate .burger__bar:nth-child(2) {
animation-name: merge-middle;
}
.burger--merge.animate .burger__bar:nth-child(3) {
animation-name: merge-bottom;
}
.burger--rotate.animate .burger__bar:nth-child(1) {
animation-name: rotate-top;
}
.burger--rotate.animate .burger__bar:nth-child(2) {
animation-name: rotate-middle;
}
.burger--rotate.animate .burger__bar:nth-child(3) {
animation-name: rotate-bottom;
}
.burger--spin.animate .burger__bar {
animation-duration: 1s;
animation-timing-function: ease;
}
.burger--spin.animate .burger__bar:nth-child(1) {
animation-name: spin-top;
}
.burger--spin.animate .burger__bar:nth-child(2) {
animation-name: spin-middle;
}
.burger--spin.animate .burger__bar:nth-child(3) {
animation-name: spin-bottom;
}
/*__________________
DEFAULT
____________________*/
@keyframes default-top {
50% {
top: 50%;
transform: translate(-50%, -50%) rotate(0);
}
100% {
top: 50%;
transform: translate(-50%, -50%) rotate(-45deg);
}
}
@keyframes default-middle {
50%, 100% {
visibility: hidden;
}
}
@keyframes default-bottom {
50% {
bottom: 50%;
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
bottom: 50%;
transform: translate(-50%, 50%) rotate(45deg);
}
}
/*__________________
MERGE
____________________*/
@keyframes merge-top {
20% {
top: 50%;
transform: translate(-50%, -50%) rotate(0) scale(1, 1);
}
50% {
transform: translate(-50%, -50%) rotate(0) scale(0.2, 1);
}
60% {
transform: translate(-50%, -50%) rotate(-45deg) scale(0.2, 1);
}
100% {
top: 50%;
transform: translate(-50%, -50%) rotate(-45deg) scale(1, 1);
}
}
@keyframes merge-middle {
50% {
transform: translate(-50%, -50%) scale(0.2, 1);
visibility: hidden;
}
100% {
visibility: hidden;
}
}
@keyframes merge-bottom {
20% {
bottom: 40%;
transform: translate(-50%, -50%) rotate(0deg) scale(1, 1);
}
50% {
transform: translate(-50%, -50%) rotate(0deg) scale(0.2, 1);
}
60% {
transform: translate(-50%, -50%) rotate(45deg) scale(0.2, 1);
}
100% {
bottom: 40%;
transform: translate(-50%, -50%) rotate(45deg) scale(1, 1);
}
}
/*__________________
ROTATE
____________________*/
@keyframes rotate-top {
50% {
top: 50%;
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
top: 50%;
transform: translate(-50%, -50%) rotate(45deg);
}
}
@keyframes rotate-middle {
50% {
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
transform: translate(-50%, -50%) rotate(135deg);
}
}
@keyframes rotate-bottom {
50% {
bottom: 50%;
transform: translate(-50%, 50%) rotate(0deg);
}
100% {
bottom: 50%;
transform: translate(-50%, 50%) rotate(45deg);
}
}
/*__________________
SPIN
____________________*/
@keyframes spin-top {
50% {
top: 50%;
transform: translate(-50%, -50%) rotate(0deg);
}
75% {
transform: translate(-50%, -50%) rotate(360deg);
}
100% {
top: 50%;
transform: translate(-50%, -50%) rotate(315deg);
}
}
@keyframes spin-middle {
50% {
visibility: hidden;
}
100% {
visibility: hidden;
}
}
@keyframes spin-bottom {
50% {
bottom: 50%;
transform: translate(-50%, 50%) rotate(0deg);
}
75% {
transform: translate(-50%, 50%) rotate(450deg);
}
100% {
bottom: 50%;
transform: translate(-50%, 50%) rotate(405deg);
}
}