@internetarchive/ia-book-actions 0.1.11-b3 → 0.1.11-b4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ia-book-actions.js +12 -13
package/package.json
CHANGED
package/src/ia-book-actions.js
CHANGED
|
@@ -534,10 +534,10 @@ export default class IABookActions extends LitElement {
|
|
|
534
534
|
if (!timerCountdown) return;
|
|
535
535
|
|
|
536
536
|
const secondsLeft = Number.parseInt((Number(this.lendingStatus.secondsLeftOnLoan)), 10);
|
|
537
|
-
const strokeDashOffset =
|
|
538
|
-
(secondsLeft / this.loanRenewTimeConfig.loanTotalTime) * 315;
|
|
537
|
+
const strokeDashOffset = Number.parseInt(((secondsLeft / this.loanRenewTimeConfig.loanTotalTime) * 315) * 1.5, 10);
|
|
539
538
|
|
|
540
|
-
|
|
539
|
+
|
|
540
|
+
console.log('resetTimerCountState === ', { secondsLeft, strokeDashOffset });
|
|
541
541
|
|
|
542
542
|
// set seconds left in loan expire
|
|
543
543
|
timerCountdown.style?.setProperty('--secondsLeftOnLoan', `${secondsLeft}s`);
|
|
@@ -545,7 +545,7 @@ export default class IABookActions extends LitElement {
|
|
|
545
545
|
// set circle stroke offset left in loan expire
|
|
546
546
|
timerCountdown.style?.setProperty(
|
|
547
547
|
'--strokeLeftOnLoan',
|
|
548
|
-
`${
|
|
548
|
+
`${strokeDashOffset}` // the perimeter of the circle = (π * 2 * radius)
|
|
549
549
|
);
|
|
550
550
|
|
|
551
551
|
const animationCircle = timerCountdown.shadowRoot.querySelector('.circle');
|
|
@@ -574,14 +574,6 @@ export default class IABookActions extends LitElement {
|
|
|
574
574
|
></book-title-bar>`;
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
-
get timerCountdownTemplate() {
|
|
578
|
-
return this.borrowType === 'browsed'
|
|
579
|
-
? html`<timer-countdown
|
|
580
|
-
.secondsLeftOnLoan=${Number(this.lendingStatus.secondsLeftOnLoan)}
|
|
581
|
-
></timer-countdown>`
|
|
582
|
-
: nothing;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
577
|
get bookActionBar() {
|
|
586
578
|
return html`
|
|
587
579
|
<collapsible-action-group
|
|
@@ -606,7 +598,10 @@ export default class IABookActions extends LitElement {
|
|
|
606
598
|
>
|
|
607
599
|
</collapsible-action-group>
|
|
608
600
|
${this.textGroupTemplate} ${this.infoIconTemplate}
|
|
609
|
-
|
|
601
|
+
<timer-countdown
|
|
602
|
+
.secondsLeftOnLoan=${Number(this.lendingStatus.secondsLeftOnLoan)}
|
|
603
|
+
class=${this.borrowType === 'browsed' ? '' : 'hide'}
|
|
604
|
+
></timer-countdown>
|
|
610
605
|
`;
|
|
611
606
|
}
|
|
612
607
|
|
|
@@ -952,6 +947,10 @@ export default class IABookActions extends LitElement {
|
|
|
952
947
|
display: block;
|
|
953
948
|
}
|
|
954
949
|
|
|
950
|
+
.hide {
|
|
951
|
+
display: none;
|
|
952
|
+
}
|
|
953
|
+
|
|
955
954
|
.lending-wrapper {
|
|
956
955
|
width: 100%;
|
|
957
956
|
margin: 0 auto;
|