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

              
                - const word = 'Showcase'
- const letters = word.split('').length
- const step = 0.1
- const duration = ((letters + 2) * step) + step
.showcase(style=`--duration: ${duration}; --step: ${step};`)
  .showcase__border
    - for(let i = 0; i < letters + 2; i++)
      div
  .showcase__backdrop
  h1.showcase__text(data-splitting='')= word
  .showcase__border
    - for(let i = 0; i < letters + 2; i++)
      div

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Roboto:700')

*
  box-sizing border-box

:root
  --font-size 4
  --border-width 4
  --text #fef160
  --border #be90d4
  --color-one #3fc380
  --color-two #f0ff00
  --color-three #f62459
  --color-four #19b5fe

animate()
  animation-delay calc(((var(--char-index) + 1) * var(--step)) * 1s)
  animation-duration calc(var(--duration) * 1s)
  animation-iteration-count infinite
  animation-name flash

body
  align-items center
  background-color #111
  display flex
  font-family 'Roboto', sans-serif
  justify-content center
  min-height 100vh


.showcase
  display grid
  grid-template-rows 20px calc(var(--font-size) * 1.25rem) 20px
  grid-template-columns repeat(10, calc(var(--font-size) * 1.25rem))
  position relative

  &__backdrop
    background #fff
    bottom 20px
    left calc((var(--font-size) * 1.25rem) - (var(--border-width) * .5px))
    opacity .75
    position absolute
    right calc((var(--font-size) * 1.25rem) - (var(--border-width) * .5px))
    top 20px

  &__border
    align-content center
    background var(--border)
    border 2px solid black
    display grid
    grid-column 1 / -1
    grid-template-columns repeat(10, calc(var(--font-size) * 1.25rem))
    justify-items center

    div
      background #fafafa
      border 2px solid rgba(0,0,0,0.75)
      height 12px
      width 12px

  &__text
    color var(--text)
    font-size calc(var(--font-size) * 1rem)
    grid-column 2 / -2
    grid-row 2
    line-height calc(var(--font-size) * 1.25rem)
    margin 0
    padding 0
    text-align center
    text-transform uppercase
    z-index 3

    .word
      display grid
      grid-gap 0 calc(var(--border-width) * 1px)
      grid-template-columns repeat(8, calc((var(--font-size) * 1.25rem) - calc(var(--border-width) * 1px)))
      padding 0 2px

    .char
      animate()
      background #000
      text-shadow 0 4px 0 #000

      &:nth-of-type(n)
        --color var(--color-one)

      &:nth-of-type(2n)
        --color var(--color-two)

      &:nth-of-type(3n)
        --color var(--color-three)

      &:nth-of-type(4n)
        --color var(--color-four)

@keyframes flash
  0%
  30%
  50%
  100%
    background #000
  40%
    background var(--color)
    filter drop-shadow(0 0 calc(var(--font-size) * 1rem) var(--color)) blur(2px) brightness(5)


              
            
!

JS

              
                const { Splitting } = window
Splitting()
              
            
!
999px

Console