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

        <meta name="ad.size" content="width=728,height=90">
        
        <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:  728px;
                height: 90px;
                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:  728px;
                height: 90px;
                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:  728px;
                height: 90px;
                top:0;
                left:-728px;
                background:#FF343A;
                z-index: 1;
            }

            .txt-1 {
                position: absolute;
                bottom:-50px;
                left:20px;
            }


            .txt-2 {
                position: absolute;
                bottom:-50px;
                left:20px;
                z-index: 2;
            }

            .img-3 {
                z-index:3;
                position: absolute;
                top: 20px;
                right: -50px;
            }

            .txt-3 {
                z-index:3;
                position: absolute;
                bottom:-50px;
                left:20px;
                z-index: 2;
            }

        </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' />

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

                <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' />

            </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:5, repeatDelay:5});

                tl.to(".txt-1",0.5,{top:15});

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

                tl.to(".cover",0.2,{left:0,ease: "none"});

                tl.to(".txt-2",0.5,{top:30}, "-=0.1");

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

                tl.to([".txt-3",".img-3"],0,{opacity:1});
                tl.to(".txt-3",0.5,{top:30});
                tl.to(".img-3",0.5,{right:50}, "-=0.2");

            }



            ready(stage1());
            
        </script>

    </body>

</html>