mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 09:17:47 +00:00
add feed indication
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Live Feed</a>
|
||||
<a class="navbar-brand" href="#"><span id="horn" class="glyphicon glyphicon-bullhorn"></span> Live Game Feed</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="myNavbar">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
@@ -6,11 +6,15 @@ import { Directive, ElementRef, HostListener, Input, Renderer } from '@angular/c
|
||||
export class HighlightDirective {
|
||||
constructor(private el: ElementRef, private renderer: Renderer) {
|
||||
let self = this;
|
||||
self.renderer.setElementClass(this.el.nativeElement, 'feed-highlight', true);
|
||||
setTimeout(function() {
|
||||
self.renderer.setElementClass(self.el.nativeElement,'feed-highlight-light', true);
|
||||
}, 1000);
|
||||
}
|
||||
self.renderer.setElementClass(this.el.nativeElement, 'feed-highlight', true);
|
||||
let horn = document.getElementById('horn');
|
||||
horn.className += ' orange';
|
||||
setTimeout(function () {
|
||||
self.renderer.setElementClass(self.el.nativeElement, 'feed-highlight-light', true);
|
||||
|
||||
document.getElementById("horn").className = document.getElementById("horn").className.replace(/(?:^|\s)orange(?!\S)/g, '')
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
private highlight(color: string) {
|
||||
this.renderer.setElementStyle(this.el.nativeElement, 'backgroundColor', color);
|
||||
|
||||
@@ -79,4 +79,8 @@ footer {
|
||||
background-color: #222222;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.orange {
|
||||
color: #ff5525;
|
||||
}
|
||||
Reference in New Issue
Block a user