@hellouxpavel/cssanimation
Version:
A Powerful CSS Animation Library for Advanced Motion Design.
88 lines (78 loc) • 1.48 kB
CSS
/*!
* Module: horizontalShake Animation
* Usage: <div class="cssanimation ca__fx-horizontalShake">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-horizontalShake {
animation-name: horizontalShake;
animation-iteration-count: infinite;
}
@keyframes horizontalShake {
3%,
12%,
21%,
30%,
39%,
48%,
57%,
65%,
74%,
83%,
92% {
transform: translateX(5px);
}
6%,
15%,
24%,
33%,
42%,
51%,
60%,
68%,
77%,
86%,
95% {
transform: translateX(3px);
}
9%,
18%,
27%,
36%,
45%,
54%,
63%,
71%,
80%,
89%,
98% {
transform: translateX(-5px);
}
}