CSS3 not work shake animation effect - html

I have This CSS3 animate code for shake effect in DIV action: (i copy this code from HERE)
CSS CODE:
.shake {
-webkit-animation-name: shake ;
animation-name: shake;
}
#-webkit-keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0)
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0)
}
}
#keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0)
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0)
}
}
Now, in action when i see div shake action not work!?
for see css effect, How do can i fix this ?
DEMO

The animated class is missing. Take a look here to find more information on how Animate.css works. You actually do not need to copy the code. You can include the library into the header of your document.
#-webkit-keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0)
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0)
}
}
#keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0)
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0)
}
}
/* add this class */
.animated {
-webkit-animation-duration:1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.shake {
-webkit-animation-name: shake;
animation-name: shake
}
<div class="animated shake">Shake this text</div>

Working, your missing the animation-duration: 4s;
#-webkit-keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0)
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0)
}
}
#keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0)
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0)
}
}
.shake {
-webkit-animation-name: shake;
animation-name: shake;
animation-duration: 4s;
}
Fiddle: http://jsfiddle.net/pjra0sqk/2/

It is becuase you didn't give animation-duration: 1s;
Just give it solved your issue.
.shake {
-webkit-animation-name: shake;
animation-name: shake;
animation-duration: 1s;
-webkit-animation-duration:1s;
}
Check your updated Fiddle.

General Code snippet to make a div shake. If anyone is still interested:
#myDiv {
/* Start the shake animation and make the animation last for 0.5 seconds */
animation: shake 0.5s;
/* When the animation is finished, start again */
animation-iteration-count: infinite;
/* Some additional styles for a better example */
background-color: #00ccff;
color: white;
text-align: center;
height: 200px;
width: 200px;
}
#keyframes shake {
0% {
transform: translate(1px, 1px) rotate(0deg);
}
10% {
transform: translate(-1px, -2px) rotate(-1deg);
}
20% {
transform: translate(-3px, 0px) rotate(1deg);
}
30% {
transform: translate(3px, 2px) rotate(0deg);
}
40% {
transform: translate(1px, -1px) rotate(1deg);
}
50% {
transform: translate(-1px, 2px) rotate(-1deg);
}
60% {
transform: translate(-3px, 1px) rotate(0deg);
}
70% {
transform: translate(3px, 1px) rotate(-1deg);
}
80% {
transform: translate(-1px, -1px) rotate(1deg);
}
90% {
transform: translate(1px, 2px) rotate(0deg);
}
100% {
transform: translate(1px, -2px) rotate(-1deg);
}
}
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Titel</title>
</head>
<body>
<div id="myDiv">Content of shaking div</div>
</body>
</html>

Related

Add CSS shaking animation to a button without hover

I am trying to make the button shake without hovering on it. When I am removing the "hover" element, the button doesn't shake at all. What should I change in the code to make it work?
.first_button:hover {
animation: shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
transform: translate3d(0, 0, 0);
backface-visibility: hidden;
perspective: 1000px;
}
#keyframes shake {
10%,
90% {
transform: translate3d(-1px, 0, 0);
}
20%,
80% {
transform: translate3d(2px, 0, 0);
}
30%,
50%,
70% {
transform: translate3d(-4px, 0, 0);
}
40%,
60% {
transform: translate3d(4px, 0, 0);
}
}
<button class="first_button">Button</button>
Use the infinite prop for your animation.
More info on animation syntax
.first_button {
animation: shake 0.82s cubic-bezier(.36, .07, .19, .97) both infinite;
transform: translate3d(0, 0, 0);
backface-visibility: hidden;
perspective: 1000px;
}
#keyframes shake {
10%,
90% {
transform: translate3d(-1px, 0, 0);
}
20%,
80% {
transform: translate3d(2px, 0, 0);
}
30%,
50%,
70% {
transform: translate3d(-4px, 0, 0);
}
40%,
60% {
transform: translate3d(4px, 0, 0);
}
}
<button class="first_button">Button</button>

CSS Animation on Mozilla Firefox

