Pen Settings

HTML

CSS

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

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

              
                <div class="e-button">
	<button class="btn">
		<span class="text">
					Click Me!
		</span>
		<span class="success-text">
			Nice Click!
		</span>
	</button>
</div>
              
            
!

CSS

              
                $f-title:'Roboto', sans-serif;
$f-body:'Open Sans', sans-serif;
@mixin fontawesome {
  display: inline-block;
  font: normal normal normal 14px/1 FontAwesome;
  font-size: inherit;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@mixin centre($axis: "both") {
	position: absolute;
	@if $axis == "y" {
		top: 50%;
		-webkit-transform: translateY(-50%);
		-moz-transform: translateY(-50%);
		-ms-transform: translateY(-50%);
		-o-transform: translateY(-50%);
		transform: translateY(-50%);
	}
	@if $axis == "x" {
		left: 50%;
		-webkit-transform: translateX(-50%);
		-moz-transform: translateX(-50%);
		-ms-transform: translateX(-50%);
		-o-transform: translateX(-50%);
		transform: translateX(-50%);
	}
	@if $axis == "both" {
		top: 50%;
		left: 50%;
		-webkit-transform: translate(-51%, -50%);
		-moz-transform: translate(-51%, -50%);
		-ms-transform: translate(-51%, -50%);
		-o-transform: translate(-51%, -50%);
		transform: translate(-51%, -50%);
	}
}
@mixin font-size($sizeValue: 1.6, $lineHeight: 2.4) {
  font-size: ($sizeValue * 10) + px;
  font-size: $sizeValue + rem;
  line-height: ($lineHeight * 10) + px;
}
@mixin fontawesome {
  display: inline-block;
  font: normal normal normal 14px/1 FontAwesome;
  font-size: inherit;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body{
	margin:0;
	padding:0;
	font-family:$f-body;
	width:100vw;
	height:100vh;
	background: radial-gradient(ellipse at center, #222 39%,#111 100%);

}

h1, h2, h3, h4{
	font-family:$f-title;
	font-weight:900;
}

p{
	@include font-size(1.8, 2.6);
}

.e-button{
	@include centre();
	width:100%;
	text-align:center;
	
	.btn{
		@include font-size(2, 2.8);
		transition:all .2s ease-in-out;
		padding:25px 0px;
		height:78px;
		border:none;
		background:none;
		color:#fff;
		font-weight:600;
		position:relative;
		outline:none;
		width:260px;
		
		span{
			position:absolute;
			top:50%;
			left:50%;
			transform:translate(-50%, -50%);
			width:100%;
			transition:all .3s ease-in-out;

			&.success-text{
				visibility:hidden;
				opacity:0;
			}
		}
		
		&:before{
			border-radius:50px;
			content:" ";
			display:block;
			width:100%;
			height:100%;
			position:absolute;
			top:50%;
			transform:translateY(-50%);
			right:0;
			background:#222;
			z-index:-1;
			transition:all .5s ease-in-out, border .3s ease-in-out;
			border:2px solid #fff;
			box-sizing:border-box;
		}
		
		&:after{
			@include fontawesome;
			content:'\f00c';
			position:absolute;
			top:50%;
			transform:translateY(-50%) scale(0);
			transform-origin:center;
			right:-28px;
			z-index:0;
			color:#fff;
			transition:all .2s ease-in-out;
		}
		
		&:hover{
			cursor:pointer;
			transform:scale(1.05) translateY(-5px) translateZ(0);
			
			&:before{
				background:lighten(#222, 5%);
				border-color:transparent;
				box-shadow:0 5px 10px rgba(0,0,0,0.2), 0 15px 20px rgba(0,0,0,0.1);
			}
		}
		
		&:active{
			transform:scale(1) translateY(0) translateZ(0);
			
			&:before{
				box-shadow:none;
			}
		}
		&.clicked{
			//Comment out if you want the button to popup again
			transform:scale(1) translateY(0) translateZ(0);
			
			&:before{
				box-shadow:none;
			}
		}
		
		&.success{
			color:#FFF;
			
			&:hover{
				cursor:default;
			}
			
			span{

				&.text{
					opacity:0;
					visibility:hidden;
				}
				
				&.success-text{
					transform:translate(-50%, -50%);
					opacity:1;
					visibility:visible;
				}
			}
			
			&:before{
				right:-50px;
				height:100%;
				width:78px;
				background:darken(#83CE7F, 15%);
				border-color:darken(#83CE7F, 25%);
			}
			
			&:after{
				transition-delay:.3s;
				transform:translateY(-50%) scale(1) ;
			}
			
			&:hover, &:active{
				transform:scale(1) translateY(0) translateZ(0);
			
				&:before{
					box-shadow:none;
				}
			}
		}
	}
}
              
            
!

JS

              
                $('.btn').stop().on('click', function(){
	button = $(this);
	button.addClass('clicked');
	
	setTimeout(function(){
		button.addClass('success');
	},300);
	
	
	setTimeout(function(){
		button.removeClass('clicked');
		button.removeClass('success');
	},4000);
});
              
            
!
999px

Console