[add] cache fonts
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-11-29 06:15:44 -05:00
parent 39fd7ab1f1
commit 2c240f2f5c
15 changed files with 142 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
const THEMES = ["light", "tan", "blue", "gray", "black"];
const THEME_FILE = "/assets/reader/readerThemes.css";
const THEME_FILE = "/assets/reader/themes.css";
/**
* Initial load handler. Gets called on DOMContentLoaded. Responsible for
@@ -267,20 +267,13 @@ class EBookReader {
// Restore Theme
this.setTheme();
// Set Fonts - TODO: Local
// https://gwfh.mranftl.com/fonts
// Set Fonts
this.rendition.getContents().forEach((c) => {
[
"https://fonts.googleapis.com/css?family=Arbutus+Slab",
"https://fonts.googleapis.com/css?family=Open+Sans",
"https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i",
].forEach((url) => {
let el = c.document.head.appendChild(
c.document.createElement("link")
);
el.setAttribute("rel", "stylesheet");
el.setAttribute("href", url);
});
let el = c.document.head.appendChild(
c.document.createElement("link")
);
el.setAttribute("rel", "stylesheet");
el.setAttribute("href", "/assets/reader/fonts.css");
});
}.bind(this)
);