-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
297 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/app/pages/account-settings/account-settings.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="row"> | ||
<div class="col-6"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<h4 clas="card-title">Temas</h4> | ||
<hr> | ||
<div class="r-panel-body"> | ||
<ul id="themecolors" class="m-t-20"> | ||
<li><b>Con el sidebar claro</b></li> | ||
<li><a #link1 (click)="cambiarColor('green', link1)" class="selector green-theme">2</a></li> | ||
<li><a #link2 (click)="cambiarColor('default', link2)" class="selector default-theme">1</a></li> | ||
<li><a #link3 (click)="cambiarColor('red', link3)" class="selector red-theme">3</a></li> | ||
<li><a #link4 (click)="cambiarColor('blue', link4)" class="selector blue-theme">4</a></li> | ||
<li><a #link5 (click)="cambiarColor('purple', link5)" class="selector purple-theme">5</a></li> | ||
<li><a #link6 (click)="cambiarColor('megna', link6)" class="selector megna-theme">6</a></li> | ||
|
||
<li class="d-block m-t-30"><b>Con el sidebar oscuro</b></li> | ||
<li><a #link7 (click)="cambiarColor('default-dark', link7)" class="selector default-dark-theme">7</a></li> | ||
<li><a #link8 (click)="cambiarColor('green-dark', link8)" class="selector green-dark-theme">8</a></li> | ||
<li><a #link9 (click)="cambiarColor('red-dark', link9)" class="selector red-dark-theme">9</a></li> | ||
<li><a #link10 (click)="cambiarColor('blue-dark', link10)" class="selector blue-dark-theme">10</a></li> | ||
<li><a #link11 (click)="cambiarColor('purple-dark', link11)" class="selector purple-dark-theme">11</a></li> | ||
<li><a #link12 (click)="cambiarColor('megna-dark', link12)" class="selector megna-dark-theme">12</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
34 changes: 34 additions & 0 deletions
34
src/app/pages/account-settings/account-settings.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Component, OnInit, Inject } from '@angular/core'; | ||
import { SettingsService } from '../../services/service.index'; | ||
|
||
@Component({ | ||
selector: 'app-account-settings', | ||
templateUrl: './account-settings.component.html', | ||
styles: [] | ||
}) | ||
export class AccountSettingsComponent implements OnInit { | ||
estilos: string = 'selector '; | ||
|
||
constructor(public _ajustesService: SettingsService) {} | ||
|
||
ngOnInit() { | ||
this.colocarCheckAlInicio(); | ||
} | ||
|
||
cambiarColor(tema, link) { | ||
this._ajustesService.aplicarTema(tema); | ||
this.aplicarCheck(link); | ||
} | ||
|
||
aplicarCheck(link) { | ||
link.classList.add('working'); | ||
const links: Array<HTMLElement> = Array.from(document.getElementsByClassName('selector')); | ||
links.forEach((el) => el.classList.remove('working')); | ||
} | ||
|
||
colocarCheckAlInicio() { | ||
const link = document.getElementsByClassName(`${this._ajustesService.ajustes.tema}-theme`)[0]; | ||
link.classList.add('working'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { SettingsService } from './settings/settings.service'; | ||
export { SharedService } from './shared/shared.service'; | ||
export { SidebarService } from './shared/sidebar.service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { | ||
SharedService, | ||
SidebarService, | ||
SettingsService | ||
} from './service.index'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
], | ||
declarations: [], | ||
providers: [ | ||
SharedService, | ||
SidebarService, | ||
SettingsService | ||
] | ||
}) | ||
|
||
export class ServiceModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Injectable, Inject } from '@angular/core'; | ||
import { DOCUMENT } from '@angular/platform-browser'; | ||
|
||
@Injectable() | ||
export class SettingsService { | ||
|
||
ajustes: Ajustes = { | ||
temaUrl: 'assets/css/color/default.css', | ||
tema: 'default' | ||
}; | ||
|
||
constructor(@Inject(DOCUMENT) private _document) { | ||
this.cargarAjustes(); | ||
} | ||
|
||
guardarAjustes() { | ||
localStorage.setItem('ajustes', JSON.stringify(this.ajustes)); | ||
} | ||
|
||
cargarAjustes() { | ||
this.ajustes = JSON.parse(localStorage.getItem('ajustes')) || this.ajustes; | ||
this.aplicarTema(this.ajustes.tema); | ||
} | ||
|
||
aplicarTema(tema) { | ||
const url = `assets/css/colors/${tema}.css`; | ||
this._document.getElementById('tema').setAttribute('href', url); | ||
|
||
this.ajustes.tema = tema; | ||
this.ajustes.temaUrl = url; | ||
this.guardarAjustes(); | ||
} | ||
} | ||
|
||
interface Ajustes { | ||
temaUrl: string; | ||
tema: string; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable() | ||
export class SidebarService { | ||
menu: Array<Object> = [ | ||
{ | ||
titulo: 'Principal', | ||
icono: 'mdi mdi-guage', | ||
submenu: [ | ||
{ titulo: 'Dashboard', url: '/dashboard' }, | ||
{ titulo: 'ProgressBar', url: '/progress' }, | ||
{ titulo: 'Gráficas', url: '/graficas1' }, | ||
] | ||
}]; | ||
|
||
constructor() { } | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.