diff --git a/src/app/app.component.html b/src/app/app.component.html index 90c6b64..8f5491e 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1 +1,37 @@ - \ No newline at end of file + +
+
+ + + + +
+
\ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e9f6ffa..3c119c7 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,4 +5,38 @@ import { Component } from '@angular/core'; templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) -export class AppComponent {} +export class AppComponent { + changeSidebarColor(color){ + var sidebar = document.getElementsByClassName('sidebar')[0]; + var mainPanel = document.getElementsByClassName('main-panel')[0]; + + this.sidebarColor = color; + + if(sidebar != undefined){ + sidebar.setAttribute('data',color); + } + if(mainPanel != undefined){ + mainPanel.setAttribute('data',color); + } + } + changeDashboardColor(color){ + var body = document.getElementsByTagName('body')[0]; + if (body && color === 'white-content') { + body.classList.add(color); + } + else if(body.classList.contains('white-content')) { + body.classList.remove('white-content'); + } + } + // function that adds color white/transparent to the navbar on resize (this is for the collapse) + updateColor = () => { + var navbar = document.getElementsByClassName('navbar')[0]; + if (window.innerWidth < 993 && !this.isCollapsed) { + navbar.classList.add('bg-white'); + navbar.classList.remove('navbar-transparent'); + } else { + navbar.classList.remove('bg-white'); + navbar.classList.add('navbar-transparent'); + } + }; +}