Add Start/End work transitions, capture field, and PWA support
This commit is contained in:
BIN
static/icon-192.png
Normal file
BIN
static/icon-192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
BIN
static/icon-512-maskable.png
Normal file
BIN
static/icon-512-maskable.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
static/icon-512.png
Normal file
BIN
static/icon-512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
29
static/manifest.webmanifest
Normal file
29
static/manifest.webmanifest
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "Org Web Adapter",
|
||||
"short_name": "OrgWeb",
|
||||
"description": "Browse, edit, and capture notes in your Org files.",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"background_color": "#0f1720",
|
||||
"theme_color": "#0f1720",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/static/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/static/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/static/icon-512-maskable.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -386,6 +386,43 @@ main h2 {
|
||||
filter: brightness(1.08);
|
||||
}
|
||||
|
||||
.capture-form {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
margin: 0 0 0.8rem;
|
||||
}
|
||||
|
||||
.capture-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 0.55rem 0.75rem;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 0.55rem;
|
||||
background: var(--panel);
|
||||
color: var(--ink);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.capture-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.capture-btn {
|
||||
border: 1px solid var(--accent);
|
||||
border-radius: 0.55rem;
|
||||
background: var(--accent);
|
||||
color: #ffffff;
|
||||
padding: 0.5rem 0.95rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.capture-btn:hover {
|
||||
filter: brightness(1.08);
|
||||
}
|
||||
|
||||
|
||||
.org-content {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
@ -618,9 +655,15 @@ body[data-theme="dark"] .webhook-send-btn.webhook-sent {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
main {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
nav {
|
||||
order: 2;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--line);
|
||||
border-bottom: none;
|
||||
border-top: 1px solid var(--line);
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@ -631,6 +674,7 @@ body[data-theme="dark"] .webhook-send-btn.webhook-sent {
|
||||
}
|
||||
|
||||
.backlinks-pane {
|
||||
order: 3;
|
||||
border-left: none;
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
|
||||
53
static/sw.js
Normal file
53
static/sw.js
Normal file
@ -0,0 +1,53 @@
|
||||
const CACHE = "orgweb-v1";
|
||||
const PRECACHE = [
|
||||
"/",
|
||||
"/static/style.css",
|
||||
"/static/manifest.webmanifest",
|
||||
"/static/icon-192.png",
|
||||
"/static/icon-512.png",
|
||||
"/static/icon-512-maskable.png",
|
||||
];
|
||||
|
||||
self.addEventListener("install", (event) => {
|
||||
event.waitUntil(
|
||||
caches
|
||||
.open(CACHE)
|
||||
.then((cache) => cache.addAll(PRECACHE))
|
||||
.then(() => self.skipWaiting())
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil(
|
||||
caches
|
||||
.keys()
|
||||
.then((keys) =>
|
||||
Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
|
||||
)
|
||||
.then(() => self.clients.claim())
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
const url = new URL(event.request.url);
|
||||
if (url.origin !== location.origin) return;
|
||||
|
||||
if (event.request.mode === "navigate") {
|
||||
event.respondWith(
|
||||
fetch(event.request).catch(() => caches.match("/"))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
event.respondWith(
|
||||
caches.match(event.request).then(
|
||||
(cached) =>
|
||||
cached ||
|
||||
fetch(event.request).then((resp) => {
|
||||
const copy = resp.clone();
|
||||
caches.open(CACHE).then((cache) => cache.put(event.request, copy));
|
||||
return resp;
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user