main
html 30 lines 1.36 KB
Raw
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6 <title>HFS Admin-panel</title>
7 <script type="module" src="/src/index.ts"></script>
8 <link rel="icon" type="image/svg+xml" href="/hfs-logo-icon.svg" />
9 <link href="../frontend/fontello.css" rel="stylesheet" />
10 <link href="/flags/freakflags.css" rel="stylesheet" />
11 <link href="../frontend/fontello.woff2" rel="prefetch" />
12 </head>
13 <body>
14 <style class="removeAtBoot">@media (prefers-color-scheme: dark) { html { background-color: #000; color: #888; } }</style>
15 <div id="root">Loading... <span id="loadingPerc"/></div>
16 <script nomodule>document.getElementById('root').innerText = "Please use a newer browser"</script>
17 <script>
18 (function(){ // legacy way to not pollute global scope
19 const total = 2600*1000 // no need to be precise, but stay on the abundant side
20 const t = setInterval(function() {
21 const e = document.getElementById('loadingPerc')
22 if (!e) // when load is complete the element will be removed
23 return clearInterval(t)
24 const v = performance.getEntriesByType('resource').reduce((acc, res) => acc + (res.transferSize || 0), 0)
25 e.innerText = Math.min(100, Math.round(v / total * 100)) + '%'
26 }, 200)
27 })()
28 </script>
29 </body>
30 </html>