/* Custom animations that respect canvas boundaries */

/* Base animation class */
.custom-animation__animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

/* =================== ATTENTION SEEKERS =================== */

/* Bounce */
@keyframes customBounce {
  from, 20%, 53%, 80%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}
.custom-animation__bounce {
  animation-name: customBounce;
  transform-origin: center bottom;
}

/* Flash */
@keyframes customFlash {
  from, 50%, to {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0;
  }
}
.custom-animation__flash {
  animation-name: customFlash;
}

/* Pulse */
@keyframes customPulse {
  from {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}
.custom-animation__pulse {
  animation-name: customPulse;
}

/* RubberBand */
@keyframes customRubberBand {
  from {
    transform: scale3d(1, 1, 1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}
.custom-animation__rubberBand {
  animation-name: customRubberBand;
}

/* Shake */
@keyframes customShake {
  from, to {
    transform: translate3d(0, 0, 0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%, 40%, 60%, 80% {
    transform: translate3d(10px, 0, 0);
  }
}
.custom-animation__shake {
  animation-name: customShake;
}

/* Swing */
@keyframes customSwing {
  20% {
    transform: rotate3d(0, 0, 1, 15deg);
  }
  40% {
    transform: rotate3d(0, 0, 1, -10deg);
  }
  60% {
    transform: rotate3d(0, 0, 1, 5deg);
  }
  80% {
    transform: rotate3d(0, 0, 1, -5deg);
  }
  to {
    transform: rotate3d(0, 0, 1, 0deg);
  }
}
.custom-animation__swing {
  transform-origin: top center;
  animation-name: customSwing;
}

/* Tada */
@keyframes customTada {
  from {
    transform: scale3d(1, 1, 1);
  }
  10%, 20% {
    transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
  }
  30%, 50%, 70%, 90% {
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
  }
  40%, 60%, 80% {
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}
.custom-animation__tada {
  animation-name: customTada;
}

/* Wobble */
@keyframes customWobble {
  from {
    transform: translate3d(0, 0, 0);
  }
  15% {
    transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
  }
  30% {
    transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
  }
  45% {
    transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
  }
  60% {
    transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
  }
  75% {
    transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__wobble {
  animation-name: customWobble;
}

/* Jello */
@keyframes customJello {
  from, 11.1%, to {
    transform: translate3d(0, 0, 0);
  }
  22.2% {
    transform: skewX(-12.5deg) skewY(-12.5deg);
  }
  33.3% {
    transform: skewX(6.25deg) skewY(6.25deg);
  }
  44.4% {
    transform: skewX(-3.125deg) skewY(-3.125deg);
  }
  55.5% {
    transform: skewX(1.5625deg) skewY(1.5625deg);
  }
  66.6% {
    transform: skewX(-0.78125deg) skewY(-0.78125deg);
  }
  77.7% {
    transform: skewX(0.390625deg) skewY(0.390625deg);
  }
  88.8% {
    transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
  }
}
.custom-animation__jello {
  animation-name: customJello;
  transform-origin: center;
}

/* =================== ENTRANCE ANIMATIONS =================== */

/* Bounce In */
@keyframes customBounceIn {
  from, 20%, 40%, 60%, 80%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(0.9, 0.9, 0.9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(0.97, 0.97, 0.97);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}
.custom-animation__bounceIn {
  animation-name: customBounceIn;
}

/* Bounce In Down */
@keyframes customBounceInDown {
  from, 60%, 75%, 90%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  0% {
    opacity: 0;
    transform: translate3d(0, calc(-1 * var(--canvas-height)), 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(0, 25px, 0);
  }
  75% {
    transform: translate3d(0, -10px, 0);
  }
  90% {
    transform: translate3d(0, 5px, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__bounceInDown {
  animation-name: customBounceInDown;
}

/* Bounce In Left */
@keyframes customBounceInLeft {
  from, 60%, 75%, 90%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  0% {
    opacity: 0;
    transform: translate3d(calc(-1 * var(--canvas-width)), 0, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(25px, 0, 0);
  }
  75% {
    transform: translate3d(-10px, 0, 0);
  }
  90% {
    transform: translate3d(5px, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__bounceInLeft {
  animation-name: customBounceInLeft;
}

/* Bounce In Right */
@keyframes customBounceInRight {
  from, 60%, 75%, 90%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  0% {
    opacity: 0;
    transform: translate3d(var(--canvas-width), 0, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(-25px, 0, 0);
  }
  75% {
    transform: translate3d(10px, 0, 0);
  }
  90% {
    transform: translate3d(-5px, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__bounceInRight {
  animation-name: customBounceInRight;
}

/* Bounce In Up */
@keyframes customBounceInUp {
  from, 60%, 75%, 90%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  0% {
    opacity: 0;
    transform: translate3d(0, var(--canvas-height), 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(0, -25px, 0);
  }
  75% {
    transform: translate3d(0, 10px, 0);
  }
  90% {
    transform: translate3d(0, -5px, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__bounceInUp {
  animation-name: customBounceInUp;
}

/* Fade In */
@keyframes customFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.custom-animation__fadeIn {
  animation-name: customFadeIn;
}

/* Fade In Down */
@keyframes customFadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, calc(-1 * var(--canvas-height) / 2), 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__fadeInDown {
  animation-name: customFadeInDown;
}

/* Fade In Left */
@keyframes customFadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(calc(-1 * var(--canvas-width) / 2), 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__fadeInLeft {
  animation-name: customFadeInLeft;
}

/* Fade In Right */
@keyframes customFadeInRight {
  from {
    opacity: 0;
    transform: translate3d(calc(var(--canvas-width) / 2), 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__fadeInRight {
  animation-name: customFadeInRight;
}

/* Fade In Up */
@keyframes customFadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, calc(var(--canvas-height) / 2), 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__fadeInUp {
  animation-name: customFadeInUp;
}

/* =================== SLIDE ANIMATIONS =================== */

/* Slide In Down */
@keyframes customSlideInDown {
  from {
    transform: translate3d(0, calc(-1 * var(--canvas-height)), 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__slideInDown {
  animation-name: customSlideInDown;
}

/* Slide In Left */
@keyframes customSlideInLeft {
  from {
    transform: translate3d(calc(-1 * var(--canvas-width)), 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__slideInLeft {
  animation-name: customSlideInLeft;
}

/* Slide In Right */
@keyframes customSlideInRight {
  from {
    transform: translate3d(var(--canvas-width), 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__slideInRight {
  animation-name: customSlideInRight;
}

/* Slide In Up */
@keyframes customSlideInUp {
  from {
    transform: translate3d(0, var(--canvas-height), 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__slideInUp {
  animation-name: customSlideInUp;
}

/* Slide Out Down */
@keyframes customSlideOutDown {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(0, var(--canvas-height), 0);
  }
}
.custom-animation__slideOutDown {
  animation-name: customSlideOutDown;
}

/* Slide Out Left */
@keyframes customSlideOutLeft {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(calc(-1 * var(--canvas-width)), 0, 0);
  }
}
.custom-animation__slideOutLeft {
  animation-name: customSlideOutLeft;
}

/* Slide Out Right */
@keyframes customSlideOutRight {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(var(--canvas-width), 0, 0);
  }
}
.custom-animation__slideOutRight {
  animation-name: customSlideOutRight;
}

/* Slide Out Up */
@keyframes customSlideOutUp {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(0, calc(-1 * var(--canvas-height)), 0);
  }
}
.custom-animation__slideOutUp {
  animation-name: customSlideOutUp;
}

/* =================== ZOOM ANIMATIONS =================== */

/* Zoom In */
@keyframes customZoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
}
.custom-animation__zoomIn {
  animation-name: customZoomIn;
}

/* Zoom In Down */
@keyframes customZoomInDown {
  from {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, calc(-1 * var(--canvas-height)), 0);
    animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
  }
  60% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
  }
}
.custom-animation__zoomInDown {
  animation-name: customZoomInDown;
}

/* Zoom In Left */
@keyframes customZoomInLeft {
  from {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(calc(-1 * var(--canvas-width)), 0, 0);
    animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
  }
  60% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
  }
}
.custom-animation__zoomInLeft {
  animation-name: customZoomInLeft;
}

/* Zoom In Right */
@keyframes customZoomInRight {
  from {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(var(--canvas-width), 0, 0);
    animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
  }
  60% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
  }
}
.custom-animation__zoomInRight {
  animation-name: customZoomInRight;
}

/* Zoom In Up */
@keyframes customZoomInUp {
  from {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, var(--canvas-height), 0);
    animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
  }
  60% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
  }
}
.custom-animation__zoomInUp {
  animation-name: customZoomInUp;
}

/* Zoom Out */
@keyframes customZoomOut {
  from {
    opacity: 1;
  }
  50% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  to {
    opacity: 0;
  }
}
.custom-animation__zoomOut {
  animation-name: customZoomOut;
}

/* Zoom Out Down */
@keyframes customZoomOutDown {
  40% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
  }
  to {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, var(--canvas-height), 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
  }
}
.custom-animation__zoomOutDown {
  animation-name: customZoomOutDown;
}

/* Zoom Out Left */
@keyframes customZoomOutLeft {
  40% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0);
  }
  to {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(calc(-1 * var(--canvas-width)), 0, 0);
  }
}
.custom-animation__zoomOutLeft {
  animation-name: customZoomOutLeft;
}

/* Zoom Out Right */
@keyframes customZoomOutRight {
  40% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0);
  }
  to {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(var(--canvas-width), 0, 0);
  }
}
.custom-animation__zoomOutRight {
  animation-name: customZoomOutRight;
}

/* Zoom Out Up */
@keyframes customZoomOutUp {
  40% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190);
  }
  to {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, calc(-1 * var(--canvas-height)), 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
  }
}
.custom-animation__zoomOutUp {
  animation-name: customZoomOutUp;
}

/* =================== SPECIAL ANIMATIONS =================== */

/* Hinge */
@keyframes customHinge {
  0% {
    transform-origin: top left;
    animation-timing-function: ease-in-out;
  }
  20%, 60% {
    transform: rotate3d(0, 0, 1, 80deg);
    transform-origin: top left;
    animation-timing-function: ease-in-out;
  }
  40%, 80% {
    transform: rotate3d(0, 0, 1, 60deg);
    transform-origin: top left;
    animation-timing-function: ease-in-out;
    opacity: 1;
  }
  to {
    transform: translate3d(0, var(--canvas-height), 0);
    opacity: 0;
  }
}
.custom-animation__hinge {
  animation-name: customHinge;
}

/* Roll In */
@keyframes customRollIn {
  from {
    opacity: 0;
    transform: translate3d(calc(-1 * var(--canvas-width)), 0, 0) rotate3d(0, 0, 1, -120deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.custom-animation__rollIn {
  animation-name: customRollIn;
}

/* Roll Out */
@keyframes customRollOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate3d(var(--canvas-width), 0, 0) rotate3d(0, 0, 1, 120deg);
  }
}
.custom-animation__rollOut {
  animation-name: customRollOut;
}

.custom-animation__slideInDown {
  animation-name: customSlideInDown;
}

/* Slide Out animations */
@keyframes customSlideOutLeft {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(calc(-1 * var(--canvas-width)), 0, 0);
  }
}

.custom-animation__slideOutLeft {
  animation-name: customSlideOutLeft;
}

@keyframes customSlideOutRight {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(var(--canvas-width), 0, 0);
  }
}

.custom-animation__slideOutRight {
  animation-name: customSlideOutRight;
}

@keyframes customSlideOutUp {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(0, calc(-1 * var(--canvas-height)), 0);
  }
}

.custom-animation__slideOutUp {
  animation-name: customSlideOutUp;
}

@keyframes customSlideOutDown {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(0, var(--canvas-height), 0);
  }
}

.custom-animation__slideOutDown {
  animation-name: customSlideOutDown;
}
