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

              
                <body>

        <div id="container" style="width:970px; height:250px;">

            <div id="intro-panel-logo">Indigo & Cloth</div>

            <div class="images" id="image1"></div>
            <div class="images hide" id="image2"></div>
            <div class="images hide" id="image3"></div>

            <div id="shrink-wrap">

                <div class="copy-text hide" id="frame1-copy">
                    <span class="product-name" id="copy1"></span>
                    <span class="prices">
                        <span class="new-prices" id="new-price1"></span>
                        <span class="old-prices" id="old-price1"></span>
                    </span>
                </div>

                <div class="copy-text hide" id="frame2-copy">
                    <span class="product-name" id="copy2"></span>
                    <span class="prices">
                        <span class="new-prices" id="new-price2"></span>
                        <span class="old-prices" id="old-price2"></span>
                    </span>
                </div>

                <div class="copy-text hide" id="frame3-copy">
                    <span class="product-name" id="copy3"></span>
                    <span class="prices">
                        <span class="new-prices" id="new-price3"></span>
                        <span class="old-prices" id="old-price3"></span>
                    </span>
                </div>


            </div>

            <div id="indigo-panel">
                <div class="hide" id="logo">Indigo & Cloth</div>
                <div class="hide" id="cta"></div>
            </div>
            
            <div id="bg-exit"></div>

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

CSS

              
                * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:before,
*:after {
    box-sizing: inherit;
}

body,
html {
    font-family: "Arial", sans-serif;
    font-weight: 400;
}

#container {
    position: relative;
    left: 0px;
    top: 0px;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid #000;
}

#bg-exit {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 199;
}

.hide {
    opacity: 0;
}

#intro-panel-logo {
    position: absolute;
    background-color: #1B3F89;
    color: #FFFFFF;
    font-size: 80px;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.images {
    position: absolute;
    width: 250px;
    height: 250px;
    z-index: 5;
}

#shrink-wrap {
    position: absolute;
    top: 60px;
    left: 270px;
    width: 390px;
    height: 120px;
    border: 1px solid transparent;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.copy-text {
    position: absolute;
    width: 100%;
    flex: 1 0 auto;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-name,
.prices {
    width: 100%;
    flex: 1 0 auto;
    display: block;
}

.product-name {
    font-size: 25px;
    line-height: 32px;
    color: #FFFFFF;
}

.prices {
    font-size: 20px;
    color: #FFFFFF;
}

.old-prices {
    font-size: 18px;
    text-decoration-line: line-through;
    margin-left: 10px;
}

#indigo-panel {
    position: absolute;
    right: 0px;
    top: 0px;
    height: 250px;
    width: 250px;
    background-color: #1B3F89;
    z-index: 5;
}

#logo {
    position: absolute;
    right: 50px;
    top: 124px;
    width: 160px;
    height: auto;
    color: #FFFFFF;
    font-size: 24px;
    z-index: 99;
}

#cta {
    position: absolute;
    top: 176px;
    right: 60px;
    width: 148px;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 18px;
    z-index: 99;
}




              
            
!

