Skip to content

Commit d4c22c9

Browse files
committed
add pwa stuff
1 parent b25a168 commit d4c22c9

34 files changed

+306
-7
lines changed

android-chrome-144x144.png

1.65 KB
Loading

android-chrome-192x192.png

2.1 KB
Loading

android-chrome-256x256.png

2.86 KB
Loading

android-chrome-36x36.png

585 Bytes
Loading

android-chrome-384x384.png

4.39 KB
Loading

android-chrome-48x48.png

654 Bytes
Loading

android-chrome-512x512.png

6.32 KB
Loading

android-chrome-72x72.png

871 Bytes
Loading

android-chrome-96x96.png

1.12 KB
Loading

apple-touch-icon-114x114.png

1.04 KB
Loading

apple-touch-icon-120x120.png

1.12 KB
Loading

apple-touch-icon-144x144.png

1.38 KB
Loading

apple-touch-icon-152x152.png

1.28 KB
Loading

apple-touch-icon-180x180.png

1.67 KB
Loading

apple-touch-icon-57x57.png

638 Bytes
Loading

apple-touch-icon-60x60.png

652 Bytes
Loading

apple-touch-icon-72x72.png

738 Bytes
Loading

apple-touch-icon-76x76.png

725 Bytes
Loading

apple-touch-icon.png

1.67 KB
Loading

browserconfig.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/mstile-150x150.png"/>
6+
<TileColor>#000000</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>

favicon-16x16.png

415 Bytes
Loading

favicon-32x32.png

558 Bytes
Loading

favicon.ico

7.23 KB
Binary file not shown.

favicon.png

22.2 KB
Loading

favicon_config.json

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"masterPicture": "favicon.png",
3+
"iconsPath": "/",
4+
"design": {
5+
"ios": {
6+
"pictureAspect": "backgroundAndMargin",
7+
"backgroundColor": "#000000",
8+
"margin": "18%",
9+
"assets": {
10+
"ios6AndPriorIcons": true,
11+
"ios7AndLaterIcons": true,
12+
"precomposedIcons": false,
13+
"declareOnlyDefaultIcon": true
14+
}
15+
},
16+
"desktopBrowser": {
17+
"design": "raw"
18+
},
19+
"windows": {
20+
"pictureAspect": "noChange",
21+
"backgroundColor": "#000000",
22+
"onConflict": "override",
23+
"assets": {
24+
"windows80Ie10Tile": false,
25+
"windows10Ie11EdgeTiles": {
26+
"small": false,
27+
"medium": true,
28+
"big": false,
29+
"rectangle": false
30+
}
31+
}
32+
},
33+
"androidChrome": {
34+
"pictureAspect": "noChange",
35+
"themeColor": "#000000",
36+
"manifest": {
37+
"display": "standalone",
38+
"orientation": "notSet",
39+
"onConflict": "override",
40+
"declared": true
41+
},
42+
"assets": {
43+
"legacyIcon": false,
44+
"lowResolutionIcons": true
45+
}
46+
},
47+
"safariPinnedTab": {
48+
"pictureAspect": "blackAndWhite",
49+
"threshold": 89.21875,
50+
"themeColor": "#000000"
51+
}
52+
},
53+
"settings": {
54+
"compression": 2,
55+
"scalingAlgorithm": "Mitchell",
56+
"errorOnImageTooSmall": false,
57+
"readmeFile": false,
58+
"htmlCodeFile": false,
59+
"usePathAsIs": false
60+
}
61+
}

favicon_data.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"result":{"status":"success"},"favicon":{"package_url":"https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/favicon_package_v0.16.zip","files_urls":["https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-144x144.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-192x192.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-256x256.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-36x36.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-384x384.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-48x48.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-512x512.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-72x72.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/android-chrome-96x96.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-114x114.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-120x120.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-144x144.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-152x152.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-180x180.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-57x57.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-60x60.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-72x72.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon-76x76.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/apple-touch-icon.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/browserconfig.xml","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/favicon-16x16.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/favicon-32x32.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/favicon.ico","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/mstile-150x150.png","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/safari-pinned-tab.svg","https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/package_files/site.webmanifest"],"html_code":"<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/apple-touch-icon.png\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon-32x32.png\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicon-16x16.png\">\n<link rel=\"manifest\" href=\"/site.webmanifest\">\n<link rel=\"mask-icon\" href=\"/safari-pinned-tab.svg\" color=\"#000000\">\n<meta name=\"msapplication-TileColor\" content=\"#000000\">\n<meta name=\"theme-color\" content=\"#000000\">","compression":"true","overlapping_markups":["link[rel=\"apple-touch-icon\"]","link[rel=\"shortcut\"]","link[rel=\"shortcut icon\"]","link[rel=\"icon\",sizes=\"16x16\"]","link[rel=\"icon\",sizes=\"32x32\"]","meta[name=\"msapplication-TileColor\"]","link[rel=\"manifest\"]","meta[name=\"theme-color\"]","link[rel=\"mask-icon\"]"]},"files_location":{"type":"path","path":"/"},"preview_picture_url":"https://realfavicongenerator.net/files/b5f3f4e8580c1ac3b67001cea26c00c59e514193/favicon_preview.png","version":"0.16"}

