1
0
Fork 0
mirror of https://github.com/Findus23/HNReader.git synced 2024-09-19 15:23:44 +02:00

more PWA things

This commit is contained in:
Lukas Winkler 2021-04-10 22:23:51 +02:00
parent f01bb84671
commit 015cca2fd7
Signed by: lukas
GPG key ID: 54DE4D798D244853
6 changed files with 34 additions and 3 deletions

BIN
web/public/icon/128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

BIN
web/public/icon/512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

4
web/public/icon/logo.svg Normal file
View file

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 33.87 33.87">
<path fill="#f60" d="M0 0h33.87v33.87H0z"/>
<path d="M10.32 8.47V25.4h2.38v-7.92h8.47v7.92h2.38V8.47h-2.38v6.88H12.7V8.47h-2.38z" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 247 B

View file

@ -4,7 +4,11 @@
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">-->
<link rel="icon apple-touch-icon" type="image/png" sizes="128x128" href="/icon/128.png">
<link rel="icon" type="image/png" sizes="512x512" href="/icon/512.png">
<link rel="apple-touch-icon" type="image/png" sizes="512x512" href="/icon/512.png">
<link rel="apple-touch-startup-image" type="image/png" sizes="512x512" href="/icon/512.png">
<link rel="manifest" href="/manifest.json">-
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Snowpack App</title>
</head>

21
web/public/manifest.json Normal file
View file

@ -0,0 +1,21 @@
{
"$schema": "https://json.schemastore.org/web-manifest.json",
"name": "HNReader",
"background_color": "#FF6600",
"display": "standalone",
"icons": [
{
"src": "/icon/128.png",
"type": "image/png",
"sizes": "128x128"
},
{
"src": "/icon/512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"lang": "en-US",
"scope": "/",
"start_url": "/"
}

View file

@ -13,8 +13,10 @@ export function dateToText(timestamp: number): string {
// inspired by https://github.com/premii/hn/blob/76ba1721f0ca5dead6fe9ac62afdf42911ebc244/a/js/helper.js#L292
const now = Date.now() / 1000
const diff = now - timestamp
if (diff <= 60) {
return diff / 60 + " seconds"
if (diff <= MINUTE) {
const value = absround(diff )
return value + " seconds"
}
if (diff < HOUR) {
const value = absround(diff / MINUTE)