playing with colors

This commit is contained in:
nixa 2016-05-19 11:29:41 +03:00
parent 77a33d880b
commit 9fbe408c22
12 changed files with 121 additions and 114 deletions

View file

@ -10,7 +10,7 @@ export class LineChartService {
getData() { getData() {
var layoutColors = this._baConfig.get().colors; var layoutColors = this._baConfig.get().colors;
var graphColor = this._baConfig.get().theme.blur ? '#000000' : layoutColors.primary; var graphColor = this._baConfig.get().colors.custom.dashboardLineChart;
return { return {
type: 'serial', type: 'serial',
@ -84,7 +84,7 @@ export class LineChartService {
id: 'g1', id: 'g1',
bullet: 'none', bullet: 'none',
useLineColorForBulletBorder: true, useLineColorForBulletBorder: true,
lineColor: colorHelper.hexToRgbA(graphColor, 0.5), lineColor: colorHelper.hexToRgbA(graphColor, 0.15),
lineThickness: 1, lineThickness: 1,
negativeLineColor: layoutColors.danger, negativeLineColor: layoutColors.danger,
type: 'smoothedLine', type: 'smoothedLine',

View file

@ -12,7 +12,6 @@ import {TodoService} from './todo.service';
}) })
export class Todo { export class Todo {
public transparent = this._baConfig.get().theme.blur;
public dashboardColors = this._baConfig.get().colors.dashboard; public dashboardColors = this._baConfig.get().colors.dashboard;
public todoList:Array<any>; public todoList:Array<any>;

View file

@ -1,4 +1,4 @@
<div class="task-todo-container" [ngClass]="{'transparent': transparent}"> <div class="task-todo-container">
<input type="text" value="" class="form-control task-todo" placeholder="Task to do.." (keyup)="addToDoItem($event)" [(ngModel)]="newTodoText"/> <input type="text" value="" class="form-control task-todo" placeholder="Task to do.." (keyup)="addToDoItem($event)" [(ngModel)]="newTodoText"/>
<i (click)="addToDoItem($event)" class="add-item-icon ion-plus-round"></i> <i (click)="addToDoItem($event)" class="add-item-icon ion-plus-round"></i>
<div class="box-shadow-border"></div> <div class="box-shadow-border"></div>

View file

@ -99,94 +99,96 @@ label.todo-checkbox {
display: none; display: none;
} }
.task-todo-container.transparent { .ng2, .blur {
.todo-panel.panel {
color: white; .task-todo-container {
opacity: 0.9; .todo-panel.panel {
} color: white;
input.task-todo { opacity: 0.9;
color: white;
width: calc(100% - 25px);
border-radius: 0;
border: none;
background: transparent;
&:focus {
outline: none;
background-color: transparent;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.12);
} }
} input.task-todo {
.add-item-icon { color: white;
display: block; width: calc(100% - 25px);
float: right; border-radius: 0;
margin-top: -45px;
margin-right: 5px;
font-size: 25px;
cursor: pointer;
}
ul.todo-list {
li {
margin: 0;
border: none; border: none;
font-weight: $font-light; background: transparent;
&:focus {
outline: none;
background-color: transparent;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.12);
}
}
.add-item-icon {
display: block;
float: right;
margin-top: -45px;
margin-right: 5px;
font-size: 25px;
cursor: pointer;
}
.blur-container{ ul.todo-list {
height: 40px; li {
position: absolute; margin: 0;
width: calc(100% + 40px);; border: none;
top: 0; font-weight: $font-light;
left: -25px;
overflow-y: hidden; .blur-container {
} height: 40px;
&:hover{
.blur-container{
box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.12);
}
.blur-box {
height: 100%;
background: linear-gradient(to right, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%);
-webkit-filter: blur(3px);
}
}
i.remove-todo {
color: white;
opacity: 0.4;
&:hover {
color: white;
opacity: 0.95;
}
}
i.mark {
min-width: 40px;
display: none;
}
label.todo-checkbox > span {
&:before {
position: absolute; position: absolute;
color: $content-text; width: calc(100% + 40px);;
content: '\f10c'; top: 0;
float: none; left: -25px;
margin-right: 6px; overflow-y: hidden;
transition: none; }
&:hover {
.blur-container {
box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.12);
}
.blur-box {
height: 100%;
background: linear-gradient(to right, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
-webkit-filter: blur(3px);
}
}
i.remove-todo {
color: white;
opacity: 0.4;
&:hover {
color: white;
opacity: 0.95;
}
}
i.mark {
min-width: 40px;
display: none;
} }
}
&.checked {
label.todo-checkbox > span { label.todo-checkbox > span {
&:before { &:before {
content: '\f00c'; position: absolute;
color: $content-text;
content: '\f10c';
float: none;
margin-right: 6px;
transition: none;
}
}
&.checked {
label.todo-checkbox > span {
&:before {
content: '\f00c';
}
} }
} }
} }
} }
}
.box-shadow-border{ .box-shadow-border {
border-bottom: 1px solid rgba(0, 0, 0, 0.12); border-bottom: 1px solid rgba(0, 0, 0, 0.12);
box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.12); box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.12);
width: calc(100% + 44px); width: calc(100% + 44px);
margin-left: -22px; margin-left: -22px;
}
} }
} }

