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

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.

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

              
                .button Click Me
              
            
!

CSS

              
                body
  background: radial-gradient(circle, lighten(aquamarine, 15%), aquamarine)
  background-repeat: no-repeat
  width: 100vw
  height: 100vh
  display: flex
  flex-flow: row nowrap
  justify-content: center
  align-items: center

.button
  font-family: 'Bungee', cursive
  font-size: 1.2rem
  position: relative
  text-transform: uppercase
  font-weight: bold
  letter-spacing: 1px
  cursor: pointer
  background: palevioletred
  border: 2px solid darken(palevioletred, 15%)
  padding: 30px 60px
  border-radius: 45px
  color: white
  overflow: hidden
  box-shadow: 0 2px 4px darkgray
  transition: all 0.2s ease-in
  z-index: 1
  
  .circle
    position: absolute
    border-radius: 50%
    pointer-events: none
    background:
      image: radial-gradient(circle closest-side, white, lighten(palevioletred, 15%))

    width: 1px
    height: 1px
    z-index: 3
    animation:
      name: ripple
      duration: 0.5s
      timing-function: ease-in
  
  &:hover
    transform: scale(1.01)
    box-shadow: 0 6px 4px darkgray

@keyframes ripple
  0%
    transform: scale(0, 0)
    opacity: 0
  75%
    transform: scale(450, 450)
    opacity: 0.75
  100%
    transform: scale(700, 700)
    opacity: 0
              
            
!

JS

              
                const button = document.querySelector('.button')

function materializeEffect(event){
  const circle = document.createElement('div')
  const x = event.layerX
  const y = event.layerY
  circle.classList.add('circle')
  circle.style.left = `${x}px`
  circle.style.top = `${y}px`
  this.appendChild(circle)
}

button.addEventListener('click', materializeEffect)
              
            
!
999px

Console