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.

            
              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
            
          
!
            
              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
🕑 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