diff --git a/frontend/src/app/components/blockchain/blockchain.component.html b/frontend/src/app/components/blockchain/blockchain.component.html index 04f71e130..5607b630b 100644 --- a/frontend/src/app/components/blockchain/blockchain.component.html +++ b/frontend/src/app/components/blockchain/blockchain.component.html @@ -1,8 +1,8 @@ -
+
- +
diff --git a/frontend/src/app/components/blockchain/blockchain.component.scss b/frontend/src/app/components/blockchain/blockchain.component.scss index cb5991d84..a33fc58d2 100644 --- a/frontend/src/app/components/blockchain/blockchain.component.scss +++ b/frontend/src/app/components/blockchain/blockchain.component.scss @@ -16,7 +16,6 @@ } .blockchain-wrapper { - overflow: hidden; height: 250px; -webkit-user-select: none; /* Safari */ @@ -61,3 +60,13 @@ left: -150px; top: 0px; } + +.animate { + transition: all 1s ease-in-out; +} +.move-left { + transform: translate(-40%, 0); + @media (max-width: 767.98px) { + transform: translate(-85%, 0); + } +} diff --git a/frontend/src/app/components/blockchain/blockchain.component.ts b/frontend/src/app/components/blockchain/blockchain.component.ts index f17569e27..10c9be309 100644 --- a/frontend/src/app/components/blockchain/blockchain.component.ts +++ b/frontend/src/app/components/blockchain/blockchain.component.ts @@ -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'; @Component({ @@ -8,13 +8,25 @@ import { StateService } from 'src/app/services/state.service'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class BlockchainComponent implements OnInit { + @Input() miningInfo: boolean = false; + @ViewChild('container') container: ElementRef; network: string; constructor( - private stateService: StateService, + public stateService: StateService, ) {} ngOnInit() { 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); } } diff --git a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html index 3c294dd0f..d3ca36060 100644 --- a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html +++ b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html @@ -1,13 +1,10 @@ -
+ +
+ +
+ +
- -
-
- - - -
-
diff --git a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss index 2aa192a3d..2e5ad3824 100644 --- a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss +++ b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss @@ -29,22 +29,19 @@ } } -.blockchain-wrapper { +#blockchain-container { position: relative; - overflow: hidden; - height: 250px; - - -webkit-user-select: none; /* Safari */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* IE10+/Edge */ - user-select: none; /* Standard */ + overflow-x: scroll; + overflow-y: hidden; + scrollbar-width: none; + -ms-overflow-style: none; } -.position-container { - position: absolute; - top: 75px; +#blockchain-container::-webkit-scrollbar { + display: none; } .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%) } + diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index 14d67e765..1b2b9833c 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -100,6 +100,7 @@ export class StateService { keyNavigation$ = new Subject(); blockScrolling$: Subject = new Subject(); + public blockShifted: boolean = false; constructor( @Inject(PLATFORM_ID) private platformId: any,