Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions fixtures/view-transition/src/components/Page.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@
}

.swipe-recognizer {
width: 200px;
border: 1px solid #333333;
width: 300px;
background: #eee;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

border-radius: 10px;
padding: 20px;
}

.button {
background: #000;
color: #fff;
border: 0px;
border-radius: 5px;
padding: 10px;
}
135 changes: 70 additions & 65 deletions fixtures/view-transition/src/components/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,75 +74,80 @@ export default function Page({url, navigate}) {
</ViewTransition>
);
return (
<div>
<button
onClick={() => {
navigate(url === '/?b' ? '/?a' : '/?b');
}}>
{url === '/?b' ? 'A' : 'B'}
</button>
<ViewTransition className="none">
<div>
<ViewTransition>
<div>
<ViewTransition className={transitions['slide-on-nav']}>
<h1>{!show ? 'A' : 'B'}</h1>
</ViewTransition>
</div>
</ViewTransition>
<ViewTransition
className={{
'navigation-back': transitions['slide-right'],
'navigation-forward': transitions['slide-left'],
}}>
<h1>{!show ? 'A' + counter : 'B' + counter}</h1>
</ViewTransition>
{show ? (
<div>
{a}
{b}
</div>
) : (
<div>
{b}
{a}
</div>
)}
<ViewTransition>
{show ? <div>hello{exclamation}</div> : <section>Loading</section>}
</ViewTransition>
<p>scroll me</p>
<p>
<Id />
</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<div className="swipe-recognizer">
<SwipeRecognizer
action={swipeAction}
gesture={startGesture}
direction={show ? 'left' : 'right'}>
Swipe me
</SwipeRecognizer>
</div>
<p></p>
<p></p>
{show ? null : (
<div className="swipe-recognizer">
<SwipeRecognizer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i missed this, this is sick

action={swipeAction}
gesture={startGesture}
direction={show ? 'left' : 'right'}>
<button
className="button"
onClick={() => {
navigate(url === '/?b' ? '/?a' : '/?b');
}}>
{url === '/?b' ? 'Goto A' : 'Goto B'}
</button>
<ViewTransition className="none">
<div>
<ViewTransition>
<div>world{exclamation}</div>
<div>
<ViewTransition className={transitions['slide-on-nav']}>
<h1>{!show ? 'A' : 'B' + counter}</h1>
</ViewTransition>
</div>
</ViewTransition>
<ViewTransition
className={{
'navigation-back': transitions['slide-right'],
'navigation-forward': transitions['slide-left'],
}}>
<h1>{!show ? 'A' + counter : 'B'}</h1>
</ViewTransition>
)}
<Activity mode={show ? 'visible' : 'hidden'}>
{show ? (
<div>
{a}
{b}
</div>
) : (
<div>
{b}
{a}
</div>
)}
<ViewTransition>
<div>!!</div>
{show ? (
<div>hello{exclamation}</div>
) : (
<section>Loading</section>
)}
</ViewTransition>
</Activity>
{show ? <Component /> : null}
</div>
</ViewTransition>
<p>
<Id />
</p>
{show ? null : (
<ViewTransition>
<div>world{exclamation}</div>
</ViewTransition>
)}
<Activity mode={show ? 'visible' : 'hidden'}>
<ViewTransition>
<div>!!</div>
</ViewTransition>
</Activity>
<p>these</p>
<p>rows</p>
<p>exist</p>
<p>to</p>
<p>test</p>
<p>scrolling</p>
<p>content</p>
<p>out</p>
<p>of</p>
<p>the</p>
<p>viewport</p>
{show ? <Component /> : null}
</div>
</ViewTransition>
</SwipeRecognizer>
</div>
);
}
Loading