index.html
7.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!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">
window.onload = function() {
window.isVideoClick = 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) {
video.play();
playButton.setAttribute("class", "pause");
videoControls.setAttribute("class", "play");
} else {
video.pause();
playButton.setAttribute("class", "play");
}
});
}
</script>
<style>
body{
margin: 0;
padding: 0;
width: 600px;
height: 566px;
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: 186px;
top:380px;
}
#border{
position: relative;
width: 600px;
height: 566px;
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: 553px;
height: 311px;
left:23px;
top:23px;
}
#video-controls{
background: url(assets/video-poster.jpg) no-repeat center center;
}
#video-controls.play {
background: none;
}
#video-controls button{
width: 100%;
height: 100%;
background: url(assets/play.svg) no-repeat center center;
border: none;
cursor: pointer;
}
#video-controls button.play:hover{
background-size: 160px 160px;
}
#video-controls button.play{
background: url(assets/play.svg) no-repeat center center;
background-size: 155px 155px;
}
#video-controls button.pause{
background: none;
}
.bar{
position: absolute;
width: 47px;
height: 30px;
left:-50px;
}
.grey{
background-color: #55565A;
top:396px;
}
.green{
background-color: #77BC1F;
top:434px;
}
.blue{
background-color: #009BDE;
top:472px;
}
.orange{
background-color: #F7A800;
top:510px;
}
#txt1, #txt2{
position: absolute;
left:69px;
top:396px;
opacity: 0;
}
#logoImg{
position: absolute;
left:297px;
top:395px;
opacity: 0;
}
</style>
</head>
<body>
<div id="border">
<!--<div id="img"><img id="" src="assets/img@1x.gif" width="600" height="566" style="border-style:none"></div>-->
<a id="click-tag" href="javascript:window.open(window.clickTag)"></a>
<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">
<button type="button" id="play-pause" class="play"></button>
</div>
<div id="bar1" class="bar grey"></div>
<div id="bar2" class="bar green"></div>
<div id="bar3" class="bar blue"></div>
<div id="bar4" class="bar orange"></div>
<img id="txt1" src="assets/txt1.svg" style="border-style:none">
<img id="txt2" src="assets/txt2.svg" style="border-style:none">
<img id="logoImg" src="assets/logo.svg" style="border-style:none">
</div>
<!-- jQuery-->
<script src="//code.jquery.com/jquery-1.12.3.min.js" integrity="sha256-aaODHAgvwQW1bFOGXMeX+pC4PZIPsvn2h1sArYOhgXQ=" crossorigin="anonymous"></script>
<!-- GREENSOCK-->
<!-- <script src="//www.greensock.com/js/src/utils/SplitText.min.js"></script> enables character or word animation - $99/yr -->
<script src="//cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
<script>
function stage1(){
var tl = new TimelineMax({repeat:0, repeatDelay:2});
var barDelay = -0.05;
var barDuration = .25;
tl.to("#bar1", barDuration, {left:0, ease:Power1.easeInOut, delay:0 });
tl.to("#bar2", barDuration, {left:0, ease:Power1.easeInOut, delay:barDelay });
tl.to("#bar3", barDuration, {left:0, ease:Power1.easeInOut, delay:barDelay });
tl.to("#bar4", barDuration, {left:0, ease:Power1.easeInOut, delay:barDelay });
var fadeDuration = .5;
tl.to("#txt1", fadeDuration, {opacity:1, ease:Power1.easeInOut, delay:-.5 });
tl.to("#txt1", fadeDuration, {opacity:0, ease:Power1.easeInOut, delay:1.5 });
tl.to("#txt2", fadeDuration, {opacity:1, ease:Power1.easeInOut, delay:-.5});
tl.to("#txt2", fadeDuration, {opacity:0, ease:Power1.easeInOut, delay:2});
tl.to("#logoImg", 1, {opacity:1, ease:Power1.easeInOut, delay:-.5 });
console.log( "time: " + tl.totalDuration() );
}
//---------------------
$(document).ready(function(){
stage1();
});
</script>
</body>
</html>