i have a little problem in my css animation, the code works in google chrome, ie9+ and safari but not in firefox.
I tried to use -moz-, but nothing happened. This animation have five images, but in mozilla only showed the first image.
Code:
.anima {
will-change: transform;
margin: 0 auto;
max-width: 436px;
width: 100%;
height: 400px;
-webkit-animation-name: effect; /* Chrome, Safari, Opera */
-webkit-animation-duration: 14s; /* Chrome, Safari, Opera */
animation-name: effect;
animation-duration: 14s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
background: url("http://miceone.com.br/imagens/fazer-26fdbd895c.svg") 0% 0% / contain no-repeat;
}
/* Chrome, Safari, Opera */
#-webkit-keyframes effect {
0% {transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
5% {background: url("http://miceone.com.br/imagens/fazer-26fdbd895c.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
10% {transform: rotate3d(1, 0, 0, 100deg);}
15% {background: url("http://miceone.com.br/imagens/evoluir-fb7c0c3ecb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
25% {background: url("http://miceone.com.br/imagens/evoluir-fb7c0c3ecb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
30% {transform: rotate3d(1, 0, 0, 100deg);}
35% {background: url("http://miceone.com.br/imagens/crescer-a364c2e9fb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
45% {background: url("http://miceone.com.br/imagens/crescer-a364c2e9fb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
50% {transform: rotate3d(1, 0, 0, 100deg);}
55% {background: url("http://miceone.com.br/imagens/acontecer-dedf63a20d.svg") 0% 0% / contain no-repeat;transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
65% {background: url("http://miceone.com.br/imagens/acontecer-dedf63a20d.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
70% {transform: rotate3d(1, 0, 0, 100deg);}
75% {background: url("http://miceone.com.br/imagens/acreditar-55f9efcefd.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
85% {background: url("http://miceone.com.br/imagens/acreditar-55f9efcefd.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
90% {transform: rotate3d(1, 0, 0, 100deg);}
100% {background: url("http://miceone.com.br/imagens/fazer-26fdbd895c.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
}
/* Standard syntax */
#keyframes effect {
0% {transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
5% {background: url("http://miceone.com.br/imagens/fazer-26fdbd895c.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
10% {transform: rotate3d(1, 0, 0, 100deg);}
15% {background: url("http://miceone.com.br/imagens/evoluir-fb7c0c3ecb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
25% {background: url("http://miceone.com.br/imagens/evoluir-fb7c0c3ecb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
30% {transform: rotate3d(1, 0, 0, 100deg);}
35% {background: url("http://miceone.com.br/imagens/crescer-a364c2e9fb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
45% {background: url("http://miceone.com.br/imagens/crescer-a364c2e9fb.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
50% {transform: rotate3d(1, 0, 0, 100deg);}
55% {background: url("http://miceone.com.br/imagens/acontecer-dedf63a20d.svg") 0% 0% / contain no-repeat;transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
65% {background: url("http://miceone.com.br/imagens/acontecer-dedf63a20d.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
70% {transform: rotate3d(1, 0, 0, 100deg);}
75% {background: url("http://miceone.com.br/imagens/acreditar-55f9efcefd.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
85% {background: url("http://miceone.com.br/imagens/acreditar-55f9efcefd.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
90% {transform: rotate3d(1, 0, 0, 100deg);}
100% {background: url("http://miceone.com.br/imagens/fazer-26fdbd895c.svg") 0% 0% / contain no-repeat; transform: rotate3d(0, 0, 0, 0deg); margin: 0 auto!important;}
}
<div class="anima"></div>
I posted this code in CodePen also.
Thanks!
I solved the problem!
In firefox, it's not possible animate the property background
Sorry for the lack of information, my english isn't so good :/
For more informations, see this oficial mozilla page below!
https://bugzilla.mozilla.org/show_bug.cgi?id=1036761
Code below:
.anima-box, .anima-box div {
margin: 0 auto!important;
max-width: 436px;
width: 100%;
height: 400px;
}
.anima-box div {
will-change: transform, opacity;
position: absolute;
left: 0;
top: 0;
-webkit-animation-duration: 14s; /* Chrome, Safari, Opera */
animation-duration: 14s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
}
.anima-fazer {
-webkit-animation-name: effect-fazer; /* Chrome, Safari, Opera */
animation-name: effect-fazer;
background: url("http://miceone.com.br/imagens/fazer-26fdbd895c.svg") 0% 0% / contain no-repeat;
opacity: 1.0;
}
.anima-evoluir {
-webkit-animation-name: effect-evoluir; /* Chrome, Safari, Opera */
animation-name: effect-evoluir;
background: url("http://miceone.com.br/imagens/evoluir-fb7c0c3ecb.svg") 0% 0% / contain no-repeat;
opacity: 0.0;
}
.anima-crescer {
-webkit-animation-name: effect-crescer; /* Chrome, Safari, Opera */
animation-name: effect-crescer;
background: url("http://miceone.com.br/imagens/crescer-a364c2e9fb.svg") 0% 0% / contain no-repeat;
opacity: 0.0;
}
.anima-acontecer {
-webkit-animation-name: effect-acontecer; /* Chrome, Safari, Opera */
animation-name: effect-acontecer;
background: url("http://miceone.com.br/imagens/acontecer-dedf63a20d.svg") 0% 0% / contain no-repeat;
opacity: 0.0;
}
.anima-acreditar {
-webkit-animation-name: effect-acreditar; /* Chrome, Safari, Opera */
animation-name: effect-acreditar;
background: url("http://miceone.com.br/imagens/acreditar-55f9efcefd.svg") 0% 0% / contain no-repeat;
opacity: 0.0;
}
#-webkit-keyframes effect-fazer {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
5% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
10% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
90% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
95% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
}
#keyframes effect-fazer {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
5% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
10% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
90% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
95% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
}
#-webkit-keyframes effect-evoluir {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
10% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
15% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
25% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
30% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
#keyframes effect-evoluir {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
10% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
15% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
25% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
30% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
#-webkit-keyframes effect-crescer {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
30% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
35% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
45% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
50% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
#keyframes effect-crescer {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
30% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
35% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
45% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
50% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
#-webkit-keyframes effect-acontecer {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
50% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
55% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
65% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
70% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
#keyframes effect-acontecer {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
50% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
55% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
65% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
70% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
#-webkit-keyframes effect-acreditar {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
70% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
75% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
85% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
90% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
#keyframes effect-acreditar {
0% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
70% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
75% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
85% {transform: rotate3d(0, 0, 0, 0deg); opacity: 1.0;}
90% {transform: rotate3d(1, 0, 0, 100deg); opacity: 0.0;}
100% {transform: rotate3d(0, 0, 0, 0deg); opacity: 0.0;}
}
<div class="anima-box">
<div class="anima-fazer"></div>
<div class="anima-evoluir"></div>
<div class="anima-crescer"></div>
<div class="anima-acontecer"></div>
<div class="anima-acreditar"></div>
</div>

CSS3 animation only on certain pages

This is my code for CSS3 animation: shake that I applied on one of the nav links. It works like a charm, but I want it turned off when someone opens the page that it is linked to it.
How can I solve this problem?
#menu-item-313 {
animation: shake 1.4s;
-webkit-animation-iteration-count: 10; /* Chrome, Safari, Opera */
animation-iteration-count: 6;
transform: translate3d(0, 0, 0);
}
#keyframes shake {
10%, 90% {
transform: translate3d(-2px, 0, 0);
}
20%, 80% {
transform: translate3d(4px, 0, 0);
}
30%, 50%, 70% {
transform: translate3d(-8px, 0, 0);
}
40%, 60% {
transform: translate3d(8px, 0, 0);
}
}
One way is to set a class on the body, like this, and use the :not selector
Sample not shaking
body:not(.pg313) #menu-item-313 {
animation: shake 1.4s;
-webkit-animation-iteration-count: 10; /* Chrome, Safari, Opera */
animation-iteration-count: 6;
transform: translate3d(0, 0, 0);
}
#keyframes shake {
10%, 90% {
transform: translate3d(-2px, 0, 0);
}
20%, 80% {
transform: translate3d(4px, 0, 0);
}
30%, 50%, 70% {
transform: translate3d(-8px, 0, 0);
}
40%, 60% {
transform: translate3d(8px, 0, 0);
}
}
<body class="pg313">
<div id="menu-item-313">
Menu item 313
</div>
<div id="menu-item-314">
Menu item 314
</div>
</body>
Sample shaking
body:not(.pg313) #menu-item-313 {
animation: shake 1.4s;
-webkit-animation-iteration-count: 10; /* Chrome, Safari, Opera */
animation-iteration-count: 6;
transform: translate3d(0, 0, 0);
}
#keyframes shake {
10%, 90% {
transform: translate3d(-2px, 0, 0);
}
20%, 80% {
transform: translate3d(4px, 0, 0);
}
30%, 50%, 70% {
transform: translate3d(-8px, 0, 0);
}
40%, 60% {
transform: translate3d(8px, 0, 0);
}
}
<body class="pg314">
<div id="menu-item-313">
Menu item 313
</div>
<div id="menu-item-314">
Menu item 314
</div>
</body>

Shake image on hover with css?

I am trying to make image shake on hover with CSS3 but seems like I have syntax error. I am trying the apply the effect to css3.png and html5.png
I have added id classes to the images that I would like to have that effect.
Here is my current html:
<div class="row">
<div class="col-lg-2 col-lg-offset-2">
<div id="img">
<img class="img-responsive shake" src="img/html5.png">
</div>
</div>
<div class="col-lg-3">
<img class="img-responsive" src="img/and.png">
</div>
<div class="col-lg-2">
<div id="img">
<img class="img-responsive shake" src="img/css3.png">
</div>
</div>
</div>
here is the CSS:
.shake {
-webkit-animation-name: shake;
animation-name: shake;
}
#-webkit-keyframes shake {
from, to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%, 30%, 50%, 70%, 90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%, 40%, 60%, 80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
#keyframes shake {
from, to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%, 30%, 50%, 70%, 90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%, 40%, 60%, 80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
To get the effect on hover, you have to include the :hover selector in your css: http://www.w3schools.com/cssref/sel_hover.asp
.shake img:hover {
***code***
}
Try replacing
.shake {
-webkit-animation-name: shake;
animation-name: shake;
}
with this CSS.
.shake:hover {
-webkit-animation-name: shake;
animation-name: shake;
-webkit-animation-duration: 2s;
animation-duration: 2s;
}
Your problem is that .shake is calling a div that you are not using in your HTML. First, take the spaces out of your div classes, it is bad naming convention... Then call those divs instead of ".shake" It would be closer to this
# .img-responsive-shake{
enter code here
}

How to use animate.css shake with less shakes

I'm using animate.css for a CSS3 shake effect, the CSS looks like the snippet below. Right now it shakes back and forth multiple times and I'd like to cut the shakes in half. Is there a way to do this with animate css3 or do I need to modify the css3 below? If so, what's the best way?
#-webkit-keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%, 30%, 50%, 70%, 90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%, 40%, 60%, 80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
#keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%, 30%, 50%, 70%, 90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%, 40%, 60%, 80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
.shake {
-webkit-animation-name: shake;
animation-name: shake;
}
Not really sure how you want to "cut the shake in half". Do you mean the speed, sway??
Here is what I came up, demo
If you want to slow the animation down, change the `-webkit-animation-duration:
Here is a custom cool shake/wobble effect:
#keyframes shake {
0% {
-webkit-transform:translate(2px,1px) rotate(0deg)
}
10% {
-webkit-transform:translate(-1px,-2px) rotate(-1deg)
}
20% {
-webkit-transform:translate(-3px,0px) rotate(1deg)
}
30% {
-webkit-transform:translate(0px,2px) rotate(0deg)
}
40% {
-webkit-transform:translate(1px,-1px) rotate(1deg)
}
50% {
-webkit-transform:translate(-1px,2px) rotate(-1deg)
}
60% {
-webkit-transform:translate(-3px,1px) rotate(0deg)
}
70% {
-webkit-transform:translate(2px,1px) rotate(-1deg)
}
80% {
-webkit-transform:translate(-1px,-1px) rotate(1deg)
}
90% {
-webkit-transform:translate(2px,2px) rotate(0deg)
}
100% {
-webkit-transform:translate(1px,-2px) rotate(-1deg)
}
}
Here is a simple demo