@hellouxpavel/cssanimation
Version:
A Powerful CSS Animation Library for Advanced Motion Design.
160 lines (149 loc) • 2.97 kB
CSS
/*!
* Module: wave-morph Animation
* Usage: <div class="cssanimation ca__fx-wave-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 wave-morph {
0% {
/* A gentle, slightly curved top and bottom */
clip-path: polygon(
0% 20%,
10% 25%,
20% 20%,
30% 25%,
40% 20%,
50% 25%,
60% 20%,
70% 25%,
80% 20%,
90% 25%,
100% 20%,
100% 80%,
90% 75%,
80% 80%,
70% 75%,
60% 80%,
50% 75%,
40% 80%,
30% 75%,
20% 80%,
10% 75%,
0% 80%
);
}
25% {
/* More pronounced wave, expanding horizontally */
clip-path: polygon(
0% 0%,
15% 10%,
30% 0%,
45% 10%,
60% 0%,
75% 10%,
90% 0%,
100% 10%,
100% 90%,
90% 100%,
75% 90%,
60% 100%,
45% 90%,
30% 100%,
15% 90%,
0% 100%
);
}
50% {
/* Reaching a flatter, more compressed state */
clip-path: polygon(0% 30%, 100% 30%, 100% 70%, 0% 70%); /* A wide rectangle */
}
75% {
/* Another wave pattern, perhaps inverted or shifted */
clip-path: polygon(
0% 10%,
10% 0%,
20% 10%,
30% 0%,
40% 10%,
50% 0%,
60% 10%,
70% 0%,
80% 10%,
90% 0%,
100% 10%,
100% 90%,
90% 100%,
80% 90%,
70% 100%,
60% 90%,
50% 100%,
40% 90%,
30% 100%,
20% 90%,
10% 100%,
0% 90%
);
}
100% {
/* Back to the initial gentle wave */
clip-path: polygon(
0% 20%,
10% 25%,
20% 20%,
30% 25%,
40% 20%,
50% 25%,
60% 20%,
70% 25%,
80% 20%,
90% 25%,
100% 20%,
100% 80%,
90% 75%,
80% 80%,
70% 75%,
60% 80%,
50% 75%,
40% 80%,
30% 75%,
20% 80%,
10% 75%,
0% 80%
);
}
}
/**
* Module: Dance
* Filename: ca__Dance.css
*/
.ca__fx-danceTop {
animation-name: danceTop;
transform-origin: top;
}