@hellouxpavel/cssanimation
Version:
A Powerful CSS Animation Library for Advanced Motion Design.
162 lines (135 loc) • 3.12 kB
CSS
.cssanimation {
animation-duration: var(--cssanimation-duration, 1s);
animation-fill-mode: var(--cssanimation-fill-mode, both);
}
.cssanimation span {
display: var(--cssanimation-display, inline-block);
}
.infinite {
animation-iteration-count: var(--cssanimation-infinite, infinite) ;
}
@media (prefers-reduced-motion: reduce) {
.cssanimation,
.cssanimation span {
animation: none ;
transition: none ;
}
}
:root {
--cssanimation-duration: 1s;
--cssanimation-fill-mode: both;
--cssanimation-infinite: infinite;
--cssanimation-backface-visibility: hidden;
--cssanimation-transform-style: preserve-3d;
--cssanimation-will-change: transform, opacity;
--cssanimation-display: inline-block;
--move-distance: -800px;
}
/**
* Module: Dramatic
* Filename: ca__Dramatic.ca__fx-css
*/
.ca__fx-curtainReveal {
animation-name: curtainReveal;
animation-timing-function: ease-out;
transform-origin: top center;
overflow: hidden;
}
@keyframes curtainReveal {
0% {
clip-path: inset(0 0 100% 0);
opacity: 0;
}
50%,
100% {
clip-path: inset(0 0 0 0);
opacity: 1;
}
}
.ca__fx-curtainClose {
animation-name: curtainClose;
animation-timing-function: ease-in;
transform-origin: top center;
}
@keyframes curtainClose {
0% {
clip-path: inset(0 0 0 0);
opacity: 1;
}
50%,
100% {
clip-path: inset(0 0 100% 0);
opacity: 0;
}
}
.ca__fx-spiralTwistIn {
animation-name: spiralTwistIn;
animation-timing-function: ease-out;
transform-origin: center;
will-change: transform, opacity;
}
@keyframes spiralTwistIn {
0% {
transform: scale(0) rotate(720deg);
opacity: 0;
}
60% {
transform: scale(1.ca__fx-05) rotate(-30deg);
opacity: 1;
}
100% {
transform: scale(1) rotate(0deg);
}
}
.ca__fx-spiralTwistOut {
animation-name: spiralTwistOut;
animation-timing-function: ease-in;
transform-origin: center;
will-change: transform, opacity;
}
@keyframes spiralTwistOut {
0% {
transform: scale(1) rotate(0deg);
opacity: 1;
}
100% {
transform: scale(0.ca__fx-3) rotate(-360deg);
opacity: 0;
}
}
.ca__fx-spotlightFocus {
animation-name: spotlightFocus;
animation-timing-function: ease-in-out;
transform-origin: center;
will-change: transform, opacity;
}
@keyframes spotlightFocus {
0% {
filter: brightness(0.ca__fx-2) blur(4px);
transform: scale(1.ca__fx-2);
opacity: 0;
}
100% {
filter: brightness(1) blur(0);
transform: scale(1);
opacity: 1;
}
}
.ca__fx-spotlightFade {
animation-name: spotlightFade;
animation-timing-function: ease-out;
transform-origin: center;
will-change: transform, opacity;
}
@keyframes spotlightFade {
0% {
filter: brightness(1) blur(0);
opacity: 1;
transform: scale(1);
}
100% {
filter: brightness(0.ca__fx-3) blur(6px);
opacity: 0;
transform: scale(0.ca__fx-9);
}
}