s|doc|docel|g
This commit is contained in:
parent
ed0d493a17
commit
355a4c75b5
2 changed files with 14 additions and 14 deletions
|
@ -2,12 +2,12 @@ import postman, { item } from "postman";
|
||||||
import { formatNumber } from "~/lib/t";
|
import { formatNumber } from "~/lib/t";
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
const doc = document.documentElement;
|
const docel = document.documentElement;
|
||||||
const loader: HTMLElement = doc.querySelector(".postman.loader")!;
|
const loader: HTMLElement = docel.querySelector(".postman.loader")!;
|
||||||
const style: HTMLStyleElement = doc.querySelector(".css.postman")!;
|
const style: HTMLStyleElement = docel.querySelector(".css.postman")!;
|
||||||
const progressBar: HTMLProgressElement = loader.querySelector("progress")!;
|
const progressBar: HTMLProgressElement = loader.querySelector("progress")!;
|
||||||
const progressNumber: HTMLSpanElement = loader.querySelector(".percentage")!;
|
const progressNumber: HTMLSpanElement = loader.querySelector(".percentage")!;
|
||||||
const rev = doc
|
const rev = docel
|
||||||
.querySelector("meta[name='revision']")!
|
.querySelector("meta[name='revision']")!
|
||||||
.getAttribute("content")!;
|
.getAttribute("content")!;
|
||||||
const fonts = (() => {
|
const fonts = (() => {
|
||||||
|
@ -15,7 +15,7 @@ import { formatNumber } from "~/lib/t";
|
||||||
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
||||||
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
||||||
];
|
];
|
||||||
if (doc.dir === "rtl") {
|
if (docel.dir === "rtl") {
|
||||||
f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
|
f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
|
||||||
}
|
}
|
||||||
return f;
|
return f;
|
||||||
|
@ -28,7 +28,7 @@ import { formatNumber } from "~/lib/t";
|
||||||
item.progress((percent: number) => {
|
item.progress((percent: number) => {
|
||||||
progressBar.value = percent;
|
progressBar.value = percent;
|
||||||
progressNumber.innerText = formatNumber(
|
progressNumber.innerText = formatNumber(
|
||||||
doc.lang,
|
docel.lang,
|
||||||
Number(percent.toFixed(0)),
|
Number(percent.toFixed(0)),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -2,13 +2,13 @@ import postman, { item } from "postman";
|
||||||
import { formatNumber } from "~/lib/t";
|
import { formatNumber } from "~/lib/t";
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
const doc = document.documentElement;
|
const docel = document.documentElement;
|
||||||
const loader = doc.querySelector(".postman.loader")!;
|
const loader = docel.querySelector(".postman.loader")!;
|
||||||
const style = doc.querySelector(".css.postman")!;
|
const style = docel.querySelector(".css.postman")!;
|
||||||
const progressBar = loader.querySelector("progress")!;
|
const progressBar = loader.querySelector("progress")!;
|
||||||
const progressNumber: HTMLSpanElement = loader.querySelector(".percentage")!;
|
const progressNumber: HTMLSpanElement = loader.querySelector(".percentage")!;
|
||||||
const { surahId } = document.querySelector<HTMLElement>(".root")!.dataset;
|
const { surahId } = document.querySelector<HTMLElement>(".root")!.dataset;
|
||||||
const rev = doc
|
const rev = docel
|
||||||
.querySelector("meta[name='revision']")!
|
.querySelector("meta[name='revision']")!
|
||||||
.getAttribute("content")!;
|
.getAttribute("content")!;
|
||||||
const fonts = (() => {
|
const fonts = (() => {
|
||||||
|
@ -16,7 +16,7 @@ import { formatNumber } from "~/lib/t";
|
||||||
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"),
|
||||||
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
||||||
];
|
];
|
||||||
if (doc.dir === "rtl") {
|
if (docel.dir === "rtl") {
|
||||||
f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
|
f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"));
|
||||||
f.push(item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)"));
|
f.push(item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)"));
|
||||||
}
|
}
|
||||||
|
@ -28,14 +28,14 @@ import { formatNumber } from "~/lib/t";
|
||||||
item.script(`/js/main/surah-stream.js?v=${rev}`, { id: "1" }),
|
item.script(`/js/main/surah-stream.js?v=${rev}`, { id: "1" }),
|
||||||
...fonts,
|
...fonts,
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
item.json(`/json/${doc.lang}/${surahId}/info.json?v=${rev}`, { className: "json surahinfo" }),
|
item.json(`/json/${docel.lang}/${surahId}/info.json?v=${rev}`, { className: "json surahinfo" }),
|
||||||
item.json(`/json/${doc.lang}/${surahId}/surah.json?v=${rev}`, { className: "json surah" }),
|
item.json(`/json/${docel.lang}/${surahId}/surah.json?v=${rev}`, { className: "json surah" }),
|
||||||
item.json(`/json/durations/${surahId}.json?v=${rev}`, { className: "json durations" }),
|
item.json(`/json/durations/${surahId}.json?v=${rev}`, { className: "json durations" }),
|
||||||
/* eslint-enable */
|
/* eslint-enable */
|
||||||
item.progress((percent: number) => {
|
item.progress((percent: number) => {
|
||||||
progressBar.value = percent;
|
progressBar.value = percent;
|
||||||
progressNumber.innerText = formatNumber(
|
progressNumber.innerText = formatNumber(
|
||||||
doc.lang,
|
docel.lang,
|
||||||
Number(percent.toFixed(0)),
|
Number(percent.toFixed(0)),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in a new issue