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

              
                <div class="cool">
  <button type="button" class="cool-btn1 ripple">Click me!</button>
  <button type="button" class="cool-btn2 ripple">Please click me!</button>
  <button type="button" class="cool-btn6 ripple">Hi! Click here.</button>
</div>
<div class="cool">
  <button type="button" class="cool-btn3 ripple"><i class="fa fa-plus"></i></button>
  <button type="button" class="cool-btn4 ripple"><i class="fa fa-comments"></i></button>
  <button type="button" class="cool-btn5 ripple"><i class="fa fa-mail-reply"></i></button>
</div>
<div class="cool" id="surprise">
    <div role="button" class="cool-btn7 ripple">I am a button too!</div>
</div>
              
            
!

CSS

              
                @mixin cool-button(){
  border: none;
  font-size: 15px;
  cursor: pointer;
  transition: all 500ms;
  text-decoration: none;
  margin: 0 1%;
  outline: none;
  font-family: 'Open Sans';
}
@mixin linear-button(){
    padding: 1.2% 3%;
}
@mixin circular-button(){
    border-radius: 30px;
    width: 56px;
    height: 56px;
    box-shadow:  0px 2px 2px 0px hsla(0, 0%, 30%, 1);
}
.cool{
	text-align: center;
	margin: 2.5% 0;
	&-btn1{
		background-color: #3F51B5;
		color: #fff;
    @include cool-button();
		@include linear-button();
    box-shadow:  0px 2px 2px 0px hsla(0, 0%, 10%, 1);
		&:hover{
	    	background-color: #4e5fc1;
	    	transition: all 0.35s;
	   }
	}
	&-btn2{
		background-color: #E91E63;
		color: #fff;
    box-shadow:  0px 2px 2px 0px hsla(0, 0%, 20%, 1);
    @include cool-button();
		@include linear-button();
		&:hover{
	    	background-color: #eb3773;
	    	transition: all 0.35s;
	    }
	}
	&-btn3{
		background-color: #03A9F4;
		color: #fff;
    @include cool-button();
		@include circular-button();
		&:hover{
	    	background-color:#12b2fd;
	    	transition: all 0.35s;
	    }
	}
  &-btn4{
		background-color: #4CAF50;
		color: #fff;
    @include cool-button();
		@include circular-button();
		&:hover{
	    	background-color:#5cb75f;
	    	transition: all 0.35s;
	    }
	}
  &-btn5{
		background-color: #009688;
		color: #fff;
    @include cool-button();
		@include circular-button();
		&:hover{
	    	background-color:#00ad9c;
	    	transition: all 0.35s;
	    }
	}
  &-btn6{
		background-color: #fff;
		color: #FF5722;
    @include cool-button();
		@include linear-button();
    box-shadow:  0 2px 4px -1px rgba(0, 0, 0, 0.14), 0 4px 5px 0 rgba(0, 0, 0, 0.098), 0 1px 10px 0 rgba(0, 0, 0, 0.084);
		&:hover{
	    	transition: all 0.35s;
	    }
	}
  &-btn7{
		background-color: #0277BD;
		color: #fff;
    @include cool-button();
		@include linear-button();
    box-shadow:  0px 2px 2px 0px hsla(0, 0%, 10%, 1);
		&:hover{
	    	background-color:#0287d4;
	    	transition: all 0.35s;
	    }
	}
}

.ripple{
  overflow:hidden;
  transform: translate3d(0, 0, 0);
  user-select: none;
}

.ripple-effect{
  position: absolute;
  border-radius: 50%;
  background-color: hsla(0, 100%, 0%, 0.7);
  user-select: none;
  pointer-events: none;
  opacity: 0.3;
  transform: translate3d(-50%,-50%,0);
  padding: 0;
  margin: 0;
}
              
            
!

JS

              
                $(document).on('click', '.ripple', function(e) {
  var $rippleBase = $('<span class="ripple-effect" />'),
    $button = $(this),
    offset = $button.offset(),
    xPos = e.pageX - offset.left,
    yPos = e.pageY - offset.top,
    rippleSize = parseInt(Math.min($button.height(), $button.width()) * 0.3),
    animationSize = parseInt(Math.max($button.width(), $button.height()) * Math.PI);

  $rippleBase
    .css({
      top: yPos,
      left: xPos,
      width: rippleSize,
      height: rippleSize,
      backgroundColor: $button.data("ripple-color")
    })
    .appendTo($button)
    .animate({
      width: animationSize,
      height: animationSize,
      opacity: 0
    }, 500, function() {
      $(this).remove();
    });
});
              
            
!
999px

Console