$colors: #F4C3D1, #E4A1BD, #D17FA8, #BA6090, #954B76, #743562, #5A2C56, #54214F, #461B46, #320F3B, #2C0A37, #250831; $r-start: 30px; $r-fade: 250px; /* --------------------------------- Mixins --------------------------------- */ %center-align { -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } @mixin animation($name, $time) { -webkit-animation: $name $time infinite; -moz-animation: $name $time infinite; -o-animation: $name $time infinite; animation: $name $time infinite; } @mixin keyframes($name) { @-webkit-keyframes #{$name} { @content; } @-moz-keyframes #{$name} { @content; } @-ms-keyframes #{$name} { @content; } @keyframes #{$name} { @content; } } #moon { position: absolute; fill: #FCF8F4; fill-rule: evenodd; width: 20px; height: 20px; left: 50%; top: 50%; @extend %center-align; } /* --------------------------------- Circles --------------------------------- */ .circle { width: $r-start; height: $r-start; border-radius: 50%; background-color: nth($colors, 1); position: absolute; opacity: 0; left: 50%; top: 50%; @extend %center-align; box-shadow: 0 0 2px rgba(0,0,0,0.1); } @for $i from 0 through 11 { .circle:nth-child(#{11}n+#{$i}) { @include animation(undulate, 5s); -webkit-animation-delay: $i * 500ms; animation-delay: $i * 500ms; } } /* --------------------------------- Animation --------------------------------- */ @include keyframes(undulate) { 0% { width: $r-start; height: $r-start; opacity: 1; } @for $i from 1 through length($colors) { $percent: 7% + 7 * $i; #{$percent} { background-color: nth($colors, $i); } } 100% { background-color: #150525; width: $r-fade; height: $r-fade; opacity: 0; } } /* --------------------------------- Global --------------------------------- */ html, body { padding: 0; margin: 0; width: 100%; height: 100%; overflow: hidden; background-color: #150525; }