Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.



button#new-gif New Gif


                body {position: relative; height: 100vh; width: 100%;}

#gif-wrap {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	margin: auto;
	background-color: #000;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	z-index: -1;

#gif-logo {
	position: fixed;
	top: .5rem;
	right: .5rem;
	border-radius: 30px;
	padding: 0 1rem;
	background: #000;
	img {
		max-width: 150px;

#new-gif {
	padding: .75rem 2.5rem;
	font-weight: 600;
	background: #424242;
	z-index: 10;
	color: #fff;
	border-radius: 30px;
	border: 0;
	font-size: 14px;
	position: fixed;
	top: .5rem;
	left: .5rem;
	transition: background .15s ease;
	cursor: pointer;
	&:hover {
		background: #626262;


                $(document).ready(function() {
	// Initiate gifLoop for set interval
	var refresh;
	// Duration count in seconds
	const duration = 1000 * 10;
	// Giphy API defaults
	const giphy = {
		baseURL: "",
		apiKey: "7IfGSmZdSFRLfxQaPcLtpQamsqj1ySOa",
		tag: "",
		// TAG EG. funny
		type: "random",
		rating: ""
		// RATING EG. pg-13
	// Target gif-wrap container
	const $gif_wrap = $("#gif-wrap");
	// Giphy API URL
	let giphyURL = encodeURI(
		giphy.baseURL +
			giphy.type +
			"?api_key=" +
			giphy.apiKey +
			"&tag=" +
			giphy.tag +
			"&rating=" +

	// Call Giphy API and render data
	var newGif = () => $.getJSON(giphyURL, json => renderGif(;

	// Display Gif in gif wrap container
	var renderGif = _giphy => {
		// Set gif as bg image
			"background-image": 'url("' + _giphy.image_original_url + '")'

		// Start duration countdown
		// refreshRate();

	// Call for new gif after duration
	// var refreshRate = () => {
	// 	// Reset set intervals
	// 	clearInterval(refresh);
	// 	refresh = setInterval(function() {
	// 		// Call Giphy API for new gif
	// 		newGif();
	// 	}, duration);
	// };

	// Call Giphy API for new gif
	const newGifButton = $('#new-gif');