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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              - var num = 300
  - for (i = 0; i < num; i++)
              $num = 300
$time = 40s
$time-range = 10s

random(min, max)
  return floor(math(0, 'random')*(max - min + 1) + min)

 overflow hidden !important
 > body
  overflow hidden !important

  width 100vw
  height 100vh
  margin 0
  overflow hidden
  animation hue 50s linear infinite

    position absolute
    animation stars linear infinite
      animation twinkle linear infinite
      border-radius 100%
      transform translateZ(0)
  for n in (0..$num)
      width random(2, 30px)
      height @width
      left (random(0, 200) / 2vw)
      animation-delay (random(2, 80) / 100s / @width - 1000s)
      animation-duration (random(900, 1100) / 5s / @width)
        width inherit
        height inherit
        width inherit
        height inherit
        animation-delay (random(1, 100) / 10s - 50s)
        animation-duration (random(50, 500) / 10s)
        background rgba(random(200, 255), random(150, 255), random(100, 255), (random(7, 10) / 10))

@keyframes stars
    transform translate(0,120vh)
    transform translate(0,-20vh)

@keyframes twinkle
  0%, 80%, 100%
    opacity .3
    opacity 1

  position fixed
  top 0
  left 0
  width 100%
  height 100%
  background radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), linear-gradient(top, rgba(57,173,219,.25) 0%, rgba(42,60,87,.4) 100%), linear-gradient(-45deg, #670d10 0%, #092756 100%)

@keyframes hue
    -webkit-filter hue-rotate(0deg)
    filter hue-rotate(0deg)
    -webkit-filter hue-rotate(360deg)
    filter hue-rotate(360deg)
@media (max-width:480px)
 .stars .container:nth-of-type(200)~.container
   display none
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.