Css3 Rolling Ball Illusion
Took the idea from https://www.youtube.com/watch?v=pNe6fsaCVtI and implemented it using only css3.
<div class="big-circle">
<div class="big-circle">
<div class="holder h1"><div class="little-circle c1"></div></div>
<div class="holder h2"><div class="little-circle c2"></div></div>
<div class="holder h3"><div class="little-circle c3"></div></div>
<div class="holder h4"><div class="little-circle c4"></div></div>
<div class="holder h5"><div class="little-circle c5"></div></div>
<div class="holder h6"><div class="little-circle c6"></div></div>
<div class="holder h7"><div class="little-circle c7"></div></div>
<div class="holder h8"><div class="little-circle c8"></div></div>
</div>
body {
body {
background-color: #3c404b;
}
.big-circle {
background-color: #FF5C00;
border-radius: 50%;
width: 500px;
height: 500px;
position: relative;
left: 50%;
margin-top: 25%;
margin-left: -250px;
}
.holder {
position: absolute;
width: 500px;
height: 500px;
}
.little-circle {
background-color: #FFFF00;
border-radius: 50%;
width: 30px;
height: 30px;
position: absolute;
top: 50%;
left: 0%;
margin-top: -15px;
margin-left: -15px;
animation:move 8s linear alternate infinite;
animation:move 8s linear alternate infinite;
}
.c2 {
animation-delay: 1s;
}
.c3 {
animation-delay: 2s;
}
.c4 {
animation-delay: 3s;
}
.c5 {
animation-delay: 4s;
}
.c6 {
animation-delay: 5s;
}
.c7 {
animation-delay: 6s;
}
.c8 {
animation-delay: 7s;
}
.h2 {
transform:rotate(22.5deg);
transform:rotate(22.5deg); /* IE 9 */
transform:rotate(22.5deg); /* IE 9 */
transform:rotate(22.5deg); /* Opera, Chrome, and Safari */
}
.h3 {
transform:rotate(45deg);
transform:rotate(45deg); /* IE 9 */
transform:rotate(45deg); /* IE 9 */
transform:rotate(45deg); /* Opera, Chrome, and Safari */
}
.h4 {
transform:rotate(67.5deg);
transform:rotate(67.5deg); /* IE 9 */
transform:rotate(67.5deg); /* IE 9 */
transform:rotate(67.5deg); /* Opera, Chrome, and Safari */
}
.h5 {
transform:rotate(90deg);
transform:rotate(90deg); /* IE 9 */
transform:rotate(90deg); /* IE 9 */
transform:rotate(90deg); /* Opera, Chrome, and Safari */
}
.h6 {
transform:rotate(112.5deg);
transform:rotate(112.5deg); /* IE 9 */
transform:rotate(112.5deg); /* IE 9 */
transform:rotate(112.5deg); /* Opera, Chrome, and Safari */
}
.h7 {
transform:rotate(135deg);
transform:rotate(135deg); /* IE 9 */
transform:rotate(135deg); /* IE 9 */
transform:rotate(135deg); /* Opera, Chrome, and Safari */
}
.h8 {
transform:rotate(157.5deg);
transform:rotate(157.5deg); /* IE 9 */
transform:rotate(157.5deg); /* IE 9 */
transform:rotate(157.5deg); /* Opera, Chrome, and Safari */
}
@keyframes move {
/* Should be `-width`, but the background-size messses it up a little */
0% {left: 0%;}
5% {left: 2%;}
10% {left: 5%;}
90% { left: 95%; }
95% {left: 98%;}
100% { left: 100%; }
}
@-webkit-keyframes move {
/* Should be `-width`, but the background-size messses it up a little */
0% {left: 0%;}
5% {left: 2%;}
10% {left: 5%;}
90% { left: 95%; }
95% {left: 98%;}
100% { left: 100%; }
}