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

              
                .glass-btn Glassy
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@900&display=swap');
/* 
frosting effect borrowed from pen by _____ I need to find that one again to give proper reference
*/
* {
  box-sizing: border-box;
}
:root {
  --h: 33;
	--s: 90%;
	--l: 90%;
  font-family: 'Noto Sans', sans-serif;

}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-content: center;
}

.glass-btn {
  user-select: none;
  font-size: clamp(1.2rem, 5vw + 1rem, 2.5rem);
  width: 10em;
  height: 4em;
  
  border-radius: 0.5em;
  background-image: linear-gradient(#0003,#0000);
  
  box-shadow:
		0 -0.125em 0.25em #0002,
		0 0.25em 0.25em hsl(var(--h) var(--s) var(--l) / 0.5),
		0 0 0 0.1em hsl(var(--h) var(--s) var(--l) / 0.5),
		0 0.175em 0.3em hsl(var(--h) var(--s) var(--l) / 0.5) inset,
		0 -0.025em 0.175em hsl(var(--h) var(--s) var(--l) / 0.4) inset,
		0 -0.25em 1em 0.3em hsl(var(--h) var(--s) var(--l) / 0.3) inset,
		0 0.6em 0 hsl(var(--h) var(--s) var(--l) / 0.3) inset,
		0 2em 1em #0004;
  backdrop-filter: blur(0.15em);
  position: relative;
  display: grid;
  place-content: center;
  color: hsl(var(--h) var(--s) var(--l) / .7);
  text-shadow: 
    0.03em 0.03em #fff5,
    -0.03em -0.03em #0005;
  cursor: pointer;
  transition: 0.1s ease;
  padding-top: 0.2em;
}

.glass-btn:before {
  content: '';
	position: absolute;
  top: 100%;
  width: 80%;
  left: 10%;
  height: 1.5em;
  
  background-image: 
    radial-gradient(
      100% 100% at center,
      hsla(var(--h),var(--s),80%,0.25),
      hsla(var(--h),var(--s),80%,0) 50%);
}

.glass-btn:after {
  content: '';
  inset: 0;
  top: 0.5em;
  position: absolute;
  
  background-image: 
    linear-gradient(
      105deg,
      transparent 20%,
      hsl(var(--h) var(--s) var(--l) / .2) 20%,
      hsl(var(--h) var(--s) var(--l) / .2) 30%,
      transparent 30%,
      transparent 32%,
      hsl(var(--h) var(--s) var(--l) / .2) 5%,
      hsl(var(--h) var(--s) var(--l) / .2) 40%,
      transparent 0%
    );
  background-size: 400% 100%;
  background-position: 100% 0%;
  transition: .3s ease;
}
.glass-btn:active:after {
  background-position: -50% 0%;
}

.glass-btn:active {
  translate: .01em .25em;
  box-shadow:
		0 -0.125em 0.25em #0002,
		0 0.25em 0.25em hsl(var(--h) var(--s) var(--l) / 0.5),
		0 0 0 0.1em hsl(var(--h) var(--s) var(--l) / 0.5),
		0 0.175em 0.3em hsl(var(--h) var(--s) var(--l) / 0.8) inset,
		0 -0.025em 0.175em hsl(var(--h) var(--s) var(--l) / 0.4) inset,
		0 -0.25em 1em 0.3em hsl(var(--h) var(--s) var(--l) / 0.3) inset,
		0 0.6em 0 hsl(var(--h) var(--s) var(--l) / 0.3) inset,
		0 1em 0.5em #0004;
  backdrop-filter: blur(0.08em);
}
.glass-btn:active:before {
  height: 1em;
}


/* fluff */

body {
  background-color: #ee5522;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 200 200'%3E%3Cdefs%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='100' y1='33' x2='100' y2='-3'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='1'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='100' y1='135' x2='100' y2='97'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='%23d23d09' fill-opacity='0.6'%3E%3Crect x='100' width='100' height='100'/%3E%3Crect y='100' width='100' height='100'/%3E%3C/g%3E%3Cg fill-opacity='0.5'%3E%3Cpolygon fill='url(%23a)' points='100 30 0 0 200 0'/%3E%3Cpolygon fill='url(%23b)' points='100 100 0 130 0 100 200 100 200 130'/%3E%3C/g%3E%3C/svg%3E");
}
              
            
!

JS

              
                
              
            
!
999px

Console