-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
75 lines (65 loc) · 2.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
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<head>
<title>loqui</title>
<!-- trunk build drive config -->
<link data-trunk rel="rust" data-type="main" href="Cargo.toml">
<link data-trunk rel="rust" data-type="worker" href="image_worker/Cargo.toml">
<link data-trunk rel="copy-file" href="data/manifest.json">
<link data-trunk rel="copy-file" href="sw.js">
<link data-trunk rel="icon" href="data/loqui.webp">
<link data-trunk rel="copy-file" href="data/loqui.webp">
<!-- PWA manifest -->
<link rel="manifest" href="manifest.json" />
<!-- IOS stuff -->
<meta name="apple-mobile-web-app-status-bar" content="#ec943c" />
<meta name="theme-color" content="#ec943c" />
<style>
html {
/* Remove touch delay: */
touch-action: manipulation;
}
body {
/* Background color for what is not covered by the egui canvas,
or where the egui canvas is translucent. */
background: #404040;
}
/* Allow canvas to fill entire web page: */
html,
body {
overflow: hidden;
margin: 0 !important;
padding: 0 !important;
}
/* Position canvas in center-top: */
canvas {
margin-right: auto;
margin-left: auto;
display: block;
position: absolute;
top: 0%;
left: 50%;
transform: translate(-50%, 0%);
}
</style>
</head>
<body>
<!-- The WASM code will resize this canvas to cover the entire screen -->
<canvas id="egui_canvas"></canvas>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
</body>
</html>