-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
110 lines (100 loc) · 4.67 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Clip - Share your gaming moments" />
<meta property="og:title" content="Clip" />
<meta property="og:description" content="Share your gaming moments" />
<meta property="og:image" content="/og-image.png" />
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#1A1F2C" />
<link rel="apple-touch-icon" href="/logo192.png" />
<title>Clip</title>
<!-- Lovable Script -->
<script src="https://cdn.gpteng.co/gptengineer.js" type="module"></script>
<!-- PostHog Analytics -->
<script>
!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+"/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="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
posthog.init(import.meta.env.VITE_POSTHOG_API_KEY, {api_host: 'https://app.posthog.com'});
</script>
<!-- Sentry Error Tracking -->
<script
src="https://js.sentry-cdn.com/YOUR-PUBLIC-KEY.min.js"
crossorigin="anonymous"
></script>
<script>
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [
new Sentry.BrowserTracing({
tracePropagationTargets: ["localhost", /^https:\/\/yourwebsite\.com/],
}),
new Sentry.Replay(),
],
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});
</script>
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
if (import.meta.env.VITE_GOOGLE_ANALYTICS_ID) {
gtag('config', import.meta.env.VITE_GOOGLE_ANALYTICS_ID);
}
</script>
<!-- Structured Data for Organization -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Clip",
"description": "Share your gaming moments",
"url": "https://clip.gaming",
"logo": "/logo192.png"
}
</script>
</head>
<body>
<div id="root"></div>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', async () => {
try {
const registration = await navigator.serviceWorker.register('/service-worker.js', {
scope: '/'
});
// Handle service worker updates
registration.addEventListener('updatefound', () => {
const newWorker = registration.installing;
newWorker.addEventListener('statechange', () => {
if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
// New content is available, show refresh prompt to user
if (window.confirm('New content is available! Click OK to refresh.')) {
window.location.reload();
}
}
});
});
console.log('ServiceWorker registration successful');
} catch (err) {
console.error('ServiceWorker registration failed: ', err);
}
});
// Handle offline/online status
window.addEventListener('online', () => {
document.body.classList.remove('offline');
});
window.addEventListener('offline', () => {
document.body.classList.add('offline');
});
}
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>