mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
fix css preserve color images
This commit is contained in:
1 parent
4b6101b019
commit
a26cfceaf4
2 files changed
+35
-30
No files matched your search
@@ -50,7 +50,11 @@ html.dark .glossaries {
|
|||||||
word-break: keep-all;
|
word-break: keep-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img[src$=".svg"] {
|
||||||
filter: invert(1) hue-rotate(180deg);
|
filter: invert(1) hue-rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rt {
|
||||||
|
font-size: 50%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -128,29 +128,29 @@ function LoadingDialog() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const { VITE_STORAGE_WORKER_URL, VITE_STORAGE_WORKER_TOKEN } =
|
const LAST_API_CALL_KEY = "LAST_API_CALL_KEY_storageWorkerURL";
|
||||||
import.meta.env;
|
const LAST_API_JSON_KEY = "LAST_API_JSON_KEY_storageWorkerURL";
|
||||||
|
|
||||||
|
let entries: YomitanStorageWorkerDictEntry[] = [];
|
||||||
|
|
||||||
|
const lastCall = localStorage.getItem(LAST_API_CALL_KEY);
|
||||||
|
const lastJSON = localStorage.getItem(LAST_API_JSON_KEY);
|
||||||
|
|
||||||
|
if (lastJSON && lastCall) {
|
||||||
|
const d = new Date(lastCall);
|
||||||
|
d.setDate(d.getDate() + 1);
|
||||||
|
if (d > new Date()) {
|
||||||
|
entries = JSON.parse(lastJSON);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const prefix = `${lang}/`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const prefix = `${lang}/`;
|
|
||||||
|
|
||||||
let entries: YomitanStorageWorkerDictEntry[] = [];
|
|
||||||
|
|
||||||
const LAST_API_CALL_KEY = "LAST_API_CALL_KEY_storageWorkerURL";
|
|
||||||
const LAST_API_JSON_KEY = "LAST_API_JSON_KEY_storageWorkerURL";
|
|
||||||
|
|
||||||
const lastCall = localStorage.getItem(LAST_API_CALL_KEY);
|
|
||||||
const lastJSON = localStorage.getItem(LAST_API_JSON_KEY);
|
|
||||||
|
|
||||||
if (lastJSON && lastCall) {
|
|
||||||
const d = new Date(lastCall);
|
|
||||||
d.setDate(d.getDate() + 1);
|
|
||||||
if (d > new Date()) {
|
|
||||||
entries = JSON.parse(lastJSON);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!entries.length) {
|
if (!entries.length) {
|
||||||
console.log(`visiting ${VITE_STORAGE_WORKER_URL}`);
|
const { VITE_STORAGE_WORKER_URL, VITE_STORAGE_WORKER_TOKEN } =
|
||||||
|
import.meta.env;
|
||||||
|
console.log(`accessing ${VITE_STORAGE_WORKER_URL}`);
|
||||||
|
|
||||||
entries = await fetch(VITE_STORAGE_WORKER_URL + "/files", {
|
entries = await fetch(VITE_STORAGE_WORKER_URL + "/files", {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -161,18 +161,19 @@ function LoadingDialog() {
|
|||||||
localStorage.setItem(LAST_API_CALL_KEY, new Date().toISOString());
|
localStorage.setItem(LAST_API_CALL_KEY, new Date().toISOString());
|
||||||
localStorage.setItem(LAST_API_JSON_KEY, JSON.stringify(entries));
|
localStorage.setItem(LAST_API_JSON_KEY, JSON.stringify(entries));
|
||||||
}
|
}
|
||||||
|
|
||||||
dicts.push(
|
|
||||||
...entries
|
|
||||||
.filter((o) => o.key.startsWith(prefix))
|
|
||||||
.map((o) => ({
|
|
||||||
filepath: `yomitan/${lang}/${o.key.substring(prefix.length)}`,
|
|
||||||
url: o.url,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
entries = JSON.parse(lastJSON || "[]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dicts.push(
|
||||||
|
...entries
|
||||||
|
.filter((o) => o.key.startsWith(prefix))
|
||||||
|
.map((o) => ({
|
||||||
|
filepath: `yomitan/${lang}/${o.key.substring(prefix.length)}`,
|
||||||
|
url: o.url,
|
||||||
|
})),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await invoke("init_yomitan", { dicts, lang });
|
await invoke("init_yomitan", { dicts, lang });
|
||||||
|
|||||||
Reference in new issue
Block a user