CSS: Shake element

PHOTO EMBED

Mon Aug 29 2022 21:00:43 GMT+0000 (UTC)

Saved by @marcopinero #css

.shake {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    animation-name: shakeMe;
    animation-duration: 3s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@keyframes shakeMe {
    2%, 18% {transform: translate3d(-5px, 0, 0);}
    4%, 16% {transform: translate3d(5px, 0, 0);}
    6%, 10%, 14% {transform: translate3d(-5px, 0, 0);}
    8%, 12% {transform: translate3d(5px, 0, 0);}
    18.1% {transform: translate3d(0px, 0, 0);}
}
content_copyCOPY