index.html
4.45 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
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>HTML5 Ad</title>
<script type="text/javascript">
// IAB source: modified to allow link testing
var clickTag = "https://businesstobruce.com/portelgin";
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;
}
a{
text-decoration: none;
}
#click-tag{
display: block;
position: absolute;
width: 100%;
height: 100%;
}
#border{
position: relative;
width: 100%;
height: 100%;
border: 1px solid #939598;
background-color: #FFFFFF;
overflow: hidden;
cursor: pointer;
box-sizing: border-box;
}
img {
position: absolute;
}
/* Custom per ad */
body{
width: 300px;
height: 250px;
}
#txt1{
top:90px;
left: 20px;
}
#txt2{
top:90px;
left: 305px;
}
#dark{
opacity:.6;
}
</style>
</head>
<body>
<!-- GREENSOCK-->
<script src="//cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
<script>
var img1 = new Image();
img1.onload = function() {
// the image is ready
// calculate img1 size and move it from bottom left to top right
var img1 = document.getElementById("img1");
var startX = 0;
var startY = - img1.height+250;
var endX = - img1.width+300;
var endY = 0;
var tl = new TimelineMax({repeat:2});
tl.set(img1, { css: { top: startY,} });
tl.to("#check", 0.6, {left:-305, ease:Power1.easeInOut, delay:.5 });
tl.to("#txt1", 0.6, {left:-305, ease:Power1.easeInOut, delay:3.3 });
tl.to(img1, 0.6, {left:endX, top:endY, ease:Power1.easeInOut, delay:-.6 });
tl.to("#txt2", 0.6, {left:20, ease:Power1.easeInOut, delay:-.6 });
tl.to("#txt2", 0.6, {left:-305, ease:Power1.easeInOut, delay:3.3 });
tl.to(img1, 0.6, {left:-305, opacity:0, ease:Power1.easeInOut, delay:-.6 });
tl.to(dark, 0.6, {left:-305, opacity:0, ease:Power1.easeInOut, delay:-.6 });
tl.to("#triangle", 0.6, {left:-305, ease:Power1.easeInOut, delay:-.6 });
tl.to("#triangle", 0.6, {left:-305, ease:Power1.easeInOut, delay:4 });
/* console.log("time:" + tl.duration()); */
};
img1.onerror = function() {
// the image has failed
};
img1.src = "assets/img1.jpg";
</script>
<div id="border">
<img src="assets/img2@2x.png" alt="img2@2x" width="300">
<img id="img1" src="assets/img1.jpg" alt="img1" width="649" height="253">
<img id="dark" src="assets/darken.png">
<img id="txt1" src="assets/txt1@2x.png" alt="txt1@2x" width="180">
<img id="txt2" src="assets/txt2@2x.png" alt="txt2@2x" width="167">
<img id="triangle" src="assets/triangle@2x.png" alt="triangle@2x" width="90">
<img id="check" src="assets/check@2x.png" alt="check@2x" width="300">
<a id="click-tag" href="javascript:window.open(window.clickTag)"></a>
</div>
</body>
</html>