-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
93 lines (81 loc) · 2.32 KB
/
index.html
File metadata and controls
93 lines (81 loc) · 2.32 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
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0px;
}
.url-container input {
width: 80%;
}
.url-container button {
width: 15%;
}
.iframe-container {
position: relative;
height: 95%;
}
.iframe-container iframe {
border: 0;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
#landing-widget {
position: absolute;
bottom: 10px;
right: 10px;
background-color: tomato;
width: 50px;
height: 50px;
}
#landing-timer {
text-align: center;
color: #ffffff;
font-weight: 600;
}
</style>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script>
var secondsAfterLanding = 0;
function go() {
document.getElementById('iframe').setAttribute('src', document.getElementById('url-input').value);
secondsAfterLanding = 0;
document.getElementById("landing-widget").style.display = "block";
document.getElementById('landing-timer').innerHTML = secondsAfterLanding + "";
}
function onLandingPageLoad() {
if (secondsAfterLanding < 5) {
window.setTimeout(landingTimerTicked, 1000);
}
};
function landingTimerTicked() {
secondsAfterLanding += 1;
document.getElementById('landing-timer').innerHTML = secondsAfterLanding + "";
if (secondsAfterLanding == 5) {
alert("Landing point rewarded!");
document.getElementById("landing-widget").style.display = "none";
} else {
window.setTimeout(landingTimerTicked, 1000);
}
}
</script>
</head>
<body>
<div class="url-container">
<input id="url-input" value="https://coupang.com/"></input>
<button type="button" onclick="go()">Go</button>
</div>
<div class="iframe-container">
<iframe id='iframe' onload="onLandingPageLoad()" src="https://coupang.com/" frameborder="0"></iframe>
</div>
<div id="landing-widget">
<p id="landing-timer">0</p>
</div>
</body>
</html>