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

              
                 <!DOCTYPE html>

 <html>

 <head>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <!-- Stylesheet declaration -->
    <link href="style.css" rel="stylesheet">
    
    <!-- DoubleClick enabler -->
    <script src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>    
        
    <!-- Ad size meta tag required by Google Display Network (Check dimensions) -->
    <meta name="ad.size" content="width=300,height=600">

    <!-- GSDevTools for testing (Remove for production) -->
    <script type="text/javascript" src="https://crafteddesign.bitbucket.io/ads/GSDevTools.min.js"></script>
    
    <!-- DoubleClick dynamic feed -->
    <script type="text/javascript">
    
        // If true, start function. If false, listen for INIT.
        window.onload = function() {

          if (Enabler.isInitialized()) {
            enablerInitHandler();
        } else {
            Enabler.addEventListener(studio.events.StudioEvent.INIT, enablerInitHandler);
        }
        
    }


    function timelineInit() {


        var mainTimeline = new TimelineMax({delay: 1});
        mainTimeline

        .to("#date2", 0.25, {opacity: 0, height: 0})

        .from("#strapline1", 0.25, {opacity: 0, height: 0, marginTop: 0}, "-=0.25")
        .to("#strapline1", 0.25, {delay: 4, opacity: 0, height: 0, marginTop: 0})

        .from("#strapline2", 0.25, {opacity: 0, height: 0, marginTop: 0}, "-=0.25")
        .to("#strapline2", 0.25, {delay: 4, opacity: 0, height: 0, marginTop: 0})

        .from("#date3", 0.25, {opacity: 0, height: 0}, "-=0.25")

        .to("#liveContent", 0.25, {bottom: "35px"}, "-=0.25")
        .from("#cta", 0.25, {y: "100%"}, "-=0.25")

    }


    function enablerInitHandler() {
        timelineInit();

        Enabler.setProfileId(00000000); 
        var devDynamicContent = {};

            // Declaring all of the available fields
            
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1= [{}];
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0]._id = 0;
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Active = true;
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Default = true;
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Unique_ID = 12345;
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Report_Label = "Default";
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].DV360_LineItemID = "1234567";
            
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].URL_LandingPage = {};
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].URL_LandingPage.Url = "https://bing.co.uk";
            
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Logo = {};
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Logo.Url = "https://via.placeholder.com/100x200";
            
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Background_Portrait = {};
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Background_Portrait.Url = "https://via.placeholder.com/600x300";
            
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Background_Landscape = {};
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Background_Landscape.Url = "https://via.placeholder.com/600x300";
            
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Colour_Highlight = "#FFE981";
            
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Title = "This is the title which can vary in length";
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Subtitle_1 = "Other parts of the ad can also vary";
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Date = "Dates would go right here";
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Strapline_1 = "This is the first strapline";
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Strapline_2 = "This is the second strapline";
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_CTA = "Book now";

            Enabler.setDevDynamicContent(devDynamicContent);
            
            
            // Assigning the logo
            
            document.getElementById('logo').src =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Logo.Url
            
            
            // Assigning the event image
            
            document.getElementById('imageBanner').style.backgroundImage =
            'url(' + devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Image_Background_Portrait.Url + ')'
            
            
            // Assigning the accent text colour to various elements
            
            document.getElementById('title2').style.color =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Colour_Highlight
            
            document.getElementById('strapline1').style.color =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Colour_Highlight

            document.getElementById('strapline2').style.color =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Colour_Highlight
            
            
            // Assigning the accent background colour to various elements
            
            document.getElementById('cta').style.backgroundColor =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Colour_Highlight
            
            
            // Assigning more fields to elements
            
            document.getElementById('title1').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Title
            
            document.getElementById('title2').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Title
            
            document.getElementById('subtitle1').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Subtitle_1
            
            document.getElementById('subtitle2').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Subtitle_1
            
            document.getElementById('date1').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Date
            
            document.getElementById('date2').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Date
            
            document.getElementById('date3').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Date

            document.getElementById('strapline1').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Strapline_1

            document.getElementById('strapline2').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_Strapline_2

            document.getElementById('cta').innerHTML =
            devDynamicContent.Dynamic_Feed_Company_Name_1_0_Sheet1[0].Text_CTA
            
        }

        </script>

    </head>

    <body>

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

        <div id="container">

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

            <div id="imageBanner">
                <img width="auto" height="120" id="logo"/>
            </div>

            <div id="launchContent" class="contentBar">
                <h1 id="title1" class="title accentText"></h1>
                <p id="subtitle1"></p>
                <p id="date1" class="smallBody"></p>
            </div>

            <div id="liveContent" class="contentBar">
                <h1 id="title2"></h1>
                <p id="subtitle2"></p>
                <p id="date2" class="smallBody"></p>
                <p id="date3" class="smallBody"></p>
                <p id="strapline1" class="strapline accentText"></p>
                <p id="strapline2" class="strapline accentText"></p>
            </div>

            <div id="cta" class="accentBackground">Book now</div>   

        </div>

            <!-- Javascript libraries (Accepted by the Google Display network as standard) -->
        
        <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>
        
    </body>

    </html>
              
            
!

CSS

              
                /*  AD CONTAINER & CLICK TAG (CHECK DIMENSIONS) */
#container, #clicktag {
    width: 300px;
    height: 600px;
    overflow: hidden;
    position: absolute;
    left: 0;
    top: 0;
}

#clicktag {
    z-index: 999999;
}

#container {
    background-color: black;
    display: flex;
    flex-direction: column;
}


/* GLOBAL STYLES */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: white;
    font-size: 18px;
    line-height: 1.33;
}

#logo {
    float: right;
}

/* Dates etc. */

.smallBody {
    font-size: 14px;
    margin-top: 10px;
}

#date3 {
    margin-top: 0;
}

/* Removing margin from common text */

h1, p {
    margin: 0;
}

h1 {
    font-size: 21px;
}


/* FRAME 1 STYLES */

#imageBanner {
    background-size: cover;
    flex-grow: 1;
}

.contentBar {
    padding: 20px 16px 40px;
    background-color: black;
}

#liveContent {
    position: absolute;
    bottom: 0;
}

#cta {
    position: absolute;
    bottom: 0;
    width: 260px;
    color: black;
    text-transform: uppercase;
    font-weight: bold;
    padding: 15px 20px;
    background-image: url(images/arrow.svg);
    background-repeat: no-repeat;
    background-position: 92% center;
}


/* FRAME 2 STYLES */
#style {
    
}
              
            
!

JS

              
                
              
            
!
999px

Console