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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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 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.


                <h1>Google Material Design Buttons</h1>
<h2>A couple of buttons to demonstrate the ripple effect on Google's Material Design buttons.</h2>
<p>Google's docs for this are <a href="" target="_blank">here</a>.</p>

<div class="container">
<button type="button" class="button button-ripple">
<button type="button" class="button button-ripple" data-ripple-color="yellow">
  <button type="button" class="button button-ripple button-round">
  <button type="button" class="button button-ripple button-round button-white">


                .button {
  background: orange;
  outline: none;
  color: white;
  border: none;
  border-radius: 0.25em;
  padding: 0.75em 2em;
  line-height: 1;
  box-shadow: 0 0 0.25em rgba(0,0,0,0.5);
  text-shadow: 0 0 0.25em rgba(0,0,0,0.5);
  font-size: 1.5rem;
.button-white {
  background: white;
  color: orange;
.button-round {
  border-radius: 100%;
  padding: 0.75em;
  width: 3em;
  height: 3em;
.button-ripple {
  position: relative;
  overflow: hidden;
  transform: translate(0);
.button-ripple_content {
  position: relative;
  z-index: 1;
.button-ripple_ripples {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  position: absolute;
  border-radius: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  transform: scale(0);

  top: 0;
  left: 0;

  animation: ripple-animation 2s;

@keyframes ripple-animation {
    from {
      transform: scale3d(1,1,1);
      opacity: 0.8;
    to {
      transform: scale3d(100,100,1);
      opacity: 0;

/* Make things perty */
html {  height: 100%;}
body { font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; background-color: #0d0d0d; color: #fff; height: 100%; padding-top: 2em; text-align: center;}
h1, h2{ margin: 0; text-transform: uppercase;text-shadow: 0 0 0.5em black;}
h2 { font-weight: 300}
input { border: 1px solid #666; background: #333; color: #fff; padding: 0.5em; box-shadow: none; outline: none !important; margin: 1em  auto; text-align: center;}
a { color: orange; text-decoration: none; transition: color 250ms ease-in-out;}
a:hover { color: yellow;}
.container { display:block; margin: 2em 0;}


$('.button-ripple').on('click touchstart',;

var ripple = {
  click: function(event){
  if ( $(this).find('.ripple').length ){
    $this = $(this),
    $ripples = $this.find('.button-ripple_ripples'),
    rippleColor = $this.attr('data-ripple-color') || $this.css('color'),
    btnOffset = $this.offset(),
    inputX = ( event.type === 'click' ) ? event.pageX : event.originalEvent.touches[0].pageX,
    inputY = ( event.type === 'click' ) ? event.pageY : event.originalEvent.touches[0].pageY,
    xPos = inputX - btnOffset.left,
    yPos = inputY -;
    $ripples.append('<span class="button-ripple_ripple"></span>');
    var $ripple = $ripples.find('.button-ripple_ripple');
    $ripple.on(animationEnd, function(){ $(this).remove(); });
    $ripples[0].style.webkitTransform = 'translate3d(' + xPos + 'px,' + yPos + 'px,0)';
    $ripples[0].style.transform = 'translate3d(' + xPos + 'px,' + yPos + 'px,0)';
    $ripple.css({ backgroundColor: rippleColor });
  init: function(){
    $('.button-ripple').wrapInner('<span class="button-ripple_content"></span>');
    $('.button-ripple').append('<div class="button-ripple_ripples"></div>')

var animation = {
	// Determines proper transition property per browser
	whichAnimationEvent: function(){
		var t;
		var el = document.createElement('fakeelement');
		var transitions = {
		for(t in transitions){
			if([t] !== undefined ){
				return transitions[t];
// Makes it easier to bind cross browser, like $('element').one(transitionEnd, function(){});
var animationEnd = animation.whichAnimationEvent();