aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-12-16 01:08:15 +0100
committermetamuffin <metamuffin@disroot.org>2023-12-16 01:08:15 +0100
commitaf99c406af8ee47bee38708cf23e86af826e41ba (patch)
tree23498a36f813454c2edea46906f812d929ba792e /web
parent21b58037c69798e922c5512ea5380943781558ff (diff)
downloadjellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar
jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar.bz2
jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar.zst
watch progress and some draft ui
Diffstat (limited to 'web')
-rw-r--r--web/script/player/mod.ts7
-rw-r--r--web/style/nodepage.css12
2 files changed, 17 insertions, 2 deletions
diff --git a/web/script/player/mod.ts b/web/script/player/mod.ts
index 0d4dc32..85befcc 100644
--- a/web/script/player/mod.ts
+++ b/web/script/player/mod.ts
@@ -153,10 +153,13 @@ function send_player_progress(node_id: string, player: Player) {
const nt = player.video.currentTime
if (t != nt) {
t = nt
- fetch(`/n/${encodeURIComponent(node_id)}/progress?t=${nt}`, { method: "POST" })
+ const start = nt < 1 * 60
+ const end = nt > player.duration.value - 5 * 60
+
+ if (!start) fetch(`/n/${encodeURIComponent(node_id)}/progress?t=${nt}`, { method: "POST" })
+ if (end) fetch(`/n/${encodeURIComponent(node_id)}/watched?state=true`, { method: "POST" })
}
}, 10000)
-
}
function mouse_idle(e: HTMLElement, timeout: number, cb: (b: boolean) => unknown) {
diff --git a/web/style/nodepage.css b/web/style/nodepage.css
index 3829fcd..576e398 100644
--- a/web/style/nodepage.css
+++ b/web/style/nodepage.css
@@ -70,3 +70,15 @@
.props p.federation::before {
content: "link";
}
+.props p.watched {
+ background: rgba(106, 224, 70, 0.522);
+}
+.props p.watched::before {
+ content: "check";
+}
+.props p.progress {
+ background: rgba(225, 255, 58, 0.522);
+}
+.props p.progress::before {
+ content: "pending";
+}