#shark {
display: block;
position: absolute;
z-index: 8002;
width: 350px;
height: 167px;
background: url(../../images/bones/shark.png) no-repeat;
bottom: 0;
left: 250px;
-webkit-animation: shark-bob 9.2s infinite linear;
-moz-animation: shark-bob 9.2s infinite linear;
-ms-animation: shark-bob 9.2s infinite linear;
-o-animation: shark-bob 9.2s infinite linear;
animation: shark-bob 9.2s infinite linear;
}
The definition for the shark-bob keyframes is in here:/* shark bob */
@-webkit-keyframes shark-bob {
0% {
left: 250px;
-webkit-transform: rotate(1deg);
bottom: -150px;
display: none;
z-index: -1;
}
7% {
bottom: -95px;
display: block;
z-index: 8002;
}
60% {
left: 575px;
-webkit-transform: rotate(-10deg);
bottom: -20px;
}
70% {
left: 700px;
-webkit-transform: rotate(-13deg);
}
73% {
-webkit-transform: rotate(-16deg);
bottom: -10px;
}
75% {
bottom: -5px;
left: 850px;
-webkit-transform: rotate(-13deg);
}
78% {
bottom: 5px;
left: 850px;
-webkit-transform: rotate(-8deg);
}
81% {
bottom: -10px;
left: 850px;
-webkit-transform: rotate(-5deg);
}
90% {
bottom: -60px;
left: 900px;
-webkit-transform: rotate(0deg);
}
95% {
bottom: -80px;
left: 1000px;
display: block;
z-index: 8002;
}
99% {
bottom: -100px;
left: 1000px;
display: none;
z-index: -1;
}
}
In terms of tooling, you might look at Sencha Animator - there are a bunch of tools out there that aim to do this, none are that great yet. The CSS is pretty readable here, which is cool. But as the animation.css file says: Seriously, don't be a douchebag and copy this since it took me
a LONG time to perfect. You're free to check it out and even use
the code as inspiration on your own projects, but don't copy it
line by line. Cman...
http://themble.com/wp-content/themes/themblev3/library/styles/css/animation.css
posted by wongcorgi at 1:38 PM on May 18, 2012