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

        <meta name="ad.size" content="width=300,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: 300px;
                height: 250px;
                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: 250px;
                background:#F2F2F2;
                overflow: hidden;
                cursor: pointer;
                box-sizing: border-box;
                /* border:1px solid; */
            }

            a{
                text-decoration: none;
                color: inherit;
            }
            
            #gray-panel{
                width:100%;
                height:100%;
                max-height: 100%;
                text-align: center;
            }

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

            #gold-panel {
                width:100%;
                height:165px;
                max-height: 100%;
                text-align: center;
                position: absolute;
                background:#EDC130;
                bottom:-155px;
            }

            .txt1 {
                position: absolute;
                top:60px;
                left:35px;
                opacity: 0;
            }

            .txt2 {
                position: absolute;
                bottom:0;
                bottom: 15px;
                left: 50px;
            }

            .txt3 {
                opacity: 0;
                position: absolute;
                left: 35px;
                top: 5px;
            }

            .img1 {
                position: absolute;
                left: 70px;
                top: 11px;
                height: 160px;
            }
            
            .img2 {
                opacity: 0;
                position: absolute;
                left: 35px;
                top: 20px;
                height: 45px;
            }

            .img3 {
                opacity: 0;
                position: absolute;
                top: 125px;
                left: 95px;
                transition: x 0.5s;
            }

            .img3 path {
                pointer-events: none;
            }

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

            <!-- <a id="click-tag" href="javascript:eyeBuild.doClick(0)"></a> -->
        </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:0, repeatDelay:10});

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

                tl.to("#blue-panel",2,{top:-160}, "+=4");
                tl.to("#gold-panel",2,{bottom:-5}, "-=2");

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

                tl.to("#blue-panel",2,{top:0});
                tl.to("#gold-panel",2,{bottom:-80}, "-=2");

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

            }

            function stopAnimateBtn() {
                Tlpath.restart();
                Tlpath.kill();
            }

            function animateBtn() {
                Tlpath = new TimelineMax({repeat:-1, repeatDelay:0});
                Tlpath.to(".img3 path:first-of-type",1,{x:10});
                Tlpath.to(".img3 path:first-of-type + path",1,{x:10}, "-=0.6");
                Tlpath.to(".img3 path:first-of-type",0.5,{opacity:0}, "-=0.7");
                Tlpath.to(".img3 path:first-of-type + path",0.5,{opacity:0}, "-=0.5");
                Tlpath.to(".img3 path:first-of-type",0,{x:-10}); 
                Tlpath.to(".img3 path:first-of-type + path",0,{x:-10});
                Tlpath.to(".img3 path:first-of-type",0.5,{opacity:1});
                Tlpath.to(".img3 path:first-of-type + path",0.5,{opacity:1}, "-=0.3");
                Tlpath.to(".img3 path:first-of-type",1,{x:0}, "-=0.6"); 
                Tlpath.to(".img3 path:first-of-type + path",1,{x:0}, "-=0.6");
            }

            ready(stage1());
            
        </script>

    </body>

</html>