Compare commits

...

2 Commits

Author SHA1 Message Date
natsoni
1927ab1bd8
Hide standard ETA data until proper ETA calculation gets implemented 2024-07-09 16:49:17 +09:00
natsoni
f756fb4d79
Update shape colors 2024-07-09 00:02:05 +09:00
3 changed files with 59 additions and 53 deletions

View File

@ -45,9 +45,9 @@
<div class="interval-spacer"> <div class="interval-spacer">
<div class="acc-to-confirmed"></div> <div class="acc-to-confirmed"></div>
</div> </div>
<div class="node mined" [id]="'confirmed'" > <div class="node selected" [id]="'confirmed'">
<div class="acc-to-confirmed left" ></div> <div class="acc-to-confirmed left" ></div>
<div class="shape-border mined-selected"> <div class="shape-border">
<div class="shape"></div> <div class="shape"></div>
</div> </div>
<div class="status"><span class="badge badge-success" i18n="transaction.rbf.mined">Mined</span></div> <div class="status"><span class="badge badge-success" i18n="transaction.rbf.mined">Mined</span></div>
@ -71,7 +71,7 @@
<div class="interval"> <div class="interval">
<div class="interval-time"> <div class="interval-time">
@if (eta) { @if (eta) {
~<app-time [time]="eta?.wait / 1000"></app-time> <span *ngIf="accelerateRatio > 1" class="compare"> ({{ accelerateRatio }}x faster)</span> ~<app-time [time]="eta?.wait / 1000"></app-time> <!-- <span *ngIf="accelerateRatio > 1" class="compare"> ({{ accelerateRatio }}x faster)</span> -->
} }
</div> </div>
</div> </div>
@ -106,7 +106,8 @@
<div class="node-spacer"></div> <div class="node-spacer"></div>
<div class="interval"> <div class="interval">
<div class="interval-time"> <div class="interval-time">
~<app-time [time]="standardETA / 1000 - now"></app-time> <!-- ~<app-time [time]="standardETA / 1000 - now"></app-time> -->
-
</div> </div>
</div> </div>
<div class="node-spacer"></div> <div class="node-spacer"></div>
@ -125,11 +126,11 @@
<div class="interval-spacer"> <div class="interval-spacer">
<div class="seen-to-acc"></div> <div class="seen-to-acc"></div>
</div> </div>
<div class="node" [id]="'accelerated'"> <div class="node accelerated" [id]="'accelerated'">
<div class="seen-to-acc left"></div> <div class="seen-to-acc left"></div>
<div class="seen-to-acc right"></div> <div class="seen-to-acc right"></div>
<div class="shape-border accelerated-selected"> <div class="shape-border">
<div class="shape accelerating"></div> <div class="shape"></div>
<div class="connector down loading"></div> <div class="connector down loading"></div>
</div> </div>
<div class="time" style="margin-top: 3px;"> <div class="time" style="margin-top: 3px;">

View File

@ -123,28 +123,6 @@
left: 50%; left: 50%;
} }
} }
.connector {
position: absolute;
height: 88px;
width: 10px;
left: -5px;
top: -73px;
transform: translateX(120%);
background: var(--tertiary);
&.down {
border-top-left-radius: 10px;
}
&.up {
border-top-right-radius: 10px;
}
&.loading {
animation: acceleratePulse 1s infinite;
}
}
} }
.nodes { .nodes {
@ -159,16 +137,19 @@
margin-bottom: -8px; margin-bottom: -8px;
transform: translateY(-50%); transform: translateY(-50%);
border-radius: 50%; border-radius: 50%;
padding: 2px; cursor: pointer;
padding: 4px;
background: transparent;
transition: background-color 300ms, padding 300ms;
.shape { .shape {
position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
background: white; background: white;
&.accelerating { transition: background-color 300ms, border 300ms;
animation: acceleratePulse 1s infinite; z-index: 1;
}
} }
&.waiting { &.waiting {
@ -177,16 +158,38 @@
} }
} }
&.accelerated-selected { .connector {
.shape { position: absolute;
background: var(--tertiary); height: 88px;
width: 10px;
left: -5px;
top: -73px;
transform: translateX(120%);
background: var(--tertiary);
&.down {
border-top-left-radius: 10px;
}
&.up {
border-top-right-radius: 10px;
}
&.loading {
animation: acceleratePulse 1s infinite;
} }
} }
}
&.mined-selected { &.accelerated {
.shape { .shape-border {
background: var(--success); animation: acceleratePulse 1s infinite;
} }
}
&.selected {
.shape-border {
background: var(--mainnet-alt);
} }
} }

View File

@ -28,14 +28,16 @@ export class AccelerationTimelineComponent implements OnInit, OnChanges {
ngOnChanges(changes): void { ngOnChanges(changes): void {
this.now = Math.floor(new Date().getTime() / 1000); this.now = Math.floor(new Date().getTime() / 1000);
if (changes?.eta?.currentValue || changes?.standardETA?.currentValue || changes?.acceleratedETA?.currentValue) { // Hide standard ETA while we don't have a proper standard ETA calculation, see https://github.com/mempool/mempool/issues/65
if (changes?.eta?.currentValue) {
if (changes?.acceleratedETA?.currentValue) { // if (changes?.eta?.currentValue || changes?.standardETA?.currentValue || changes?.acceleratedETA?.currentValue) {
this.accelerateRatio = Math.floor((Math.floor(changes.eta.currentValue.time / 1000) - this.now) / (Math.floor(changes.acceleratedETA.currentValue / 1000) - this.now)); // if (changes?.eta?.currentValue) {
} else if (changes?.standardETA?.currentValue) { // if (changes?.acceleratedETA?.currentValue) {
this.accelerateRatio = Math.floor((Math.floor(changes.standardETA.currentValue / 1000) - this.now) / (Math.floor(changes.eta.currentValue.time / 1000) - this.now)); // this.accelerateRatio = Math.floor((Math.floor(changes.eta.currentValue.time / 1000) - this.now) / (Math.floor(changes.acceleratedETA.currentValue / 1000) - this.now));
} // } else if (changes?.standardETA?.currentValue) {
} // this.accelerateRatio = Math.floor((Math.floor(changes.standardETA.currentValue / 1000) - this.now) / (Math.floor(changes.eta.currentValue.time / 1000) - this.now));
} // }
// }
// }
} }
} }