Update service-worker, show tag
This commit is contained in:
rodič
f2bf563640
revize
8ac8bced5b
|
@ -21,6 +21,7 @@
|
|||
"postcss": "^8.4.21",
|
||||
"prettier": "^2.8.3",
|
||||
"prettier-plugin-svelte": "^2.9.0",
|
||||
"s-offline": "^0.5.1",
|
||||
"svelte": "^3.55.1",
|
||||
"svelte-markdown": "^0.2.3",
|
||||
"tailwindcss": "^3.2.4",
|
||||
|
@ -2068,6 +2069,12 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ping.js": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ping.js/-/ping.js-0.3.0.tgz",
|
||||
"integrity": "sha512-qisFwio7j0cwYbOcRL4BlTdxKALcpGPTkpl8ichGASgkrVqfI3sZfQDsP8wETR5rfutXZJLjlJ117aLkRnk2mA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
|
||||
|
@ -2411,6 +2418,23 @@
|
|||
"queue-microtask": "^1.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/s-offline": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/s-offline/-/s-offline-0.5.1.tgz",
|
||||
"integrity": "sha512-CD8OWW87Y2XYbPYqfKgeHF/4yv33A2RFrcD8stgxuL+QI+ydMcMTX6CtA6SRlbhAMKScwhvXCXDxBcwk4hqiPw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ping.js": "^0.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0",
|
||||
"npm": ">=9.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"ping.js": "^0.3.0",
|
||||
"svelte": "^3.53.1"
|
||||
}
|
||||
},
|
||||
"node_modules/sade": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
"postcss": "^8.4.21",
|
||||
"prettier": "^2.8.3",
|
||||
"prettier-plugin-svelte": "^2.9.0",
|
||||
"s-offline": "^0.5.1",
|
||||
"svelte": "^3.55.1",
|
||||
"svelte-markdown": "^0.2.3",
|
||||
"tailwindcss": "^3.2.4",
|
||||
|
|
|
@ -55,8 +55,9 @@
|
|||
href="https://github.com/utxo-foundation/prague-blockchain-week/commits/main"
|
||||
target="_blank"
|
||||
class="underline hover:no-underline"
|
||||
>{formatDistanceToNow(new Date(bundle.time))} ago</a
|
||||
>{formatDistanceToNow(new Date(bundle.__time || null))} ago</a
|
||||
>
|
||||
({bundle.__tag})
|
||||
|
|
||||
<a
|
||||
href="https://analytics.gwei.cz/explore.prgblockweek.com"
|
||||
|
|
|
@ -12,7 +12,8 @@ export const config = {
|
|||
speakers: {
|
||||
title: 'Speakers',
|
||||
model: 'speaker',
|
||||
img: 'photoUrl'
|
||||
img: 'photoUrl',
|
||||
virtual: true
|
||||
},
|
||||
'media-partners': {
|
||||
title: 'Media Partners & Communities',
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
import { page } from '$app/stores';
|
||||
import '../app.css';
|
||||
import DarkModeToggle from '$lib/components/DarkModeToggle.svelte';
|
||||
import { SOffline } from 's-offline';
|
||||
|
||||
const handleNetworkChange = (status) => {
|
||||
console.log('event details: ', status);
|
||||
};
|
||||
|
||||
$: homepage =
|
||||
!$page.params.type &&
|
||||
|
@ -12,7 +17,31 @@
|
|||
</script>
|
||||
|
||||
<div class="w-full h-full bg-pbw-red">
|
||||
<div class="flex max-w-7xl items-right justify-end p-2 m-auto h-[50px] -mb-[30px]">
|
||||
<div
|
||||
class="flex gap-4 max-w-7xl items-center justify-end p-2 m-auto h-[50px] -mb-[30px] text-white"
|
||||
>
|
||||
<div class="my-auto">
|
||||
{#if typeof window !== 'undefined'}
|
||||
<SOffline pingUrl="https://x.gwei.cz/" on:detectedCondition={handleNetworkChange}>
|
||||
<span slot="online" class="flex gap-2 items-center text-pbw-yellow">
|
||||
<div>
|
||||
<svg class="w-2" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="50" cy="50" r="50" fill="rgb(255 222 89)" />
|
||||
</svg>
|
||||
</div>
|
||||
<div>Online</div>
|
||||
</span>
|
||||
<span slot="offline" class="flex gap-2 items-center text-red-300">
|
||||
<div>
|
||||
<svg class="w-2" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="50" cy="50" r="50" fill="rgb(252 165 165)" />
|
||||
</svg>
|
||||
</div>
|
||||
<div>Offline</div>
|
||||
</span>
|
||||
</SOffline>
|
||||
{/if}
|
||||
</div>
|
||||
<DarkModeToggle />
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,13 +1,29 @@
|
|||
import { build, files, version } from '$service-worker';
|
||||
import data from '$lib/data.json' assert { type: 'json' };
|
||||
import { config } from '$lib/pbw.js';
|
||||
|
||||
// Create a unique cache name for this deployment
|
||||
const CACHE = `cache-${version}`;
|
||||
|
||||
const images = [];
|
||||
for (const col in config.collections) {
|
||||
if (config.collections[col].virtual) continue;
|
||||
images.push(...data[col].map((x) => x.logo || x.photoUrl || x.photo).filter((e) => e));
|
||||
}
|
||||
for (const ev of data.events) {
|
||||
if (ev.speakers) {
|
||||
images.push(...ev.speakers.map((s) => s.photoUrl).filter((x) => x));
|
||||
}
|
||||
}
|
||||
|
||||
const ASSETS = [
|
||||
...build, // the app itself
|
||||
...files // everything in `static`
|
||||
...files, // everything in `static`
|
||||
...images
|
||||
];
|
||||
|
||||
console.log(ASSETS);
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
// Create a new cache and add all files to it
|
||||
async function addFilesToCache() {
|
||||
|
|
Načítá se…
Odkázat v novém úkolu