/ Published in: CSS
This uses css3 keyframes, so IE support is limited.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<style> @-webkit-keyframes clock { 0% {-webkit-transform: rotate(0deg);} 100% {-webkit-transform: rotate(360deg);} } @-moz-keyframes clock { 0% {-moz-transform: rotate(0deg);} 100% {-webkit-transform: rotate(360deg);} } @-webkit-keyframes counter-clock{ 0% {-webkit-transform: rotate(360deg);width: 85px;height: 85px;} 50% {-webkit-transform: rotate(180deg);width: 185px; height: 185px;} 100% {-webkit-transform: rotate(0deg);width: 85px;height: 85px;} } @-moz-keyframes counter-clock{ 0% {-moz-transform: rotate(360deg); width: 85px;height: 85px;} 100% {-moz-transform: rotate(0deg);width: 185px;height: 185px;} } /* spinners */ .spinner { float: none; position: absolute; text-align: center; width: 85px; height: 85px; -moz-animation-timing-function: linear; -moz-animation-iteration-count: infinite; -moz-animation-direction: normal; -moz-animation-delay: 0; -moz-animation-play-state: running; -moz-animation-fill-mode: forwards; -webkit-animation-timing-function: linear; -webkit-animation-iteration-count: infinite; -webkit-animation-direction: normal; -webkit-animation-delay: 0; -webkit-animation-play-state: running; -webkit-animation-fill-mode: forwards; } #spinner1 { background-color: #454545; left: 31px; top: 45px; -moz-animation-name: clock; -moz-animation-duration: 10s; -webkit-animation-name: clock; -webkit-animation-duration: 10s; } #spinner2 { background-color: #123123; left: 81px; top: 85px; -moz-animation-name: counter-clock; -moz-animation-duration: 10s; -webkit-animation-name: counter-clock; -webkit-animation-duration: 10s; } </style> <div class="container"> <div class="spinner" id="spinner1"></div> <div class="spinner" id="spinner2"></div> </div>
URL: http://jsfiddle.net/ryanwfiorini/kStWt/25/