index.html

+42-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,48 @@
11
<!DOCTYPE html>
22
<html lang="en-us">
33
<head>
4-
<title>QuTiP Virtual Lab</title>
5-
<!-- Required meta tags -->
6-
<meta charset="utf-8" />
7-
<meta
8-
name="viewport"
9-
content="width=device-width, initial-scale=1"
10-
/>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6+
<title>QuTiP Virtual Lab</title>
7+
<link rel="canonical" href="https://qutip.org/qutip-virtual-lab" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
10+
<!-- Icons and Colors -->
11+
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png">
12+
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">
13+
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">
14+
<link rel="manifest" href="./manifest.json">
15+
<link rel="mask-icon" href="./safari-pinned-tab.svg" color="#000000">
16+
<link rel="shortcut icon" href="./favicon.ico">
17+
<meta name="msapplication-TileColor" content="#000000">
18+
<meta name="msapplication-TileImage" content="./mstile-144x144.png">
19+
<meta name="msapplication-config" content="./browserconfig.xml">
20+
<meta name="theme-color" content="#000000">
21+
22+
<!-- SEO and Social Sharing and SEO -->
23+
<meta name="description" content="Explore simple quantum systems with QuTiP" />
24+
<meta name="robots" content="noodp" />
25+
<meta property="og:locale" content="en_US" />
26+
<meta property="og:type" content="website" />
27+
<meta property="og:title" content="QuTiP Virtual Lab" />
28+
<meta property="og:description" content="Explore simple quantum systems with QuTiP" />
29+
<meta property="og:url" content="https://qutip.org/qutip-virtual-lab" />
30+
<meta property="og:site_name" content="QuTiP Virtual Lab" />
31+
<meta property="section:publisher" content="https://www.facebook.com/simplepwa/" />
32+
<meta property="og:image" content="https://qutip.org/qutip-virtual-lab/share.jpg" />
33+
<meta name="twitter:card" content="summary_large_image" />
34+
<meta name="twitter:title" content="QuTiP Virtual Lab" />
35+
<meta name="twitter:description" content="Explore simple quantum systems with QuTiP" />
36+
<meta name="twitter:image" content="https://qutip.org/qutip-virtual-lab/share.jpg" />
37+
38+
<!-- Javscript -->
39+
<script>
40+
if ("serviceWorker" in navigator) {
41+
window.addEventListener("load", () => {
42+
navigator.serviceWorker && navigator.serviceWorker.register("./sw.js");
43+
});
44+
}
45+
</script>
1146
</head>
1247

1348
<body>

manifest.json

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"name": "Simple PWA",
3+
"short_name": "Simple PWA",
4+
"display": "standalone",
5+
"start_url": "./?utm_source=pwa_install",
6+
"scope": ".",
7+
"theme_color": "#000",
8+
"background_color": "#000",
9+
"icons":[
10+
{
11+
"src": "android-chrome-36x36.png",
12+
"sizes": "36x36",
13+
"type": "image/png"
14+
},
15+
{
16+
"src": "android-chrome-48x48.png",
17+
"sizes": "48x48",
18+
"type": "image/png"
19+
},
20+
{
21+
"src": "android-chrome-72x72.png",
22+
"sizes": "72x72",
23+
"type": "image/png"
24+
},
25+
{
26+
"src": "android-chrome-96x96.png",
27+
"sizes": "96x96",
28+
"type": "image/png"
29+
},
30+
{
31+
"src": "android-chrome-144x144.png",
32+
"sizes": "144x144",
33+
"type": "image/png"
34+
},
35+
{
36+
"src": "android-chrome-192x192.png",
37+
"sizes": "192x192",
38+
"type": "image/png"
39+
},
40+
{
41+
"src": "android-chrome-256x256.png",
42+
"sizes": "256x256",
43+
"type": "image/png"
44+
},
45+
{
46+
"src": "android-chrome-384x384.png",
47+
"sizes": "384x384",
48+
"type": "image/png"
49+
},
50+
{
51+
"src": "android-chrome-512x512.png",
52+
"sizes": "512x512",
53+
"type": "image/png"
54+
},
55+
{
56+
"src": "maskable_icon.png",
57+
"sizes": "650x650",
58+
"type": "image/png",
59+
"purpose": "maskable"
60+
}
61+
]
62+
}

mstile-150x150.png

1.3 KB
Loading

robots.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
User-agent: *
2+
Disallow: /.git
3+
Allow: /
4+
5+
Sitemap: https://simplepwa.com/sitemap.xml

