@hellouxpavel/cssanimation
Version:
A Powerful CSS Animation Library for Advanced Motion Design.
71 lines (58 loc) • 1.46 kB
CSS
/*!
* Module: jiggleTransform Animation
* Usage: <div class="cssanimation ca__fx-jiggleTransform">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-jiggleTransform {
animation: jiggleTransform 0.7s ease-in-out forwards;
transform-origin: center;
}
@keyframes jiggleTransform {
0%,
100% {
transform: rotate(0deg) scale(1);
}
15% {
transform: rotate(-3deg) scale(1.02);
}
30% {
transform: rotate(3deg) scale(0.98);
}
45% {
transform: rotate(-2deg) scale(1.01);
}
60% {
transform: rotate(2deg) scale(0.99);
}
75% {
transform: rotate(-1deg) scale(1);
}
}