Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!-- Dynamic polite load HTML 5 ad template 1.1 for DoubleClick Studio -->

<!DOCTYPE html>

<html>

<head>
    
    <!-- DoubleClick Studio enabler -->
    <script src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>    
        
    <!-- Global stylesheet declaration for styles not polite loaded -->
    <link href="global.css" rel="stylesheet">
    
    <!-- DoubleClick Studio hosted JavaScript libraries only (See https://support.google.com/richmedia/answer/6307288 for more information) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://s0.2mdn.net/ads/studio/cached_libs/tweenmax_1.19.0_643d6911392a3398cb1607993edabfa7_min.js"></script>
    <script type="text/javascript" src="https://s0.2mdn.net/ads/studio/cached_libs/timelinemax_1.19.0_4cba7b163d6263b39d53727ed4c7bb6f_min.js"></script>
    <script type="text/javascript" src="https://s0.2mdn.net/ads/studio/cached_libs/cssplugin_1.19.0_cfbff7d208ccfdbe176b9855af1eb1fa_min.js"></script>
    <script type="text/javascript" src="https://s0.2mdn.net/ads/studio/cached_libs/easepack_1.19.0_be87087c08fcec83e2b64c70571fe91f_min.js"></script>
                    
    <!-- Various -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <script language="javascript">
        
		// Initialize Enabler
		if (Enabler.isInitialized()) {
			init();
		} else {
			Enabler.addEventListener(studio.events.StudioEvent.INIT, init);
		}
		// Run when Enabler is ready
		function init(){
			
            // politeInit();
			// Load in Javascript
			
			if (Enabler.isPageLoaded()) {
				politeInit();
			} else {
				Enabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, politeInit);
			} 
		}
		
		function politeInit() {	
            			
			//Load in CSS files
			
			var extCSS=document.createElement('link');
			extCSS.setAttribute("rel", "stylesheet");
			extCSS.setAttribute("type", "text/css");
			extCSS.setAttribute("href", Enabler.getFilename("polite.css")); 
			document.getElementsByTagName("head")[0].appendChild(extCSS);
			document.getElementById("loading").style.display="none";
			}
        
	</script>
    
</head>

<body>

    <!-- Click tag required by DoubleClick -->
    <a id="clicktag" href="#" onclick="javascript:window.open(clickTag()); return false;"></a>

    <div id="loading">Loading…</div>
    
    <div id="container">

        <!-- The ad and it's content go here, manipulate your ad with animation.js -->

        <!-- Frame 1 -->
        <div id="ball"></div>
        
        <!-- Frame 2 -->
        <!-- Frame 3 -->

    </div>
    
    <script type="text/javascript" src="animation.js"></script>
                    
</body>

</html>
              
            
!

CSS

              
                /* Global styles */

body {
    margin: 0;
}

/*  Ad container & click tag (Check dimensions) */
#container, #clicktag, #loading {
    width: 300px;
    height: 250px;
    overflow: hidden;
    position: absolute;
    left: 0;
    top: 0;
}

#clicktag {
    z-index: 999999;
}

#container {
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

#loading {
    background: url(images/loading.gif) center center no-repeat;
    z-index: 999998;
  background-color: white;
}

/* Frame 1 styles */
#ball {
    background-color: red;
    width: 60px;
    height: 60px;
    border-radius: 100%;    
}


/* Frame 2 styles */
#style {
    
}
              
            
!

JS

              
                // Timeline declaration
var mainTimeline = new TimelineMax(); // Delays the start of the timeline by 2 seconds and repeats 3 times
mainTimeline

// Tweens
.to ("#ball", 1, {y:"100%"})
              
            
!
999px

Console