53189da6 by Dan Rempel

Clean up

1 parent 310907c7
1 <!DOCTYPE html>
2 <head>
3
4 <meta charset="utf-8">
5 <title>HTML5 Ad</title>
6 <!--
7 <script type="text/javascript">
8
9 // IAB source: modified to allow link testing
10 var clickTag = "http://thecommonwell.ca/wave";
11 function getParameterByName(name)
12 {
13 var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
14 if (match == null || match == ""){
15 return clickTag;
16 } else{
17 return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
18 }
19 }
20 clickTag = getParameterByName('clickTag');
21 </script>
22 -->
23 <script type="text/javascript" src="https://quickresource.eyereturn.com/eyebuild/eyebuild_1_19.js"></script>
24 <script type="text/javascript">
25 window.onload = function() {
26 eyeBuild.initialize();
27 window.isVideoClick = false;
28
29 var videoPlays = 0;
30 var v0 = false;
31 var v25 = false;
32 var v50 = false;
33 var v75 = false;
34
35 var video = document.getElementById("video");
36 var videoControls = document.getElementById("video-controls");
37 var playButton = document.getElementById("play-pause");
38 playButton.addEventListener("click", function(e) {
39 if (video.paused == true) {
40 play();
41 eyeBuild.doIAT(0);
42 } else {
43 pause();
44 eyeBuild.doIAT(1);
45 }
46 });
47 var play = function(){
48 video.play();
49 videoPlays++;
50 playButton.setAttribute("class", "pause");
51 videoControls.setAttribute("class", "play");
52 }
53 var pause = function(){
54 video.pause();
55 playButton.setAttribute("class", "play");
56 }
57 video.addEventListener('ended', function(e){
58 video.currentTime = 0;
59 pause();
60 videoControls.setAttribute("class", "start");
61 playButton.setAttribute("class", "play");
62 v0 = false;
63 v25 = false;
64 v50 = false;
65 v75 = false;
66 eyeBuild.doIAT(9);
67 }, false);
68
69 // track video plays
70 video.addEventListener('timeupdate', function(e){
71 var pct = video.currentTime / video.duration *100;
72 if (pct > 75 && !v75){
73 v75 = true;
74 eyeBuild.doIAT(8);
75 }else if (pct > 50 && !v50){
76 v50 = true;
77 eyeBuild.doIAT(7);
78 }else if (pct > 25 && !v25){
79 v25 = true;
80 eyeBuild.doIAT(6);
81 }else if (pct > 0 && !v0){
82 v0 = true;
83 eyeBuild.doIAT(5);
84 if(videoPlays>1){
85 eyeBuild.doIAT(10);
86 }
87 }
88 }, false);
89
90 }
91 </script>
92
93
94 <style>
95
96 body{
97 margin: 0;
98 padding: 0;
99 width: 300px;
100 height: 600px;
101 line-height: 1.2;
102 font-size: 27px;
103 letter-spacing: .4;
104 color: #CD040B;
105 font-family: "Neue Haas Grotesk", Arial, sans-serif;
106 /*font-weight: 800;*/ /*BOLD-800, MEDIUM-600, ROMAN - 400*/
107 font-style: normal;
108 }
109
110 a{
111 text-decoration: none;
112 color: inherit;
113 }
114 #click-tag{
115 display: block;
116 position: absolute;
117 width: 100%;
118 height: 420px;
119 top:180px;
120 }
121
122 #border{
123 position: relative;
124 width: 300px;
125 height: 600px;
126 border: 1px solid #55565A;
127 background-color: #FFFFFF;
128 overflow: hidden;
129 cursor: pointer;
130 box-sizing: border-box;
131 }
132
133 #border:hover #cta{
134 background-color: #666666;
135 }
136
137 #border:active #cta{
138 background-color: #000000;
139 }
140
141 #video, #video-controls{
142 position: absolute;
143 width: 272px;
144 height: 152px;
145 left:13px;
146 top:15px;
147 }
148 #video-controls.start{
149 background: url(assets/video-poster.jpg) no-repeat center center;
150 }
151 #video-controls button{
152 background: url(assets/play.svg) no-repeat center center;
153 border: none;
154 cursor: pointer;
155 width: 100%;
156 height: 100%;
157 }
158
159 #video-controls button.play:hover{
160 background-size: 88px 88px;
161 }
162 #video-controls button.play{
163 background: url(assets/play.svg) no-repeat center center;
164 background-size: 85px 85px;
165 }
166
167 #video-controls button.pause:hover{
168 background-size: 20px 20px;
169 }
170 #video-controls button.pause{
171 background: url(assets/pause.svg) no-repeat 5px 127px;
172 background-size: 0px 0px;
173 }
174
175
176 </style>
177
178 </head>
179
180 <body>
181 <div id="border">
182 <div id="img"><img id="logoImg" src="assets/img@2x.gif" width="300" height="600" style="border-style:none"></div>
183 <video id="video" width="272" height="152">
184 <source src="assets/vid.mp4" type="video/mp4">
185 Your browser doesn't support HTML5 video.
186 </video>
187 <div id="video-controls" class="start">
188 <button type="button" id="play-pause" class="play"></button>
189 </div>
190
191 <a id="click-tag" href="javascript:eyeBuild.doClick(0)"></a>
192 <!--<a id="click-tag" href="javascript:window.open(window.clickTag)"></a>-->
193 </div>
194
195 </body>
196
197 </html>
...\ No newline at end of file ...\ No newline at end of file