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.

            
              - const directions = ['North', 'North East', 'East', 'South East', 'South', 'South West', 'West', 'North West']
.container
  each direction in directions
    .page
      .text(data-word=direction, data-scroll='out', data-splitting='', class=`text--${direction.toLowerCase().replace(' ', '-')}`)= direction
            
          
!
            
              :root
  --speed 1
  --delay 0.5
  --font-size 60

body
  background #111
  min-height 100vh
  overflow-x hidden

  @media(min-width 768px)
    --font-size 100

.page
  height 100vh
  width 100vw
  scroll-snap-align center
  font-size calc(var(--font-size) * 1px)
  font-weight bold
  display flex
  align-items center
  justify-content center
  font-variant small-caps
  position relative

.text
  --clip 0
  position relative
  &--north
    --origin 50% 0

  &--north-east
    --origin 100% 0

  &--east
    --origin 100% 50%

  &--south-east
    --origin 100% 100%

  &--south
    --origin 50% 100%

  &--south-west
    --origin 0% 100%

  &--west
    --origin 0% 50%

  &--north-west
    --origin 0% 0%

  & > span
    transition -webkit-clip-path calc(var(--speed) * 1s) calc(var(--delay) * 1s) ease, clip-path calc(var(--speed) * 1s) calc(var(--delay) * 1s) ease
    $clip = circle(calc(var(--clip) * 1%) at var(--origin))
    -webkit-clip-path $clip
    clip-path $clip

  &[data-scroll="in"] > span
    --clip 150

  &:before
    content attr(data-word)
    position absolute
    color rgba(255, 255, 255, 0.15)
    top 0
    left 0
    font-size calc(var(--font-size) * 1px)
    z-index -1

/**
  * Themeing
*/

.container
  height 100vh
  overflow auto
  overflow-x hidden
  // Cant include nice scrolling as it
  // introduces a weird rendering error...   
  // -webkit-overflow-scrolling touch  
  scroll-snap-type y mandatory

.char
  color #fff

.text--north .char:nth-of-type(1)
  color #e6261f

.text--north-east .char:nth-of-type(1)
  color #eb7532

.text--east .char:nth-of-type(1)
  color #f7d038

.text--south-east .char:nth-of-type(1)
  color #a3e048

.text--south .char:nth-of-type(1)
  color #49da9a

.text--south-west .char:nth-of-type(1)
  color #34bbe6

.text--west .char:nth-of-type(1)
  color #4355db

.text--north-west .char:nth-of-type(1)
  color #e6261f
.text--north-west .char:nth-of-type(2)
  color #f7d038
.text--north-west .char:nth-of-type(3)
  color #49da9a
.text--north-west .char:nth-of-type(4)
  color #4355db
.text--north-west .char:nth-of-type(5)
  color #d23be7
            
          
!
            
              const { Splitting } = window
Splitting()
window.ScrollOut({
  scrollingElement: '.container',
  targets: '.text',
})

            
          
!
999px
๐Ÿ•‘ 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.

Console