fix: improve small screen support
This commit is contained in:
1 parent
ed33e9d59b
commit
ae1a3bffc0
9 files changed
+76
-58
No files matched your search
@@ -21,6 +21,7 @@
|
||||
"@sveltejs/adapter-vercel": "^5.1.0",
|
||||
"@sveltejs/kit": "latest",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||
"@tailwindcss/container-queries": "^0.1.1",
|
||||
"@types/markdown-it": "^12.2.3",
|
||||
"@types/markdown-it-container": "^2.0.6",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<a
|
||||
{...$$restProps}
|
||||
class="items-center flex flex-row gap-2 hover:underline flex-shrink-0 {$$props.class ||
|
||||
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {$$props.class ||
|
||||
''}"
|
||||
href="/c/{community.name}@{new URL(community.actor_id).hostname}"
|
||||
>
|
||||
@@ -27,18 +27,25 @@
|
||||
{/if}
|
||||
|
||||
{#if name}
|
||||
<span class="flex gap-0 items-center">
|
||||
<span class="flex gap-0 items-center max-w-full min-w-0 flex-shrink">
|
||||
<span class="font-medium">{community.title}</span>
|
||||
{#if showInstance}
|
||||
<span class="font-medium">{community.title}</span>
|
||||
<span
|
||||
class="text-slate-500 dark:text-zinc-500 font-normal {$$props.instanceClass ||
|
||||
''}"
|
||||
class="text-slate-500 dark:text-zinc-500 font-normal
|
||||
instance-text flex-shrink {$$props.instanceClass || ''}"
|
||||
>
|
||||
@{new URL(community.actor_id).hostname}
|
||||
</span>
|
||||
{:else}
|
||||
{community.title}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
<style>
|
||||
.instance-text {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -124,30 +124,30 @@
|
||||
combinedPosts = combinedPosts.toSpliced(index, 1)
|
||||
}}
|
||||
>
|
||||
<button
|
||||
slot="badges"
|
||||
class:hidden={!post.withCrossposts}
|
||||
on:click={() => {
|
||||
if (viewPost == post.post.id) viewPost = -1
|
||||
else viewPost = post.post.id
|
||||
}}
|
||||
>
|
||||
<svelte:fragment slot="badges">
|
||||
{#if post.withCrossposts}
|
||||
<Badge
|
||||
class="z-10 backdrop-blur-xl hover:brightness-110 cursor-pointer transition-all"
|
||||
color="gray-subtle"
|
||||
<button
|
||||
on:click={() => {
|
||||
if (viewPost == post.post.id) viewPost = -1
|
||||
else viewPost = post.post.id
|
||||
}}
|
||||
>
|
||||
{#if viewPost == post.post.id}
|
||||
<Icon mini src={Minus} size="14" />
|
||||
{:else}
|
||||
<Icon mini src={Plus} size="14" />
|
||||
{/if}
|
||||
{post.crossposts.length} crosspost{post.crossposts.length == 1
|
||||
? ''
|
||||
: 's'}
|
||||
</Badge>
|
||||
{/if}
|
||||
</button>
|
||||
<Badge
|
||||
class="z-10 backdrop-blur-xl hover:brightness-110 cursor-pointer transition-all"
|
||||
color="gray-subtle"
|
||||
>
|
||||
{#if viewPost == post.post.id}
|
||||
<Icon mini src={Minus} size="14" />
|
||||
{:else}
|
||||
<Icon mini src={Plus} size="14" />
|
||||
{/if}
|
||||
{post.crossposts.length} crosspost{post.crossposts.length ==
|
||||
1
|
||||
? ''
|
||||
: 's'}
|
||||
</Badge>
|
||||
</button>{/if}
|
||||
</svelte:fragment>
|
||||
</Post>
|
||||
{#if post.withCrossposts && viewPost == post.post.id}
|
||||
<div
|
||||
|
||||
@@ -60,13 +60,14 @@
|
||||
subscribed =
|
||||
subscribed == 'NotSubscribed' ? 'Subscribed' : 'NotSubscribed'
|
||||
}}
|
||||
class="relative cursor-pointer pr-2 row-span-2"
|
||||
class="relative cursor-pointer pr-2 row-span-2 flex-shrink-0"
|
||||
>
|
||||
<Avatar
|
||||
url={community.icon}
|
||||
width={28}
|
||||
alt={community.name}
|
||||
style="grid-area: avatar; height: 100%;"
|
||||
class="flex-shrink-0"
|
||||
/>
|
||||
{#if subscribed != undefined && $profile?.jwt}
|
||||
<div
|
||||
@@ -87,10 +88,14 @@
|
||||
</Subscribe>
|
||||
{/if}
|
||||
{#if community}
|
||||
<CommunityLink {community} style="grid-area: community;" />
|
||||
<CommunityLink
|
||||
{community}
|
||||
style="grid-area: community;"
|
||||
class="flex-shrink"
|
||||
/>
|
||||
{/if}
|
||||
<span
|
||||
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 flex-wrap items-center"
|
||||
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 items-center"
|
||||
style="grid-area: stats;"
|
||||
>
|
||||
{#if user}
|
||||
@@ -106,12 +111,11 @@
|
||||
</UserLink>
|
||||
{/if}
|
||||
{#if published}
|
||||
<RelativeDate date={published} />
|
||||
<RelativeDate date={published} class="flex-shrink-0" />
|
||||
{/if}
|
||||
</span>
|
||||
<div
|
||||
class="flex flex-row items-center self-center flex-wrap gap-2 [&>*]:flex-shrink-0
|
||||
{Object.values(badges).some(Boolean) ? 'pt-2' : ''}"
|
||||
class="flex flex-row items-center self-center flex-wrap gap-2 [&>*]:flex-shrink-0 badges"
|
||||
style="grid-area: badges;"
|
||||
>
|
||||
{#if badges.nsfw}
|
||||
@@ -192,4 +196,8 @@
|
||||
grid-template-rows: auto auto auto;
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
|
||||
.badges:not(:empty) {
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
@@ -16,20 +16,28 @@
|
||||
</script>
|
||||
|
||||
<a
|
||||
class="items-center inline-flex flex-row gap-1 hover:underline {$$props.class ??
|
||||
class="items-center flex flex-row gap-1 hover:underline max-w-full min-w-0 {$$props.class ??
|
||||
''}"
|
||||
href="/u/{user.name}@{new URL(user.actor_id).hostname}"
|
||||
>
|
||||
{#if avatar}
|
||||
<Avatar url={user.avatar} alt={user.name} width={avatarSize} />
|
||||
<Avatar
|
||||
url={user.avatar}
|
||||
alt={user.name}
|
||||
width={avatarSize}
|
||||
class="flex-shrink-0"
|
||||
/>
|
||||
{/if}
|
||||
<span class="flex flex-wrap gap-0 items-center" class:ml-0.5={avatar}>
|
||||
<span
|
||||
class="flex gap-0 items-center flex-shrink max-w-full min-w-0"
|
||||
class:ml-0.5={avatar}
|
||||
>
|
||||
<span class:font-medium={showInstance}>
|
||||
{$userSettings.displayNames ? user.display_name || user.name : user.name}
|
||||
</span>
|
||||
{#if showInstance}
|
||||
<span
|
||||
class="text-slate-500 dark:text-zinc-500 font-normal {$$props.instanceClass ??
|
||||
class="text-slate-500 dark:text-zinc-500 font-normal instance-text flex-shrink {$$props.instanceClass ??
|
||||
''}"
|
||||
>
|
||||
@{new URL(user.actor_id).hostname}
|
||||
@@ -48,3 +56,12 @@
|
||||
<slot name="badges" />
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
<style>
|
||||
.instance-text {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -100,7 +100,9 @@
|
||||
</SearchBar>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="flex flex-row gap-2 py-2 px-2 items-center w-full">
|
||||
<div
|
||||
class="flex flex-row gap-2 py-2 px-2 items-center w-full rounded-full overflow-auto"
|
||||
>
|
||||
<div class="ml-auto" />
|
||||
{#if $profile?.user && isAdmin($profile.user)}
|
||||
<NavButton
|
||||
|
||||
@@ -54,20 +54,3 @@
|
||||
</Pageination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.background-gradient {
|
||||
background-image: radial-gradient(
|
||||
circle at left,
|
||||
rgba(162, 1, 114, 0.05) 0%,
|
||||
rgba(255, 0, 43, 0) 100%
|
||||
),
|
||||
radial-gradient(
|
||||
circle at 60% 80%,
|
||||
rgba(162, 33, 1, 0.1) 0%,
|
||||
rgba(255, 0, 174, 0) 100%
|
||||
);
|
||||
background-repeat: no-repeat;
|
||||
mask-image: linear-gradient(to bottom, rgba(0 0 0 / 100%), transparent);
|
||||
}
|
||||
</style>
|
||||
+1
-1
@@ -66,5 +66,5 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
plugins: [require('@tailwindcss/container-queries')],
|
||||
}
|
||||
Reference in new issue
Block a user