[mempool | blockchain] position changes between main/mining dashboards
This commit is contained in:
parent
b1bd6f8fdb
commit
538ae3b757
@ -1,8 +1,8 @@
|
|||||||
<div class="text-center" class="blockchain-wrapper">
|
<div class="text-center" class="blockchain-wrapper animate" #container [class]="stateService.blockShifted ? 'move-left' : ''">
|
||||||
<div class="position-container {{ network }}">
|
<div class="position-container {{ network }}">
|
||||||
<span>
|
<span>
|
||||||
<app-mempool-blocks></app-mempool-blocks>
|
<app-mempool-blocks></app-mempool-blocks>
|
||||||
<app-blockchain-blocks></app-blockchain-blocks>
|
<app-blockchain-blocks [miningInfo]="miningInfo"></app-blockchain-blocks>
|
||||||
<div id="divider"></div>
|
<div id="divider"></div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.blockchain-wrapper {
|
.blockchain-wrapper {
|
||||||
overflow: hidden;
|
|
||||||
height: 250px;
|
height: 250px;
|
||||||
|
|
||||||
-webkit-user-select: none; /* Safari */
|
-webkit-user-select: none; /* Safari */
|
||||||
@ -61,3 +60,13 @@
|
|||||||
left: -150px;
|
left: -150px;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.animate {
|
||||||
|
transition: all 1s ease-in-out;
|
||||||
|
}
|
||||||
|
.move-left {
|
||||||
|
transform: translate(-40%, 0);
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
transform: translate(-85%, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
|
import { Component, OnInit, ChangeDetectionStrategy, Input, ViewChild, ElementRef } from '@angular/core';
|
||||||
import { StateService } from 'src/app/services/state.service';
|
import { StateService } from 'src/app/services/state.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -8,13 +8,25 @@ import { StateService } from 'src/app/services/state.service';
|
|||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class BlockchainComponent implements OnInit {
|
export class BlockchainComponent implements OnInit {
|
||||||
|
@Input() miningInfo: boolean = false;
|
||||||
|
@ViewChild('container') container: ElementRef;
|
||||||
network: string;
|
network: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private stateService: StateService,
|
public stateService: StateService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.network = this.stateService.network;
|
this.network = this.stateService.network;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.miningInfo) {
|
||||||
|
this.container.nativeElement.className += ' move-left';
|
||||||
|
this.stateService.blockShifted = true;
|
||||||
|
} else if (this.stateService.blockShifted) {
|
||||||
|
this.container.nativeElement.className = this.container.nativeElement.className.replace(' move-left', '');
|
||||||
|
this.stateService.blockShifted = false;
|
||||||
|
}
|
||||||
|
}, 250);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
<div class="container-xl dashboard-container">
|
<!-- lastest blocks -->
|
||||||
|
<div id="blockchain-container" class="fade-border" dir="ltr" #blockchainContainer>
|
||||||
|
<app-blockchain [miningInfo]=true></app-blockchain>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-xl">
|
||||||
|
|
||||||
<!-- lastest blocks -->
|
|
||||||
<div class="text-center" class="blockchain-wrapper fade-border">
|
|
||||||
<div class="position-container">
|
|
||||||
<span>
|
|
||||||
<app-blockchain-blocks [miningInfo]="true"></app-blockchain-blocks>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row row-cols-1 row-cols-md-2 mt-3">
|
<div class="row row-cols-1 row-cols-md-2 mt-3">
|
||||||
|
|
||||||
|
@ -29,22 +29,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.blockchain-wrapper {
|
#blockchain-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow-x: scroll;
|
||||||
height: 250px;
|
overflow-y: hidden;
|
||||||
|
scrollbar-width: none;
|
||||||
-webkit-user-select: none; /* Safari */
|
-ms-overflow-style: none;
|
||||||
-moz-user-select: none; /* Firefox */
|
|
||||||
-ms-user-select: none; /* IE10+/Edge */
|
|
||||||
user-select: none; /* Standard */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.position-container {
|
#blockchain-container::-webkit-scrollbar {
|
||||||
position: absolute;
|
display: none;
|
||||||
top: 75px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.fade-border {
|
.fade-border {
|
||||||
-webkit-mask-image: linear-gradient(90deg, #000 70%, transparent);
|
-webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 80%, transparent 100%)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,7 @@ export class StateService {
|
|||||||
keyNavigation$ = new Subject<KeyboardEvent>();
|
keyNavigation$ = new Subject<KeyboardEvent>();
|
||||||
|
|
||||||
blockScrolling$: Subject<boolean> = new Subject<boolean>();
|
blockScrolling$: Subject<boolean> = new Subject<boolean>();
|
||||||
|
public blockShifted: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(PLATFORM_ID) private platformId: any,
|
@Inject(PLATFORM_ID) private platformId: any,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user