index.html 6.47 KB
<!DOCTYPE html>
    <head>
       
        <meta charset="utf-8">
        <title>HTML5 Ad</title>
        <!--
        <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();
                window.isVideoClick = false;
                
                var videoPlays = 0;
                var v0 = false;
                var v25 = false;
                var v50 = false;
                var v75 = false;
                
                var video = document.getElementById("video");
                var videoControls = document.getElementById("video-controls");
                var playButton = document.getElementById("play-pause");
                playButton.addEventListener("click", function(e) {
                    if (video.paused == true) {
                        play();
                        eyeBuild.doIAT(0);
                    } else {
                        pause();
                        eyeBuild.doIAT(1);
                    }
                });
                var play = function(){
                    video.play();
                    videoPlays++;
                    playButton.setAttribute("class", "pause");
                    videoControls.setAttribute("class", "play");
                }
                var pause = function(){
                    video.pause();
                    playButton.setAttribute("class", "play");
                }
                video.addEventListener('ended', function(e){
                    video.currentTime = 0;
                    pause();
                    videoControls.setAttribute("class", "start");
                    playButton.setAttribute("class", "play");
                    v0 = false;
                    v25 = false;
                    v50 = false;
                    v75 = false;
                    eyeBuild.doIAT(9);
                }, false);
                
                // track video plays
                video.addEventListener('timeupdate', function(e){
                    var pct = video.currentTime / video.duration *100;
                    if (pct > 75 && !v75){
                        v75 = true;
                        eyeBuild.doIAT(8);
                    }else if (pct > 50 && !v50){
                        v50 = true;
                        eyeBuild.doIAT(7);
                    }else if (pct > 25 && !v25){
                        v25 = true;
                        eyeBuild.doIAT(6);
                    }else if (pct > 0 && !v0){
                        v0 = true;
                        eyeBuild.doIAT(5);
                        if(videoPlays>1){
                            eyeBuild.doIAT(10);
                        }
                    }
                }, false);
                
            }
        </script>
        
        
        <style>
            
            body{
                margin: 0;
                padding: 0;
                width: 300px;
                height: 600px;
                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;
            }
            #click-tag{
                display: block;
                position: absolute;
                width: 100%;
                height: 420px;
                top:180px;
            }
            
            #border{
                position: relative;
                width: 300px;
                height: 600px;
                border: 1px solid #55565A;
                background-color: #FFFFFF;
                overflow: hidden;
                cursor: pointer;
				box-sizing: border-box;
            }
            
            #border:hover  #cta{
                background-color: #666666;
            }
            
            #border:active  #cta{
                background-color: #000000;
            }
            
			#video, #video-controls{
                position: absolute;
                width: 272px;
                height: 152px;
                left:13px;
                top:15px;
            }
			#video-controls.start{
                background: url(assets/video-poster.jpg) no-repeat center center;
            }
			#video-controls button{
                background: url(assets/play.svg) no-repeat center center;
                border: none;
                cursor: pointer;
                width: 100%;
                height: 100%;
            }
			#video-controls button.play:hover{
                background-size: 88px 88px;
            }
            #video-controls button.play{
                background: url(assets/play.svg) no-repeat center center;                
                background-size: 85px 85px;
            }
            #video-controls button.pause{
                background: none;           
            }
            
        </style>
        
    </head>
    
    <body>
        <div id="border">
            <div id="img"><img id="logoImg" src="assets/img@2x.gif" width="300" height="600" style="border-style:none"></div>
            <video id="video" width="272" height="152">
                <source src="assets/vid.mp4" type="video/mp4">
                Your browser doesn't support HTML5 video.
            </video>
            <div id="video-controls" class="start">
                <button type="button" id="play-pause" class="play"></button>
            </div>

            <a id="click-tag" href="javascript:eyeBuild.doClick(0)"></a>
            <!--<a id="click-tag" href="javascript:window.open(window.clickTag)"></a>-->
        </div>
        
    </body>

</html>