-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
176 lines (150 loc) · 4.82 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="name" content="axis3d">
<meta name="version" content="38">
<meta name="revised" content="2024-03-22">
<meta name="copyright" content="Kay Sievers, [email protected]">
<meta name="license" href="LICENSE">
<meta name="rating" content="safe for kids">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Versio Duo – axis3d</title>
<meta name="description" content="3D Orientation">
<link rel="canonical" href="https://versioduo.com/axis3d">
<link rel="source" href="https://github.com/versioduo/axis3d">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="black">
<link rel="icon" href="icons/logo-black.svg" media="(prefers-color-scheme: light)">
<link rel="icon" href="icons/logo.svg" media="(prefers-color-scheme: dark)">
<link rel="manifest" href="site.webmanifest">
<link rel="stylesheet" href="css/bulma.min.css">
<link rel="stylesheet" href="css/bulma-addons.css">
<link rel="stylesheet" href="css/fonts.css">
<link rel="stylesheet" href="css/fontawesome.min.css">
<style>
html {
background-color: black;
scroll-padding-top: 3.25rem;
scroll-behavior: smooth;
overflow: auto;
}
body {
font-family: 'DIN 1451', sans-serif;
color: hsl(0, 0%, 21%);
}
.navbar {
opacity: 95%;
}
section {
background-color: hsl(0, 0%, 92%);
padding: 1rem;
}
section:not(:first-of-type) {
margin-top: 0.25rem;
}
/* Do not mess with the DIN font, fake bold looks really ugly */
.title {
font-weight: 400;
}
.inactive {
pointer-events: none;
}
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.width-label {
width: 6rem;
}
.width-text {
width: 8rem;
}
.width-text-wide {
width: 12rem;
}
.width-number {
width: 4.5rem;
}
.log {
height: 12rem;
overflow: auto;
background-color: white;
padding: 1rem;
}
</style>
</head>
<body class="has-navbar-fixed-top" data-theme="light">
<nav class="navbar is-fixed-top is-black" aria-label="navigation">
<div class="container">
<div class="navbar-brand">
<a class="navbar-home navbar-item is-size-4 pl-4" href="#">
<img src="icons/logo.svg" alt="" style="width: auto; height: 1.5rem;">
<h1 class="ml-3">
axis3d
</h1>
</a>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
<span class="inactive" aria-hidden="true"></span>
<span class="inactive" aria-hidden="true"></span>
<span class="inactive" aria-hidden="true"></span>
</a>
</div>
<div class="navbar-menu">
<div class="navbar-start"></div>
</div>
</div>
</nav>
<script src="js/V2Web.js"></script>
<script src="js/V2Log.js"></script>
<script src="js/V2MIDI.js"></script>
<script src="js/V2MIDISelect.js"></script>
<script src="js/V2Connection.js"></script>
<script src="js/V2Device.js"></script>
<script src="js/gl-matrix-min.js"></script>
<script src="js/V2Axis.js"></script>
<script>
'use strict';
{
// Initialize the menu.
V2Web.setup();
// Early logging init, we don't have a device or the web sections yet, but we already
// record the messages. setup() is called later to attach the device.
const log = new V2Log();
// Read commands from the URL.
const url = new URL(window.location);
// WebUSB exports the link to this site with the USB device name to connect to.
const connect = url.searchParams.get('connect');
if (connect) {
// Remove the command, it is only used for the first connection.
url.searchParams.delete('connect');
window.history.pushState({}, '', url);
}
// Add the sections.
const device = new V2Device(log, connect);
log.setup(device);
// Cache the content for offline operation.
V2Web.registerServiceWorker('service-worker.js', (state, newWorker) => {
// There is no worker during the intial setup.
if (!navigator.serviceWorker.controller)
return;
switch (state) {
case 'installed':
// A new version was installed into the cache and a new worker is waiting to take control.
V2Web.notifyUpdate('A fresh version is available', () => {
newWorker.postMessage({
type: 'skipWaiting'
});
});
break;
case 'activated':
// A new worker took control over the page.
location.reload();
break;
}
});
new V2Axis(device);
}
</script>
</body>
</html>