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

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

              
                <body>
    <!-- Main Wrapper to contain ad content. -->
    <div id="mainHeader" class="spriteBG"></div>
    <div id="mainContainer">
        <div id="mainScene"> <!-- Parent container for each scene which are hidden from view until needed -->
            <div id="weather" class="spriteBG MnStaggerElem"></div>
            <div id="NYBtn" class="spriteBG MnStaggerElem"></div>
            <div id="NJBtn" class="spriteBG MnStaggerElem"></div>
            <div id="PABtn" class="spriteBG MnStaggerElem"></div>
            <div id="mainCTA" class="spriteBG MnStaggerElem"></div>
        </div>
        <div id="NYScene"> <!-- Parent container for each scene which are hidden from view until needed -->
            <div id="mainImgNY" class="spriteBG NYStaggerElem"></div>
            <div id="outdoorNY" class="spriteBG NYStaggerElem"></div>
            <div id="fabFood" class="spriteBG NYStaggerElem"></div>
            <div id="specSport" class="spriteBG NYStaggerElem"></div>
            <div id="cta" class="spriteBG NYStaggerElem"></div>
        </div>
        <div id="NJScene"> <!-- Parent container for each scene which are hidden from view until needed -->
            <div id="mainImgNJ" class="spriteBG NJStaggerElem"></div>
            <div id="outdoorNJ" class="spriteBG NJStaggerElem"></div>
            <div id="fabFood" class="spriteBG NJStaggerElem"></div>
            <div id="specSport" class="spriteBG NJStaggerElem"></div>
            <div id="cta" class="spriteBG NJStaggerElem"></div>
        </div>
        <div id="PAScene"> <!-- Parent container for each scene which are hidden from view until needed -->
            <div id="mainImgPA" class="spriteBG PAStaggerElem"></div>
            <div id="outdoorPA" class="spriteBG PAStaggerElem"></div>
            <div id="fabFood" class="spriteBG PAStaggerElem"></div>
            <div id="specSport" class="spriteBG PAStaggerElem"></div>
            <div id="cta" class="spriteBG PAStaggerElem"></div>
        </div>
    </div>  
    
<!-- ALL SCRIPTS -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js" integrity="sha256-NsDsBdeb2dMWTv/D7KDxlizW+Cux9ByyEuCAkQviQVM=" crossorigin="anonymous"></script>
<script src="bwMain.js"></script>
</body>
              
            
!

CSS

              
                 html {
            margin: 0px;
            padding: 0px; 
        }
        
        body {
            margin: 0px;
            padding: 0px; 
        }
        /* ----------------------------------------------------- Setting the Main LogoHeader size and background to push rest of the cotent down ----------------------------------------------------- */
        #mainHeader {
            height: 55px;
            width: 322px;
            background-position: 0px 0px;
            padding: 0px;
            margin:0px;
        }
        
        /* ----------------------------------------------------- Sets the ALL CONTAINERS dimensions and hides everything out of view, resets padding and margins. ADD SCENE id's to this Style. */
        #mainContainer, #mainScene, #NYScene, #NJScene, #PAScene {
            width: 320px;
            height: 425px;
            overflow: hidden;
            margin: 0px;
            padding: 0px;
            border: 1px solid red;
        }
        /* ----------------------------------------------------- SET ALL INNER DIVS TOI Absolute Positioning ----------------------------------------------------- */

        #mainScene, #NYScene, #NJScene, #PAScene {
            position: absolute;
            visibility: hidden;
        }

        /* ----------------------------------------------------- Set Spritesheet to background of any div ----------------------------------------------------- */
        .spriteBG {
            background-image: url('http://thefxbx.com/G2MTESTBED/BWSpriteSheetVar1.jpg')
        }
        
        /*SHARED Clipping Paths */
        #fabFood {
            height: 90px;
            width: 320px;
            background-position: 0px -777px;
        }
        #specSport {
            height: 84px;
            width: 320px;
            background-position: 0px -867px;
        }
        #cta {
            height: 90px;
            width: 320px;
            background-position: 0px -513px;
        }
        
        /* -----------------------------------------------------Scene 1 clipping Paths----------------------------------------------------- */
        #headerMain {
            height: 55px;
            width: 320px;
            background-position: 0px 0px;
        }
        #weather {
            height: 98px;
            width: 320px;
            background-position: 0px -55px;
        }
        #NYBtn {
            height: 93px;
            width: 320px;
            background-position: 0px -153px;
        }
        #NJBtn {
            height: 92px;
            width: 320px;
            background-position: 0px -246px;
        }
        #PABtn {
            height: 90px;
            width: 320px;
            background-position: 0px -338px;
        }
        #mainCTA {
            height: 90px;
            width: 320px;
            background-position: 0px -445px;
        }
        
        /* ----------------------------------------------------- ALL Hover States ----------------------------------------------------- */
        #NYBtn:hover, #NJBtn:hover, #PABtn:hover, #mainCTA:hover, #mainImgNY:hover, #outdoorNY:hover, #mainImgNJ:hover, #outdoorNJ:hover, #mainImgPA:hover, #outdoorPA:hover, #fabFood:hover, #specSport:hover, #cta:hover {
            -webkit-filter: brightness(110%); /* Safari */
            filter: brightness(110%);
        }
        
        /* ----------------------------------------------------- Scene 2 NEW YORK clipping Paths ----------------------------------------------------- */
        #headerNY {
            height: 55px;
            width: 320px;
            background-position: 0px 0px;
        }
        #mainImgNY {
            height: 117px;
            width: 320px;
            background-position: 0px -572px;
        }
        #outdoorNY {
            height: 89px;
            width: 320px;
            background-position: 0px -689px;
        }
        
        /* ----------------------------------------------------- Scene 3 NEW YORK clipping Paths ----------------------------------------------------- */
        #headerNJ {
            height: 55px;
            width: 320px;
            background-position: 0px 0px;
        }
        #mainImgNJ {
            height: 117px;
            width: 320px;
            background-position: 0px -982px;
        }
        #outdoorNJ {
            height: 89px;
            width: 320px;
            background-position: 0px -1099px;
        }
        
        /* ----------------------------------------------------- Scene 4 NEW YORK clipping Paths ----------------------------------------------------- */
        #headerPA {
            height: 55px;
            width: 320px;
            background-position: 0px 0px;
        }
        #mainImgPA {
            height: 117px;
            width: 320px;
            background-position: 0px -1220px;
        }
        #outdoorPA {
            height: 89px;
            width: 320px;
            background-position: 0px -1337px;
        }
              
            
