[add] progress & activity sync with web reader

This commit is contained in:
2023-10-12 19:14:29 -04:00
parent 8ecd6ad57d
commit a972b5a8aa
4 changed files with 1460 additions and 49 deletions

View File

@@ -2,21 +2,12 @@
<html lang="en">
<head>
<link rel="manifest" href="{{ .RelBase }}./manifest.json" />
<meta
name="theme-color"
content="#F3F4F6"
media="(prefers-color-scheme: light)"
/>
<meta
name="theme-color"
content="#1F2937"
media="(prefers-color-scheme: dark)"
/>
<meta name="theme-color" content="#D2B48C" />
<meta charset="utf-8" />
<meta
id="viewport"
name="viewport"
content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
/>
<script src="https://cdn.tailwindcss.com"></script>
<title>Book Manager - {{block "title" .}}{{end}}</title>
@@ -37,10 +28,14 @@
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
#bottom-bar {
padding-bottom: env(safe-area-inset-bottom);
}
</style>
</head>
<body class="bg-gray-100 dark:bg-gray-800">
<main class="relative h-[100dvh] overflow-hidden">
<body class="bg-gray-100 dark:bg-gray-800 h-[100dvh]">
<main class="relative overflow-hidden">
<div
id="top-bar"
class="-top-32 transition-all duration-200 absolute z-10 bg-gray-100 dark:bg-gray-800 flex items-center justify-around w-full h-32 px-2"
@@ -114,7 +109,7 @@
<div
id="bottom-bar"
class="-bottom-24 transition-all duration-200 absolute z-10 bg-gray-100 dark:bg-gray-800 items-center flex h-24 w-full overflow-y-scroll snap-x snap-mandatory no-scrollbar"
class="-bottom-28 transition-all duration-200 absolute z-10 bg-gray-100 dark:bg-gray-800 items-center flex w-full overflow-y-scroll snap-x snap-mandatory no-scrollbar"
>
<div
class="items-center flex flex-col w-screen h-full flex-none snap-center p-2"

View File

@@ -1,6 +1,7 @@
{{template "base.html" .}} {{define "title"}}Reader{{end}} {{define "header"}}
<a href="../">Documents</a>
{{end}} {{define "content"}}
<script src="../../assets/reader/platform.js"></script>
<script src="../../assets/reader/jszip.min.js"></script>
<script src="../../assets/reader/epub.min.js"></script>
<script src="../../assets/reader/index.js"></script>
@@ -8,6 +9,7 @@
<div id="hiddden-viewer" class="hidden"></div>
<script>
let currentReader = new EBookReader("./file", {
id: "{{ .Data.ID }}",
words: {{ .Data.Words }},
pages: {{ .Data.Pages }},
progress: "{{ .Progress }}",