index.html 6.76 KB
<!DOCTYPE html>
    <head>
       
        <meta charset="utf-8">
        <title>HTML5 Ad</title>

        <meta name="ad.size" content="width=300,height=600">
        
        <script type="text/javascript">
            
            // IAB source: modified to allow link testing
            var clickTag = "https://www.manningcanning.com/";
            function getParameterByName(name)
            {
                var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
                if (match == null || match == ""){
                    return clickTag;
                } else{
                    return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
                }
            }
            clickTag = getParameterByName('clickTag');
        </script>
       
        <style>
            
            body{
                margin: 0;
                padding: 0;
                width: 300px;
                height: 600px;
                line-height: 1.2;
                font-size: 27px;
                letter-spacing: .4;
                background:white;
                color: #CD040B;
                font-family: "Neue Haas Grotesk", Arial, sans-serif;
                /*font-weight: 800;*/ /*BOLD-800, MEDIUM-600, ROMAN - 400*/
                font-style: normal;
            }
            
            a{
                text-decoration: none;
                color: inherit;
            }
            img {
                border-style:none;
            }
            
            #border{
                position: absolute;
                width: 300px;
                height: 600px;
                background:#231F20;
                overflow: hidden;
                cursor: pointer;
                box-sizing: border-box;
                /* border:1px solid; */
                display: flex;
                align-items: center;
                flex-direction: column;
                justify-content: center;
            }

            .cover {
                position: absolute;
                width: 300px;
                height: 600px;
                bottom:-600px;
                background:#FF4C46; 
                z-index: 1;
            }

            .cover-2 {
                position: absolute;
                width: 300px;
                height: 224px;
                bottom:0;
                background:#231F20;  
                z-index: 1; 
            }

            .txt-1 {
                position: absolute;
                bottom:-100px;
            }

            .txt-1-2 {
                position: absolute;
                bottom:-100px;
            }

            .txt-1-3 {
                position: absolute;
                bottom:-100px;
            }

            .img-2 {
                position: absolute;
                top:150px;
                z-index: 2;
            }

            .txt-2 {
                position: absolute;
                bottom:-100px;
                z-index: 2;
            }

            .img-3 {
                z-index:3;
                position: absolute;
                top:115px;
            }

            .txt-3 {
                z-index:3;
                position: absolute;
                top:455px;
            }

            .img-4-bg {
                position: absolute;
                top:0;
            }

            .img-4 {
                position: absolute;
                bottom:180px;
                z-index: 1;
            }

            .img-4-2 {
                position: absolute;
                bottom:12px;
                z-index: 1;
            }

            .txt-4 {
                opacity: 0;
                position: absolute;
                bottom:-100px;
                z-index: 1;
            }

            .txt-4-2 {
                opacity: 0;
                position: absolute;
                bottom:-100px;
                z-index: 1;
            }

        </style>
        
    </head>
    
    <body>
        <a id="click-tag" href="javascript:window.open(window.clickTag)">
            <div id="border">

                <img class='txt-1' src='assets/txt-1.png' />
                <img class='txt-1-2' src='assets/txt-1-2.png' />
                <img class='txt-1-3' src='assets/txt-1-3.png' />

                <div class='cover'></div>

                <img class='img-2' style='opacity:0' src='assets/img-2.png' />
                <img class='txt-2' src='assets/txt-2.png' />

                <img class='img-3' style='opacity:0' src='assets/img-3.png' />
                <img class='txt-3' style='opacity:0' src='assets/txt-3.png' />

                <img class='img-4-bg' style='opacity:0' src='assets/img-4-bg.png' />

                <div class='cover-2' style='opacity:0'></div>
                <img class='img-4' style='opacity: 0' src='assets/img-4.png' />
                <img class='img-4-2' style='opacity: 0' src='assets/img-4-2.png' />

                <img class='txt-4' style='opacity: 0' src='assets/txt-4.png' />


            </div>
        </a>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
        
        <script>


            function ready(fn) {
                if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
                    fn();
                } else {
                    document.addEventListener('DOMContentLoaded', fn);
                }
            }


            function stage1(){

                var tl = new TimelineMax({repeat:3, repeatDelay:7});

                tl.to(".txt-1",0.5,{top:125});
                tl.to(".txt-1-2",0.5,{top:235}, "-=0.25");
                tl.to(".txt-1-3",0.5,{top:355}, "-=0.25");

                tl.to([".txt-1",".txt-1-2",".txt-1-3"],0,{opacity:0}, "+=3.5");

                tl.to(".img-2",0,{opacity:1,scale:0.75});
                tl.to(".img-2",0.4,{scale:1.25,transformOrigin:"50% 50%", ease:"bounce.out"});
                tl.to(".img-2",0.4,{scale:0.90,transformOrigin:"50% 50%", ease:"bounce.out"});
                tl.to(".img-2",0.4,{scale:1,transformOrigin:"50% 50%", ease:"bounce.out"});
                tl.to(".txt-2",1,{top:455}, "-=1");

                tl.to(".cover",0.2,{top:0,ease: "none"}, "+=1.7");

                tl.to(".txt-3",0,{opacity:1}, "-=0.1");
                tl.to(".img-2",0,{opacity:0});
                tl.to(".img-3",0,{opacity:1});

                tl.to([".cover", ".img-2", ".img-3", ".img-2", ".txt-1", ".txt-1-2", ".txt-2", ".txt-3"],0,{opacity:0}, "+=2.5");
                tl.to("#border",0,{background:"rgb(241,242,243)"});
                tl.to([".img-4-bg",".cover-2", ".img-4", ".img-4-2",".txt-4", ".txt-4-2"],0,{opacity:1});

                tl.to(".txt-4",0.5,{bottom:125});

            }



            ready(stage1());
            
        </script>

    </body>

</html>