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

              
                .universe
  - (1..250).each do
    %div{:class => "ball"}
              
            
!

CSS

              
                $balls: 250 ///////////////////// number of balls (default: 250)
$size: 3 //////////////////////// scale of max-size (default: 3)
$color: random /////////// CSS color of a ball (default: random)
$bg: #0F0000 /////////////// page background (default:  #0F0000)
$time: 3 ////////// velocity of movement in seconds (default: 3)
$rotateAll: false // boolean. rotate all system (default: false)

.ball
  border-top: 2px solid rgba(255,255,255,0.2)
  display: inline-block
  border-radius: 50%
  &:hover
    // do nothing
  
// balls + movement
@for $i from 1 through $balls
  @keyframes float-#{$i}
    from
      transform: translate(random(10) + em, random(5) + em)
    to
      transform: translate(random(5) + em, random(25) + em) rotate(360deg)
  .ball:nth-child(#{$i}) //
    $ballsize: $size/random(4) + em
    $transitionTime: $time * random(3)
    @if $color == random
      background: hsla(random(360), 100%, 30%,  0.6)
    @else
      background: $color
    width: $ballsize
    height: $ballsize
    @if $i < 10
      margin: 0 random(3) * $i + px
    @else
      margin: 0 $i/5 + px
    @if $transitionTime > 1
      animation: float-#{$i} ($transitionTime + s) ease-in-out infinite alternate
    @else
      animation: float-#{$i} 3s ease-in-out infinite alternate

// page decoration + rotateAll effect
@keyframes rotateAll
  to
    transform: rotate(360deg)
body
  cursor: pointer
  overflow: hidden
  background: $bg -webkit-radial-gradient(50% 40%,ellipse cover, lighten($bg, 10%), $bg 40%) no-repeat
  background: $bg -moz-radial-gradient(50% 40%,ellipse cover, lighten($bg, 10%), $bg 40%) no-repeat
.universe
  border-radius: 50%
  background: transparent
  @if $rotateAll
    animation: rotateAll 20s ease-in-out infinite
              
            
!

JS

              
                
              
            
!
999px

Console