diff --git a/frontend/src/styles/nav.scss b/frontend/src/styles/nav.scss index 548951b23..b96221d0d 100644 --- a/frontend/src/styles/nav.scss +++ b/frontend/src/styles/nav.scss @@ -120,7 +120,7 @@ } } -#top { +header { grid-template-areas: "logo menu"; line-height: 2.3rem; font-size: 2.3rem; diff --git a/frontend/src/styles/z_media-queries.scss b/frontend/src/styles/z_media-queries.scss index aaf16f17d..b70dc1631 100644 --- a/frontend/src/styles/z_media-queries.scss +++ b/frontend/src/styles/z_media-queries.scss @@ -346,7 +346,7 @@ //800px @media only screen and (max-width: 50rem) { - #top .logo .text { + header .logo .text { font-size: 1.5rem; line-height: 1.5rem; margin-top: -0.1em; @@ -509,7 +509,7 @@ //650px @media only screen and (max-width: 40.625rem) { - #top { + header { #menu { .textButton.account { .text { @@ -693,7 +693,7 @@ .pageAbout .section .contributors { grid-template-columns: 1fr 1fr; } - #top .logo .bottom { + header .logo .bottom { margin-top: 0; } .pageLogin { @@ -738,7 +738,7 @@ //550px @media only screen and (max-width: 34.375rem) { - #top { + header { .logo { grid-template-columns: auto; .text { @@ -894,7 +894,7 @@ } } - #top { + header { #menu { font-size: 1rem; } @@ -916,7 +916,7 @@ } } #centerContent { - #top { + header { // grid-template-columns: 1fr auto; .desktopConfig { display: none; @@ -972,7 +972,7 @@ //400px @media only screen and (max-width: 25rem) { - #top .config { + header .config { grid-gap: 0.25rem; .group .buttons { font-size: 0.65rem; @@ -980,7 +980,7 @@ } } - #top #menu { + header #menu { font-size: 0.75rem; } diff --git a/frontend/src/ts/commandline/lists/navigation.ts b/frontend/src/ts/commandline/lists/navigation.ts index 8f2e22369..58409dab0 100644 --- a/frontend/src/ts/commandline/lists/navigation.ts +++ b/frontend/src/ts/commandline/lists/navigation.ts @@ -16,7 +16,7 @@ const commands: MonkeyTypes.Command[] = [ display: "View Leaderboards", icon: "fa-crown", exec: (): void => { - $("#top #menu .textButton.view-leaderboards").trigger("click"); + $("header #menu .textButton.view-leaderboards").trigger("click"); }, }, { @@ -42,7 +42,7 @@ const commands: MonkeyTypes.Command[] = [ icon: "fa-user", alias: "stats", exec: (): void => { - $("#top #menu .textButton.view-account").hasClass("hidden") + $("header #menu .textButton.view-account").hasClass("hidden") ? navigate("/login") : navigate("/account"); }, diff --git a/frontend/src/ts/controllers/account-controller.ts b/frontend/src/ts/controllers/account-controller.ts index 44b9f56ed..73e6cb5ce 100644 --- a/frontend/src/ts/controllers/account-controller.ts +++ b/frontend/src/ts/controllers/account-controller.ts @@ -100,7 +100,7 @@ async function getDataAndInit(): Promise { const msg = e.message || e; Notifications.add("Failed to get user data: " + msg, -1); - $("#top #menu .account").css("opacity", 1); + $("header #menu .account").css("opacity", 1); return false; } if (ActivePage.get() === "loading") { @@ -194,7 +194,9 @@ export async function loadUser(user: UserType): Promise { // var providerData = user.providerData; LoginPage.hidePreloader(); - $("#top .signInOut .icon").html(``); + $("header .signInOut .icon").html( + `` + ); // showFavouriteThemesAtTheTop(); @@ -226,12 +228,12 @@ if (Auth && ConnectionState.get()) { console.log(`auth state changed, user ${user ? true : false}`); console.debug(user); if (user) { - $("#top .signInOut .icon").html( + $("header .signInOut .icon").html( `` ); await loadUser(user); } else { - $("#top .signInOut .icon").html(``); + $("header .signInOut .icon").html(``); if (window.location.pathname === "/account") { window.history.replaceState("", "", "/login"); } @@ -268,7 +270,7 @@ if (Auth && ConnectionState.get()) { // await UpdateConfig.loadPromise; const search = window.location.search; const hash = window.location.hash; - $("#top .signInOut .icon").html(``); + $("header .signInOut .icon").html(``); if (window.location.pathname === "/account") { window.history.replaceState("", "", "/login"); } @@ -439,7 +441,7 @@ export function signOut(): void { DB.setSnapshot(undefined); LoginPage.enableSignUpButton(); LoginPage.enableInputs(); - $("#top .signInOut .icon").html(``); + $("header .signInOut .icon").html(``); setTimeout(() => { hideFavoriteQuoteLength(); }, 125); @@ -613,7 +615,7 @@ $(".pageLogin .login button.signInWithGoogle").on("click", () => { // signInWithGitHub(); // }); -$("#top .signInOut").on("click", () => { +$("header .signInOut").on("click", () => { if (Auth === undefined) { Notifications.add("Authentication uninitialized", -1, { duration: 3, diff --git a/frontend/src/ts/controllers/challenge-controller.ts b/frontend/src/ts/controllers/challenge-controller.ts index 1e391ab29..2085231ee 100644 --- a/frontend/src/ts/controllers/challenge-controller.ts +++ b/frontend/src/ts/controllers/challenge-controller.ts @@ -204,7 +204,7 @@ export async function setup(challengeName: string): Promise { Notifications.add(message, -1); ManualRestart.set(); setTimeout(() => { - $("#top .config").removeClass("hidden"); + $("header .config").removeClass("hidden"); $(".page.pageTest").removeClass("hidden"); }, 250); return false; @@ -217,7 +217,7 @@ export async function setup(challengeName: string): Promise { Notifications.add("Challenge not found", 0); ManualRestart.set(); setTimeout(() => { - $("#top .config").removeClass("hidden"); + $("header .config").removeClass("hidden"); $(".page.pageTest").removeClass("hidden"); }, 250); return false; @@ -307,7 +307,7 @@ export async function setup(challengeName: string): Promise { } ManualRestart.set(); notitext = challenge.message; - $("#top .config").removeClass("hidden"); + $("header .config").removeClass("hidden"); $(".page.pageTest").removeClass("hidden"); if (notitext === undefined) { diff --git a/frontend/src/ts/elements/account-button.ts b/frontend/src/ts/elements/account-button.ts index 186ef9eab..d62155d36 100644 --- a/frontend/src/ts/elements/account-button.ts +++ b/frontend/src/ts/elements/account-button.ts @@ -13,11 +13,13 @@ export function skipXpBreakdown(): void { export function loading(state: boolean): void { if (state) { - $("#top #menu .account").css("opacity", 1).css("pointer-events", "none"); + $("header #menu .account").css("opacity", 1).css("pointer-events", "none"); if (usingAvatar) { - $("#top #menu .account .loading").css("opacity", 1).removeClass("hidden"); - $("#top #menu .account .avatar") + $("header #menu .account .loading") + .css("opacity", 1) + .removeClass("hidden"); + $("header #menu .account .avatar") .stop(true, true) .css({ opacity: 1 }) .animate( @@ -26,11 +28,11 @@ export function loading(state: boolean): void { }, 100, () => { - $("#top #menu .account .avatar").addClass("hidden"); + $("header #menu .account .avatar").addClass("hidden"); } ); } else { - $("#top #menu .account .loading") + $("header #menu .account .loading") .stop(true, true) .removeClass("hidden") .css({ opacity: 0 }) @@ -40,7 +42,7 @@ export function loading(state: boolean): void { }, 100 ); - $("#top #menu .account .user") + $("header #menu .account .user") .stop(true, true) .css({ opacity: 1 }) .animate( @@ -49,16 +51,16 @@ export function loading(state: boolean): void { }, 100, () => { - $("#top #menu .account .user").addClass("hidden"); + $("header #menu .account .user").addClass("hidden"); } ); } } else { - $("#top #menu .account").css("opacity", 1).css("pointer-events", "auto"); + $("header #menu .account").css("opacity", 1).css("pointer-events", "auto"); if (usingAvatar) { - $("#top #menu .account .loading").css("opacity", 1).addClass("hidden"); - $("#top #menu .account .avatar") + $("header #menu .account .loading").css("opacity", 1).addClass("hidden"); + $("header #menu .account .avatar") .stop(true, true) .removeClass("hidden") .css({ opacity: 0 }) @@ -69,7 +71,7 @@ export function loading(state: boolean): void { 100 ); } else { - $("#top #menu .account .loading") + $("header #menu .account .loading") .stop(true, true) .css({ opacity: 1 }) .animate( @@ -78,10 +80,10 @@ export function loading(state: boolean): void { }, 100, () => { - $("#top #menu .account .loading").addClass("hidden"); + $("header #menu .account .loading").addClass("hidden"); } ); - $("#top #menu .account .user") + $("header #menu .account .user") .stop(true, true) .removeClass("hidden") .css({ opacity: 0 }) @@ -102,8 +104,8 @@ export async function update( ): Promise { if (Auth?.currentUser) { if (xp !== undefined) { - $("#top #menu .level").text(Math.floor(Misc.getLevel(xp))); - $("#top #menu .bar").css({ + $("header #menu .level").text(Math.floor(Misc.getLevel(xp))); + $("header #menu .bar").css({ width: (Misc.getLevel(xp) % 1) * 100 + "%", }); } @@ -111,20 +113,20 @@ export async function update( Misc.getDiscordAvatarUrl(discordId, discordAvatar).then( (discordAvatarUrl) => { if (discordAvatarUrl) { - $("#top #menu .account .avatar").css( + $("header #menu .account .avatar").css( "background-image", `url(${discordAvatarUrl})` ); usingAvatar = true; - $("#top #menu .account .user").addClass("hidden"); - $("#top #menu .account .avatar").removeClass("hidden"); + $("header #menu .account .user").addClass("hidden"); + $("header #menu .account .avatar").removeClass("hidden"); } } ); } else { - $("#top #menu .account .avatar").addClass("hidden"); - $("#top #menu .account .user").removeClass("hidden"); + $("header #menu .account .avatar").addClass("hidden"); + $("header #menu .account .user").removeClass("hidden"); } $("#menu .textButton.account") .removeClass("hidden") diff --git a/frontend/src/ts/elements/alerts.ts b/frontend/src/ts/elements/alerts.ts index ee28a5a55..51f3ad614 100644 --- a/frontend/src/ts/elements/alerts.ts +++ b/frontend/src/ts/elements/alerts.ts @@ -337,9 +337,9 @@ function fillNotifications(): void { export function setNotificationBubbleVisible(tf: boolean): void { if (tf) { - $("#top #menu .showAlerts .notificationBubble").removeClass("hidden"); + $("header #menu .showAlerts .notificationBubble").removeClass("hidden"); } else { - $("#top #menu .showAlerts .notificationBubble").addClass("hidden"); + $("header #menu .showAlerts .notificationBubble").addClass("hidden"); } } @@ -430,7 +430,7 @@ $("#alertsPopupWrapper .accountAlerts").on("click", ".deleteAll", () => { } }); -$("#top #menu .showAlerts").on("click", () => { +$("header #menu .showAlerts").on("click", () => { show(); }); diff --git a/frontend/src/ts/elements/leaderboards.ts b/frontend/src/ts/elements/leaderboards.ts index 8fc797ad6..48555bda0 100644 --- a/frontend/src/ts/elements/leaderboards.ts +++ b/frontend/src/ts/elements/leaderboards.ts @@ -881,13 +881,13 @@ $(document).on("keydown", (event) => { } }); -$("#top #menu").on("click", ".textButton", (e) => { +$("header #menu").on("click", ".textButton", (e) => { if ($(e.currentTarget).hasClass("leaderboards")) { show(); } }); -$(document).on("keypress", "#top #menu .textButton", (e) => { +$(document).on("keypress", "header #menu .textButton", (e) => { if (e.key === "Enter") { $(e.currentTarget).trigger("click"); } diff --git a/frontend/src/ts/test/focus.ts b/frontend/src/ts/test/focus.ts index ecbee6405..91363bc99 100644 --- a/frontend/src/ts/test/focus.ts +++ b/frontend/src/ts/test/focus.ts @@ -11,7 +11,7 @@ export function set(foc: boolean, withCursor = false): void { if (foc && !state) { state = true; Caret.stopAnimation(); - $("#top").addClass("focus"); + $("header").addClass("focus"); $("#bottom").addClass("focus"); if (!withCursor) $("body").css("cursor", "none"); $("#middle").addClass("focus"); @@ -30,7 +30,7 @@ export function set(foc: boolean, withCursor = false): void { } else if (!foc && state) { state = false; Caret.startAnimation(); - $("#top").removeClass("focus"); + $("header").removeClass("focus"); $("#bottom").removeClass("focus"); $("body").css("cursor", "default"); $("#middle").removeClass("focus"); diff --git a/frontend/src/ts/test/test-config.ts b/frontend/src/ts/test/test-config.ts index 8b9341470..7d9795f84 100644 --- a/frontend/src/ts/test/test-config.ts +++ b/frontend/src/ts/test/test-config.ts @@ -2,11 +2,11 @@ import * as ConfigEvent from "../observables/config-event"; // import * as Misc from "../utils/misc"; // export function show() { -// $("#top .config").removeClass("hidden").css("opacity", 1); +// $("header .config").removeClass("hidden").css("opacity", 1); // } // export function hide() { -// $("#top .config").css("opacity", 0).addClass("hidden"); +// $("header .config").css("opacity", 0).addClass("hidden"); // } export function show(): void { diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index f14579d34..171531cfd 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -1578,7 +1578,7 @@ $("#popups").on( } ); -$("#top").on("click", "#menu #startTestButton, .logo", () => { +$("header").on("click", "#menu #startTestButton, .logo", () => { if (ActivePage.get() === "test") restart(); }); diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts index fbcd9dd44..b712d64be 100644 --- a/frontend/src/ts/test/test-ui.ts +++ b/frontend/src/ts/test/test-ui.ts @@ -411,7 +411,7 @@ export async function screenshot(): Promise { $(".pageTest .buttons").removeClass("hidden"); $("noscript").removeClass("hidden"); $("#nocss").removeClass("hidden"); - $("#top, #bottom").removeClass("invisible"); + $("header, #bottom").removeClass("invisible"); $("#result").removeClass("noBalloons"); if (revertCookie) $("#cookiePopupWrapper").removeClass("hidden"); if (revealReplay) $("#resultReplay").removeClass("hidden"); @@ -450,7 +450,7 @@ export async function screenshot(): Promise { $("#ad-result-small-wrapper").addClass("hidden"); $("#testConfig").addClass("hidden"); $(".page.pageTest").prepend("
"); - $("#top, #bottom").addClass("invisible"); + $("header, #bottom").addClass("invisible"); $("#result").addClass("noBalloons"); if (revertCookie) $("#cookiePopupWrapper").addClass("hidden"); diff --git a/frontend/src/ts/ui.ts b/frontend/src/ts/ui.ts index 4ab529d3c..7391ea1c9 100644 --- a/frontend/src/ts/ui.ts +++ b/frontend/src/ts/ui.ts @@ -43,7 +43,7 @@ if (isLocalhost()) { window.onerror = function (error): void { Notifications.add(error.toString(), -1); }; - $("#top .logo .top").text("localhost"); + $("header .logo .top").text("localhost"); $("head title").text($("head title").text() + " (localhost)"); $("body").append( `
local
local
` diff --git a/frontend/static/email-handler.html b/frontend/static/email-handler.html index e76c51d0e..9762a64b4 100644 --- a/frontend/static/email-handler.html +++ b/frontend/static/email-handler.html @@ -44,7 +44,7 @@