Skip to content

Commit d14a0b8

Browse files
committed
Deploying to gh-pages from @ 8814b4e 🚀
0 parents  commit d14a0b8

9 files changed

Lines changed: 1878 additions & 0 deletions

assets/apple-touch-icon.png

9.17 KB
Loading

assets/favicon-192x192.png

9.82 KB
Loading

assets/favicon-512x512.png

26.5 KB
Loading

eframe_template.js

Lines changed: 1671 additions & 0 deletions
Large diffs are not rendered by default.

eframe_template_bg.wasm

3.86 MB
Binary file not shown.

favicon.ico

15 KB
Binary file not shown.

index.html

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
6+
<!-- Disable zooming: -->
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
8+
9+
<!-- change this to your project name -->
10+
<title>eframe template</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://emilk.github.io/eframe_template/eframe_template.js';
16+
const wasm = await init({ module_or_path: 'https://emilk.github.io/eframe_template/eframe_template_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://emilk.github.io/eframe_template/" />
27+
28+
<link rel="icon" href="https://emilk.github.io/eframe_template/favicon.ico" integrity="sha384-H/sMllKx3oRVji7dIGR2TCCETwjCqXOIm90neNv6wtMTQzSBGDF3c1bDT4V6Mkdc"/>
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
<link rel="manifest" href="manifest.json">
39+
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png">
40+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
41+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#404040">
42+
43+
<style>
44+
html {
45+
/* Remove touch delay: */
46+
touch-action: manipulation;
47+
}
48+
49+
body {
50+
/* Light mode background color for what is not covered by the egui canvas,
51+
or where the egui canvas is translucent. */
52+
background: #909090;
53+
}
54+
55+
@media (prefers-color-scheme: dark) {
56+
body {
57+
/* Dark mode background color for what is not covered by the egui canvas,
58+
or where the egui canvas is translucent. */
59+
background: #404040;
60+
}
61+
}
62+
63+
/* Allow canvas to fill entire web page: */
64+
html,
65+
body {
66+
overflow: hidden;
67+
margin: 0 !important;
68+
padding: 0 !important;
69+
height: 100%;
70+
width: 100%;
71+
}
72+
73+
/* Make canvas fill entire document: */
74+
canvas {
75+
margin-right: auto;
76+
margin-left: auto;
77+
display: block;
78+
position: absolute;
79+
top: 0;
80+
left: 0;
81+
width: 100%;
82+
height: 100%;
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+
</style>
129+
<link rel="modulepreload" href="https://emilk.github.io/eframe_template/eframe_template.js" crossorigin="anonymous" integrity="sha384-sqs/w5iz+I4ElFUB1UwHHCrmq5lksd/H9GkpdZCWejbA2MnUe1ee4dbwywx9Y8IH"><link rel="preload" href="https://emilk.github.io/eframe_template/eframe_template_bg.wasm" crossorigin="anonymous" integrity="sha384-HRsdZXR3WhFqOLr5MyvjGwBpb6GQiYHZU2ga0m60xbBXx+S+jW8Ut7UMF56umrC5" as="fetch" type="application/wasm"></head>
130+
131+
<body>
132+
<!-- The WASM code will resize the canvas dynamically -->
133+
<!-- the id is hardcoded in main.rs . so, make sure both match. -->
134+
<canvas id="the_canvas_id"></canvas>
135+
136+
<!-- the loading spinner will be removed in main.rs -->
137+
<div class="centered" id="loading_text">
138+
<noscript>You need javascript to use this website</noscript>
139+
<p style="font-size:16px">
140+
Loading…
141+
</p>
142+
<div class="lds-dual-ring"></div>
143+
</div>
144+
145+
<!--Register Service Worker. this will cache the wasm / js scripts for offline use (for PWA functionality). -->
146+
<!-- Force refresh (Ctrl + F5) to load the latest files instead of cached files -->
147+
<script>
148+
// We disable caching during development so that we always view the latest version.
149+
if ('serviceWorker' in navigator && window.location.hash !== "#dev") {
150+
window.addEventListener('load', function () {
151+
navigator.serviceWorker.register('sw.js');
152+
});
153+
}
154+
</script>
155+
</body>
156+
157+
</html>
158+
159+
<!-- Powered by egui: https://github.com/emilk/egui/ -->

manifest.json

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

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+
'./eframe_template.js',
6+
'./eframe_template_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)