Tighten novella reader page chrome
This commit is contained in:
parent
17a1eb9ddc
commit
cfdbaea6f3
6 changed files with 25 additions and 79 deletions
|
|
@ -25,19 +25,28 @@ export const defaultContentPageLayout: PageLayout = {
|
|||
showCurrentPage: false,
|
||||
showRoot: false,
|
||||
}),
|
||||
condition: (page) => page.fileData.slug !== "index",
|
||||
condition: (page) => page.fileData.slug !== "index" && page.fileData.slug !== "Fiction/The-Burden-of-Proof",
|
||||
}),
|
||||
Component.ConditionalRender({
|
||||
component: Component.ArticleTitle(),
|
||||
condition: (page) => !page.fileData.slug?.endsWith("/index") && page.fileData.slug !== "index",
|
||||
condition: (page) =>
|
||||
!page.fileData.slug?.endsWith("/index") &&
|
||||
page.fileData.slug !== "index" &&
|
||||
page.fileData.slug !== "Fiction/The-Burden-of-Proof",
|
||||
}),
|
||||
Component.ConditionalRender({
|
||||
component: AetheriaAuthorMeta(),
|
||||
condition: (page) => !page.fileData.slug?.endsWith("/index") && page.fileData.slug !== "index",
|
||||
condition: (page) =>
|
||||
!page.fileData.slug?.endsWith("/index") &&
|
||||
page.fileData.slug !== "index" &&
|
||||
page.fileData.slug !== "Fiction/The-Burden-of-Proof",
|
||||
}),
|
||||
Component.ConditionalRender({
|
||||
component: Component.ContentMeta(),
|
||||
condition: (page) => !page.fileData.slug?.endsWith("/index") && page.fileData.slug !== "index",
|
||||
condition: (page) =>
|
||||
!page.fileData.slug?.endsWith("/index") &&
|
||||
page.fileData.slug !== "index" &&
|
||||
page.fileData.slug !== "Fiction/The-Burden-of-Proof",
|
||||
}),
|
||||
Component.ConditionalRender({
|
||||
component: AetheriaEpubReader(),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export default (() => {
|
|||
const AetheriaEpubReader: QuartzComponent = () => (
|
||||
<section
|
||||
class="aetheria-epub-reader"
|
||||
data-epub-src="/static/fiction/the-burden-of-proof.epub?v=reader-pages-2"
|
||||
data-epub-src="/static/fiction/the-burden-of-proof.epub?v=reader-native-pages-1"
|
||||
aria-label="The Burden of Proof ebook reader"
|
||||
>
|
||||
<div class="aetheria-reader-heading">
|
||||
|
|
@ -32,7 +32,7 @@ export default (() => {
|
|||
</label>
|
||||
<label>
|
||||
<span>Spread</span>
|
||||
<select data-reader-setting="spread"><option value="none">Single</option><option value="auto">Auto</option></select>
|
||||
<select data-reader-setting="spread"><option value="none">Single</option><option value="always">Two Pages</option></select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Theme</span>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ type ReaderSettings = {
|
|||
fontSize: number
|
||||
lineHeight: number
|
||||
flow: "paginated" | "scrolled-doc"
|
||||
spread: "auto" | "none"
|
||||
spread: "always" | "none"
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
|
@ -17,7 +17,7 @@ declare global {
|
|||
}
|
||||
|
||||
const cookieName = "aetheria_tbp_reader"
|
||||
const settingsVersion = 3
|
||||
const settingsVersion = 4
|
||||
const defaults: ReaderSettings = {
|
||||
version: settingsVersion,
|
||||
theme: "dark",
|
||||
|
|
@ -41,7 +41,7 @@ function readSettings(): ReaderSettings {
|
|||
fontSize: Number.isFinite(saved.fontSize) ? Math.min(150, Math.max(80, saved.fontSize)) : defaults.fontSize,
|
||||
lineHeight: Number.isFinite(saved.lineHeight) ? Math.min(210, Math.max(130, saved.lineHeight)) : defaults.lineHeight,
|
||||
flow: ["paginated", "scrolled-doc"].includes(saved.flow) ? saved.flow : defaults.flow,
|
||||
spread: saved.version === settingsVersion && ["auto", "none"].includes(saved.spread) ? saved.spread : defaults.spread,
|
||||
spread: saved.version === settingsVersion && ["always", "none"].includes(saved.spread) ? saved.spread : defaults.spread,
|
||||
}
|
||||
} catch {
|
||||
return { ...defaults }
|
||||
|
|
@ -112,12 +112,6 @@ async function initReader(root: HTMLElement) {
|
|||
viewport.style.width = "100%"
|
||||
viewport.style.maxWidth = "100%"
|
||||
viewport.style.overflow = "hidden"
|
||||
viewport.querySelectorAll<HTMLElement>(".epub-container, .epub-view, iframe").forEach((element) => {
|
||||
element.style.setProperty("width", "100%", "important")
|
||||
element.style.setProperty("max-width", "100%", "important")
|
||||
element.style.setProperty("min-width", "0", "important")
|
||||
if (element.classList.contains("epub-view")) element.style.setProperty("flex", "0 0 100%", "important")
|
||||
})
|
||||
}
|
||||
|
||||
async function displayLocation(target?: string) {
|
||||
|
|
|
|||
|
|
@ -114,10 +114,9 @@ body[data-slug="Fiction/The-Burden-of-Proof"] {
|
|||
contain: layout paint;
|
||||
background: #11161b;
|
||||
|
||||
iframe,
|
||||
.epub-container {
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
position: absolute !important;
|
||||
inset: 0 auto auto 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue