Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 6786aab

Browse files
feat: add menu drawer
1 parent 931b4a5 commit 6786aab

12 files changed

Lines changed: 283 additions & 121 deletions

File tree

public/illustrations/Insurance.png

560 KB
Loading
417 KB
Loading

public/illustrations/court.png

482 KB
Loading

public/illustrations/education.png

501 KB
Loading

public/illustrations/train.png

448 KB
Loading

src/app/form-data-context.tsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/app/globals.css

Lines changed: 129 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@
1313
flex
1414
flex-1
1515
gap-y-3
16-
/* flex-col */
1716
text-base
18-
bg-no-repeat
1917
to-pink-200
18+
antialiased
19+
bg-no-repeat
2020
from-sky-400
2121
overflow-hidden
2222
;
2323

24+
font-family: var(--font-source-sans-pro);
25+
2426
background-size: 50rem 35rem, auto;
25-
background-position: calc(100vw - 30rem) calc(100vh - 30rem), 0 0;
27+
background-position: calc(100vw - 30rem) calc(100vh - 27rem), 0 0;
2628
background-image: url(/clouds.webp), linear-gradient(to bottom right, var(--tw-gradient-stops));
2729
}
2830

@@ -37,8 +39,11 @@
3739
;
3840
}
3941

40-
h1 {
42+
/* h1 {
4143
@apply container mx-auto px-12 text-xl text-sky-600;
44+
} */
45+
h2 {
46+
@apply text-3xl;
4247
}
4348

4449
button, button[type="submit"] {
@@ -50,15 +55,17 @@
5055
text-sm
5156
rounded
5257
relative
58+
text-white
59+
bg-pink-400
5360
items-center
61+
font-semibold
5462
justify-center
5563
transition-all
64+
/* text-stone-100 */
5665
focus:shadow-lg
5766
active:enabled:shadow
5867
hover:enabled:shadow-lg
5968
focus-visible:outline-none
60-
bg-pink-400
61-
text-stone-100
6269
hover:bg-pink-500
6370
active:bg-pink-300
6471
disabled:bg-pink-300
@@ -171,7 +178,7 @@
171178
.messages {
172179
@apply
173180
flex
174-
px-6
181+
px-14
175182
pt-6
176183
gap-6
177184
pb-12
@@ -196,11 +203,11 @@
196203
;
197204
}
198205

199-
.message.user {
206+
.message.assistant {
200207
@apply mr-48 bg-blue-100;
201208
}
202209

203-
.message.assistant {
210+
.message.user {
204211
@apply ml-48 bg-green-100;
205212
}
206213

@@ -220,13 +227,45 @@
220227
@apply absolute h-full shadow z-20 bg-white p-3 flex flex-col gap-6;
221228
} */
222229

223-
.menu {
224-
@apply bg-white p-3 flex flex-col gap-6;
225-
}
226230
/* .menu {
227-
@apply p-3 flex flex-col gap-6 bg-black bg-opacity-10;
231+
@apply p-3 flex flex-col gap-6;
228232
} */
229233

234+
.menu-toggle {
235+
@apply absolute z-20 top-6 left-6 w-auto
236+
focus:shadow-none
237+
active:enabled:shadow-none
238+
hover:enabled:shadow-none;
239+
}
240+
241+
.menu-toggle svg {
242+
@apply text-white;
243+
}
244+
245+
.menu {
246+
@apply
247+
p-6
248+
z-30
249+
w-72
250+
flex
251+
fixed
252+
top-0
253+
gap-6
254+
left-0
255+
h-full
256+
flex-col
257+
/* bg-black */
258+
bg-white
259+
transform
260+
/* bg-opacity-50 */
261+
translate-x-0
262+
transition-transform;
263+
}
264+
265+
.menu.collapsed {
266+
@apply -translate-x-full;
267+
}
268+
230269
.controls {
231270
@apply flex gap-3;
232271
}
@@ -239,6 +278,10 @@
239278
@apply flex items-center gap-2;
240279
}
241280

281+
.threads li a {
282+
@apply truncate;
283+
}
284+
242285
.threads li a, .threads li svg {
243286
@apply text-slate-800;
244287
/* @apply text-white; */
@@ -248,6 +291,79 @@
248291
@apply text-pink-500;
249292
}
250293

294+
.home {
295+
@apply flex-1 flex flex-col items-center justify-center;
296+
}
297+
298+
.home h1 {
299+
@apply text-9xl text-sky-900 mb-12;
300+
text-shadow: 0px 1px 1px white;
301+
font-family: var(--font-dancing-script);
302+
}
303+
304+
/* .themes {
305+
@apply flex flex-1 px-12;
306+
} */
307+
308+
.themes {
309+
/* @apply flex flex-wrap flex-1 items-start content-center justify-center mx-12; */
310+
/* @apply flex flex-wrap flex-1 bg-blue-100 items-start; */
311+
}
312+
313+
.themes a[href] {
314+
@apply no-underline;
315+
}
316+
317+
.themes .tile {
318+
@apply
319+
m-6
320+
py-3
321+
pr-6
322+
pl-1
323+
/* pl-40 */
324+
rounded
325+
text-lg
326+
bg-white
327+
shadow-lg
328+
text-slate-800
329+
hover:shadow-xl
330+
;
331+
332+
background-size: contain;
333+
background-repeat: no-repeat;
334+
background-origin: content-box;
335+
background-position: 1rem center;
336+
}
337+
338+
.themes .tile.retirement {
339+
background-image: url(/illustrations/calculator.png);
340+
}
341+
342+
.themes .tile.insurance {
343+
background-image: url(/illustrations/insurance.png);
344+
}
345+
346+
.themes .tile.train {
347+
background-image: url(/illustrations/train.png);
348+
}
349+
350+
.themes .tile.education {
351+
background-image: url(/illustrations/education.png);
352+
}
353+
354+
.themes .tile.court {
355+
background-image: url(/illustrations/court.png);
356+
}
357+
358+
.themes .tile h2 {
359+
@apply mb-3;
360+
font-weight: 600;
361+
}
362+
363+
.themes .tile .text {
364+
@apply ml-32 my-3;
365+
}
366+
251367
footer {
252368
@apply
253369
px-7

src/app/layout.tsx

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ const sourceSans = localFont({
3030
],
3131
})
3232

33+
const dancingScript = localFont({
34+
preload: true,
35+
display: "swap",
36+
fallback: ["serif"],
37+
variable: "--font-dancing-script",
38+
src: [
39+
{
40+
weight: "400",
41+
style: "normal",
42+
path: "../fonts/DancingScript-Regular.ttf",
43+
},
44+
],
45+
})
46+
3347
const sourceCode = localFont({
3448
weight: "400",
3549
preload: true,
@@ -40,17 +54,21 @@ const sourceCode = localFont({
4054
src: "../fonts/SourceCodePro-Regular.ttf",
4155
})
4256

43-
const Layout = ({ children }: { children: React.ReactNode }) => (
44-
<html lang="en" className={`${sourceSans.variable} ${sourceCode.variable}`}>
45-
<head />
46-
<body>
47-
<ThreadsProvider>
48-
<Menu />
49-
{children}
50-
{/* <Footer /> */}
51-
</ThreadsProvider>
52-
</body>
53-
</html>
54-
)
55-
57+
const Layout = ({ children }: { children: React.ReactNode }) => {
58+
return (
59+
<html
60+
lang="en"
61+
className={`${sourceSans.variable} ${sourceCode.variable} ${dancingScript.variable}`}
62+
>
63+
<head />
64+
<body>
65+
<ThreadsProvider>
66+
<Menu />
67+
{children}
68+
{/* <Footer /> */}
69+
</ThreadsProvider>
70+
</body>
71+
</html>
72+
)
73+
}
5674
export default Layout

src/app/page.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
import Form from "@/components/form"
1+
// import Form from "@/components/form"
22
import Footer from "@/components/footer"
3-
import Messages from "@/components/messages"
4-
import { ChatProvider } from "@/hooks/use-chat"
3+
import Themes from "@/components/themes"
4+
// import Messages from "@/components/messages"
5+
// import { ChatProvider } from "@/hooks/use-chat"
56

6-
export default function Page({ params: { id } }: { params: { id: string } }) {
7+
export default function Page() {
78
return (
89
<main>
9-
<ChatProvider threadId={id}>
10-
<Messages />
11-
<Form />
12-
<Footer />
13-
</ChatProvider>
10+
{/* <ChatProvider threadId={id}> */}
11+
{/* <Messages />
12+
<Form /> */}
13+
<div className="home">
14+
<h1>LegIA</h1>
15+
<Themes />
16+
</div>
17+
<Footer />
18+
{/* </ChatProvider> */}
1419
</main>
1520
)
1621
}

0 commit comments

Comments
 (0)