-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
82 lines (66 loc) · 2.29 KB
/
index.html
File metadata and controls
82 lines (66 loc) · 2.29 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.152.2/build/three.module.js"
} }
</script>
<link href="./styles/main.css" rel="stylesheet" type="text/css">
<script type="module" src="./src/code.js?v=2"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-555BDQJLHH"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-555BDQJLHH');
</script>
</head>
<body>
<button id="restart-btn">
Apply RF Pulse
</button>
<div id="scene-container"></div>
<script>
document.getElementById('restart-btn').addEventListener('click', () => {
gtag('event', 'restart_click', {
button_id: 'restart-btn',
});
});
</script>
<script>
(function(){
const ENDPOINT = 'https://analytics.tkimhofer.dev/collect';
const TOKEN = 'MMXVtk';
function anonId(){
const k='anon_id'; let v=localStorage.getItem(k);
if(!v){ v=crypto.randomUUID(); localStorage.setItem(k,v); }
return v;
}
async function track(event, props={}){
const payload = {
v: 1, event, ts: Date.now(),
page: location.href, ref: document.referrer || null,
anon_id: anonId(), ua: navigator.userAgent, ...props
};
try {
await fetch(ENDPOINT, {
method: 'POST',
headers: { 'Content-Type':'application/json', 'x-analytics-token': TOKEN },
keepalive: true,
body: JSON.stringify(payload)
});
} catch {}
}
track('page_view');
document.addEventListener('DOMContentLoaded', ()=>{
const btn = document.getElementById('restart-btn');
if (btn) btn.addEventListener('click', ()=>track('rf_pulse_click', {control:'restart-btn'}));
});
})();
</script>
</body>
</html>