$dark: #262626; $light: #dcdcd2; $vsize: 400px; $shift: 8px; $timing: cubic-bezier(.30,.1,.30,1); @function toggle($value, $first, $second) { @if $value == $first { @return $second; } @else { @return $first; } } @keyframes wobble { 0% { transform: translateX(-$shift); } 50% { transform: translateX($shift); } 100% { transform: translateX(-$shift); } } @mixin circles($num) { $color: $light; $size: 35px; $sadd: 25px; $wait: 0s; @for $current from $num through 1 { div.circle:nth-of-type(#{$current}) { @if $current % 2 == 0 { background: $light; } @else { background: $dark; animation: wobble 1.8s infinite $timing; animation-delay: $wait; } width: $size; height: $size; left: (200 - ($size / 2)); top: (200 - ($size / 2)); } $size: $size + $sadd; $sadd: toggle($sadd, 25px, 35px); $wait: $wait + 0.1s; } } *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } html, body { padding: 0; margin: 0; } body { background: #202020; font-family: Roboto; color: #454545; a { text-decoration: none; color: #9a9a9a; &:hover { color: #ffffff; } } } #note { text-align: center; width: $vsize; position: absolute; margin-top: 410px; } #box { left: 50%; top: 50%; transform: translate(-50%, -50%); box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); position: absolute; background: $dark; width: $vsize; height: $vsize; #wrap { @include circles(19); width: 400px; height: 400px; overflow: hidden; position: absolute; div.circle { position: absolute; border-radius: 50%; &:nth-of-type(odd) { transform: translateX(-$shift); } } } }