/* -------------------------------------------
    Animation
    - Base
    - Reveal
    - Mask
    - Blink
    - Custom Line Drawing
    - Kenburn
    - Particles
    - Snowfall
    - Sparkle
---------------------------------------------- */

// Base
.appear-animate {
  visibility: hidden;
  opacity: 0;
}

.appear-animation-visible {
  visibility: visible;
  opacity: 1;

  &.animated-done {
    animation: none;
  }
}

.animated-svg svg {
  width: 100%;
  height: 100%;
}

.animated {
  animation-timing-function: cubic-bezier(0.3, 0.3, 0.15, 1);
  animation-duration: 1s;
  animation-fill-mode: both;
}

// Reveal
.revealInDown:after,
.revealInLeft:after,
.revealInRight:after,
.revealInUp:after {
  content: "";
  display: block !important;
  position: absolute;
  background-color: var(--alpha-reveal-animation-color);
  visibility: visible;
  animation-duration: inherit;
  animation-delay: inherit;
  animation-timing-function: inherit;
  z-index: 10
}

.revealInDown>*,
.revealInLeft>*,
.revealInRight>*,
.revealInUp>* {
  visibility: inherit !important
}

@keyframes revealContent {
  0% {
    visibility: hidden
  }

  50% {
    visibility: hidden
  }

  50.1% {
    visibility: visible
  }
}

// Mask
.maskUp {
  animation-name: maskUp
}

.maskRight {
  animation-name: maskRight
}

.maskDown {
  animation-name: maskDown
}

.maskLeft {
  animation-name: maskLeft
}

@keyframes maskUp {
  from {
    transform: translate(0, 100%)
  }

  to {
    transform: translate(0, 0)
  }
}

@keyframes maskRight {
  from {
    transform: translate(-100%, 0)
  }

  to {
    transform: translate(0, 0)
  }
}

@keyframes maskDown {
  from {
    transform: translate(0, -100%)
  }

  to {
    transform: translate(0, 0)
  }
}

@keyframes maskLeft {
  from {
    transform: translate(100%, 0)
  }

  to {
    transform: translate(0, 0)
  }
}

// Blink
.blink {
  animation-name: blink
}

@keyframes blink {

  from,
  to {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

// Custom Line Drawing
.animated .customLineAnim {
  animation: 5s customLineAnim;
}

@keyframes customLineAnim {
  0% {
    opacity: 1;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    stroke-linecap: square;
  }

  100% {
    opacity: 1;
    stroke-dasharray: 3000;
    stroke-dashoffset: 2000;
    stroke-linecap: square;
  }
}

// Kenburn
.kenBurnsToRight {
  -webkit-animation-name: kenBurnsToRight;
  animation-name: kenBurnsToRight;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  transform-origin: right;
}

.kenBurnsToLeft {
  -webkit-animation-name: kenBurnsToLeft;
  animation-name: kenBurnsToLeft;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  transform-origin: left;
}

.kenBurnsToLeftTop {
  -webkit-animation-name: kenBurnsToLeft;
  animation-name: kenBurnsToLeft;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  transform-origin: left top;
}

.kenBurnsToRightTop {
  -webkit-animation-name: kenBurnsToRight;
  animation-name: kenBurnsToRight;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  transform-origin: right top;
}

@keyframes kenBurnsToRight {
  from {
    transform: scale(1.2);
  }

  to {
    transform: scale(1);
  }
}

@keyframes kenBurnsToLeft {
  from {
    transform: scale(1.2);
  }

  to {
    transform: scale(1);
  }
}

// Particle
.particle-effect {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

// Snowfall
.snowfall {
  background-image: url(../images/effects/s1.png),
    url(../images/effects/s2.png),
    url(../images/effects/s3.png);
  animation: snow 10s linear infinite;
  z-index: 1;
}

.effect-snow {
  background-image: url(../images/effects/s4.png),
    url(../images/effects/s5.png);
  animation: snowsecond 20s linear infinite
}

@keyframes snow {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px;
  }

  50% {
    background-position: 500px 500px, 100px 300px, -200px 250px;
  }

  100% {
    background-position: 400px 800px, 300px 600px, -200px 400px;
  }
}

@keyframes snowsecond {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px
  }

  100% {
    background-position: 500px 1000px, 400px 400px, 300px 300px
  }
}

// Sparkle
.sparkle {
  background-image: url(../images/effects/sparkle1.png),
    url(../images/effects/sparkle2.png);
  animation: sparkle 60s linear infinite
}

@keyframes sparkle {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px
  }

  100% {
    background-position: -500px -1000px, -400px -400px, 300px 300px
  }
}