Added theme switching
All checks were successful
Copy Files to Samba Share dev / Copy Files (push) Successful in 22s

This commit is contained in:
2024-11-01 12:19:01 +01:00
parent 105002f4a3
commit 47ad7f3659
5 changed files with 112 additions and 25 deletions

View File

@@ -2,3 +2,4 @@
<a href="/"><img src="assets/logo-light.svg" alt="Logo light" class="only-on-light" /></a>
<h1>Ontvlambaar</h1>
<span class="slogan">Jullie het vuur, wij de branding</span>
<input type="checkbox" [checked]="isDarkMode()" (change)="themeClicked($event)">

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, computed, input, output } from '@angular/core';
@Component({
selector: 'app-hero',
@@ -8,5 +8,13 @@ import { Component } from '@angular/core';
styleUrl: './hero.component.scss'
})
export class HeroComponent {
theme= input<string>();
isDarkMode = computed(() => {
return this.theme() === 'dark';
});
themeChange = output<string>();
public themeClicked(event: any) {
this.themeChange.emit(event.target.checked ? 'dark' : 'light');
}
}