-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
40 lines (36 loc) · 1.73 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./icon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;700&display=swap" rel="stylesheet" />
<link rel="manifest" href="./manifest.json" />
<link rel="apple-touch-icon" href="./assets/icon.png" />
<meta name="apple-mobile-web-app-status-bar" content="#151515" />
<meta name="theme-color" content="#138375" />
<title>image-converter</title>
<style>
.index {
display: none;
}
</style>
</head>
<body>
<div id="app"></div>
<label class="index">Convert and compress images saved on your device or from your clipboard. With image-converter,
you can convert image from various formats, and compress or convert them directly on your device.</label>
<script type="module" src="/src/main.ts"></script>
<script>
if ('serviceWorker' in navigator) {
let registration;
const registerServiceWorker = async () => {
registration = await navigator.serviceWorker.register('./service-worker.js', { scope: window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1) });
};
registerServiceWorker();
}
const appVersion = "2.1.0";
fetch("./updatecode.txt", { cache: "no-store" }).then((res) => res.text().then((text) => { if (text.replace("\n", "") !== appVersion) if (confirm(`There's a new version of image-converter. Do you want to update? [${appVersion} --> ${text.replace("\n", "")}]`)) { caches.delete("imageconverter-cache"); location.reload(true); } }).catch((e) => { console.error(e) })).catch((e) => console.error(e));
</script>
</body>
</html>