Skip to content

Commit 4b8fd97

Browse files
committed
Deploying to gh-pages from @ c9f790c 🚀
0 parents  commit 4b8fd97

File tree

6 files changed

+1563
-0
lines changed

6 files changed

+1563
-0
lines changed

favicon-936423c9dbfcadfc.ico

1.12 KB
Binary file not shown.

index.html

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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>whilers</title>
11+
12+
<!-- config for our rust wasm binary. go to https://trunkrs.dev/assets/#rust for more customization -->
13+
14+
<script type="module" nonce="smxl3moVag4CGZunQ3rUXg==">
15+
import init, * as bindings from 'https://jakkos.net/whilers/whilers-5216dfca7702e14d.js';
16+
const wasm = await init('https://jakkos.net/whilers/whilers-5216dfca7702e14d_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://jakkos.net/whilers/" />
27+
28+
<link rel="icon" href="https://jakkos.net/whilers/favicon-936423c9dbfcadfc.ico" integrity="sha384&#x2D;TGvVwWUMT3NbXcb9BTD7BYC6qFlbFbh659p5ntVoOVjWbR9O&#x2F;iLqqbQVYDxTehNj"/>
29+
30+
31+
32+
33+
34+
35+
<link rel="manifest" href="manifest.json">
36+
<link rel="apple-touch-icon" href="icon_ios_touch_192.png">
37+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
38+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#404040">
39+
40+
<style>
41+
html {
42+
/* Remove touch delay: */
43+
touch-action: manipulation;
44+
}
45+
46+
body {
47+
/* Light mode background color for what is not covered by the egui canvas,
48+
or where the egui canvas is translucent. */
49+
background: #909090;
50+
}
51+
52+
@media (prefers-color-scheme: dark) {
53+
body {
54+
/* Dark mode background color for what is not covered by the egui canvas,
55+
or where the egui canvas is translucent. */
56+
background: #404040;
57+
}
58+
}
59+
60+
/* Allow canvas to fill entire web page: */
61+
html,
62+
body {
63+
overflow: hidden;
64+
margin: 0 !important;
65+
padding: 0 !important;
66+
height: 100%;
67+
width: 100%;
68+
}
69+
70+
/* Position canvas in center-top: */
71+
canvas {
72+
margin-right: auto;
73+
margin-left: auto;
74+
display: block;
75+
position: absolute;
76+
top: 0%;
77+
left: 50%;
78+
transform: translate(-50%, 0%);
79+
}
80+
81+
.centered {
82+
margin-right: auto;
83+
margin-left: auto;
84+
display: block;
85+
position: absolute;
86+
top: 50%;
87+
left: 50%;
88+
transform: translate(-50%, -50%);
89+
color: #f0f0f0;
90+
font-size: 24px;
91+
font-family: Ubuntu-Light, Helvetica, sans-serif;
92+
text-align: center;
93+
}
94+
95+
/* ---------------------------------------------- */
96+
/* Loading animation from https://loading.io/css/ */
97+
.lds-dual-ring {
98+
display: inline-block;
99+
width: 24px;
100+
height: 24px;
101+
}
102+
103+
.lds-dual-ring:after {
104+
content: " ";
105+
display: block;
106+
width: 24px;
107+
height: 24px;
108+
margin: 0px;
109+
border-radius: 50%;
110+
border: 3px solid #fff;
111+
border-color: #fff transparent #fff transparent;
112+
animation: lds-dual-ring 1.2s linear infinite;
113+
}
114+
115+
@keyframes lds-dual-ring {
116+
0% {
117+
transform: rotate(0deg);
118+
}
119+
120+
100% {
121+
transform: rotate(360deg);
122+
}
123+
}
124+
125+
</style>
126+
<link rel="modulepreload" href="https://jakkos.net/whilers/whilers-5216dfca7702e14d.js" crossorigin=anonymous integrity="sha384-EV3jPdXUclk8hf21Cunut6Q6N0SMbXeWujf2K4D7d13LBOWm5CG8Nmyy6Yd1lNQ9"><link rel="preload" href="https://jakkos.net/whilers/whilers-5216dfca7702e14d_bg.wasm" crossorigin=anonymous integrity="sha384-JyypF5tUm8JBwJoAaahgyY5x3yGLf+9uXLNh9lDFf3vggBsDwzWAzfJjQ/4wdlAC" as="fetch" type="application/wasm"></head>
127+
128+
<body>
129+
<!-- The WASM code will resize the canvas dynamically -->
130+
<!-- the id is hardcoded in main.rs . so, make sure both match. -->
131+
<canvas id="the_canvas_id"></canvas>
132+
133+
<!--Register Service Worker. this will cache the wasm / js scripts for offline use (for PWA functionality). -->
134+
<!-- Force refresh (Ctrl + F5) to load the latest files instead of cached files -->
135+
<script>
136+
// We disable caching during development so that we always view the latest version.
137+
if ('serviceWorker' in navigator && window.location.hash !== "#dev") {
138+
window.addEventListener('load', function () {
139+
navigator.serviceWorker.register('sw.js');
140+
});
141+
}
142+
</script>
143+
</body>
144+
145+
</html>
146+
147+
<!-- Powered by egui: https://github.com/emilk/egui/ -->

manifest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "whilers PWA",
3+
"short_name": "whilers-pwa",
4+
"lang": "en-US",
5+
"id": "/index.html",
6+
"start_url": "./index.html",
7+
"display": "standalone",
8+
"background_color": "white",
9+
"theme_color": "white"
10+
}

sw.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var cacheName = 'whilers-pwa';
2+
var filesToCache = [
3+
'./',
4+
'./index.html',
5+
'./whilers.js',
6+
'./whilers.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)