index.html 4.79 KB
<!DOCTYPE html>
    <head>
    
        <meta charset="utf-8">
        <title>HTML5 GSAP Ad</title>
        <meta name="ad.size" content="width=970,height=250">
        <script type="text/javascript">
            
            // IAB source: modified to allow link testing
            var clickTag = "https://ontarioplanners.ca/planonit";
            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: 970px;
                height: 250px;
                line-height: 1.2;
                font-size: 27px;
                letter-spacing: 0;
                font-family: "Neue Haas Grotesk", Arial, sans-serif;
                /*font-weight: 800;*/ /*BOLD-800, MEDIUM-600, ROMAN - 400*/
                font-style: normal;
                background:#F2F2F2;
            }
            
            a{
                text-decoration: none;
                color: inherit;
            }
            #border{
                position: absolute;
                width: 970px;
                height: 250px;
                background:#F2F2F2;
                overflow: hidden;
                cursor: pointer;
				box-sizing: border-box;
            }

            #gray-panel{
                width:100%;
                height:100%;
                max-height: 100%;
                text-align: center;
            }

            #blue-panel {
                width:100%;
                height:100%;
                max-height: 100%;
                text-align: center;
                position: absolute;
                left:-745px;
                background:#0B4D85;    
                top:0; 
                width:755px;
            }

            #gold-panel {
                width:215px;
                height:100%;
                max-height: 100%;
                text-align: center;
                position: absolute;
                right:-205px;
                background:#EDC130;    
                top:0; 
            }

            #gold-panel img {
                margin-top:40px;
            }

            .txt1 {
                opacity: 0;
                margin-top:60px;
                margin-left:-55px;
            }

            .txt2 {
                margin-top:75px;
            }

            .txt3 {
                opacity: 0;
            }

            .img2 {
                opacity: 0;
                position: absolute;
                top: 40px;
                left: 55px;
            }

            .txt3 {
                position: absolute;
                top: 75px;
                left: 55px; 
            }


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

            <div id="gray-panel">
              <img class='txt1' src="./assets/txt1.png" alt="" >
            </div>

            <div id='blue-panel'>
                <img class='txt2' src="./assets/txt2.png" alt="" >
                <img class='txt3' src="./assets/txt3.png" alt="" >
            </div>
    
            <div id='gold-panel'>
                <img class='img1' src="./assets/logo_rpp.png" alt="" >
                <img class='img2' src="./assets/sponserd.png" alt="" >
            </div>
    
        </div>
        </a>

    <!-- GREENSOCK-->
        <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:0, repeatDelay:10});

                tl.to(".img1",2.5,{opacity:1});
                tl.to(".txt1",1.0,{opacity:1}, "-=1.5");

                tl.to("#blue-panel",2,{left:0}, "+=4");
                tl.to("#gold-panel",2,{right:0}, "-=2");

                tl.to(".txt2",1.5,{opacity:0}, "+=2.5");
                tl.to(".img1",1.5,{opacity:0}, "-=1.5");

                tl.to(".txt3",1.5,{opacity:1});
                tl.to(".img2",1.5,{opacity:1}, "-=1.5");
            }

            ready(stage1());
        
        </script>
       
    </body>

</html>