Added theme switching
All checks were successful
Copy Files to Samba Share dev / Copy Files (push) Successful in 22s
All checks were successful
Copy Files to Samba Share dev / Copy Files (push) Successful in 22s
This commit is contained in:
@@ -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)">
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user