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="container">
	<div class="card" style="--color: #00afaf">
		<button class="button">
			<span class="text">Hover</span>
			<div class="icon">
				<svg>
					<use xlink:href="#arrow-right"></use>
				</svg>
			</div>
		</button>
	</div>
	<div class="card" style="--color: #00bb00">
		<button class="button">
			<span class="text">Hover</span>
			<div class="icon">
				<svg>
					<use xlink:href="#arrow-right"></use>
				</svg>
			</div>
		</button>
	</div>
	<div class="card" style="--color: #0f2bff">
		<button class="button">
			<span class="text">Hover</span>
			<div class="icon">
				<svg>
					<use xlink:href="#arrow-right"></use>
				</svg>
			</div>
		</button>
	</div>
	<div class="card" style="--color: #ff6a2f">
		<button class="button">
			<span class="text">Hover</span>
			<div class="icon">
				<svg>
					<use xlink:href="#arrow-right"></use>
				</svg>
			</div>
		</button>
	</div>
</div>
<svg style="display: none">
	<symbol id="arrow-right" viewBox="0 0 20 10">
		<path d="M14.84 0l-1.08 1.06 3.3 3.2H0v1.49h17.05l-3.3 3.2L14.84 10 20 5l-5.16-5z"></path>
	</symbol>
	<filter id="noiseFilter">
		<feTurbulence type="fractalNoise" baseFrequency="1.8" numOctaves="6" stitchTiles="stitch"></feTurbulence>
	</filter>
</svg>
              
            
!

CSS

              
                .container {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-template-rows: repeat(2, 1fr);
	background: rgb(9, 8, 25);
}

.card {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 10px;
	background: linear-gradient(rgba(25, 31, 50, 0.2), rgb(4 8 20 / 0.01)),
		rgb(4 8 20 / 0.8);
	box-shadow: inset 0 0 0 1px rgb(200 200 220 / 0.16),
		inset 0 0 5px -3px var(--color), inset 0 12px 48px 0 rgb(160 220 240 / 0.08),
		inset 0 0 120px -100px var(--color);
	border-radius: 16px;
	color: var(--color);
	overflow: hidden;
}
.card::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(var(--color) 8%, transparent 8%),
		radial-gradient(var(--color) 8%, transparent 8%),
		radial-gradient(var(--color) 8%, transparent 8%),
		radial-gradient(var(--color) 8%, transparent 8%);
	background-position: 0% 0%, 0% 100%, 100% 0%, 100% 100%;
	background-size: 40px 40px;
	background-repeat: no-repeat;
	filter: drop-shadow(0 0 6px var(--color));
}
.card::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--color);
	opacity: 0.2;
	-webkit-mask-image: radial-gradient(90% 90% at 50% 50%, transparent, black);
	mask-image: radial-gradient(90% 90% at 50% 50%, transparent, black);
	filter: url(#noiseFilter);
	z-index: 1;
}

.button {
	--w: 180px;
	--h: 60px;
	--icon-size: 25px;
	--text-color: rgb(210 210 240);
	--box-glow-color: transparent;
	--box-glow-blur: 20px;
	position: relative;
	min-width: var(--w);
	min-height: var(--h);
	border-radius: var(--h);
	display: flex;
	justify-content: center;
	align-items: center;
	border: none;
	font-family: "Montserrat";
	color: var(--text-color);
	background: rgb(4 8 20 / 0.8);
	box-shadow: 0 0 0 1px rgb(200 200 220 / 0.22),
		0 0 var(--box-glow-blur) var(--box-glow-color),
		inset 0 0 26px -10px var(--box-glow-color);
	overflow: hidden;
	cursor: pointer;
	transition: box-shadow 500ms ease;
	z-index: 2;
}
.button::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgb(200 200 220 / 0.1);
	box-shadow: inset 0 0px 24px 0 rgb(170 230 250 / 0.12);
	border-radius: var(--h);
	z-index: 1;
	transition: transform 500ms ease, box-shadow 500ms ease;
}

.text,
.icon {
	z-index: 2;
}

.text {
	transform: translateX(-50%);
	font-family: "Montserrat";
	transition: transform 500ms ease;
}

.icon {
	position: absolute;
	width: var(--icon-size);
	height: var(--icon-size);
	left: 0;
	transform: translateX(calc((var(--w)) / 2 + 8px));
	transition: transform 500ms ease, color 500ms ease;
}
svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.button:active {
	--box-glow-blur: 36px;
}
.button:hover,
.button:active {
	--box-glow-color: var(--color);
}
.button:hover::before,
.button:active::before {
	transform: translateX(65%);
	box-shadow: inset 0 0px 0px 0 transparent;
}
.button:hover .text,
.button:active .text {
	transform: translateX(0%);
	animation-play-state: running;
}
.button:hover .icon,
.button:active .icon {
	transform: translateX(calc(var(--w) - var(--icon-size) - 19px));
	color: var(--color);
}

.button:focus-visible {
	outline: none;
}
.button:focus-visible:not(:hover, :active) {
	--box-glow-color: rgb(114 114 114 / 0.5);
}

@media (max-width: 500px) {
	.container {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	width: 100%;
	height: 100vh;
	overflow: hidden;
	display: flex;
}

              
            
!

JS

              
                	
              
            
!
999px

Console