Skip to content

Instantly share code, notes, and snippets.

@chouzar
Last active May 29, 2020 17:26
Show Gist options
  • Select an option

  • Save chouzar/eed26400234c5feb2583410b0cdc6e55 to your computer and use it in GitHub Desktop.

Select an option

Save chouzar/eed26400234c5feb2583410b0cdc6e55 to your computer and use it in GitHub Desktop.
CSS animation
.step {
position: relative;
transition: linear 200ms opacity;
opacity: 1;
animation-duration: 200ms;
}
.step.left,
.step.right {
transition-delay: 200ms;
}
.step.hide,
.step.hide {
opacity: 0;
}
.step.show.,
.step.show. {
opacity: 1;
}
.step.left.hide { animation-name: hide-left; }
.step.left.show { animation-name: show-left; }
.step.right.hide { animation-name: hide-right; }
.step.right.show { animation-name: show-right; }
@keyframes hide-left {
from {left: 0; opacity: 1;}
to {left: -15px; opacity: 0;}
}
@keyframes show-left {
from {left: -15px; opacity: 0;}
to {left: 0; opacity: 1;}
}
@keyframes hide-right {
from {left: 0; opacity: 1;}
to {left: +15px; opacity: 0;}
}
@keyframes show-right {
from {left: +15px; opacity: 0;}
to {left: 0; opacity: 1;}
}
.step.fixate {
position: absolute;
width: 100%;
left: 0;
top: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment