- 🏫 I am a
software development technician
at CESDE - 🏆 Finalized in
June-2023
- 🧑💻 Currently working on
Frontend Development
&Backend Developer
- 💥 You can visit MY WEBSITE for some frontend knowledge
- 📧 Feel free to reach me out
- 🤓 Always believe
"You are what you loved"
constructor(@Inject(DOCUMENT) private document: Document) {
const modeSelected = localStorage.getItem('modeSelected');
if (modeSelected) {
const mode: Mode = JSON.parse(modeSelected);
this._darkModeIsSelect.next(mode);
this.setDarkModeClass(mode.mode === 'dark');
}
}
selecDarkMode(mode: string) {
const isDark = mode === 'dark';
this.setDarkModeClass(isDark);
this._darkModeIsSelect.next({ mode });
localStorage.setItem('modeSelected', JSON.stringify(this._darkModeIsSelect.value));
}
private setDarkModeClass(isDark: boolean) {
if (isDark) {
this.document.body.classList.add('vela__blue');
} else {
this.document.body.classList.remove('vela__blue');
}
}
|