.frame
.center
- for i in (1..20)
div class="dot dot-#{i}" style="--index: #{i}"
View Compiled
.frame {
position: absolute;
top: 50%;
left: 50%;
width: 400px;
height: 400px;
margin-top: -200px;
margin-left: -200px;
border-radius: 2px;
box-shadow: 4px 8px 16px 0 rgba(0,0,0,0.1);
overflow: hidden;
background: #fff;
color: #333;
font-family: 'Open Sans', Helvetica, sans-serif;
font-smoothing: antialiased;
osx-font-smoothing: grayscale;
background: #4c4ba2;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.center > div {
--time: calc(60 / calc(40 + 20 - var(--index)) * 1000ms);
height: 10px;
width: 10px;
background: white;
margin-bottom: 7px;
border-radius: 100%;
animation: dot var(--time) ease-in-out infinite;
}
@keyframes dot {
0%, 100% {
transform: translateX(50px);
}
50% {
transform: translateX(-50px);
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.