-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
351 lines (325 loc) · 12.3 KB
/
index.html
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
/>
<script
src="https://challenges.cloudflare.com/turnstile/v0/api.js"
async
defer
></script>
<style>
.w-form-done,
.w-form-fail {
display: none;
}
.visible {
display: block !important;
}
</style>
<!-- Snippet for PostHog, dynamic links, wallet user identification and app download buttons -->
<script>
// prettier-ignore
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
// Function to generate the dynamic link
function getDynamicLink(link, distinctId, forwardTo) {
console.log("Generating dynamic link for:", link); // Log the original link
// Create a URL object from the base link
var linkUrl = new URL(link);
// Append 'distinct_id' as a query parameter
linkUrl.searchParams.append("distinct_id", distinctId);
console.log("Appended distinct_id:", distinctId); // Log the distinct ID
// Optionally append 'go_to' parameter if 'forwardTo' is provided
if (forwardTo) {
linkUrl.searchParams.append("go_to", forwardTo);
console.log("Appended forwardTo:", forwardTo); // Log the forwardTo parameter
}
// Construct the dynamic link
var dynamicLink =
"https://haqq.page.link/" +
"?link=" +
encodeURIComponent(linkUrl.toString()) +
"&apn=com.haqq.wallet&isi=6443843352&ibi=com.haqq.wallet";
console.log("Generated dynamic link:", dynamicLink); // Log the generated dynamic link
return dynamicLink;
}
posthog.init("phc_S8yvZufvPSBgyfXwjP2nIzndGES4HV8i0yOxMecUkLE", {
api_host: "https://haqq-posthog-proxy.vercel.app/ingest",
ui_host: "https://eu.posthog.com",
person_properties: "identified_only",
persistence: "localStorage+cookie",
loaded: function (posthog) {
// Identify user from HaqqWallet
var isHaqqWallet = Boolean(
window.ethereum && window.ethereum.isHaqqWallet
);
if (isHaqqWallet) {
var walletDistinctId = window.__HAQQWALLET__
? window.__HAQQWALLET__.POSTHOG_DISTINCT_ID
: null;
console.log("IdentifyWalletUsers", { walletDistinctId });
posthog.identify(walletDistinctId || posthog.get_distinct_id());
}
// Dynamic redirection based on URL parameters
var params = new URLSearchParams(window.location.search);
var goTo = params.get("go_to");
var distinctId = params.get("distinct_id");
if (distinctId && distinctId !== "undefined" && distinctId !== "") {
posthog.identify(distinctId);
if (goTo && goTo !== "undefined" && goTo !== "") {
window.location.href = goTo;
}
}
// This script generates dynamic links for buttons on the page based on the user's distinct ID
// Get the user's distinct ID from PostHog
var distinctId =
typeof posthog !== "undefined" ? posthog.get_distinct_id() : null;
console.log("Retrieved distinct ID:", distinctId); // Log the retrieved distinct ID
// Check if distinctId is available
if (distinctId) {
// Find all buttons by class name 'button-app-ios' or 'button-app-android'
var iosButtons = document.getElementsByClassName("button-app-ios");
var androidButtons =
document.getElementsByClassName("button-app-android");
// Process iOS buttons
for (var i = 0; i < iosButtons.length; i++) {
var button = iosButtons[i];
// Generate the dynamic link for iOS
var dynamicLink = getDynamicLink(
window.location.origin,
distinctId,
"https://apps.apple.com/app/haqq-wallet-by-bored-gen/id6443843352"
);
button.setAttribute("href", dynamicLink);
console.log(
"Updated iOS button",
i,
"with dynamic link:",
dynamicLink
); // Log the updated link
}
// Process Android buttons
for (var j = 0; j < androidButtons.length; j++) {
var button = androidButtons[j];
// Generate the dynamic link for Android
var dynamicLink = getDynamicLink(
window.location.origin,
distinctId,
"https://play.google.com/store/apps/details?id=com.haqq.wallet"
);
button.setAttribute("href", dynamicLink);
console.log(
"Updated Android button",
j,
"with dynamic link:",
dynamicLink
); // Log the updated link
}
} else {
console.warn("Distinct ID not available.");
}
},
});
</script>
</head>
<body>
<div id="feedback-form-container">
<h2>Develop your vision on HAQQ</h2>
<br />
<form id="feedback-form">
<input
maxlength="256"
id="feedback-name"
name="feedback-name"
placeholder="Name"
type="text"
required
/>
<br />
<input
maxlength="256"
name="feedback-email"
placeholder="Enter your e-mail"
type="email"
id="feedback-email"
required
/>
<br />
<textarea
placeholder="Your message"
maxlength="5000"
minlength="10"
id="feedback-message"
name="feedback-message"
required
></textarea>
<br />
<div
class="cf-turnstile"
data-sitekey="0x4AAAAAAAJdhpkY-4iZ4A_X"
data-callback="onTurnstileSuccess"
></div>
<br />
<input
type="submit"
data-wait="Please wait..."
value="Submit"
disabled
/>
</form>
<div class="w-form-done" aria-label="footer form success">
<div>
Great! You've successfully subscribed to HAQQ updates. Stay tuned for
all the latest news!
</div>
</div>
<div class="w-form-fail" aria-label="footer form failure">
<div>Oops! Something went wrong while submitting the form.</div>
</div>
</div>
<div id="subscribe-form-container">
<h2>Sign up for HAQQ updates</h2>
<br />
<form id="subscribe-form">
<input
maxlength="256"
name="subscribe-name"
placeholder="Full name"
type="text"
id="subscribe-name"
required
/>
<br />
<input
maxlength="256"
placeholder="Enter your e-mail"
type="email"
id="subscribe-email"
name="subscribe-email"
required
/>
<br />
<div
class="cf-turnstile"
data-sitekey="0x4AAAAAAAJdhpkY-4iZ4A_X"
data-callback="onTurnstileSuccess"
></div>
<br />
<input
type="submit"
data-wait="Please wait..."
value="Subscribe"
disabled
/>
</form>
<div class="success-message w-form-done" aria-label="footer form success">
<div>
Great! You've successfully subscribed to HAQQ updates. Stay tuned for
all the latest news!
</div>
</div>
<div class="w-form-fail" aria-label="footer form failure">
<div>Oops! Something went wrong while submitting the form.</div>
</div>
</div>
<div id="subscribe-roadmap-form-container">
<h2>Sign up for HAQQ Roadmap updates</h2>
<br />
<form id="subscribe-roadmap-form">
<input
maxlength="256"
placeholder="Enter your e-mail"
type="email"
id="subscribe-roadmap-email"
name="subscribe-email"
required
/>
<br />
<div
class="cf-turnstile"
data-sitekey="0x4AAAAAAAJdhpkY-4iZ4A_X"
data-callback="onTurnstileSuccess"
></div>
<br />
<input
type="submit"
data-wait="Please wait..."
value="Subscribe"
disabled
/>
</form>
<div class="success-message w-form-done" aria-label="footer form success">
<div>
Great! You've successfully subscribed to HAQQ Roadmap updates. Stay
tuned for all the latest news!
</div>
</div>
<div class="w-form-fail" aria-label="footer form failure">
<div>Oops! Something went wrong while submitting the form.</div>
</div>
</div>
<!-- Placeholder for price -->
<div>
<h2>ISLM Price</h2>
<p><span data-islm-price>Loading price...</span> ISLM</p>
</div>
<!-- Placeholder for chain stats -->
<div>
<h2>Chain Stats</h2>
<ul role="list">
<li>
<h3>Mainnet accounts created</h3>
<p data-chain-stats-accounts>Loading...</p>
</li>
<li>
<h3>Transactions in the last 24 hours</h3>
<p data-chain-stats-transactions>Loading...</p>
</li>
<li>
<h3>Seconds to consensus finality</h3>
<p data-chain-stats-finality>Loading...</p>
</li>
<li>
<h3>Average cost per transaction</h3>
<p data-chain-stats-cost>Loading...</p>
</li>
<li>
<h3>Supply</h3>
<p data-chain-stats-supply>Loading...</p>
</li>
<li>
<h3>Circulating Supply</h3>
<p data-chain-stats-circulating-supply>Loading...</p>
</li>
<li>
<h3>Staked Amount</h3>
<p data-chain-stats-staked-amount>Loading...</p>
</li>
<li>
<h3>Staked ratio</h3>
<p><span data-chain-stats-staked-ratio>Loading...</span> %</p>
</li>
<li>
<h3>Validators count</h3>
<p data-chain-stats-validators-count>Loading...</p>
</li>
<li>
<h3>Active validators count</h3>
<p data-chain-stats-active-validators-count>Loading...</p>
</li>
</ul>
</div>
<!-- New section for app download buttons -->
<div>
<h2>Dynamic links for HAQQ Wallet download</h2>
<a href="#" class="button-app-ios">Download for iOS</a>
<br />
<a href="#" class="button-app-android">Download for Android</a>
</div>
<script type="module" src="./main.js"></script>
</body>
</html>