Skip to content

Commit 2ff7e00

Browse files
authored
ezclip v0.1.0
ezclip v0.1.0
1 parent 4289acb commit 2ff7e00

10 files changed

Lines changed: 2334 additions & 0 deletions

assets/icon-1024.png

314 KB
Loading

assets/icon-256.png

47.2 KB
Loading

assets/icon_ios_touch_192.png

20.6 KB
Loading

assets/maskable_icon_x512.png

128 KB
Loading

ezclip-a0768dfce8f32940.js

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

ezclip-a0768dfce8f32940_bg.wasm

5.62 MB
Binary file not shown.

favicon-f402c8741ce815ec.ico

15 KB
Binary file not shown.

index.html

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
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> ezClip </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 '/ezclip-a0768dfce8f32940.js';
16+
const wasm = await init({ module_or_path: '/ezclip-a0768dfce8f32940_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="/" />
27+
28+
<link rel="icon" href="/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="assets/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+
/* Make canvas fill entire document: */
75+
canvas {
76+
margin-right: auto;
77+
margin-left: auto;
78+
display: block;
79+
position: absolute;
80+
top: 0;
81+
left: 0;
82+
width: 100%;
83+
height: 100%;
84+
}
85+
86+
.centered {
87+
margin-right: auto;
88+
margin-left: auto;
89+
display: block;
90+
position: absolute;
91+
top: 50%;
92+
left: 50%;
93+
transform: translate(-50%, -50%);
94+
color: #f0f0f0;
95+
font-size: 24px;
96+
font-family: Ubuntu-Light, Helvetica, sans-serif;
97+
text-align: center;
98+
}
99+
100+
/* ---------------------------------------------- */
101+
/* Loading animation from https://loading.io/css/ */
102+
.lds-dual-ring {
103+
display: inline-block;
104+
width: 24px;
105+
height: 24px;
106+
}
107+
108+
.lds-dual-ring:after {
109+
content: " ";
110+
display: block;
111+
width: 24px;
112+
height: 24px;
113+
margin: 0px;
114+
border-radius: 50%;
115+
border: 3px solid #fff;
116+
border-color: #fff transparent #fff transparent;
117+
animation: lds-dual-ring 1.2s linear infinite;
118+
}
119+
120+
@keyframes lds-dual-ring {
121+
0% {
122+
transform: rotate(0deg);
123+
}
124+
125+
100% {
126+
transform: rotate(360deg);
127+
}
128+
}
129+
</style>
130+
<link rel="modulepreload" href="/ezclip-a0768dfce8f32940.js" crossorigin="anonymous" integrity="sha384-wWO0Wnk5a5odrhaveqG3qbSKfJOnOhm7J7F6UR5bccoAd1TpwiL29cpTiNuPPu4m"><link rel="preload" href="/ezclip-a0768dfce8f32940_bg.wasm" crossorigin="anonymous" integrity="sha384-NAJ6fN8OB59RSYrE69L3njdhnuTREAUgXtAygiVsIXYiQLbiYUngpeWToMlvtdx0" 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+
<!-- the loading spinner will be removed in main.rs -->
138+
<div class="centered" id="loading_text">
139+
<noscript>You need javascript to use this website</noscript>
140+
<p style="font-size:16px">
141+
Loading…
142+
</p>
143+
<div class="lds-dual-ring"></div>
144+
</div>
145+
146+
<!--Register Service Worker. this will cache the wasm / js scripts for offline use (for PWA functionality). -->
147+
<!-- Force refresh (Ctrl + F5) to load the latest files instead of cached files -->
148+
<script>
149+
// We disable caching during development so that we always view the latest version.
150+
if ('serviceWorker' in navigator && window.location.hash !== "#dev") {
151+
window.addEventListener('load', function () {
152+
navigator.serviceWorker.register('sw.js');
153+
});
154+
}
155+
</script>
156+
</body>
157+
158+
</html>
159+
160+
<!-- 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": "ezClip PWA",
3+
"short_name": "ezclip-pwa",
4+
"icons": [
5+
{
6+
"src": "./assets/icon-256.png",
7+
"sizes": "256x256",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "./assets/maskable_icon_x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png",
14+
"purpose": "any maskable"
15+
},
16+
{
17+
"src": "./assets/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+
}

sw.js

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