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

              
                <h1>Slumber Party Massacre 2</h1>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Abril+Fatface)

@keyframes focus
  0%
    opacity: 0
    filter: blur(4px)
    transform: translate3d(-52%,-50%,0)
  50%
    filter: blur(4px)
    transform: translate3d(-49%,-50%,0)
  80%
    filter: blur(6px)
    transform: translate3d(-50%,-50%,0)
  100%
    opacity: 1
    filter: blur(0px)
    transform: translate3d(-50%,-50%,0)

@keyframes ripple
  0%
    opacity: 0
    transform: translate3d(0,0,0)
  100%
    opacity: 1
    transform: translate3d(0,0,0)

html, body
  width: 100%
  height: 100%
  overflow: hidden

body
  color: white
  font-family: 'Abril Fatface', serif
  font-size: 48px
  line-height: 1em
  background-color: black
  
  &:before
    content: ''
    position: fixed
    top: 50%
    left: 50%
    width: 102%
    height: 102%
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/191456/s113.jpg')
    background-repeat: no-repeat
    background-position: 50% 50%
    background-size: cover
    opacity: 0.33
    transform: rotate(0deg) translate3d(-50%,-50%,0)

h1
  position: absolute
  top: 50%
  left: 50%
  white-space: nowrap
  opacity: 0
  
  &.focus
    animation: focus 1332ms ease-in-out forwards

  span
    position: relative
    display: inline-block
    opacity: 0
    
    &:last-child
      color: #900

    &.show
      animation: ripple 666ms ease-in-out forwards
              
            
!

JS

              
                $ ->
  
  # Vars
  $title = $('h1')
  title = $title.text()
  new_title = ''
  delay = 24
  
  for i in [0...title.length]
    t = if title[i] is ' ' then (new_title + ' ') else (new_title + '<span class="show" style="animation-delay: ' + (i * delay) + 'ms">' + title[i] + '</span>')
    $title.html(t)
    new_title = $title.html()

  $title.addClass('focus')
              
            
!
999px

Console