!

JS

              
                (function($) {
    var mainContainer = $('#mainContainer'),
        mainScene = $('#mainScene'),
        NYScene = $('#NYScene'),
        NJScene = $('#NJScene'),
        PAScene = $('#PAScene'),
        fabFood = $('#fabFood'),
        specSport = $('#specSport'),
        cta = $('#cta'),
        headerMain = $('#headerMain'),
        weather = $('#weather'),
        NYBtn = $('#NYBtn'),
        NJBtn = $('#NJBtn'),
        PABtn = $('#PABtn'),
        mainCTA = $('#mainCTA'),
        headerNY = $('#headerNY'),
        mainImgNY = $('#mainImgNY'),
        outdoorNY = $('#outdoorNY'),
        headerNJ = $('#headerNJ'),
        mainImgNJ = $('#mainImgNJ'),
        outdoorNJ = $('#outdoorNJ'),
        headerPA = $('#headerPA'),
        mainImgPA = $('#mainImgPA'),
        outdoorPA = $('#outdoorPA'),
        MnStaggerEL = $(".MnStaggerElem"),
        NYStaggerEL = $(".NYStaggerElem"),
        NJStaggerEL = $(".NJStaggerElem"),
        PAStaggerEL = $(".PAStaggerElem"),

// Initiate Timelines
tlSlideMain = new TimelineMax();
    
tlSlideMain
//Set All Slides Containers to be off screen
    .set(mainScene, {x: -322, zIndex:5})
    .set(NYScene, {x: -322, zIndex:4})
    .set(NJScene, {x: -322, zIndex:3})
    .set(PAScene, {x: -322, zIndex:2})

.addLabel('mainSceneIntro')
    .set(mainScene, {zIndex:5})
    .to(mainScene, 1, {x: 0, autoAlpha: 1})
    .staggerFrom(MnStaggerEL, 1, {x: -322}, 0.2)
    .addPause()

.addLabel('mainSceneOutro')
    .to(mainScene, 1, {x: -322, autoAlpha: 0})

.addLabel('NYSceneIntro')
    .set(NYScene, {zIndex:5})
    .to(NYScene, 1, {x: 0, autoAlpha: 1})
    .staggerFrom(NYStaggerEL, 1, {x: -322}, 0.2)
    .addPause()

.addLabel('NYSceneOutro')
    .to(NYScene, 1, {x: -322, autoAlpha: 0})

.addLabel('NJSceneIntro')
    .set(NJScene, {zIndex:5})
    .to(NJScene, 1, {x: 0, autoAlpha: 1})
    .staggerFrom(NJStaggerEL, 1, {x: -322}, 0.2)
    .addPause()

.addLabel('NJSceneOutro')
    .to(NJScene, 1, {x: -322, autoAlpha: 0})

.addLabel('PASceneIntro')
    .set(PAScene, {zIndex:5})
    .to(PAScene, 1, {x: 0, autoAlpha: 1})
    .staggerFrom(PAStaggerEL, 1, {x: -322}, 0.2)
    .addPause()

.addLabel('PASceneOutro')
    .to(PAScene, 1, {x: -322, autoAlpha: 0});

//TIMELINE FUNCTIONS
$("#NYBtn").click(function() {
    tlSlideMain.play('NYSceneIntro');
});
    
$("#NJBtn").click(function() {
    tlSlideMain.play('NJSceneIntro');
});
    
 $("#PABtn").click(function() {
    tlSlideMain.play('PASceneIntro');
});
    
 $("#headerNY").click(function() {
     alert('HeaderNYClicked');
    tlSlideMain.play('mainSceneIntro');
});  
 $("#headerNJ").click(function() {
     alert('HeaderNJClicked');
    tlSlideMain.play('mainSceneIntro');
});
 $("#headerPA").click(function() {
    alert('HeaderPAClicked');
    tlSlideMain.play('mainSceneIntro');
});
    

})(jQuery);

              
            
!
999px

Console