Nested DIV Circles (Animated)
Nested circles, animated with CSS to make a tunneling effect.
by MegaScience
HTML
<div id="container">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div></div>
...
CSS
@keyframes myOrbit {
from {
transform: rotate(0deg) translateX(10px) rotate(0deg);
}
to {
transform: rotate(360deg) translateX(10px) rotate(-360deg);
}
}
html, body {
height: 100%;
margin: 0;
overflow: hidden;
}
#container {
overflow: hidden;
}
#container div {
height: 100%;
width: 100%;
padding: 5%;
border-radius: 100%;
border: 2px solid rgba(0, 0, 0, 0.3);
box-sizing: border-box;
background-color: rgba(0, 0, 255, 0.3);
/**/
animation: myOrbit 4s linear infinite;
}
#container div:empty {
background-color: rgba(255, 0, 0, 0.3);
}
#container > div {
height: 100vmin;
width: 100vmin;
overflow: hidden;
margin: 0 auto;
}
#container {
width: 100%;
height: 100%;
}