design: tweak design

This commit is contained in:
Xyphyn committed 2023-07-30 14:44:43 -07:00
1 parent ddea19e6b9
commit 62baf475b6
7 files changed
+57 -36

No files matched your search

@@ -69,16 +69,13 @@
<StickyCard>
<div class="flex flex-row gap-3 items-center">
<Avatar
width={42}
url={community_view.community.icon ??
`https://api.dicebear.com/6.x/initials/svg?seed=${community_view.community.name}`}
width={48}
url={community_view.community.icon}
alt={community_view.community.name}
/>
<div class="flex flex-col">
<h1 class="font-bold text-base">
{community_view.community.title}
</h1>
<span class="opacity-60 text-sm">
<div class="flex flex-col gap-0">
<h1 class="font-bold text-xl">{community_view.community.title}</h1>
<span class="dark:text-zinc-400 text-slate-600 text-sm">
!{community_view.community.name}@{new URL(
community_view.community.actor_id
).hostname}
+2 -2
View File
@@ -10,15 +10,15 @@
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
export let post: PostView
export let actions: boolean = true
export let hideCommunity = false
</script>
<Card class="bg-white flex flex-col w-full p-5 gap-2.5">
<div class="flex flex-row w-full gap-2.5">
<div class="flex flex-col gap-1.5 grow">
<PostMeta
community={post.community}
community={hideCommunity ? undefined : post.community}
user={post.creator}
published={new Date(post.post.published + 'Z')}
upvotes={post.counts.upvotes}
+11 -6
View File
@@ -13,7 +13,7 @@
Trash,
} from 'svelte-hero-icons'
export let community: Community
export let community: Community | undefined = undefined
export let user: Person | undefined = undefined
export let published: Date
@@ -31,15 +31,20 @@
</script>
<span class="flex flex-row gap-2 text-sm items-center">
<Avatar url={community.icon} width={24} alt={community.name} />
{#if community}
<Avatar url={community.icon} width={24} alt={community.name} />
{/if}
<div class="flex flex-col text-xs">
<CommunityLink {community} />
{#if community}
<CommunityLink {community} />
{/if}
<span
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-1 flex-wrap"
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-1 flex-wrap items-center"
>
{#if user}
<UserLink {user} />
<span>•</span>
<div class="mr-0.5 text-zinc-100">
<UserLink avatarSize={20} {user} avatar={!community} />
</div>
{/if}
<RelativeDate date={published} />
{#if upvotes != undefined && downvotes != undefined}
@@ -23,7 +23,12 @@
{#if avatar}
<Avatar url={user.avatar} alt={user.name} width={avatarSize} />
{/if}
<span class="flex flex-wrap gap-0" class:text-red-500={user.admin}>
<span
class="flex flex-wrap gap-0"
class:ml-0.5={avatar}
class:text-red-500={user.admin}
class:font-bold={user.admin}
>
{#if $userSettings.showInstance}
{user.name}
<span class="text-slate-500 dark:text-zinc-400 font-normal">
+5 -3
View File
@@ -32,6 +32,8 @@
<Navbar />
<ToastContainer />
<Moderation />
<main class="mx-auto max-w-5xl p-4 flex-1 w-full">
<slot />
</main>
<div class="flex flex-row w-full mx-auto max-w-6xl">
<main class="p-4 flex-[3]">
<slot />
</main>
</div>
+22 -12
View File
@@ -12,6 +12,7 @@
import { userSettings } from '$lib/settings.js'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
export let data
@@ -20,14 +21,11 @@
<svelte:head>
<title>{data.posts.posts[0]?.community.name}</title>
<meta
name="og:title"
content={data.community.community_view.community.name}
/>
{#if data.community.community_view.community.description}
<meta name="og:title" content={data.community.community.name} />
{#if data.community.community.description}
<meta
name="og:description"
content={data.community.community_view.community.description}
content={data.community.community.description}
/>
{/if}
<meta name="og:url" content={$page.url.toString()} />
@@ -36,15 +34,27 @@
<Modal bind:open={sidebar}>
<span slot="title">Sidebar</span>
<div class="mx-auto">
<CommunityCard community_view={data.community.community_view} />
<CommunityCard community_view={data.community} />
</div>
</Modal>
<div class="flex flex-col md:flex-row gap-4 w-full">
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<h1 class="text-2xl font-bold">
{data.community.community_view.community.title}
</h1>
<div class="flex flex-row gap-3 items-center">
<Avatar
width={48}
url={data.community.community.icon}
alt={data.community.community.name}
/>
<div class="flex flex-col gap-0">
<h1 class="font-bold text-xl">{data.community.community.title}</h1>
<span class="dark:text-zinc-400 text-slate-600 text-sm">
!{data.community.community.name}@{new URL(
data.community.community.actor_id
).hostname}
</span>
</div>
</div>
<div class="md:hidden">
<Button color="secondary" on:click={() => (sidebar = true)}>
Sidebar
@@ -68,7 +78,7 @@
</div>
{#each data.posts.posts as post, index (post.post.id)}
<div in:fly={{ y: -8, opacity: 0, delay: index < 4 ? index * 100 : 0 }}>
<Post {post} />
<Post hideCommunity={true} {post} />
</div>
{/each}
<Pageination
@@ -82,6 +92,6 @@
/>
</div>
<div class="hidden md:block">
<CommunityCard community_view={data.community.community_view} />
<CommunityCard community_view={data.community} />
</div>
</div>
+6 -4
View File
@@ -20,9 +20,11 @@ export async function load(req: any) {
sort: sort,
auth: get(authData)?.token,
}),
community: await getClient().getCommunity({
name: req.params.name,
auth: get(authData)?.token,
}),
community: (
await getClient().getCommunity({
name: req.params.name,
auth: get(authData)?.token,
})
).community_view,
}
}