diff --git a/src/js/loaders/SurahIndexLoader.ts b/src/js/loaders/SurahIndexLoader.ts index 375c380..74d3242 100644 --- a/src/js/loaders/SurahIndexLoader.ts +++ b/src/js/loaders/SurahIndexLoader.ts @@ -2,12 +2,12 @@ import postman, { item } from "postman"; import { formatNumber } from "~/lib/t"; (function () { - const doc = document.documentElement; - const loader: HTMLElement = doc.querySelector(".postman.loader")!; - const style: HTMLStyleElement = doc.querySelector(".css.postman")!; + const docel = document.documentElement; + const loader: HTMLElement = docel.querySelector(".postman.loader")!; + const style: HTMLStyleElement = docel.querySelector(".css.postman")!; const progressBar: HTMLProgressElement = loader.querySelector("progress")!; const progressNumber: HTMLSpanElement = loader.querySelector(".percentage")!; - const rev = doc + const rev = docel .querySelector("meta[name='revision']")! .getAttribute("content")!; const fonts = (() => { @@ -15,7 +15,7 @@ import { formatNumber } from "~/lib/t"; item.font("Cairo Regular", "url(/fonts/cairo-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)")); } return f; @@ -28,7 +28,7 @@ import { formatNumber } from "~/lib/t"; item.progress((percent: number) => { progressBar.value = percent; progressNumber.innerText = formatNumber( - doc.lang, + docel.lang, Number(percent.toFixed(0)), ); }), diff --git a/src/js/loaders/SurahStreamLoader.ts b/src/js/loaders/SurahStreamLoader.ts index 1957acb..ad4e20c 100644 --- a/src/js/loaders/SurahStreamLoader.ts +++ b/src/js/loaders/SurahStreamLoader.ts @@ -2,13 +2,13 @@ import postman, { item } from "postman"; import { formatNumber } from "~/lib/t"; (function () { - const doc = document.documentElement; - const loader = doc.querySelector(".postman.loader")!; - const style = doc.querySelector(".css.postman")!; + const docel = document.documentElement; + const loader = docel.querySelector(".postman.loader")!; + const style = docel.querySelector(".css.postman")!; const progressBar = loader.querySelector("progress")!; const progressNumber: HTMLSpanElement = loader.querySelector(".percentage")!; const { surahId } = document.querySelector(".root")!.dataset; - const rev = doc + const rev = docel .querySelector("meta[name='revision']")! .getAttribute("content")!; const fonts = (() => { @@ -16,7 +16,7 @@ import { formatNumber } from "~/lib/t"; item.font("Cairo Regular", "url(/fonts/cairo-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("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" }), ...fonts, /* eslint-disable */ - item.json(`/json/${doc.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}/info.json?v=${rev}`, { className: "json surahinfo" }), + item.json(`/json/${docel.lang}/${surahId}/surah.json?v=${rev}`, { className: "json surah" }), item.json(`/json/durations/${surahId}.json?v=${rev}`, { className: "json durations" }), /* eslint-enable */ item.progress((percent: number) => { progressBar.value = percent; progressNumber.innerText = formatNumber( - doc.lang, + docel.lang, Number(percent.toFixed(0)), ); }),