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

              
                h1 Liquid Button
	span made by YU EN
.wrap
	.span.span-1
	.span.span-2
	.span.span-3
	.span.span-4
	.symbol ⋮
	p Background
.wrap-2
	.span.span-1
	.span.span-2
	.span.span-3
	.span.span-4
	.symbol ⋮
	p Outline
	
              
            
!

CSS

              
                body {
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	height: 100vh;
	background: #FFE8D5;
	font-family: 'Catamaran', sans-serif;
	font-family: 'Ubuntu', sans-serif;
	font-family: 'Libre Baskerville', serif;
	letter-spacing: .5px;
}
h1 {
	width: 100%;
	text-align: center;
	font-size: 20px;
	color: #FFAA63;
	margin-top: 1.5rem;
	position: absolute;
	top: 50%;
	span {
		display: block;
		font-size: 12px;
		opacity: .6;
		margin-top: .7rem;
		font-family: 'Catamaran', sans-serif;
	}
}
p {
	width: 100%;
	text-align: center;
	font-size: 16px;
	color: #FF9D4C;
	margin-top: 1.5rem;
	position: absolute;
	top: 90px;
	opacity: .5;
	transition: all 300ms;
	font-family: 'Ubuntu', sans-serif;
	font-weight: 500;
}
$w: 130px;
.wrap, .wrap-2 {
	margin: 0 3rem;
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	width: 35%;
	&:hover {
		p {
			opacity: 1;
		}
	}
	.span {
		cursor: pointer;
		border: 1.5px solid white;
		width: $w;
		height: $w;
		position: absolute;
		opacity: .6;
		border-radius: 100%;
		transition: all;
	}
}
.wrap {
	.symbol {
			color: #FFD3AE;
			font-size: 36px;
			z-index: 1;
			transition: all 1000ms;
			user-select: none;
			cursor: pointer;
			&.go-heart {
				transition: all 1000ms;
				animation: go-heart 1000ms infinite linear;
			}
	}
	.span {
		cursor: pointer;
		border: 1.5px solid white;
		position: absolute;
		background: white;
		opacity: .6;
		border-radius: 100%;
		transition: all;
	}
	.span-1 {
		transition: all 1200ms;
		&.go {
			border-radius: 40% 42% 45% 55%;
			animation: gogo 5200ms infinite linear;
		}
	}
	.span-2 {
		transition: all 1200ms;
		&.go {
			border-radius: 55% 41% 65% 43%;
			animation: gogo-2 5500ms infinite linear;
		}
	}
	.span-3 {
		transition: all 1200ms;
		&.go {
			border-radius: 52% 72% 45% 61%;
			animation: gogo 3400ms infinite linear;
		}
	}
	.span-4 {
		transition: all 1200ms;
		&.go {
			border-radius: 58% 56% 72% 58%;
			animation: gogo-2 6000ms infinite linear;
		}
	}
}
.wrap-2 {
	.symbol {
			color: white;
			font-size: 36px;
			z-index: 1;
			transition: all 1000ms;
			user-select: none;
			cursor: pointer;
			&.go-heart {
				transition: all 1000ms;
				animation: go-heart 1000ms infinite linear;
			}
	}
	.span-1 {
		transition: all 1200ms;
		&.go {
			border-radius: 40% 42% 45% 55%;
			animation: gogo 5200ms infinite linear;
		}
	}
	.span-2 {
		transition: all 1200ms;
		&.go {
			border-radius: 55% 41% 65% 43%;
			animation: gogo-2 5500ms infinite linear;
		}
	}
	.span-3 {
		transition: all 1200ms;
		&.go {
			border-radius: 52% 72% 45% 61%;
			animation: gogo 3400ms infinite linear;
		}
	}
	.span-4 {
		transition: all 1200ms;
		&.go {
			border-radius: 58% 56% 72% 58%;
			animation: gogo-2 6000ms infinite linear;
		}
	}
}
.go {
	transition: all 1200ms;
}
@keyframes gogo {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}
@keyframes gogo-2 {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(-720deg);
	}
}
@keyframes go-heart {
	from {
		transform: scale(1.3) rotate(0deg);
	} to {
		transform: scale(1.3) rotate(360deg);
	}
}
              
            
!

JS

              
                
$('.wrap').on('click', function(){
	$('.wrap .span-1').toggleClass('go');
	$('.wrap .span-2').toggleClass('go');
	$('.wrap .span-3').toggleClass('go');
	$('.wrap .span-4').toggleClass('go');
	$('.wrap .symbol').toggleClass('go-heart');
})

$('.wrap-2').on('click', function(){
	$('.wrap-2 .span-1').toggleClass('go');
	$('.wrap-2 .span-2').toggleClass('go');
	$('.wrap-2 .span-3').toggleClass('go');
	$('.wrap-2 .span-4').toggleClass('go');
	$('.wrap-2 .symbol').toggleClass('go-heart');
})
              
            
!
999px

Console