Skip to content

Commit cc0c4a7

Browse files
committed
style: increase responsiveness for mobile view
1 parent fff8a98 commit cc0c4a7

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

apps/frontend/app/pages/index.vue

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const { isPending, isError, data, error } = useQuery({
3232
</script>
3333

3434
<template>
35-
<div class="min-h-screen flex flex-col items-center justify-center gap-4 py-4 text-center">
35+
<div class="min-h-screen flex flex-col items-center justify-center gap-4 px-4 py-4 text-center">
3636
<div class="flex items-end gap-2">
3737
<GridMaker
3838
:value="[
@@ -52,7 +52,7 @@ const { isPending, isError, data, error } = useQuery({
5252
/>
5353
</div>
5454

55-
<div class="flex items-center justify-center gap-4">
55+
<div class="w-full flex flex-col items-center justify-center gap-2 sm:flex-row sm:gap-4">
5656
<div class="flex items-center gap-2">
5757
<p>
5858
Theme:
@@ -61,13 +61,11 @@ const { isPending, isError, data, error } = useQuery({
6161
<template #fallback>
6262
<Button
6363
key="fallback"
64-
class="w-18"
6564
label="..."
6665
/>
6766
</template>
6867

6968
<Button
70-
class="w-18"
7169
:label="colorMode.preference"
7270
@pointerdown="colorMode.preference = (colorMode.preference !== 'dark')
7371
? 'dark'
@@ -95,24 +93,24 @@ const { isPending, isError, data, error } = useQuery({
9593
/>
9694
</div>
9795

98-
<div>
96+
<div class="max-w-full flex flex-col items-center">
9997
<div>Configured frontendUrl: {{ runtimeConfig.public.frontendUrl }}</div>
10098
<div>Configured backendUrl: {{ runtimeConfig.public.backendUrl }}</div>
10199
<div>API Response from `<code>{{ $apiClient.api.dummy.hello.$url() }}</code>`:</div>
102-
<pre class="rounded bg-black p-2 px-4 text-left text-white">{{ apiError || apiResult || 'Empty' }}</pre>
100+
<pre class="max-w-full w-fit overflow-x-auto rounded bg-black p-2 px-4 text-left text-white">{{ apiError || apiResult || 'Empty' }}</pre>
103101
</div>
104102

105-
<div>
103+
<div class="max-w-full flex flex-col items-center">
106104
<div>Tanstack Query result (fetched client-side and persisted to IndexedDB for 12 hours)</div>
107-
<pre class="rounded bg-black p-2 px-4 text-left text-white">{{ isPending ? 'Loading...' : isError ? error : data }}</pre>
105+
<pre class="max-w-full w-fit overflow-x-auto rounded bg-black p-2 px-4 text-left text-white">{{ isPending ? 'Loading...' : isError ? error : data }}</pre>
108106
<Button
109107
class="mt-2"
110108
label="Make stale (refetch)"
111109
@pointerdown="queryClient.invalidateQueries({ queryKey: ['hello_test'] })"
112110
/>
113111
</div>
114112

115-
<div>
113+
<div class="max-w-full">
116114
<ClientOnly>
117115
<template #fallback>
118116
<div key="fallback" class="h-12 flex items-center">
@@ -130,33 +128,35 @@ const { isPending, isError, data, error } = useQuery({
130128

131129
<div v-if="$auth.loggedIn">
132130
<div>User information:</div>
133-
<pre class="max-w-60vw overflow-hidden text-ellipsis rounded bg-black p-2 px-4 text-left text-white">{{ $auth }}</pre>
131+
<pre class="max-w-full overflow-x-auto rounded bg-black p-2 px-4 text-left text-white 2xl:max-w-60vw">{{ $auth }}</pre>
134132
</div>
135133
</ClientOnly>
136134
</div>
137135

138-
<Carousel class="relative max-w-xs w-full">
139-
<CarouselContent>
140-
<!-- You could either explicitly import the shadcn components or use them with 'Shad' auto-import prefix -->
141-
<ShadCarouselItem v-for="(_, index) in 5" :key="index">
142-
<div class="p-1">
143-
<Card>
144-
<template #title>
145-
Simple Card #{{ index }}
146-
</template>
147-
<template #content>
148-
<p class="m-0">
149-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque
150-
quas!
151-
</p>
152-
</template>
153-
</Card>
154-
</div>
155-
</ShadCarouselItem>
156-
</CarouselContent>
157-
<CarouselPrevious />
158-
<CarouselNext />
159-
</Carousel>
136+
<div class="max-w-full w-full flex justify-center px-12">
137+
<Carousel class="relative max-w-xs w-full">
138+
<CarouselContent>
139+
<!-- You could either explicitly import the shadcn components or use them with 'Shad' auto-import prefix -->
140+
<ShadCarouselItem v-for="(_, index) in 5" :key="index">
141+
<div class="p-1">
142+
<Card>
143+
<template #title>
144+
Simple Card #{{ index }}
145+
</template>
146+
<template #content>
147+
<p class="m-0">
148+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque
149+
quas!
150+
</p>
151+
</template>
152+
</Card>
153+
</div>
154+
</ShadCarouselItem>
155+
</CarouselContent>
156+
<CarouselPrevious />
157+
<CarouselNext />
158+
</Carousel>
159+
</div>
160160

161161
<div>
162162
<IsSST />

0 commit comments

Comments
 (0)