View file

@ -15,11 +15,9 @@ import {TrafficChartService} from './trafficChart.service';
export class TrafficChart { export class TrafficChart {
public doughnutData: Array<Object>; public doughnutData: Array<Object>;
public transparent:boolean = false;
constructor(private trafficChartService:TrafficChartService) { constructor(private trafficChartService:TrafficChartService) {
this.doughnutData = trafficChartService.getData(); this.doughnutData = trafficChartService.getData();
this.transparent = trafficChartService.getTransparent();
} }
ngAfterViewInit() { ngAfterViewInit() {

View file

@ -1,4 +1,4 @@
<div class="channels-block" [ngClass]="{'transparent': transparent}"> <div class="channels-block">
<div class="chart-bg"></div> <div class="chart-bg"></div>
<div class="traffic-chart" id="trafficChart"> <div class="traffic-chart" id="trafficChart">

View file

@ -5,21 +5,23 @@
position: relative; position: relative;
} }
.channels-block.transparent { .ng2, .blur {
.traffic-chart canvas{ .channels-block {
border: 10px solid rgba(0,0,0,0.35); .traffic-chart canvas{
box-shadow: 0 0 5px 0 rgb(0, 0, 0) inset; border: 15px solid rgba(0,0,0,0.2);
border-radius: 150px; //box-shadow: 0 0 5px 0 rgb(0, 0, 0) inset;
} border-radius: 150px;
}
.chart-bg{ .chart-bg{
position: absolute; position: absolute;
width: 180px; width: 180px;
height: 180px; height: 180px;
left: 60px; left: 60px;
top: 60px; top: 60px;
background-color: rgba(0,0,0,0.35); background-color: rgba(0,0,0,0.4);
border-radius: 100px; border-radius: 100px;
}
} }
} }

View file

@ -49,8 +49,4 @@ export class TrafficChartService {
}, },
]; ];
} }
getTransparent() {
return this._baConfig.get().theme.blur;
}
} }

View file

@ -53,6 +53,6 @@ export class BaCardBlur {
} }
private _isEnabled() { private _isEnabled() {
return this._baConfig.get().theme.blur; return this._baConfig.get().theme.name == 'blur';
} }
} }

View file

@ -7,23 +7,29 @@ import {BaThemeConfigProvider, isMobile} from '../../../theme';
}) })
export class BaThemeRun { export class BaThemeRun {
@HostBinding('class.blur-theme') isBlur:boolean = false; private _classes:Array<string> = [];
@HostBinding('class.mobile') isMobile:boolean = false; @HostBinding('class') classesString:string;
constructor(private _baConfig:BaThemeConfigProvider) { constructor(private _baConfig:BaThemeConfigProvider) {
} }
public ngOnInit():void { public ngOnInit():void {
this._assignBlur(); this._assignTheme();
this._assignMobile(); this._assignMobile();
} }
// TODO: assign any theme class, not only hardcoded blur private _assignTheme():void {
private _assignBlur():void { this._addClass(this._baConfig.get().theme.name);
this.isBlur = this._baConfig.get().theme.blur;
} }
private _assignMobile():void { private _assignMobile():void {
this.isMobile = isMobile(); if (isMobile()) {
this._addClass('mobile');
}
}
private _addClass(cls:string) {
this._classes.push(cls);
this.classesString = this._classes.join(' ');
} }
} }

View file

@ -26,8 +26,8 @@ $bootstrap-panel-header-border: none;
$bootstrap-panel-shadow: 1px 1px 4px 0 rgba(0, 0, 0, 0.15); $bootstrap-panel-shadow: 1px 1px 4px 0 rgba(0, 0, 0, 0.15);
$mail-box: whitesmoke; $mail-box: whitesmoke;
$auth-panel-background: #ffffff; $auth-panel-background: #ffffff;
$progress-background: rgba(#000000, 0.07); $progress-background: rgba(0,0,0, 0.15);
$progress-default: rgba(#000000, 0.15); $progress-default: rgba($default-text, 0.95);
$primary: #00abff !default; $primary: #00abff !default;
$info: #40daf1 !default; $info: #40daf1 !default;

View file

@ -31,7 +31,7 @@ export class BaThemeConfigProvider {
conf = { conf = {
theme: { theme: {
blur: false, name: 'ng2',
}, },
colors: { colors: {
default: this.basic.default, default: this.basic.default,
@ -64,6 +64,10 @@ export class BaThemeConfigProvider {
gossip: this.dashboardColors.gossip, gossip: this.dashboardColors.gossip,
white: this.dashboardColors.white, white: this.dashboardColors.white,
}, },
custom: {
dashboardLineChart: '#fff',
}
} }
}; };