page-transition 0.1.0-beta.40 → 0.1.0-beta.42

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.
@@ -6,6 +6,7 @@ export function updatePlaybackRate({ rafId, rejectFn, elArray, transitionPropert
6
6
  let progress = 0;
7
7
  let summ = target ? 0 : duration;
8
8
  let animationArray = [];
9
+ let start = false;
9
10
  elArray.forEach((el) => {
10
11
  el?.getAnimations().forEach((obj) => {
11
12
  if (obj instanceof CSSTransition &&
@@ -27,6 +28,13 @@ export function updatePlaybackRate({ rafId, rejectFn, elArray, transitionPropert
27
28
  summ = target ? Math.min(summ + dt, duration) : Math.max(summ - dt, 0);
28
29
  progress = summ / duration;
29
30
  animationArray.forEach((obj) => {
31
+ const currentTime = obj.currentTime;
32
+ if (target && typeof currentTime === 'number' && currentTime > 0)
33
+ start = true;
34
+ if (obj.playState !== "running" ||
35
+ typeof currentTime !== "number" ||
36
+ currentTime <= 0 && start)
37
+ return;
30
38
  obj.updatePlaybackRate(progress);
31
39
  console.log("AFTER", {
32
40
  meinProg: progress,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "page-transition",
3
- "version": "0.1.0-beta.40",
3
+ "version": "0.1.0-beta.42",
4
4
  "description": "A page transition library for the Next.js App Router.",
5
5
  "license": "MIT",
6
6
  "files": [