-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
101 lines (91 loc) · 3.29 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PupperSim</title>
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, max-age=0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
#content img {
max-width: 100%;
height: auto;
}
#content {
text-align: center;
padding: 20px;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/speech-commands"></script>
</head>
<body>
<div id="console"></div>
<script src="index.js"></script>
<div id="content">
<h1>Welcome to PupperSim</h1>
<p>Loading content...</p>
<img src="android-chrome-512x512.png" alt="PupperSim Icon">
</div>
<div id="content">
</div>
<script>
function checkCompatibility() {
// Check for WebGL support
if (!window.WebGLRenderingContext) {
return "Your device does not support WebGL.";
}
// Check for WASM support
if (!('WebAssembly' in window)) {
return "Your browser does not support WebAssembly.";
}
// Check for memory availability (this is a rough estimation)
var isLowMemoryDevice = navigator.deviceMemory && navigator.deviceMemory <= 1; // 1 GB or less
if (navigator.deviceMemory) {
return "Available memory: " + navigator.deviceMemory + "GB";
}
return null; // No issues detected
}
function notifyUserIfIncompatible() {
var compatibilityMessage = checkCompatibility();
if (compatibilityMessage) {
document.getElementById('content').innerHTML = `
<h1>PupperSim</h1>
<p>${compatibilityMessage}</p>
<img src="android-chrome-512x512.png" alt="PupperSim Logo">
`;
} else {
// Load your WebAssembly module and other resources here
// loadWebAssemblyModule();
}
}
function loadWebAssemblyModule() {
// Placeholder function to load your Emscripten-based module
// Replace this with actual code to load and initialize your WASM module
document.getElementById('content').innerHTML = `
<h1>PupperSim</h1>
<p>New favicon!</p>
`;
}
window.onload = notifyUserIfIncompatible;
</script>
</body>
</html>