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

              
                <div class="colour-1"></div>
<div class="colour-2"></div>
<div class="colour-3"></div>

<!-- The below code is not needed -->
<div class="aurora">
  <div class="aurora__container">
    <h1>Aurora Example</h1>
    <p>Example of using CSS to create and Aurora style effect.</p>
  </div>
</div>
              
            
!

CSS

              
                // - - - - - - - - - - - - - - -
// Code for the Aurora effect
// - - - - - - - - - - - - - -
body {
  background: #1c1ca2;
}

div {
  position: absolute;
  opacity: 0.75;
}

@function shadow($color) {
  @return 0 0 45vmax 45vmax #{$color};
}

@keyframes hueRotate {
  to {
    filter: hue-rotate(360deg);
  }
}

@keyframes colour-1 {
  0% {
    top: 0vh;
    left: 50vw;
  }
  25% {
    left: 0vw;
  }
  50% {
    top: 100vh;
  }
  75% {
    left: 100vw;
  }
  100% {
    top: 0vh;
    left: 50vw;
  }
}

@keyframes colour-2 {
  0% {
    top: 50vh;
    left: 100vw;
  }
  25% {
    top: 100vh;
  }
  50% {
    left: 0vw;
  }
  75% {
    top: 0vh;
  }
  100% {
    top: 50vh;
    left: 100vw;
  }
}

@keyframes colour-3 {
  0% {
    top: 100vh;
    left: 50vw;
  }
  25% {
    left: 100vw;
  }
  50% {
    top: 0vh;
  }
  75% {
    left: 0vw;
  }
  100% {
    top: 100vh;
    left: 50vw;
  }
}

.colour-1 {
  box-shadow: shadow(purple);
  animation: hueRotate 10s 0s linear infinite, colour-1 19s 0s linear infinite;
}

.colour-2 {
  box-shadow: shadow(blue);
  animation: hueRotate 15s 0s linear infinite, colour-2 25s 0s linear infinite;
}

.colour-3 {
  box-shadow: shadow(red);
  animation: hueRotate 20s 0s linear infinite, colour-3 15s 0s linear infinite;
}

// - - - - - - - - - - - - - - - - - - - - -
// Extra code for the text box (not needed)
// - - - - - - - - - - - - - - - - - - - - -
@keyframes fadeOut {
  to {
    opacity: 0;
  }
}
.aurora,
.aurora > * {
  z-index: 2;
  position: static;
  opacity: 1;
  display: grid;
  place-content: center;
  width: 100vw;
  height: 100vh;
}

.aurora__container {
  animation: fadeOut 3s 5s linear 1 forwards;
  display: block;
  height: auto;
  width: auto;
  max-width: 600px;
  padding: clamp(20px, 5vw, 60px);
  margin: clamp(8px, 4vw, 24px);
  background-color: #ffffff;
  color: #00000097;
  border-radius: 10px;
  box-shadow: 0px 12px 24px -5px rgba(0, 0, 0, 0.2);
  mix-blend-mode: soft-light;

  h1 {
    text-align: center;
    font-family: sans-serif;
    font-size: clamp(25px, 5vw, 50px);
    line-height: 1.2;
    padding-bottom: 16px;
    font-weight: bold;
    -webkit-text-stroke-width: thin;
    -webkit-text-stroke: black;
  }

  p {
    font-weight: bold;
    text-align: center;
    font-family: sans-serif;
    font-size: clamp(16px, 4vw, 30px);
    line-height: 1.2;
    -webkit-text-stroke-width: thin;
    -webkit-text-stroke: black;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console