diff --git a/frontend/src/app/app.component.html b/frontend/src/app/app.component.html
index d9872a24..7310d1f0 100644
--- a/frontend/src/app/app.component.html
+++ b/frontend/src/app/app.component.html
@@ -107,4 +107,12 @@
+
diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts
index 883b7f28..254bd1b2 100644
--- a/frontend/src/app/app.component.ts
+++ b/frontend/src/app/app.component.ts
@@ -9,7 +9,7 @@ import {
OnInit,
PLATFORM_ID,
Renderer2,
- ViewEncapsulation
+ ViewEncapsulation,
} from "@angular/core"
import { RouterLink, RouterLinkActive, RouterOutlet } from "@angular/router"
import { initFlowbite } from "flowbite"
@@ -24,7 +24,7 @@ import { StatusComponent } from "./status/status.component"
imports: [RouterOutlet, StatusComponent, RouterLink, RouterLinkActive, NgOptimizedImage, Highlight],
templateUrl: "./app.component.html",
styleUrl: "./app.component.css",
- encapsulation: ViewEncapsulation.None
+ encapsulation: ViewEncapsulation.None,
})
export class AppComponent implements OnInit, AfterViewInit {
title = "aur.chaotic.cx"
@@ -33,16 +33,10 @@ export class AppComponent implements OnInit, AfterViewInit {
@Inject(PLATFORM_ID) private platformId: object,
private el: ElementRef,
private httpClient: HttpClient,
- private renderer: Renderer2
- ) {
- }
+ private renderer: Renderer2,
+ ) {}
ngOnInit(): void {
- const theme = localStorage.getItem("theme")
- if (theme) {
- loadTheme(theme, this.renderer, this.el)
- }
-
TimeAgo.addDefaultLocale(en)
if (isPlatformBrowser(this.platformId)) {
@@ -51,6 +45,13 @@ export class AppComponent implements OnInit, AfterViewInit {
}
ngAfterViewInit(): void {
+ const theme = localStorage.getItem("theme")
+ if (theme && theme !== "mocha") {
+ loadTheme(theme, this.renderer, this.el)
+ } else {
+ this.renderer.setStyle(this.el.nativeElement.ownerDocument.body, "backgroundColor", "#1e1e2e")
+ }
+
// Cause stats metrics to be pre-generated by calling its URL,
// which are then cached in the backend for 5 minutes
const routesToPreCache = [
@@ -58,7 +59,7 @@ export class AppComponent implements OnInit, AfterViewInit {
"30d/packages",
"30d/rank/30/packages",
"30d/rank/30/countries",
- "30d/user-agents"
+ "30d/user-agents",
]
routesToPreCache.forEach((route) => {
this.httpClient.get(CAUR_CACHED_METRICS_URL + route)
diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html
index a4d5f2db..052b4487 100644
--- a/frontend/src/app/home/home.component.html
+++ b/frontend/src/app/home/home.component.html
@@ -1,5 +1,5 @@