css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              form
  - const possibilities = [ 'It is<br/> certain', 'It is<br/> decidedly<br/> so', 'Without<br> a<br/> doubt', 'Yes<br/> definitely', 'You may<br/> rely<br/> on it', 'As I<br/> see it,<br/> yes', 'Most<br/> likely', 'Outlook<br/> good', 'Yes', 'Signs<br/> point to<br/> yes', 'Reply <br/> hazy, try<br/> again', 'Ask<br/> again<br/> later', 'Better not<br/> tell you<br/> now', 'Cannot<br/> predict<br/> now', 'Concentrate<br/> and ask<br/> again', 'Don\'t<br/> count<br/> on it', 'My reply<br/> is<br/> no', 'My<br/> sources<br/> say no', 'Outlook<br/> not so<br/> good', 'Very<br/> doubtful']
  - for (let i = 0; i < possibilities.length; i++)
    input(type='radio', name='answer', id=possibilities[i], value=possibilities[i])
    span !{possibilities[i]}
  .eight__backdrop
  .eight
    .eight__fascia
      .eight__number 8
    .eight__fascia
      .eight__window
    ul
      - for (let i = 0; i < possibilities.length; i++)
        li
          label(for=possibilities[i])

  input(type='reset')
            
          
!
            
              *
  box-sizing border-box

body
  display flex
  align-items center
  font-family 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif
  justify-content center
  font-size .8rem
  min-height 100vh
  text-align center
  letter-spacing 1px
  background rgb(219, 10, 91)

$size = 300px
$reset = translate(-50%, -50%)

form
  border-radius 100%
  cursor pointer
  height $size
  position relative
  width $size

  *
    cursor pointer

[type='radio']
  display none
  left 100%
  position absolute

[type='reset']
  display none
  height 100%
  left 0
  opacity 0
  position absolute
  top 0
  width 100%
  z-index 6

li
  margin 0
  padding 0
  height $size
  width $size

label
  display block
  height 100%
  width 100%

ul
  animation scale 7s infinite steps(20)
  left 0
  margin 0
  padding 0
  position absolute
  top 0
  width 100%
  z-index 5

@keyframes scale
  to
    transform translateY(-100%)

.eight
  border-radius 100%
  height 100%
  overflow hidden
  position relative
  width 100%
  z-index 4

  &__backdrop
    background radial-gradient(circle at 5% 5%, #666, #222 50%), #222
    border-radius 100%
    height 100%
    left 0
    position absolute
    top 0
    width 100%

  &__number
    align-items center
    background white
    border-radius 100%
    display flex
    font-size 125px
    height 50%
    justify-content center
    left 50%
    position absolute
    top 50%
    transform $reset
    width 50%

  &__window
    background radial-gradient(transparent, #000)
    border 10px double #555
    border-radius 100%
    height calc(50% + 20px)
    left 50%
    position absolute
    top 50%
    transform $reset
    width calc(50% + 20px)

  &__fascia
    height $size
    position relative
    width $size


@keyframes floaty
  0%, 100%
    transform $reset
  25%
    transform $reset translate(-2%, 2%) rotate(2deg)
  50%
    transform $reset translate(2%, -2%) rotate(-2deg)
  75%
    transform $reset translate(1%, 1%) rotate(1deg)


span
  background blue
  text-transform uppercase
  color #ffffff
  text-shadow 1px 1px 0 darken(#fff, 25%)
  position absolute
  top 50%
  left 50%
  width 45%
  height 45%
  transform-origin 50% 25%
  transform translate(-50%, -50%)
  text-transform uppercase
  display flex
  align-items center
  justify-content center
  opacity 0
  animation-duration 10s
  animation-timing-function linear
  animation-iteration-count infinite
  animation-name floaty
  z-index 2

  &:nth-of-type(even)
    $clip = polygon(0 100%, 50% 20%, 100% 100%)
    -webkit-clip-path $clip
    align-items flex-end
    clip-path $clip
    padding-bottom 5%
    top 40%

  &:nth-of-type(odd)
    $clip = polygon(0 0, 50% 80%, 100% 0)
    -webkit-clip-path $clip
    align-items flex-start
    clip-path $clip
    padding-top 5%
    top 60%

[type='radio']:checked

  + span
    opacity 1
    transition opacity 1s 1.7s

  ~ .eight
  ~ .eight__backdrop
    animation shake .25s 4

  ~ .eight .eight__fascia
    transform translate(0, -100%)
    transition transform .25s 1.25s ease

  ~ [type='reset']
    display block

  ~ .eight__mask
    display block


@keyframes shake
  0%, 100%
    transform translate(0, 0)
  50%
    transform translate(10px, 5px)
  75%
    transform translate(-10px, -5px)
            
          
!
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.
Loading ..................

Console