Skip to content

Commit 26abf05

Browse files
author
Di Wang
committed
settings page - add white bg
1 parent b122d5d commit 26abf05

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

src/app/dashboard/settings/settings.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ <h4 class="text-center text-uppercase">Sidebar Background</h4>
1919
<div class="col-md-12 dot-row">
2020
<div class="dot red" (click)="bgColorChooseClick('#D80B0B')"></div>
2121
<div class="dot dodgerblue" (click)="bgColorChooseClick('dodgerblue')"></div>
22+
<div class="dot white" (click)="bgColorChooseClick('#fff')"></div>
2223
<div class="dot black" (click)="bgColorChooseClick('#000')"></div>
2324
</div>
2425
</div>

src/app/sidebar/sidebar.component.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
left: 13px;
1414
}
1515

16-
.logo:after{
16+
.divider{
1717
content: '';
18-
position: absolute;
19-
bottom: 0;
20-
right: 15px;
18+
position: relative;
2119
height: 1px;
20+
left: 15px;
2221
width: calc(100% - 30px);
2322
background-color: rgba(255, 255, 255, 0.5);
2423
}
@@ -62,7 +61,6 @@
6261

6362
.nav li a span{
6463
margin-left: 20px;
65-
font-weight: 100;
6664
}
6765

6866
.active a, .active a:hover{

src/app/sidebar/sidebar.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
<div class="logo text-uppercase">
1+
<div class="logo text-uppercase" [style.color]="normalFontColor">
22
<img src="../../assets/img/angular2-logo.png" class="logo-img" alt="logo"/>
33
Dashboard Pro
44
</div>
5+
<div class="divider" [style.background-color]="dividerBgColor"></div>
56
<div class="sidebar-wrapper">
67
<div class="nav-container">
78
<ul class="nav">
89
<li *ngFor="let menuItem of menuItems" routerLinkActive #rla="routerLinkActive" [ngClass]="rla.isActive? 'active' : ''" [routerLinkActiveOptions]="{exact: true}">
9-
<a [routerLink]="[menuItem.path]" [style.background-color]="rla.isActive? color : 'transparent'" [style.color]="rla.isActive? activeFontColor : 'rgba(255,255,255,.8)'">
10+
<a [routerLink]="[menuItem.path]" [style.background-color]="rla.isActive? color : 'transparent'" [style.color]="rla.isActive? activeFontColor : normalFontColor">
1011
<i class="material-icons">{{menuItem.icon}}</i>
1112
<span>{{menuItem.title}}</span>
1213
</a>

src/app/sidebar/sidebar.component.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,37 @@ export class SidebarComponent implements OnInit, AfterViewInit, OnDestroy {
1111
public color: string;
1212
public menuItems: object;
1313
public activeFontColor: string;
14-
constructor(public setingsService: SettingsService) {
14+
public normalFontColor: string;
15+
public dividerBgColor: string;
16+
constructor(public settingsService: SettingsService) {
1517
this.menuItems = ROUTES;
1618
this.activeFontColor = 'rgba(0,0,0,.6)';
19+
this.normalFontColor = 'rgba(255,255,255,.8)';
20+
this.dividerBgColor = 'rgba(255, 255, 255, 0.5)';
1721
}
1822

1923
ngOnInit() {
20-
this.color = this.setingsService.getSidebarFilter();
21-
this.setingsService.sidebarFilterUpdate.subscribe((filter: string) => {
24+
this.color = this.settingsService.getSidebarFilter();
25+
this.settingsService.sidebarFilterUpdate.subscribe((filter: string) => {
2226
this.color = filter;
2327
if (filter === '#fff') {
2428
this.activeFontColor = 'rgba(0,0,0,.6)';
2529
}else {
2630
this.activeFontColor = 'rgba(255,255,255,.8)';
2731
}
2832
});
33+
this.settingsService.sidebarColorUpdate.subscribe((color: string) => {
34+
if (color === '#fff') {
35+
this.normalFontColor = 'rgba(0,0,0,.6)';
36+
this.dividerBgColor = 'rgba(0,0,0,.1)';
37+
}else {
38+
this.normalFontColor = 'rgba(255,255,255,.8)';
39+
this.dividerBgColor = 'rgba(255, 255, 255, 0.5)';
40+
}
41+
});
2942
}
3043
ngOnDestroy() {
31-
this.setingsService.sidebarFilterUpdate.unsubscribe();
44+
this.settingsService.sidebarFilterUpdate.unsubscribe();
3245
}
3346

3447
ngAfterViewInit() {

0 commit comments

Comments
 (0)