mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
refactor(traffic): align content
This commit is contained in:
parent
082f72b441
commit
c2f6c03ae6
4 changed files with 59 additions and 71 deletions
|
|
@ -1,16 +1,9 @@
|
|||
<div class="traffic-bar">
|
||||
<div class="period-from">{{ barData.prevDate }}</div>
|
||||
<div class="vertical-progress-bar">
|
||||
<div class="progress-line"
|
||||
[style.height.%]="barData.prevValue">
|
||||
<span class="value-prev caption">{{ barData.prevDate }}</span>
|
||||
<div class="progress-line-container" [style.height.%]="barData.prevValue">
|
||||
<div class="progress-line-prev"></div>
|
||||
</div>
|
||||
<div class="progress-line-container" [style.height.%]="barData.nextValue">
|
||||
<div class="progress-line-now" [class.success]="successDelta" [class.failure]="!successDelta">
|
||||
</div>
|
||||
</div>
|
||||
<div class="vertical-progress-bar">
|
||||
<div class="progress-line"
|
||||
[style.height.%]="barData.nextValue"
|
||||
[class.success]="successDelta"
|
||||
[class.failure]="!successDelta">
|
||||
</div>
|
||||
</div>
|
||||
<div class="period-to">{{ barData.nextDate }}</div>
|
||||
</div>
|
||||
<span class="value-now caption">{{ barData.nextDate }}</span>
|
||||
|
|
|
|||
|
|
@ -1,49 +1,54 @@
|
|||
@import '../../../../../@theme/styles/themes';
|
||||
|
||||
@include nb-install-component() {
|
||||
height: 100%;
|
||||
|
||||
.traffic-bar {
|
||||
display: flex;
|
||||
align-self: stretch;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
align-items: flex-end;
|
||||
height: nb-theme(list-item-line-height);
|
||||
max-width: 7rem;
|
||||
|
||||
> * {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
.value-prev,
|
||||
.value-now {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.period-from, .period-to {
|
||||
align-self: flex-end;
|
||||
font-size: 1rem;
|
||||
line-height: 0.8;
|
||||
.progress-line-container {
|
||||
flex: 1;
|
||||
margin-bottom: 0.1875rem;
|
||||
}
|
||||
|
||||
.period-from {
|
||||
position: absolute;
|
||||
@include nb-ltr(right, 100%);
|
||||
@include nb-rtl(left, 100%);
|
||||
bottom: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.vertical-progress-bar {
|
||||
.progress-line-prev,
|
||||
.progress-line-now {
|
||||
height: 100%;
|
||||
width: 0.7rem;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.progress-line {
|
||||
.progress-line-prev {
|
||||
background-color: nb-theme(border-basic-color-3);
|
||||
width: 100%;
|
||||
@include nb-ltr {
|
||||
margin-left: auto;
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
@include nb-rtl {
|
||||
margin-left: 0.25rem;
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-line-now {
|
||||
@include nb-ltr {
|
||||
margin-left: 0.25rem;
|
||||
margin-right: auto;
|
||||
}
|
||||
@include nb-rtl {
|
||||
margin-left: auto;
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
&.success {
|
||||
background-color: nb-theme(color-success-default);
|
||||
}
|
||||
|
||||
&.failure {
|
||||
background-color: nb-theme(color-danger-default);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<nb-list>
|
||||
<nb-list-item class="item" *ngFor="let item of frontCardData; trackBy: trackByDate">
|
||||
<span class="caption">{{ item.date }}</span>
|
||||
<span>{{ item.value }}</span>
|
||||
<span>{{ item.date }}</span>
|
||||
<span clsas="value">{{ item.value }}</span>
|
||||
<span class="delta" [class.up]="item.delta.up" [class.down]="!item.delta.up">
|
||||
<nb-icon [icon]="item.delta.up ? 'arrow-up' : 'arrow-down'" pack="eva"></nb-icon>
|
||||
{{ item.delta.value }}%
|
||||
|
|
|
|||
|
|
@ -5,29 +5,23 @@
|
|||
@include nb-install-component() {
|
||||
overflow: auto;
|
||||
|
||||
nb-card-body {
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 4.5rem;
|
||||
|
||||
> * {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
> * {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
ngx-traffic-bar {
|
||||
flex: 1;
|
||||
}
|
||||
.value,
|
||||
.delta {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.delta {
|
||||
|
|
@ -41,10 +35,6 @@
|
|||
&.up {
|
||||
color: nb-theme(color-success-default);
|
||||
}
|
||||
|
||||
nb-icon ::ng-deep svg {
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-down(is) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue