diff --git a/src/elements/TitleBar.ts b/src/elements/NavBar.ts similarity index 90% rename from src/elements/TitleBar.ts rename to src/elements/NavBar.ts index 27a1ae5..453aeed 100644 --- a/src/elements/TitleBar.ts +++ b/src/elements/NavBar.ts @@ -5,9 +5,9 @@ import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState"; import i18next from "i18next"; -export function TitleBar(): HTMLElement { +export function NavBar(): HTMLElement { return makeElement({ - id: "titleBar", + id: "navBar", tag: "nav", class: ["uk-navbar", "uk-navbar-container"], children: [ @@ -55,7 +55,7 @@ export function TitleBar(): HTMLElement { }) } -export function reloadTitleBar(): void { - document.querySelector(".titleBar").replaceWith(TitleBar()); +export function reloadNavBar(): void { + document.querySelector("#navBar").replaceWith(NavBar()); } diff --git a/src/main.ts b/src/main.ts index 3affb6c..52826d9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,7 +25,7 @@ import { getSealStatus } from "./api/sys/getSealStatus"; import { makeElement } from "./htmlUtils"; import { pageState } from "./globalPageState"; import { playground } from "./playground"; -import { TitleBar } from "./elements/TitleBar"; +import { NavBar } from "./elements/NavBar"; // Translations import { formatDistance } from './formatDistance'; @@ -41,7 +41,7 @@ declare global { function onLoad(): void { document.body.innerHTML = ""; - document.body.appendChild(TitleBar()); + document.body.appendChild(NavBar()); document.body.appendChild(makeElement({ tag: "div", class: ["uk-container", "uk-container-medium", "uk-align-center"], diff --git a/src/pages/SetLanguage.ts b/src/pages/SetLanguage.ts index d10815c..3477366 100644 --- a/src/pages/SetLanguage.ts +++ b/src/pages/SetLanguage.ts @@ -4,7 +4,7 @@ import { changePage, setPageContent } from "../pageUtils"; import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState"; import i18next from 'i18next'; -import { reloadTitleBar } from "../elements/TitleBar"; +import { reloadNavBar } from "../elements/NavBar"; // @ts-ignore import translations from "../translations/index.mjs"; @@ -59,7 +59,7 @@ export class SetLanguagePage extends Page { console.log(pageState.language); void i18next.changeLanguage(language).then((t) => { pageState.pageDirection = t("language_direction"); - reloadTitleBar(); + reloadNavBar(); changePage("HOME"); }); });