-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
55 lines (46 loc) · 1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>lullaby.cafe</title>
</head>
<body>
<script>
function getDeviceInformation() {
const deviceInfo = {
deviceType: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'Mobile' : 'Desktop',
operatingSystem: navigator.platform,
browserVersion: navigator.userAgent,
gpu: getGPUInfo(),
screenResolution: `${screen.width}x${screen.height}`,
platform: navigator.platform,
referrer: document.referrer || 'Unknown'
};
return deviceInfo;
}
function getGPUInfo() {
const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (!gl) {
return 'N/A';
}
const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
return debugInfo ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : 'N/A';
}
function sendDeviceInfo() {
const deviceInfo = getDeviceInformation();
fetch('info.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(deviceInfo)
}).then(() => {
window.location.href = 'https://lullaby.cafe';
});
}
sendDeviceInfo();
</script>
</body>
</html>