CSS3 Animation Playaround
by parkji
HTML
<div id="clock">
<div id="pendulum"></div>
</div>
CSS
@-webkit-keyframes pendulum {
0% {
left: 0;
}
25% {
/*top: 10px;*/
-webkit-transform: rotate(15deg);
left: -26px;
}
50% {
}
75% {
/*top: 10px;*/
-webkit-transform: rotate(-15deg);
left: 26px;
}
100% {
left: 0;
}
}
#pendulum {
background: #000;
border-right: 0;
border-bottom: 0;
-webkit-border-radius: 100px;
height: 50px;
width: 50px;
-webkit-transition: all 0.5s ease-in;
-webkit-animation-name: pendulum;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
position: relative;
top: 60px;
}
#pendulum:before {
content: '';
background: #000;
width: 1px;
height: 75px;
position: absolute;
top: -75px;
left: 50%;
}
#clock {
position: relative;
border: 1px solid #000;
border-top-width: 20px;
width: 105px;
padding-left: 50px;
height: 150px;
}