From 66d0bc8d84c38f48036099d2c0b512796ea0194c Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 23 Nov 2024 16:10:48 +0800 Subject: [PATCH] Profile: support wide page --- src/platform/StackedRouter.css | 11 +- src/profiles/Profile.css | 38 +++ src/profiles/Profile.tsx | 600 +++++++++++++++++---------------- 3 files changed, 347 insertions(+), 302 deletions(-) diff --git a/src/platform/StackedRouter.css b/src/platform/StackedRouter.css index dc787bb..320dfe7 100644 --- a/src/platform/StackedRouter.css +++ b/src/platform/StackedRouter.css @@ -1,9 +1,10 @@ .StackedPage { - contain: layout style; - container: StackedPage / size; - display: contents; - max-width: 100vw; - max-width: 100dvw; + contain: strict; + container: StackedPage / inline-size; + width: 100vw; + width: 100dvw; + height: 100vh; + height: 100dvh; } dialog.StackedPage { diff --git a/src/profiles/Profile.css b/src/profiles/Profile.css index 994a278..7dcfa70 100644 --- a/src/profiles/Profile.css +++ b/src/profiles/Profile.css @@ -115,6 +115,44 @@ } } +@container StackedPage (inline-size >=960px) { + .Profile { + display: grid; + grid-template-columns: auto 560px; + grid-template-rows: min-content 1fr; + height: 100cqh; + + >.topbar { + grid-column: 1 / 3; + grid-row: 1 /2; + + .MuiToolbar-root { + padding-right: calc(560px + 24px); + } + } + + > .details { + height: 100%; + display: flex; + flex-flow: column nowrap; + + > .intro { + flex-grow: 1; + } + } + + >.recent-toots { + overflow-y: auto; + margin-top: calc(-1 * var(--scaffold-topbar-height)); + z-index: calc(var(--tutu-zidx-nav, 1) + 1); + + >.toot-list-toolbar { + top: 0; + } + } + } +} + .Profile__page-title { flex-grow: 1; white-space: nowrap; diff --git a/src/profiles/Profile.tsx b/src/profiles/Profile.tsx index 04aba5f..f795c7c 100644 --- a/src/profiles/Profile.tsx +++ b/src/profiles/Profile.tsx @@ -237,315 +237,321 @@ const Profile: Component = () => { } class="Profile" > - - document.getElementById(menuButId)!.getBoundingClientRect() - } - aria-label="Options for the Profile" - > - - - - - - - - - {/* // for future */} - - - - { - const { left, right, top } = - event.currentTarget.getBoundingClientRect(); - openSubscribeMenu({ - left, - right, - top, - e: 1, - }); - }} - > - - - - Subscribe... - - } - > - - - - - Edit... +
+ + document.getElementById(menuButId)!.getBoundingClientRect() + } + aria-label="Options for the Profile" + > + + + + + + + + + {/* // for future */} - - - - - - - Followers - - - {profile()?.followersCount ?? ""} - - - - - - - - Following - - - {profile()?.followingCount ?? ""} - - - - - - - - Blocklist - - - - - - Mention in... - - - - - - - Open in browser... - - share({ url: profile()?.url })}> - - - - Share... - - - - - - - - - - - - 's Home - - - - - - -
-
- -
-
- - - - - - - - createRenderEffect(() => (e.innerHTML = displayName())) - } - aria-label="Display name" - > -
- {fullUsername()} -
-
- - - {<>} - - - - - - - - - - -
-
-
- createRenderEffect(() => (e.innerHTML = description() || "")) - } - >
- - - - - {(item, index) => { - return ( - - - - - - ); - }} - - -
{item.name} - - - - { - createRenderEffect(() => (e.innerHTML = item.value)); - }} - >
-
- -
- -
- - - 0}> - + + + + Subscribe... + + } + > + + + + + Edit... + + + + + + + + + Followers + + + {profile()?.followersCount ?? ""} + + + + + + + + Following + + + {profile()?.followingCount ?? ""} + + + + + + + + Blocklist + + + + + + Mention in... + - - - - - + + + + + Open in browser... + + share({ url: profile()?.url })}> + + + + Share... + +
+ + + + + + + + + 's Home + + + + + + +
- + +
+
+ + + + + + + + createRenderEffect(() => (e.innerHTML = displayName())) + } + aria-label="Display name" + > +
+ + {fullUsername()} + +
+
+ + + {<>} + + + + + + + + + + +
+ +
+ createRenderEffect(() => (e.innerHTML = description() || "")) + } + >
+ + - }> - - - + + + {(item, index) => { + return ( + + + + + + ); + }} + + +
{item.name} + + + + { + createRenderEffect(() => (e.innerHTML = item.value)); + }} + >
- + + +
+
+ +
+ + + 0}> + + + + + + + +
+ + }> + + + +
+
+
); };