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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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.


                <div style="width: 600px; margin: auto; text-align: center; font-family: arial">
  <p>And so, the unwritten law of the internet, that any experiment involving video/images must involve cats in one way or another, reared its head again. When would the internet's fascination with cats come to an end? Never. The answer is "Never".</p> 
  <img src='' class='gif' />


                img.gif {
	visibility: hidden;

.jsgif {
	position: relative;

.gifcontrol {	
	position: absolute;
	top: 0px;
	left: 0px;
	width: 100%;
	height: 100%;
	cursor: pointer;
	&:after {
		transition: background 0.25s ease-in-out;
		position: absolute;
		content: ""; 
		display: block;
		left: calc(50% - 25px);
		top: calc(50% - 25px);

	&.loading {
		background: rgba(255, 255, 255, 0.75);
		&:after {
			background: #FF9900;
			width: 50px;
			height: 50px;		
			border-radius: 50px;

	&.playing {
		/* Only show the 'stop' button on hover */
		&:after {
			opacity: 0;
			transition: opacity 0.25s ease-in-out;
			border-left: 20px solid #FF9900;
			border-right: 20px solid #FF9900;
			width: 50px;
			height: 50px;
      box-sizing: border-box;
		&:hover:after {
			opacity: 1;

	&.paused {
		background: rgba(255, 255, 255, 0.5);
		&:after {
			width: 0;
			height: 0;
			border-style: solid;
			border-width: 25px 0 25px 50px;
			border-color: transparent transparent transparent #ff9900;

	transition: background 0.25s ease-in-out;
	z-index: 100;



                var gifElements = document.querySelectorAll('img.gif');

for(var e in gifElements) {
	var element = gifElements[e];
	if(element.nodeName == 'IMG') {
		var supergif = new SuperGif({
			gif: element,
			progressbar_height: 0,
			auto_play: false,

		var controlElement = document.createElement("div");
		controlElement.className = "gifcontrol loading g"+e;

		supergif.load((function(controlElement) {
			controlElement.className = "gifcontrol paused";
			var playing = false;
			controlElement.addEventListener("click", function(){
				if(playing) {
					playing = false;
					controlElement.className = "gifcontrol paused";
				} else {;
					playing = true;
					controlElement.className = "gifcontrol playing";
			}.bind(this, controlElement));
		var canvas = supergif.get_canvas(); = canvas.width+"px"; = canvas.height+"px"; = canvas.offsetLeft+"px";
		var containerElement = canvas.parentNode;