-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
346 lines (312 loc) · 15.9 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lmo distribution explorer</title>
<!-- PyScript -->
<link
rel="stylesheet"
href="https://pyscript.net/releases/2024.3.2/core.css"
crossorigin="anonymous"
>
<script
type="module"
src="https://pyscript.net/releases/2024.3.2/core.js"
crossorigin="anonymous"
></script>
<!-- Bootstrap -->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
rel="stylesheet"
crossorigin="anonymous"
>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
crossorigin="anonymous"
></script>
<!-- Dark mode switcher -->
<script>
/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
*/
(() => {
'use strict'
const getStoredTheme = () => localStorage.getItem('theme')
const setStoredTheme = theme => localStorage.setItem('theme', theme)
const getPreferredTheme = () => {
const storedTheme = getStoredTheme()
if (storedTheme) {
return storedTheme
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
const setTheme = theme => {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
}
setTheme(getPreferredTheme())
const showActiveTheme = (theme, focus = false) => {
const themeSwitcher = document.querySelector('#bd-theme')
if (!themeSwitcher) {
return
}
const themeSwitcherText = document.querySelector('#bd-theme-text')
const activeThemeIcon = document.querySelector('.theme-icon-active use')
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
element.classList.remove('active')
element.setAttribute('aria-pressed', 'false')
})
btnToActive.classList.add('active')
btnToActive.setAttribute('aria-pressed', 'true')
activeThemeIcon.setAttribute('href', svgOfActiveBtn)
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`
themeSwitcher.setAttribute('aria-label', themeSwitcherLabel)
if (focus) {
themeSwitcher.focus()
}
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme())
}
})
window.addEventListener('DOMContentLoaded', () => {
showActiveTheme(getPreferredTheme())
document.querySelectorAll('[data-bs-theme-value]')
.forEach(toggle => {
toggle.addEventListener('click', () => {
const theme = toggle.getAttribute('data-bs-theme-value')
console.log('toggle theme')
setStoredTheme(theme)
setTheme(theme)
showActiveTheme(theme, true)
})
})
})
})()
</script>
<!-- Bootstrap Icons -->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
rel="stylesheet"
crossorigin="anonymous"
>
<!-- Plotly style overrides -->
<style>
.xtick > text,
.ytick > text {
fill: var(--bs-body-color) !important;
}
.xgrid,
.ygrid {
stroke: var(--bs-secondary-bg) !important;
}
.zerolinelayer > .zl {
stroke: var(--bs-border-color) !important;
}
</style>
</head>
<body class="vh-100 d-flex flex-column overflow-x-hidden overflow-y-hidden">
<header>
<nav class="navbar navbar-expand bg-secondary">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img
src="https://jorenham.github.io/Lmo/img/logo.png"
width="30"
height="30"
alt="Lmo"
/>
</a>
<ul class="navbar-nav">
<li class="nav-item col-6 col-lg-auto">
<a
class="nav-link py-2 px-0 px-lg-2"
href="https://github.com/jorenham/Lmo-web"
target="_blank"
rel="noopener"
>
<i class="bi-github"></i>
<small class="d-lg-none ms-2">GitHub</small>
</a>
</li>
<li class="nav-item py-2 py-lg-1 col-12 col-lg-auto">
<div class="vr d-none d-lg-flex h-100 mx-lg-2 text-white"></div>
<hr class="d-lg-none my-2 text-white-50">
</li>
<li class="nav-item dropdown">
<svg xmlns="http://www.w3.org/2000/svg" style="display: none">
<symbol id="circle-half" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
</symbol>
<symbol id="moon-fill" viewBox="0 0 16 16">
<path d="M6 .278a.77.77 0 0 1 .08.858 7.2 7.2 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277q.792-.001 1.533-.16a.79.79 0 0 1 .81.316.73.73 0 0 1-.031.893A8.35 8.35 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.75.75 0 0 1 6 .278"/>
</symbol>
<symbol id="sun-fill" viewBox="0 0 16 16">
<path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
</symbol>
</svg>
<button
class="btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle d-flex align-items-center"
id="bd-theme"
type="button"
aria-expanded="false"
data-bs-toggle="dropdown"
data-bs-display="static"
aria-label="Toggle theme (auto)"
>
<svg class="bi my-1 theme-icon-active" width="16" height="16" fill="currentColor">
<use href="#circle-half"></use>
</svg>
<span class="d-lg-none ms-2" id="bd-theme-text">Toggle theme</span>
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-theme-text">
<li>
<button
type="button"
class="dropdown-item d-flex align-items-center"
data-bs-theme-value="light"
aria-pressed="false"
>
<svg class="bi me-2 opacity-50 theme-icon" width="16" height="16" fill="currentColor">
<use href="#sun-fill"></use>
</svg>
Light
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg>
</button>
</li>
<li>
<button
type="button"
class="dropdown-item d-flex align-items-center"
data-bs-theme-value="dark"
aria-pressed="false"
>
<svg class="bi me-2 opacity-50 theme-icon" width="16" height="16" fill="currentColor">
<use href="#moon-fill"></use>
</svg>
Dark
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg>
</button>
</li>
<li>
<button
type="button"
class="dropdown-item d-flex align-items-center active"
data-bs-theme-value="auto"
aria-pressed="true"
>
<svg class="bi me-2 opacity-50 theme-icon" width="16" height="16" fill="currentColor">
<use href="#circle-half"></use>
</svg>
Auto
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg>
</button>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<main class="container-fluid d-flex p-0 flex-grow-1 w-100">
<aside
class="overflow-y-auto d-flex flex-column flex-shrink-1 bg-secondary-subtle shadow"
style="width: 24rem;"
>
<div id="rv_placeholders" class="p-3 placeholder-glow">
<span class="placeholder placeholder-lg col-10 mb-1"></span>
<span class="col-2 text-muted text-end">(</span>
<span class="placeholder col-3 ms-4 mb-1"></span><br>
<span class="placeholder col-4 ms-4 mb-1"></span><br>
<span class="font-monospace text-muted">).</span>
<span class="placeholder placeholder-lg col-2"></span>
<span class="font-monospace text-muted">()</span>
</div>
<form id="rv" class="p-3 d-none">
<fieldset id="rv_0">
<div class="font-monospace">
<select
id="rv_0_name"
name="rv-0-name"
class="select-rv p-0 m-0 bg-secondary-subtle border-0"
>
</select><span class="text-muted">(</span>
</div>
<div id="rv_0_params" class="ps-4 font-monospace">
<div>
<span class="text-muted">loc =</span>
<span
id="rv_0_params_-2"
contenteditable
class="border-2 border-bottom"
role="textbox"
>0.0</span><span class="text-muted">,</span>
</div>
<div>
<span class="text-muted">scale =</span>
<span
id="rv_0_params_-1"
contenteditable
class="border-2 border-bottom"
role="textbox"
>1.0</span><span class="text-muted">,</span>
</div>
</div>
<div class="font-monospace">
<span
class="text-muted"
>).</span><select
id="rv_0_func"
name="rv-0-func"
class="select-func p-0 m-0 bg-secondary-subtle border-0"
>
</select><span
class="text-muted"
>()</span>
</div>
</fieldset>
</form>
<footer class="d-flex flex-column text-center mt-auto pb-3">
<span class="text-secondary">
Powered by
</span>
<a
href="https://github.com/jorenham/Lmo"
class="link-body-emphasis link-underline-opacity-0 lead"
target="_blank"
>
Lmo
</a>
</footer>
</aside>
<div id="chart" class="w-100"></div>
</main>
<!-- Custom -->
<script
type="py"
src="./main.py"
config="./pyscript.toml"
>
</script>
<!-- MathJax 3 (plotly requirement) -->
<script
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"
crossorigin="anonymous"
></script>
<!-- Plotly.js -->
<script
src="https://cdn.jsdelivr.net/npm/plotly.js-dist@2/plotly.min.js"
crossorigin="anonymous"
></script>
</body>
</html>