Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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.

+ add another resource

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <svg class="defs">
      <defs>
      <symbol id="s-star" viewbox="0 0 210 210">
        <polygon points="98.4999978 153.75 38.2520165 185.424245 49.7583542 118.337123 1.01670635 70.8257603 68.3760155 61.037872 98.5000012 1.1379786e-14 128.624005 61.0378871 195.98331 70.8258091 147.241642 118.337136 158.747982 185.424247" transform="translate(10,10)"/>
      </symbol>
    </defs>
</svg>

<div class="demo demo--lights">
  <svg viebox="0 0 1024 640">
    <svg viewBox="0 0 320 50">
      <svg viewBox="0 0 150 150">  
        <g class="group--stars">
          <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-star" class="star--outline"></use>
          <g class="group--stars-anim">
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-star" fill="currentColor"></use>
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-star" fill="white"></use>
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-star" fill="currentColor"></use>
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-star" fill="white"></use>
          </g>
        </g>
      </svg>
  </svg>
  </svg>
</div>
              
            
!

CSS

              
                $size: 200vw;
$trans-hor: 75px;
$trans-vert: 75px;
$lights-color: lightseagreen;

html,
body {
  height: 100%;
  overflow: hidden;
  color: $lights-color;
}

body:after {
  content: "";
  background: radial-gradient(rgb(255, 255, 255), $lights-color 80vw), repeating-conic-gradient(rgba(255, 255, 255, 1) 0 10deg, $lights-color 0 20deg) 50% no-repeat;
  background-blend-mode: multiply;
  // mask-image: radial-gradient(circle at center, #000, rgba(255, 255, 255, .1) 100vw);
  animation: spin 20s linear infinite;
  border-radius: 50%;
  position: absolute;
  top: -9999px;
  bottom: -9999px;
  left: -9999px;
  right: -9999px;
  margin: auto;
  width: $size;
  height: $size;
  will-change: transform;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.demo--lights {
  position: absolute;
  z-index: 9;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  color: $lights-color;
}

svg {
  width: 100%;
  height: 100%;
  display: none;
}

.group--stars {
  transform: scale(.9);
}

.star--outline {
  transform-origin: $trans-hor $trans-vert;
  transform: scale(1.2);
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-dasharray: 4;
  animation: stardashoffset 2s infinite linear;
}

.group--stars-anim {
  use {
    transform-origin: $trans-hor $trans-vert;
    animation: starmove 8s infinite linear;
  }
  @for $item from 2 through 4 {
    use:nth-child(#{$item}) {
      transform: scale(1-($item/5));
    }
  }
}

.c-lights {
  fill: none;
  transform-origin: 320px 320px;
  animation: rotation 20s infinite linear;
}

@keyframes starmove {
  $trans-min: .8;
  $trans-max: 1.2;
  $trans-min-offset: .7;
  $trans-max-offset: 1.3;
  0% {
    transform-origin: $trans-hor*$trans-min*.8 $trans-vert*$trans-min;
  }
  12.5% {
    transform-origin: $trans-hor $trans-vert*$trans-min-offset*.95;
  }
  25% {
    transform-origin: $trans-hor*$trans-max*1.2 $trans-vert*$trans-min;
  }
  37.5% {
    transform-origin: $trans-hor*$trans-max*1.15 $trans-vert;
  }
  50% {
    transform-origin: $trans-hor*$trans-max*1.1 $trans-vert*$trans-max*1.05;
  }
  65.5% {
    transform-origin: $trans-hor $trans-vert*$trans-max-offset*1.1;
  }
  75% {
    transform-origin: $trans-hor*$trans-min*.9 $trans-vert*$trans-max*1.05;
  }
  87.5% {
    transform-origin: $trans-hor*$trans-min-offset*.95 $trans-vert;
  }
  100% {
    transform-origin: $trans-hor*$trans-min*.8 $trans-vert*$trans-min;
  }
}

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

@keyframes stardashoffset {
  100% {
    stroke-dashoffset: -32;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console