Skip to content

Commit b1cf000

Browse files
committed
style: make quiblet page responsive
1 parent bca2167 commit b1cf000

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

frontend/src/routes/(app)/q/[name]/+page.svelte

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import Avatar from '$lib/components/ui/avatar.svelte';
55
import { cn } from '$lib/functions/classnames';
66
import { FormatDate } from '$lib/functions/date';
7+
import { pluralize } from '$lib/functions/pluralize';
78
import { createAuthStore } from '$lib/stores/auth.svelte';
89
import { createSidebarStore } from '$lib/stores/sidebar.svelte';
910
import type { PageData } from './$types';
@@ -43,18 +44,36 @@
4344
<!-- show quiblet cover if not null or solid bg -->
4445
<div
4546
class={cn(
46-
!quiblet?.banner ? 'h-24 bg-neutral' : 'h-40 bg-cover bg-center',
47+
!quiblet?.banner ? 'h-24 bg-neutral' : 'h-24 bg-cover bg-center md:h-40',
4748
'w-full rounded-2xl'
4849
)}
4950
style="background-image: url({quiblet?.banner});"
5051
></div>
51-
<div class="absolute inset-x-0 -bottom-12 flex items-end justify-between px-4">
52-
<div class="flex items-end gap-2">
52+
<div
53+
class="inset-x-0 -bottom-12 flex flex-col justify-between gap-4 md:absolute md:flex-row md:items-end md:px-4"
54+
>
55+
<div class="mt-4 flex items-center gap-2 md:mt-0 md:items-end">
5356
<Avatar
54-
class="size-20 rounded-full outline outline-8 outline-base-300"
57+
class="size-14 flex-shrink-0 rounded-full outline-8 outline-base-300 md:size-20 md:outline"
5558
src={quiblet?.avatar}
5659
/>
57-
<h3 class="text-2xl font-bold text-info">q/{quiblet?.name}</h3>
60+
<div class="flex flex-col">
61+
<h3 class="text-xl font-bold text-info md:text-2xl">q/{quiblet?.name}</h3>
62+
<div class="flex items-center gap-2 md:hidden">
63+
<div class="flex items-center gap-1">
64+
<span class="text-sm text-info">{quiblet?.members?.length}</span>
65+
<span class="text-xs text-base-content/75"
66+
>{pluralize('Member', quiblet?.members?.length ?? 0)}</span
67+
>
68+
</div>
69+
<div class="flex items-center gap-1">
70+
<span class="text-sm text-info">{quiblet?.quibs}</span>
71+
<span class="text-xs text-base-content/75"
72+
>{pluralize('Quib', quiblet?.quibs)}</span
73+
>
74+
</div>
75+
</div>
76+
</div>
5877
</div>
5978
<!-- quiblet basic operations -->
6079
<div class="flex items-center gap-2">
@@ -65,13 +84,13 @@
6584
<button class="btn btn-secondary h-10 px-3" aria-label="Join quiblet">
6685
<span class="text-sm font-medium">{is_joined ? 'Joined' : 'Join'}</span>
6786
</button>
68-
<button class="btn btn-neutral size-10 p-0" aria-label="More options">
87+
<button class="btn btn-neutral ml-auto size-10 p-0 md:ml-0" aria-label="More options">
6988
<coreicons-shape-more class="size-5 rotate-90"></coreicons-shape-more>
7089
</button>
7190
</div>
7291
</div>
7392
</div>
74-
<div class="h-12"></div>
93+
<div class="hidden h-12 md:flex"></div>
7594
<QuibsHeader />
7695
<!-- list highlighted quibs if exists -->
7796
{#if highlighted_quibs?.length}
@@ -80,7 +99,7 @@
8099
<coreicons-shape-hash class="size-5"></coreicons-shape-hash>
81100
<h4 class="font-medium">Highlights</h4>
82101
</div>
83-
<div class="grid grid-cols-3 gap-4">
102+
<div class="grid grid-cols-2 gap-4 md:grid-cols-3">
84103
{#each highlighted_quibs as quib}
85104
<div
86105
class="relative flex h-40 flex-col gap-2 overflow-hidden rounded-2xl border border-neutral p-2 transition-colors hover:bg-base-200"

0 commit comments

Comments
 (0)