Blink projected halving block.
This commit is contained in:
parent
ba3aba918a
commit
422055046e
@ -1,7 +1,7 @@
|
|||||||
<div class="mempool-blocks-container">
|
<div class="mempool-blocks-container">
|
||||||
<div class="flashing">
|
<div class="flashing">
|
||||||
<div *ngFor="let projectedBlock of mempoolBlocks; let i = index; trackBy: trackByFn">
|
<div *ngFor="let projectedBlock of mempoolBlocks; let i = index; trackBy: trackByFn">
|
||||||
<div class="bitcoin-block text-center mempool-block" id="mempool-block-{{ i }}" [ngStyle]="getStyleForMempoolBlockAtIndex(i)">
|
<div class="bitcoin-block text-center mempool-block" [class.blink-bg]="blocksLeftToHalving === (i + 1)" id="mempool-block-{{ i }}" [ngStyle]="getStyleForMempoolBlockAtIndex(i)">
|
||||||
<a [routerLink]="['/mempool-block/' | relativeUrl, i]" class="blockLink"> </a>
|
<a [routerLink]="['/mempool-block/' | relativeUrl, i]" class="blockLink"> </a>
|
||||||
<div class="block-body" *ngIf="mempoolBlocks?.length">
|
<div class="block-body" *ngIf="mempoolBlocks?.length">
|
||||||
<div class="fees">
|
<div class="fees">
|
||||||
|
@ -111,3 +111,21 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Blinking block
|
||||||
|
|
||||||
|
.blink-bg {
|
||||||
|
color: #fff;
|
||||||
|
animation: blinkingBackground 1s infinite;
|
||||||
|
background: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blinkingBackground {
|
||||||
|
0% { background-color: #10c018;}
|
||||||
|
25% { background-color: #1056c0;}
|
||||||
|
50% { background-color: #ef0a1a;}
|
||||||
|
75% { background-color: #CFB53B;}
|
||||||
|
100% { background-color: #04a1d5;}
|
||||||
|
}
|
@ -28,12 +28,20 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
resetTransitionTimeout: number;
|
resetTransitionTimeout: number;
|
||||||
|
|
||||||
|
blocksLeftToHalving: number;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private stateService: StateService,
|
private stateService: StateService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
this.stateService.blocks$
|
||||||
|
.subscribe((block) => {
|
||||||
|
this.blocksLeftToHalving = 630000 - block.height;
|
||||||
|
});
|
||||||
|
|
||||||
this.mempoolBlocksSubscription = this.stateService.mempoolBlocks$
|
this.mempoolBlocksSubscription = this.stateService.mempoolBlocks$
|
||||||
.subscribe((blocks) => {
|
.subscribe((blocks) => {
|
||||||
const stringifiedBlocks = JSON.stringify(blocks);
|
const stringifiedBlocks = JSON.stringify(blocks);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user