index.html 8.53 KB
<!DOCTYPE html>
    <head>
    
  </script>
        <meta charset="utf-8">
        <title>HTML5 GSAP Ad</title>
        <meta name="ad.size" content="width=300,height=250">
<!--
        <script type="text/javascript">
            
            // IAB source: modified to allow link testing
            var clickTag = "http://thecommonwell.ca/wave";
            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>
-->
        <script type="text/javascript" src="https://quickresource.eyereturn.com/eyebuild/eyebuild_1_19.js"></script>
        <script type="text/javascript">
            window.onload = function() {
            	eyeBuild.initialize();
            }        
        </script>
        
        
        <style>
            
            body{
                margin: 0;
                padding: 0;
                width: 300px;
                height: 250px;
                line-height: 1.2;
                font-size: 27px;
                letter-spacing: .4;
                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;
            }
            #border{
                position: relative;
                width: 300px;
                height: 250px;
                border: 1px solid #55565A;
                overflow: hidden;
                cursor: pointer;
				box-sizing: border-box;
				background: url(assets/back1.jpg);
/* 				background: url(guide1.png); */
                background-position-x: 0px;
 
            }
            
            #logo{
                position: absolute;
                width: 55px;
                height: auto;
                right: 16px;
                bottom:18px;
                opacity: 0;
            }
            #legal{
                position: absolute;
                width: 180px;
                height: auto;
                left: 9px;
                bottom:6px;
            }
            #ey-frame{
                position: absolute;
                left: 17px;
                top:16px;
                z-index: 9;
            }
            #txt{
                position: absolute;
                width: 112px;
                height: auto;
                left: 35px;
                top:59px;
                z-index: 10;
                opacity: 0;
            }
            #gradient{
                position: absolute;
                opacity: .15;
            }
            #dot-1, #dot-2, #dot-3, #dot-txt{
                position: absolute;
                left: -12px;
                top: 61px;
                width:11px;
                height: 11px;
                background-color: #FFD400;
            }
            #dot-txt{
                left:-12px;
                top:90px;
                opacity: 1;
            }
            #border #cta{
                position: absolute;
                left: 23px;
                top:169px;
                width:148px;
                height: 26px;
                opacity: 0;
                background: url(assets/cta-norm.svg);
            }
            #border:hover #cta{
                background: url(assets/cta-hover.svg);     
            }
            #cta img{
                width: 92px;
                height:auto;
                margin: 8px 5px 5px 9px;
                display: block;
            }
            #tag1, #tag2, #tag3{
                position: absolute;
                left: 19px;
                top:85px;
                width:208px;
                height: auto;
                opacity: 0;
            }
            #tag2{
                width:196px;
            }
            #tag3{
                width:238px;
            }
            #tag-mask{
                position: absolute;
                width:0;
                height:100%;
                overflow: hidden;
            }
            
            
            
        </style>
    </head>
    
    <body>
        <a href="javascript:eyeBuild.doClick(0)" class="cta">
        <div id="border">
            <img id="logo" src="assets/logo.svg" alt="logo">
<!--             <img id="legal" src="assets/legal.png" alt="legal"> -->
            <img id="txt" src="assets/copy1.svg" alt="copy1">

            <img id="gradient" src="assets/gradient.svg" alt="gradient">
            <div id="dot-1"></div>
            <div id="dot-2"></div>
            <div id="dot-3"></div>

            <div id="cta"><img src="assets/cta-copy.svg" alt="cta"></div>
            <div id="tag-mask">
                <img id="tag1" src="assets/copy-betterquestion.svg" alt="The better the question">
                <img id="tag2" src="assets/copy-betteranswer.svg" alt="The better the answer">
                <img id="tag3" src="assets/copy-betterworks.svg" alt="The better the world works.">
            </div>
            <div id="dot-txt"></div>
            
<!--
            
-->
            
        </div>
        </a>

    <!-- GREENSOCK-->
        <script src="assets/TweenMax.min.js"></script>
        <script src="assets/DrawSVGPlugin.min.js"></script>
        <script src="assets/ey-frame-svg-1.0.3.min.js"></script>
        
        <script>
            
            function stage1(){
            	var tl = new TimelineMax(); /* {repeat:2, repeatDelay:2} */
            	
                var d=.4;

                    
            	tl.to("#logo", .7, {opacity:1, ease:Power1.easeInOut, delay:-.5 });
            	tl.from("#border", 1.5, {backgroundPosition:"-109px 0", ease:Power1.easeInOut, delay:-.5 });
            	
                var myeySvg = initEySvgFrame(7, 151, 178);
                document.getElementById("border").appendChild(myeySvg);
                animateEyFrame(.2);
                animateGradient(.2);
                
            	tl.to("#txt", d, {opacity:1, ease:Power1.easeInOut, delay:0 });
            	tl.to("#txt", d, {opacity:0, ease:Power1.easeInOut, delay:5.5 });
                
                //animateFill(3.3);
/*
            	tl.to("#txt2", d, {opacity:1, ease:Power1.easeInOut, delay:0 });
            	tl.to("#txt2", d, {opacity:0, ease:Power1.easeInOut, delay:4 });
*/

                animateEyReverse(7.5);
                
                // phase 2
                
/*             	tl.to("#gradient",      d, {opacity:1, ease:Power1.easeInOut, delay:1 }); */
            	tl.to("#logo",         .7, {scaleX:1.23, scaleY:1.23, bottom:36, right:35, ease:Power1.easeInOut, delay:.5 });
            	
            	tl.fromTo("#tag-mask",  d, {width:0}, {width:320, ease:Linear.easeNone, delay:-1.2 });
            	tl.fromTo("#dot-txt",   d, {left:-12}, {left:312, ease:Linear.easeNone, delay:-d});
            	tl.to("#tag1",          d, {opacity:1, ease:Linear.easeNone, delay:-d });
            	tl.fromTo("#dot-1",     d, {left:-12, opacity:1}, {left:59, opacity:1, ease:Power3.easeOut, delay:0});
            	tl.to("#tag1",          d, {opacity:0, ease:Linear.easeNone, delay:1 });
            	
            	tl.fromTo("#tag-mask",  d, {width:0}, {width:320, ease:Linear.easeNone, delay:0 });
            	tl.fromTo("#dot-txt",   d, {left:-12}, {left:312, ease:Linear.easeNone, delay:-d});
            	tl.to("#tag2",          d, {opacity:1, ease:Linear.easeNone, delay:-d });
            	tl.fromTo("#dot-2",     d, {left:-12}, {left:39, ease:Power3.easeOut, delay:0});
            	tl.to("#tag2",          d, {opacity:0, ease:Linear.easeNone, delay:1 });

            	tl.fromTo("#tag-mask",  d, {width:0}, {width:320, ease:Linear.easeNone, delay:0 });
            	tl.fromTo("#dot-txt",   d, {left:-12}, {left:312, ease:Linear.easeNone, delay:-d});
            	tl.to("#tag3",          d, {opacity:1, ease:Linear.easeNone, delay:-d });
            	tl.fromTo("#dot-3",     d, {left:-12}, {left:19, ease:Power3.easeOut, delay:0});
            	
             	tl.to("#cta",           d, {opacity:1, ease:Linear.easeNone, delay:0 });
               

            		
            	console.log( "time: " + tl.totalDuration() );
            }

            //---------------------
            stage1();

            
        
        </script>
       
    </body>

</html>