page-transition 0.1.0-beta.47 → 0.1.0-beta.49
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/README.md
CHANGED
|
@@ -10,7 +10,7 @@ A page transition library for the Next.js App Router.
|
|
|
10
10
|
- Scroll restoration
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
|
-
 
|
|
14
14
|
|
|
15
15
|
`npm install page-transition@beta`
|
|
16
16
|
|
|
@@ -169,8 +169,20 @@ items: [1, 0]
|
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
```css
|
|
172
|
+
[data-transition] .page-wrapper{
|
|
173
|
+
opacity: 1;
|
|
174
|
+
transition: opacity 0.5s linear;
|
|
175
|
+
}
|
|
176
|
+
[data-transition].exit .page-wrapper{
|
|
177
|
+
opacity: 0;
|
|
178
|
+
}
|
|
179
|
+
[data-transition].enter .page-wrapper{
|
|
180
|
+
opacity: 1;
|
|
181
|
+
}
|
|
182
|
+
|
|
172
183
|
[data-transition] .overlay-wrapper{
|
|
173
184
|
position: fixed;
|
|
185
|
+
z-index: 99;
|
|
174
186
|
inset: 0;
|
|
175
187
|
|
|
176
188
|
display: grid;
|
|
@@ -7,11 +7,12 @@ export function transitionRunning(elArray, transitionProperty) {
|
|
|
7
7
|
'transform': 'transform'
|
|
8
8
|
};
|
|
9
9
|
if (elArray[0].getAnimations().some((obj) => {
|
|
10
|
+
const progress = obj.effect?.getComputedTiming().progress;
|
|
10
11
|
return obj.playState === 'running' &&
|
|
11
12
|
obj.effect instanceof KeyframeEffect &&
|
|
12
13
|
obj.effect.getKeyframes().some(frame => {
|
|
13
14
|
return frame[property[transitionProperty]] !== undefined;
|
|
14
|
-
});
|
|
15
|
+
}) && progress != null && progress !== 0;
|
|
15
16
|
})) {
|
|
16
17
|
return true;
|
|
17
18
|
}
|
|
@@ -72,6 +72,7 @@ export function useHandleLinkClick({ container, handleLinkClick, currentPathname
|
|
|
72
72
|
new Promise((resolve) => {
|
|
73
73
|
if (state.current === 'navigating') {
|
|
74
74
|
if (basePathUrl === currentPathname.current) {
|
|
75
|
+
afterExitFn.current?.();
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
else if (basePathUrl !== currentPathname.current) {
|