@hellouxpavel/cssanimation
Version:
A Powerful CSS Animation Library for Advanced Motion Design.
66 lines (54 loc) • 1.38 kB
CSS
/*!
* Module: stretchCollapse Animation
* Usage: <div class="cssanimation ca__fx-stretchCollapse">Your Content</div>
*/
/* stylelint-disable */
: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;
}
.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 ;
}
}
/* stylelint-enable */
.ca__fx-stretchCollapse {
animation: stretchCollapse 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
transform-origin: center;
}
@keyframes stretchCollapse {
0% {
transform: scaleY(1);
}
25% {
transform: scaleY(1.3);
} /* Stretch */
50% {
transform: scaleY(0.7);
} /* Collapse */
75% {
transform: scaleY(1.1);
}
100% {
transform: scaleY(1);
}
}