feat(navigation): switch theme

This commit is contained in:
2025-08-21 04:10:46 +02:00
parent 3406450eba
commit aebd3d643e
2 changed files with 17 additions and 3 deletions

View File

@@ -62,9 +62,15 @@
} }
</div> </div>
<div class="options flex flex-row gap-[10px]"> <div class="options flex flex-row gap-[10px]">
<div class="dark-mode size-[50px]"> @if (themeSwitchService.darkMode()) {
<div class="dark-mode size-[50px]" (click)="themeSwitchService.switchToLight()">
<fa-icon [icon]="faMoon"/> <fa-icon [icon]="faMoon"/>
</div> </div>
} @else {
<div class="dark-mode size-[50px]" (click)="themeSwitchService.switchToDark()">
<fa-icon [icon]="faSun"/>
</div>
}
<div class="language size-[50px]">EN</div> <div class="language size-[50px]">EN</div>
</div> </div>
</nav> </nav>

View File

@@ -52,4 +52,12 @@ export class ThemeSwitchService {
console.info(`switching to theme: ${theme.name}`); console.info(`switching to theme: ${theme.name}`);
this.theme.set(theme); this.theme.set(theme);
} }
switchToDark() {
this.switchToTheme(Theme.THEMES.find(t => t.code === 'dark')!);
}
switchToLight() {
this.switchToTheme(Theme.THEMES.find(t => t.code === 'light')!);
}
} }