Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions src/transition/ios.transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ export const createIosTransitionAnimation = <TOpts extends IosTransitionAnimatio
const shade = navEl.ownerDocument.createElement('div');
shade.className = 'ios-transition-shade';
shade.setAttribute('aria-hidden', 'true');
const edge = navEl.ownerDocument.createElement('div');
edge.setAttribute('aria-hidden', 'true');
const clipPath = topPage.style.clipPath;
// UIKit's continuous page outline is smaller in tablet-sized panes.
const [corner, control] = topPage.offsetWidth >= 768 ? [36, 13] : [78, 22];
Expand All @@ -198,18 +196,8 @@ export const createIosTransitionAnimation = <TOpts extends IosTransitionAnimatio
pointerEvents: 'none',
background: 'rgba(0, 0, 0, 0.1)',
});
Object.assign(edge.style, {
position: 'absolute',
top: '0',
bottom: '0',
[isRTL ? 'right' : 'left']: '-100%',
width: '100%',
zIndex: topPage.style.zIndex,
pointerEvents: 'none',
background: `linear-gradient(to ${isRTL ? 'right' : 'left'}, rgba(0, 0, 0, 0.02), transparent 18px)`,
});
rootAnimation.beforeAddWrite(() => {
topPage.before(shade, edge);
topPage.before(shade);
topPage.style.clipPath = `inset(0 round ${corner * 0.82}px)`;
topPage.style.clipPath = `shape(from 0px ${corner}px,
curve to ${corner}px 0px with 0px ${control}px / ${control}px 0px, hline to calc(100% - ${corner}px),
Expand All @@ -219,23 +207,13 @@ export const createIosTransitionAnimation = <TOpts extends IosTransitionAnimatio
});
rootAnimation.afterAddWrite(() => {
shade.remove();
edge.remove();
topPage.style.clipPath = clipPath;
});
rootAnimation.addAnimation(
createAnimation()
.addElement(shade)
.fromTo(OPACITY, backDirection ? 1 : 0, backDirection ? 0 : 1),
);
rootAnimation.addAnimation(
createAnimation()
.addElement(edge)
.fromTo(
TRANSFORM,
`translateX(${backDirection ? CENTER : OFF_RIGHT})`,
`translateX(${backDirection ? (isRTL ? '-100%' : '100%') : CENTER})`,
),
);
}

if (leavingEl && navEl !== null && navEl !== undefined) {
Expand Down
Loading