Commit 314ba28d authored by van.chen's avatar van.chen

报警组件

parent 0c149dff
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<Icon [type]="'voice'" class="alarmLeftIcon"></Icon> <Icon [type]="'voice'" class="alarmLeftIcon"></Icon>
<div class="alarmShows"> <div class="alarmShows">
<div class="alarmItem" *ngFor="let one of options;let i = index" <div class="alarmItem" *ngFor="let one of options;let i = index"
[ngClass]="{'active' : active === i, 'unActive': active !== i}">{{one.a}}</div> [ngClass]="{'active' : active === i, 'unActive': active !== i}">{{one.a}}
<div>{{one.time | date: 'yyyy-MM-dd HH:mm:ss'}}</div> <div class="alarmTime">{{one.time | date: 'yyyy-MM-dd HH:mm:ss'}}</div>
</div>
</div> </div>
</div> </div>
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
} }
.alarmLeftIcon { .alarmLeftIcon {
color: #f98e55; color: #ff0000;
height: 20px; height: 20px;
width: 20px; width: 20px;
display: inline-flex; display: inline-flex;
text-align: center; text-align: center;
padding: 0 5px 0 15px; padding: 7px 5px 0 15px;
vertical-align: middle; vertical-align: top;
} }
.alarmShows { .alarmShows {
...@@ -25,64 +25,83 @@ ...@@ -25,64 +25,83 @@
.alarmItem { .alarmItem {
width: 100%; width: 100%;
color: #ff0000;
font-size: 12px;
height: auto;
} }
.alarmItem.active { .alarmItem.active {
display: block; display: block;
-webkit-animation: slideIn .2s forwards; -webkit-animation: slideIn 1s forwards;
animation: slideIn .2s forwards; animation: slideIn 1s forwards;
} }
.alarmItem.unActive { .alarmItem.unActive {
display: none; display: none;
-webkit-animation: slideOut .2s forwards; -webkit-animation: slideOut 1s forwards;
animation: slideOut .2s forwards; animation: slideOut 1s forwards;
}
.alarmTime {
text-align: right;
padding-right: 10px;
color: #ff0000;
font-size: 12px;
padding-top: 5px;
} }
@-webkit-keyframes slideIn { @-webkit-keyframes slideIn {
from { from {
-webkit-transform: translate3d(0, 100%, 0); -webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0) transform: translate3d(0, 100%, 0);
opacity: 0;
} }
to { to {
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0) transform: translate3d(0, 0, 0);
opacity: 1;
} }
} }
@keyframes slideIn { @keyframes slideIn {
from { from {
-webkit-transform: translate3d(0, 100%, 0); -webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0) transform: translate3d(0, 100%, 0);
opacity: 0;
} }
to { to {
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0) transform: translate3d(0, 0, 0);
opacity: 1;
} }
} }
@-webkit-keyframes slideOut { @-webkit-keyframes slideOut {
from { from {
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0) transform: translate3d(0, 0, 0);
opacity: 1;
} }
to { to {
-webkit-transform: translate3d(0, 100%, 0); -webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0) transform: translate3d(0, 100%, 0);
opacity: 0;
} }
} }
@keyframes slideOut { @keyframes slideOut {
from { from {
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0) transform: translate3d(0, 0, 0);
opacity: 1;
} }
to { to {
-webkit-transform: translate3d(0, 100%, 0); -webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0) transform: translate3d(0, 100%, 0);
opacity: 0;
} }
} }
...@@ -26,7 +26,7 @@ export class AlarmBarComponent implements OnInit { ...@@ -26,7 +26,7 @@ export class AlarmBarComponent implements OnInit {
this.active++; this.active++;
} }
this.changeAlarm(); this.changeAlarm();
}, 2000); }, 3000);
} }
ngOnInit() { ngOnInit() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment