Here's an alternative in which the yellow color rotates instead of filling to the side:
HTML (hooray for pseudo-elements!):
<div id="horizon"></div>
CSS
#horizon:before {
content: "";
position: absolute;
width: 400px;
height: 400px;
background: transparent;
border:5px dashed #eee;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
}
#horizon{
width:410px;
height:200px;
position:relative;
overflow:hidden;
}
#horizon:after {
content: "";
position: absolute;
width: 400px;
height: 200px;
top:5px;
left:5px;
background: yellow;
-moz-border-radius: 400px 400px 0 0;
-webkit-border-radius: 400px 400px 0 0;
border-radius: 400px 400px 0 0;
-webkit-transform-origin: bottom;
-moz-transform-origin: bottom;
transform-origin: bottom;
-webkit-animation-name: rotate;
-webkit-animation-duration: 5s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: rotate;
-moz-animation-duration: 5s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
}
@-moz-keyframes rotate {
from {-moz-transform:rotateZ(180deg);}
to {-moz-transform:rotateZ(360deg)}
}
@-webkit-keyframes rotate {
from {-webkit-transform:rotateZ(180deg);}
to {-webkit-transform:rotateZ(360deg)}
}
Fiddle: http://jsfiddle.net/Mp4sZ/
source
share