@internetarchive/ia-book-actions 0.1.11-b4 → 0.1.11-b5
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 +4 -3
package/package.json
CHANGED
package/src/ia-book-actions.js
CHANGED
|
@@ -534,10 +534,11 @@ 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
|
|
537
|
+
const firstStrokeDashOffset = Number.parseInt(((secondsLeft / this.loanRenewTimeConfig.loanTotalTime) * 315) * 1.5, 10);
|
|
538
|
+
const actualStrokeDashOffset = firstStrokeDashOffset > 315 ? 315 : firstStrokeDashOffset;
|
|
538
539
|
|
|
539
540
|
|
|
540
|
-
console.log('resetTimerCountState === ', { secondsLeft,
|
|
541
|
+
console.log('resetTimerCountState === ', { secondsLeft, firstStrokeDashOffset, actualStrokeDashOffset});
|
|
541
542
|
|
|
542
543
|
// set seconds left in loan expire
|
|
543
544
|
timerCountdown.style?.setProperty('--secondsLeftOnLoan', `${secondsLeft}s`);
|
|
@@ -545,7 +546,7 @@ export default class IABookActions extends LitElement {
|
|
|
545
546
|
// set circle stroke offset left in loan expire
|
|
546
547
|
timerCountdown.style?.setProperty(
|
|
547
548
|
'--strokeLeftOnLoan',
|
|
548
|
-
`${
|
|
549
|
+
`${actualStrokeDashOffset}` // the perimeter of the circle = (π * 2 * radius)
|
|
549
550
|
);
|
|
550
551
|
|
|
551
552
|
const animationCircle = timerCountdown.shadowRoot.querySelector('.circle');
|