Merge branch 'themesDeveloper' of bitbucket.org:equilibriumito/gabinete-digital into themesDeveloper

This commit is contained in:
Peter Maquiran
2021-10-26 17:23:50 +01:00
28 changed files with 46 additions and 27 deletions
+20 -6
View File
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { ThemeService } from 'src/app/services/theme.service';
@Injectable({
providedIn: 'root'
@@ -11,14 +12,27 @@ export class BackgroundService {
funx: Function
}[] = []
constructor() { }
constructor(
private themeservice: ThemeService
) { }
online() {
document.body.style.setProperty(`--color`, "#0782C9");
document.body.style.setProperty(`--color2`, "#45BAFF");
document.body.style.setProperty(`--color3`, "#0782C9");
document.body.style.setProperty(`--color4`, "#0782c9f0");
document.body.style.setProperty(`--color5`, "#45BAFF");
if (this.themeservice.currentTheme == 'gov') {
document.body.style.setProperty(`--color`, "#d9d9d9");
document.body.style.setProperty(`--color2`, "#f0f0f0");
document.body.style.setProperty(`--color3`, "#d9d9d9");
document.body.style.setProperty(`--color4`, "#d9d9d9ee");
document.body.style.setProperty(`--color5`, "#ececec");
} else {
document.body.style.setProperty(`--color`, "#0782C9");
document.body.style.setProperty(`--color2`, "#45BAFF");
document.body.style.setProperty(`--color3`, "#0782C9");
document.body.style.setProperty(`--color4`, "#0782c9f0");
document.body.style.setProperty(`--color5`, "#45BAFF");
}
this.callBacks.forEach((e) => {
if (e.type == 'Online') {
e.funx()
+4 -2
View File
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { StorageService } from 'src/app/services/storage.service';
@Injectable({
providedIn: 'root'
@@ -12,7 +13,7 @@ export class ThemeService {
currentTheme = 'gov'
constructor() { }
constructor(private storageservice: StorageService) { }
setTheme(theme: 'gov' | 'default') {
@@ -20,7 +21,8 @@ export class ThemeService {
document.body.classList.remove("default");
document.body.classList.add(theme);
this.currentTheme = theme
console.log('Current theme', theme)
console.log('Current theme', theme);
this.storageservice.store('theme',theme);
}