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

              
                <body>
	<div class='button' tabIndex="0">
		<div id='wrapper' class='wrapper'>
			<span class='tag-wrapper'>
				<span id='tag' class='icon tag ei-tag' data-icon='ei-tag' data-size='l'></span>
			</span>
			<span id='close' class='close'></span>
		</div>
	</div>
</body>
              
            
!

CSS

              
                body {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(45deg, rgb(84,58,183) 0%, rgb(0,172,193) 100%);
	background-repeat: none;
	background-size: 100% 100%;
  color:white;
	width: 100vw;
	height: 100vh;
	padding: 0;
}

@keyframes button-click {
	0% { transform: scale(1) translateY(0); }
	50% { transform: scale(0.95) translateY(2px); }
	100% { transform: scale(1) translateY(0); }
}

.button {
	display: flex;
	background: #eef3f7;
	align-items: center;
	justify-content: center;
	border-radius: 100%;
	box-shadow: 0px 15px 35px -5px rgb(50 88 130 / 32%);
	width: 100px;
	max-width: 800px;
	height: 100px;
	margin: auto;
	transform: scale(1) translateY(0);
	transition: transform 250ms ease;
	&:focus {
		animation: button-click 300ms ease 0ms 1;
	}
	&:active {
		animation: none;
	}
}

.wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.tag-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	transform: scale(1);
	transition: transform 400ms ease-in-out 300ms;
}

.tag {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #4b5054;
	transform: rotate(-90deg);
	transition: transform 200ms ease-in-out 600ms;
	cursor: pointer;
}

.close {
	display: none;
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	width: 75px;
	height: 75px;
	transform-origin: center;
	transition: opacity 100ms ease-in-out 300ms, transform 400ms ease-in-out 0ms;
	&::before, &::after {
		content: '';
		position: absolute;
		background: #4b5054;
		width: 6px;
		height: 60px;
		top: 6px;
		border-radius: 4px;
		opacity: 0;
		transform: scale(1) rotate(0);
		transition: opacity 100ms ease-in-out 300ms, top 200ms ease 100ms, height 200ms ease 100ms, transform 400ms ease-in-out 0ms;
	}
}

.wrapper.open .tag-wrapper {
	transform: scaleX(0);
	transition: transform 500ms ease-in-out 200ms;
	.tag {
		transform: rotate(-45deg);
		transition: all 300ms ease-in-out 0ms;
	}
}

.wrapper.open .close {
	display: flex;
	&::before, &::after {
		display: flex;
		height: 50px;
		top: 12px;
		opacity: 1;
		transition: opacity 100ms ease-in-out 500ms, top 200ms ease 400ms, height 200ms ease 400ms, transform 400ms ease-in-out 500ms;
	}
	&::before {
		transform: scale(0.9) rotate(-45deg);
	}
	&::after {
		transform: scale(0.9) rotate(45deg);
	}
}

              
            
!

JS

              
                jQuery(document).ready(function ($) {
	$('#wrapper').click(function() {
		$(this).toggleClass('open');
	});
});
              
            
!
999px

Console