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

              
                <!-- Blobfoxes: https://volpeon.ink/emojis/blobfox/ -->
<div id="blobfox-container">
	<input id="boop-input" type="checkbox" name="boop" aria-label="Boop the Blobfox">
	<img src="https://freeplay.floof.company/assets/blobfox/blobfoxfloofhappy.svg" alt="Blob Fox Floof Happy">
	<img src="https://freeplay.floof.company/assets/blobfox/blobfoxboopfloof.svg" alt="Blob Fox Floof Boop">
	<img src="https://freeplay.floof.company/assets/blobfox/blobfoxfloofcute.svg" alt="Blob Fox Floof Boop">
</div>
              
            
!

CSS

              
                /* Center placement & color */
html { display: grid; height: 100%; place-items: center; background-color: #080011 }

#blobfox-container {
	/* Make sure that any absolutely positioned elements 
	inside is relative to this container */
	position: relative;
	width: 160px;
	height: 160px;
	/* glow effect */
	filter: drop-shadow(0 20px 80px #ff6b0080);
	/* hover effect */
	transition: transform .3s cubic-bezier(0,0.5,0,1.4), filter .2s;
	&:hover {
		transform: scale(1.025) translateY(-4px);
		filter: drop-shadow(0 20px 80px #ff6b0090);
	}
}

#blobfox-container img {
	/* Position the blobfoxes on top of each other */
	position: absolute;
	width: 100%;
	height: 100%;
	/* Prevent accidentally highlighting images from spam booping */
	user-select: none;
	/* Prevent from getting in way of clicking checkbox input */
	pointer-events: none;
	/* Add transitions for cross-fading blobfoxes (opacity)
	and pressing down (transform) */
	transition: opacity .1s linear, transform .4s cubic-bezier(0,0,0,2);

	/* Hide blobfox img's except from the first img */
	&:not(:first-of-type) {
		opacity: 0;
	}

	/* For the animation, creates a bouncy effect by starting
	it slightly scaled up, scaled from the bottom right */
	&:nth-of-type(2) {
		transform-origin: bottom right;
		transform: scale(1.1);
	}
}

#boop-input {
	/* Position the input where the blobfox's nose is */
	position: absolute;
	left: 20%;
  top: 43%;
  width: 30%;
  height: 25%;
	/* Let the user know they can boop */
	cursor: pointer;
	/* Remove the checkbox's browser styling, hiding it */
	appearance: none;
	
	/* When the input is clicked/"checked", 
	change to BlobFoxBoopHappy */
	&:checked {
		& ~ img {
			opacity: 0;
		}
		& ~ img:nth-of-type(3) {
			opacity: 1;
		}
	}
	
	/* During the click, change to BlobFoxBoop */
	&:active {
		/* Hide the user's cursor */
		cursor: none;
		
		/* Select all images after the input, and hide them */
		& ~ img {
			/* The img:nth-of-type(3) in the :checked is a more 
			specific selector, so we use !important to override that 
			(https://www.w3schools.com/css/css_specificity.asp) */
			opacity: 0 !important;
			/* Change the scale of the images for the animation */
			transform: scale(1.05);
		}
		/* Make the second img (the BlobFoxBoop) visible */
		& ~ img:nth-of-type(2) {
			/* Again, need !important to override 
			the !important before */
			opacity: 1 !important;
		}
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console