cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              mixin spiral_circle()
	.spiral__circle
		.spiral__circle
			.spiral__circle
				.spiral__circle
					.spiral__circle
						.spiral__circle
							.spiral__circle
								.spiral__circle
									.spiral__circle
										.spiral__circle
											.spiral__circle
												.spiral__circle
													.spiral__circle
														.spiral__circle
															.spiral__circle
																.spiral__circle
																	.spiral__circle
																		.spiral__circle
																			.spiral__circle
																				.spiral__circle
																					.spiral__circle
																						.spiral__circle
																							.spiral__circle
																								.spiral__circle
																									.spiral__circle
																										.spiral__circle
																											.spiral__circle
																												.spiral__circle
																													.spiral__circle
																														.spiral__circle
																															.spiral__circle
																																.spiral__circle
																																	.spiral__circle
																																		.spiral__circle
																																			.spiral__circle
																																				.spiral__circle
																																					.spiral__circle
																																						.spiral__circle
																																							.spiral__circle
																																								.spiral__circle
																																									.spiral__circle
																																										.spiral__circle
																																											.spiral__circle
																																												.spiral__circle
																																													.spiral__circle
																																														.spiral__circle
																																															.spiral__circle
																																																.spiral__circle
																																																	.spiral__circle
																																																		.spiral__circle
																																																		





.spiral__container
	+spiral_circle
            
          
!
            
              // This is the main mixin for creating keyframe animations with cross-browser compatibility automatically set up. It needs the name and also the body with the keyframe locations and properties.

// @example
//   @include keyframes(name-here) {
//      0%   { color: black; }
//      50%   { color: color(mono, white); }
//      100% { color: black; }
//   }
//
//   @include animation('name-here 1s linear 0s infinite');
@mixin keyframes($animationName) {
    @-webkit-keyframes #{$animationName} {
        @content;
    }
    @-moz-keyframes #{$animationName} {
        @content;
    }
    @-o-keyframes #{$animationName} {
        @content;
    }
    @keyframes #{$animationName} {
        @content;
    }
}
/// This is the setup for the keyframes mixin
/// @see keyframes
/// @group Dependencies
@mixin animation($animate...) {
    $max: length($animate);
    $animations: '';

    @for $i from 1 through $max {
        $animations: #{$animations + nth($animate, $i)};

        @if $i < $max {
            $animations: #{$animations + ", "};
        }
    }
    -webkit-animation: $animations;
    -moz-animation:    $animations;
    -o-animation:      $animations;
    animation:         $animations;
}

@keyframes spin {
  0% { transform: rotate(0deg); }

  100% { transform: rotate(360deg); }
}



 @function isEven($value) {
  @if ( ($value % 2) == 0) {
    @return true;
  
   }  @else {
    @return false;
  } 
} 



$total_spirals: 50;




.spiral__container {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background-color: rgba(140, 140, 255, 1);
}

.spiral__circle {
  min-width: 7px;
  min-height: 7px;
  box-sizing: border-box;
  padding: 3.5px;
  
  border-radius: 100%;
  // border: 1px solid rgba(gray, 0.4);
  
  animation: spin 60s infinite linear
}


@for $current from 1 through $total_spirals {
  $selector: '.spiral__container';
  $rank: ($total_spirals + 1) - $current;
  $even: isEven($rank);
  $percentage: $rank / $total_spirals;
  $invert_percentage: 1 - $percentage;
  $opacity: (1 * $invert_percentage) + 0.3;
  
  $border-width: 7px * $percentage;
  
  @for $i from 1 through $current {
    $selector: $selector + ' > .spiral__circle';
  }
  
  #{$selector} {
    
    @if ( $even ) {
      border-top: $border-width solid rgba(white, $opacity);
		border-bottom: $border-width solid rgba(white, $opacity);
		
		// border-right: $border-width solid rgba(black, $opacity);
      // border-left: $border-width solid rgba(black, $opacity);
    } @else {
      border-top: $border-width solid rgba(black, $opacity);
		border-bottom: $border-width solid rgba(black, $opacity);
      
		// border-right: $border-width solid rgba(white, $opacity);
		// border-left: $border-width solid rgba(white, $opacity);
    }
  }
}
            
          
!
999px
Loading ..................

Console