safari-pinned-tab.svg

+34
Loading

share.jpg

36.4 KB
Loading

sitemap.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
4+
5+
<url>
6+
<loc>https://qutip.org/qutip-virtual-lab/</loc>
7+
<lastmod>2020-08-22</lastmod>
8+
</url>
9+
10+
</urlset>

sw.js

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
const cacheName = "cache1"; // Change value to force update
2+
3+
self.addEventListener("install", event => {
4+
// Kick out the old service worker
5+
self.skipWaiting();
6+
7+
event.waitUntil(
8+
caches.open(cacheName).then(cache => {
9+
return cache.addAll([
10+
"/",
11+
"android-chrome-36x36.png", // Favicon, Android Chrome M39+ with 0.75 screen density
12+
"android-chrome-48x48.png", // Favicon, Android Chrome M39+ with 1.0 screen density
13+
"android-chrome-72x72.png", // Favicon, Android Chrome M39+ with 1.5 screen density
14+
"android-chrome-96x96.png", // Favicon, Android Chrome M39+ with 2.0 screen density
15+
"android-chrome-144x144.png", // Favicon, Android Chrome M39+ with 3.0 screen density
16+
"android-chrome-192x192.png", // Favicon, Android Chrome M39+ with 4.0 screen density
17+
"android-chrome-256x256.png", // Favicon, Android Chrome M47+ Splash screen with 1.5 screen density
18+
"android-chrome-384x384.png", // Favicon, Android Chrome M47+ Splash screen with 3.0 screen density
19+
"android-chrome-512x512.png", // Favicon, Android Chrome M47+ Splash screen with 4.0 screen density
20+
"apple-touch-icon.png", // Favicon, Apple default
21+
"apple-touch-icon-57x57.png", // Apple iPhone, Non-retina with iOS6 or prior
22+
"apple-touch-icon-60x60.png", // Apple iPhone, Non-retina with iOS7
23+
"apple-touch-icon-72x72.png", // Apple iPad, Non-retina with iOS6 or prior
24+
"apple-touch-icon-76x76.png", // Apple iPad, Non-retina with iOS7
25+
"apple-touch-icon-114x114.png", // Apple iPhone, Retina with iOS6 or prior
26+
"apple-touch-icon-120x120.png", // Apple iPhone, Retina with iOS7
27+
"apple-touch-icon-144x144.png", // Apple iPad, Retina with iOS6 or prior
28+
"apple-touch-icon-152x152.png", // Apple iPad, Retina with iOS7
29+
"apple-touch-icon-180x180.png", // Apple iPhone 6 Plus with iOS8
30+
"browserconfig.xml", // IE11 icon configuration file
31+
"favicon.ico", // Favicon, IE and fallback for other browsers
32+
"favicon-16x16.png", // Favicon, default
33+
"favicon-32x32.png", // Favicon, Safari on Mac OS
34+
"index.html", // Main HTML file
35+
"logo.png", // Logo
36+
"main.js", // Main Javascript file
37+
"manifest.json", // Manifest file
38+
"maskable_icon.png", // Favicon, maskable https://web.dev/maskable-icon
39+
"mstile-70x70.png", // Favicon, Windows 8 / IE11
40+
"mstile-144x144.png", // Favicon, Windows 8 / IE10
41+
"mstile-150x150.png", // Favicon, Windows 8 / IE11
42+
"mstile-310x150.png", // Favicon, Windows 8 / IE11
43+
"mstile-310x310.png", // Favicon, Windows 8 / IE11
44+
"safari-pinned-tab.svg", // Favicon, Safari pinned tab
45+
"share.jpg", // Social media sharing
46+
"style.css", // Main CSS file
47+
]);
48+
})
49+
);
50+
});
51+
52+
self.addEventListener("activate", event => {
53+
// Delete any non-current cache
54+
event.waitUntil(
55+
caches.keys().then(keys => {
56+
Promise.all(
57+
keys.map(key => {
58+
if (![cacheName].includes(key)) {
59+
return caches.delete(key);
60+
}
61+
})
62+
)
63+
})
64+
);
65+
});
66+
67+
// Offline-first, cache-first strategy
68+
// Kick off two asynchronous requests, one to the cache and one to the network
69+
// If there's a cached version available, use it, but fetch an update for next time.
70+
// Gets data on screen as quickly as possible, then updates once the network has returned the latest data.
71+
self.addEventListener("fetch", event => {
72+
event.respondWith(
73+
caches.open(cacheName).then(cache => {
74+
return cache.match(event.request).then(response => {
75+
return response || fetch(event.request).then(networkResponse => {
76+
cache.put(event.request, networkResponse.clone());
77+
return networkResponse;
78+
});
79+
})
80+
})
81+
);
82+
});

0 commit comments

Comments
 (0)