Skip to content

Commit 1130f2e

Browse files
committed
Deploying to gh-pages from @ d7b80b1 🚀
0 parents  commit 1130f2e

10 files changed

Lines changed: 1604 additions & 0 deletions

favicon-f402c8741ce815ec.ico

15 KB
Binary file not shown.

icon-1024.png

314 KB
Loading

icon-256.png

47.2 KB
Loading

icon_ios_touch_192.png

20.6 KB
Loading

index.html

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4+
5+
<!-- Disable zooming: -->
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
7+
8+
<head>
9+
<!-- change this to your project name -->
10+
<title>Ti:Sapphire Harmonic Generator Crystal Calculator</title>
11+
12+
<!-- config for our rust wasm binary. go to https://trunkrs.dev/assets/#rust for more customization -->
13+
14+
<script type="module">
15+
import init, * as bindings from 'https://rims-code.github.io/crystal_angle/tisa_xtal_calculator-aff65b60ca501e0d.js';
16+
const wasm = await init('https://rims-code.github.io/crystal_angle/tisa_xtal_calculator-aff65b60ca501e0d_bg.wasm');
17+
18+
19+
window.wasmBindings = bindings;
20+
21+
22+
dispatchEvent(new CustomEvent("TrunkApplicationStarted", {detail: {wasm}}));
23+
24+
</script>
25+
<!-- this is the base url relative to which other urls will be constructed. trunk will insert this from the public-url option -->
26+
<base href="https://rims-code.github.io/crystal_angle/" />
27+
28+
<link rel="icon" href="https://rims-code.github.io/crystal_angle/favicon-f402c8741ce815ec.ico" integrity="sha384-jNOAE6jgE03LznIulCTVP6BH4NrTuROFjP9wj8bV1UUMJKtZAvstFpIAP3PDcFpx"/>
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
<link rel="manifest" href="manifest.json">
40+
<link rel="apple-touch-icon" href="icon_ios_touch_192.png">
41+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
42+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#404040">
43+
44+
<style>
45+
html {
46+
/* Remove touch delay: */
47+
touch-action: manipulation;
48+
}
49+
50+
body {
51+
/* Light mode background color for what is not covered by the egui canvas,
52+
or where the egui canvas is translucent. */
53+
background: #909090;
54+
}
55+
56+
@media (prefers-color-scheme: dark) {
57+
body {
58+
/* Dark mode background color for what is not covered by the egui canvas,
59+
or where the egui canvas is translucent. */
60+
background: #404040;
61+
}
62+
}
63+
64+
/* Allow canvas to fill entire web page: */
65+
html,
66+
body {
67+
overflow: hidden;
68+
margin: 0 !important;
69+
padding: 0 !important;
70+
height: 100%;
71+
width: 100%;
72+
}
73+
74+
/* Position canvas in center-top: */
75+
canvas {
76+
margin-right: auto;
77+
margin-left: auto;
78+
display: block;
79+
position: absolute;
80+
top: 0%;
81+
left: 50%;
82+
transform: translate(-50%, 0%);
83+
}
84+
85+
.centered {
86+
margin-right: auto;
87+
margin-left: auto;
88+
display: block;
89+
position: absolute;
90+
top: 50%;
91+
left: 50%;
92+
transform: translate(-50%, -50%);
93+
color: #f0f0f0;
94+
font-size: 24px;
95+
font-family: Ubuntu-Light, Helvetica, sans-serif;
96+
text-align: center;
97+
}
98+
99+
/* ---------------------------------------------- */
100+
/* Loading animation from https://loading.io/css/ */
101+
.lds-dual-ring {
102+
display: inline-block;
103+
width: 24px;
104+
height: 24px;
105+
}
106+
107+
.lds-dual-ring:after {
108+
content: " ";
109+
display: block;
110+
width: 24px;
111+
height: 24px;
112+
margin: 0px;
113+
border-radius: 50%;
114+
border: 3px solid #fff;
115+
border-color: #fff transparent #fff transparent;
116+
animation: lds-dual-ring 1.2s linear infinite;
117+
}
118+
119+
@keyframes lds-dual-ring {
120+
0% {
121+
transform: rotate(0deg);
122+
}
123+
124+
100% {
125+
transform: rotate(360deg);
126+
}
127+
}
128+
129+
</style>
130+
<link rel="modulepreload" href="https://rims-code.github.io/crystal_angle/tisa_xtal_calculator-aff65b60ca501e0d.js" crossorigin="anonymous" integrity="sha384-ST6Yy2OkoJm4Gcz05DKXgN6lKyFa2QIqoNcSAb4TPjBpzHQrPOvvCORzMsyMf3zb"><link rel="preload" href="https://rims-code.github.io/crystal_angle/tisa_xtal_calculator-aff65b60ca501e0d_bg.wasm" crossorigin="anonymous" integrity="sha384-JBa7ouQhLy3LLF3osu5OMfJSQWLrhj3cOH/P32ictvRznc0GnxvNoUEwkQyvD/zm" as="fetch" type="application/wasm"></head>
131+
132+
<body>
133+
<!-- The WASM code will resize the canvas dynamically -->
134+
<!-- the id is hardcoded in main.rs . so, make sure both match. -->
135+
<canvas id="the_canvas_id"></canvas>
136+
137+
<!--Register Service Worker. this will cache the wasm / js scripts for offline use (for PWA functionality). -->
138+
<!-- Force refresh (Ctrl + F5) to load the latest files instead of cached files -->
139+
<script>
140+
// We disable caching during development so that we always view the latest version.
141+
if ('serviceWorker' in navigator && window.location.hash !== "#dev") {
142+
window.addEventListener('load', function () {
143+
navigator.serviceWorker.register('sw.js');
144+
});
145+
}
146+
</script>
147+
</body>
148+
149+
</html>
150+
151+
<!-- Powered by egui: https://github.com/emilk/egui/ -->

manifest.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "egui Template PWA",
3+
"short_name": "egui-template-pwa",
4+
"icons": [
5+
{
6+
"src": "./icon-256.png",
7+
"sizes": "256x256",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "./maskable_icon_x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png",
14+
"purpose": "any maskable"
15+
},
16+
{
17+
"src": "./icon-1024.png",
18+
"sizes": "1024x1024",
19+
"type": "image/png"
20+
}
21+
],
22+
"lang": "en-US",
23+
"id": "/index.html",
24+
"start_url": "./index.html",
25+
"display": "standalone",
26+
"background_color": "white",
27+
"theme_color": "white"
28+
}

maskable_icon_x512.png

128 KB
Loading

sw.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var cacheName = 'egui-template-pwa';
2+
var filesToCache = [
3+
'./',
4+
'./index.html',
5+
'./tisa_xtal_calculator.js',
6+
'./tisa_xtal_calculator_bg.wasm',
7+
];
8+
9+
/* Start the service worker and cache all of the app's content */
10+
self.addEventListener('install', function (e) {
11+
e.waitUntil(
12+
caches.open(cacheName).then(function (cache) {
13+
return cache.addAll(filesToCache);
14+
})
15+
);
16+
});
17+
18+
/* Serve cached content when offline */
19+
self.addEventListener('fetch', function (e) {
20+
e.respondWith(
21+
caches.match(e.request).then(function (response) {
22+
return response || fetch(e.request);
23+
})
24+
);
25+
});

0 commit comments

Comments
 (0)