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 Tap!
input#checker.sr-only(type="checkbox")
label(for="checker")
.transform
  span rotateX(-24deg)
  span rotateY(32deg)
  span rotateX(90deg)
  span translateZ(calc(var(--depth) + var(--stack-height)) * -1)
- const RING_COUNT = 10;
.container
  .scene
    .plane(style=`--ring-count: ${RING_COUNT}`)
      - let rings = 0;
      while rings < RING_COUNT
        .ring(style=`--index: ${rings};`)
        - rings++;

              
            
!

CSS

              
                @property --rotate-x
  initial-value 0deg
  inherits false
  syntax '<angle>'

@property --rotate-y
  initial-value 0deg
  inherits false
  syntax '<angle>'
  
@property --flatten
  initial-value 0deg
  inherits false
  syntax '<angle>'
  
@property --translate-z
  initial-value 0
  inherits false
  syntax '<length>'


:root
  --border-width 1.2vmin
  --depth 20vmin
  --stack-height 6vmin
  --scene-size 20vmin
  --ring-size calc(var(--scene-size) * 0.6)
  --plane radial-gradient(hsla(0, 0%, 0%, 0.1) 50%, transparent 65%)
  --ring-shadow hsla(0, 0%, 0%, 0.5)
  --hue-one 320
  --hue-two 210
  --blur 10px
  --speed 1.2s
  --bg hsl(0, 0%, 98%)
  --ring-filter brightness(1) drop-shadow(0 0 0 var(--accent))
  --transition 0.5s

label
  position fixed
  height 100vmax
  width 100vmax
  top 50%
  left 50%
  z-index 4
  transform translate(-50%, -50%)
  
.sr-only
  position absolute
  width 1px
  height 1px
  padding 0
  margin -1px
  overflow hidden
  clip rect(0, 0, 0, 0)
  white-space nowrap
  border-width 0

*
  box-sizing border-box
  transform-style preserve-3d
  
h1
  font-family sans-serif
  font-size 3rem
  position fixed
  bottom 2rem
  right 2rem
  color hsl(0, 0%, 15%)
  margin 0
  
body
  display grid
  place-items center
  min-height 100vh
  overflow hidden
  
.transform
  display flex
  align-items center
  justify-content center
  position absolute
  flex-wrap wrap
  top 50%
  gap 0.5rem
  transform translate3d(0, -20vmin, 200vmin)
  z-index 3
  
  span
    background hsla(0, 0%, 10%, 0.85)
    padding 0.5rem
    border-radius 0.5rem
    opacity var(--opacity, 0)
    transition opacity var(--transition)
    transition-delay var(--delay, 0)
    font-family sans-serif
    font-weight bold
    color hsl(0, 0%, 100%)
    white-space nowrap
    
    &:nth-of-type(1)
      --delay calc(var(--transition) * 3)
    &:nth-of-type(2)
      --delay calc(var(--transition) * 2)
    &:nth-of-type(3)
      --delay var(--transition)
    &:nth-of-type(4)
      --delay 0s
  
.container
  height var(--scene-size)
  width var(--scene-size)
  transform translate3d(0, 0, 100vmin) rotateX(var(--rotate-x)) rotateY(var(--rotate-y)) rotateX(var(--flatten)) translateZ(var(--translate-z)) rotate(0deg)
  transition --rotate-x var(--transition) calc(var(--transition) * 3), --rotate-y var(--transition) calc(var(--transition) * 2), --flatten var(--transition) var(--transition), --translate-z var(--transition) 0s   
 
:checked ~ .container
  --rotate-x -24deg
  --rotate-y 32deg
  --flatten 90deg
  --translate-z calc((var(--depth) + var(--stack-height)) * -1)
  transition --rotate-x var(--transition) 0s, --rotate-y var(--transition) var(--transition), --flatten var(--transition) calc(var(--transition) * 2), --translate-z var(--transition) calc(var(--transition) * 3)

:checked ~ .transform
  --opacity 1
  
  span
    &:nth-of-type(4)
      --delay calc(var(--transition) * 3)
    &:nth-of-type(3)
      --delay calc(var(--transition) * 2)
    &:nth-of-type(2)
      --delay var(--transition)
    &:nth-of-type(1)
      --delay 0s
  
.scene
.plane
  height 100%
  width 100%
  position relative
  
.scene
  background hsla(280, 80%, 50%, 0.25)

.plane
  background hsla(200, 80%, 50%, 0.25)
  transform translate3d(0, 0, var(--depth))
              
            
!

JS

              
                
              
            
!
999px

Console