JS

              
                    let frame1Copy = "Kari Jacket - Kasbek Camouflage.";
    let price1 = "€400.00";
    let oldPrice1 = "€500.00";
    let frame2Copy = "Sports Coat - Hoodie Tech Style";
    let price2 = "€400.00";
    let oldPrice2 = "€500.00";
    let frame3Copy = "Hunting Trousers - Indigo Sports Wear";
    let price3 = "€400.00";
    let oldPrice3 = "€500.00";
    let frame1CopyColor = "#FFFFFF";
    let frame2CopyColor = "#FFFFFF";
    let frame3CopyColor = "#FFFFFF";
    let price1Color = "#FFFFFF";
    let price2Color = "#FFFFFF";
    let price3Color = "#FFFFFF";
    let oldPrice1Color = "#FFFFFF";
    let oldPrice2Color = "#FFFFFF";
    let oldPrice3Color = "#FFFFFF";
    let ctaCopy = "Shop Now";
    let ctaBg = "#FFFFFF";
    let ctaCopyColor = "#1B3F89";
    let image1Url = "";
    let image2Url = "";
    let image3Url = "";
    let img1Color = "#FFFFFF";
    let img2Color = "#FFFFFF";
    let img3Color = "#FFFFFF";
    let logo = "Indigo & Cloth";
    let bg = "#1B3F89";

    document.querySelector('#container').style.backgroundColor = bg;
    document.querySelector('#logo').style.backgroundImage = "url(" + logo + ")";
    document.querySelector("#cta").style.backgroundColor = ctaBg;
    document.querySelector("#cta").innerHTML = '<span style="color:' + ctaCopyColor + '">' + ctaCopy + '</span>';
    document.querySelector("#image1").style.backgroundColor = img1Color;
    document.querySelector("#image2").style.backgroundColor = img2Color;
    document.querySelector("#image3").style.backgroundColor = img3Color;

    document.querySelector("#copy1").innerHTML = '<span style="color:' + frame1CopyColor + '">' + frame1Copy + '</span>';
    document.querySelector("#copy2").innerHTML = '<span style="color:' + frame2CopyColor + '">' + frame2Copy + '</span>';
    document.querySelector("#copy3").innerHTML = '<span style="color:' + frame3CopyColor + '">' + frame3Copy + '</span>';

    document.querySelector("#new-price1").innerHTML = '<span style="color:' + price1Color + '">' + price1 + '</span>';
    document.querySelector("#new-price2").innerHTML = '<span style="color:' + price2Color + '">' + price2 + '</span>';
    document.querySelector("#new-price3").innerHTML = '<span style="color:' + price3Color + '">' + price3 + '</span>';

    document.querySelector("#old-price1").innerHTML = '<span style="color:' + oldPrice1Color + '">' + oldPrice1 + '</span>';
    document.querySelector("#old-price2").innerHTML = '<span style="color:' + oldPrice2Color + '">' + oldPrice2 + '</span>';
    document.querySelector("#old-price3").innerHTML = '<span style="color:' + oldPrice3Color + '">' + oldPrice3 + '</span>';
    

  // GSAP Animation Code *******************************************************************

    var tl = gsap.timeline({
        
    });
    
    tl 
        .to("#intro-panel-logo", { duration: 0.75, autoAlpha: 0, ease: "Power2.easeIn" })
.add("banner")
        .fromTo("#image1, #frame1-copy", {x: -970, y: 0 }, { duration: 0.75, x: 0, y: 0, ease: "Power2.easeIn", autoAlpha: 1 }, '>-0.1')
        .to("#cta, #logo", { autoAlpha: 1, ease: "Power2.easeIn" }, '>-0.15') 
        .fromTo("#image1, #frame1-copy", { x: 0, y: 0 }, { duration: 0.75, x: 970, y: 0, ease: "Power1.easeOut" }, '+=1.5')
        .fromTo("#image2, #frame2-copy", { x: 0, y: 250 }, { duration: 0.75, x: 0, y: 0, ease: "Power1.easeOut", autoAlpha: 1 }, '>-0.15')
        .to("#image2, #frame2-copy", { x: -970, y: 0, ease: "Power2.easeOut" }, '>+1.5')
        .fromTo("#image3, #frame3-copy", { x: 0, y: -250 }, { duration: 0.75, x: 0, y: 0, ease: "Power1.easeOut", autoAlpha: 1 }, '>-0.15')
        .to("#cta", { repeat: 1, keyframes: [ {transform: "scale(.85)", duration: 0.3}, {transform: "none", duration: 0.3, ease: "power1.inOut"}]}, '>+0.75')
.add("end");
    

let main = gsap.timeline()
.add(tl.tweenTo("banner"))
.add(tl.tweenFromTo("banner", "end", {repeat:1}))


              
            
!
999px

Console