@hellouxpavel/cssanimation
Version:
A Powerful CSS Animation Library for Advanced Motion Design.
53 lines (44 loc) • 1.27 kB
CSS
/*!
* Module: morph Animation
* Usage: <div class="cssanimation ca__fx-morph">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 */
@keyframes morph {
0% {
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); /* Diamond */
}
50% {
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%); /* Trapezoid */
}
100% {
clip-path: polygon(0% 15%, 15% 0%, 100% 0%, 85% 15%, 100% 100%, 0% 100%); /* A complex star-like shape */
}
}