Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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(20,30) scale(.85)"/>
      </symbol>
      
      <radialGradient id="gr-radial-lights" 
      cx="50%" cy="50%" r="70%">
        <stop stop-color="white" offset="5%"
          stop-opacity="1"/>
        <stop stop-color="white" offset="100%" stop-opacity="0"/>
      </radialGradient>
    </defs>
</svg>

<div class="demo demo--lights">
  <svg viebox="0 0 1024 640">
    <svg viewbox="0 0 640 640">
      <g transform="scale(1)" stroke-width="142%" stroke-dasharray="8% 70%">
        <circle class="c-lights" r="75%" cx="50%" cy="50%" stroke="orangered"/>
        <circle class="c-lights" r="75%" cx="50%" cy="50%" stroke="teal" stroke-dashoffset="15%"/>
        <circle class="c-lights" r="75%" cx="50%" cy="50%" stroke="gold" stroke-dashoffset="30%"/>
        <circle class="c-lights" r="75%" cx="50%" cy="50%" stroke="crimson" stroke-dashoffset="45%"/>
        <circle class="c-lights" r="75%" cx="50%" cy="50%" stroke="mediumseagreen" stroke-dashoffset="60%"/>
       </g>   
    </svg>
    
    <svg viewbox="0 0 320 80">
      <svg viewbox="0 0 150 170">  
        <g class="group--stars">
          <use xlink:href="#s-star" class="star--outline"/>
          <g class="group--stars-anim">
            <use xlink:href="#s-star" fill="currentColor"/>
            <use xlink:href="#s-star" fill="teal"/>
            <use xlink:href="#s-star" fill="orangered"/>
            <use xlink:href="#s-star" fill="gold"/>
          </g>
        </g>
      </svg>
    </svg>
  </svg>
</div>
              
            
!

CSS

              
                $trans-hor: 75px;
$trans-vert: 75px;
$lights-color: darkslategray;

.defs {
  position: absolute;
  }
.demo--lights {
    position: absolute; 
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: $lights-color;
    color: $lights-color;
    }
   svg {
     width: 100%;
     height: 100%;
     } 
    .group--stars {
      transform: scale(.9) translate(10);
      }
    .star--outline {
        transform-origin: $trans-hor $trans-vert;
        transform: scale(1.3);
        fill: mediumseagreen;
        stroke: currentColor;
        stroke-width: 6;
        }
    .group--stars-anim {
        use {
            transform-origin: $trans-hor $trans-vert;
            }
      
        @for $item from 2 through 4 {
            use:nth-child(#{$item}) {
              transform: scale(1-($item/5));
              animation-delay: -#{$item}s;
              }
          }
        }
    .c-lights {
        fill: none;
        transform-origin: 320px 320px;
        animation: rotation 20s infinite linear;
        }

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

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

JS

              
                
              
            
!
999px

Console