-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmanifest.ts
More file actions
75 lines (70 loc) · 1.84 KB
/
manifest.ts
File metadata and controls
75 lines (70 loc) · 1.84 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { ManifestOptions } from "vite-plugin-pwa";
export const manifest: Partial<ManifestOptions> = {
name: "Othello",
short_name: "Othello",
description: "Play Othello against an AI with this beautiful modern web app.",
id: "othello-web-app",
background_color: "#121212",
theme_color: "#121212",
display: "standalone",
categories: ["games"],
iarc_rating_id: "b5c3da86-e1a0-4f97-86b6-a3f6246c90ff",
related_applications: [
{
platform: "play",
url: "https://play.google.com/store/apps/details?id=app.web.othello_rust.twa",
id: "app.web.othello_rust.twa",
},
{
platform: "windows",
url: "https://www.microsoft.com/store/productId/9N6P75JT9G40",
},
],
icons: getIcons(),
screenshots: getScreenshots(),
};
function getIcons() {
const purposes = ["any", "maskable"];
const sizes = ["192", "512"];
const types = ["png", "webp"];
const icons: { src: string; sizes: string; type: string; purpose: string }[] = [];
for (const purpose of purposes) {
for (const type of types) {
for (const size of sizes) {
icons.push({
src: `icons/${purpose}-${size}.${type}`,
sizes: `${size}x${size}`,
type: `image/${type}`,
purpose: purpose,
});
}
}
icons.push({
src: `icons/${purpose}.svg`,
sizes: "any",
type: "image/svg+xml",
purpose,
});
}
return icons;
}
function getScreenshots() {
return [
...[0, 1, 2, 3, 4, 5].map((id) => {
return {
src: `screenshots/android/${id}.webp`,
sizes: "1080x1920",
type: "image/webp",
platform: "android",
};
}),
...[0, 1, 2, 3, 4, 5].map((id) => {
return {
src: `screenshots/windows/${id}.webp`,
sizes: "2560x1440",
type: "image/webp",
platform: "windows",
};
}),
];
}