@@ -18,24 +18,28 @@ const AIChat = ({
18
18
setLoading : ( loading : boolean ) => void ;
19
19
} ) => {
20
20
return (
21
- < div className = "absolute inset-0 flex flex-col items-end justify-start top-[11vh] py-2 px-16 pointer-events-none" >
22
- < div className = "px-4 py-2 rounded-md flex flex-col justify-evenly items-center w-full max-w-md pointer-events-auto" >
21
+ < div
22
+ className = "absolute inset-0 flex flex-col items-end justify-start top-[10vh] sm:top-[11vh] py-2 px-2 sm:px-4 md:px-16 pointer-events-none
23
+ from-zinc-900 to-zinc-950/20 bg-gradient-to-b mx-2 sm:mx-0 sm:bg-transparent
24
+ [background:radial-gradient(200%_150%_at_50%_15%,#111_25%,#7d11_100%)] sm:[background:none]"
25
+ >
26
+ < div className = "px-2 sm:px-4 py-2 rounded-md flex flex-col justify-evenly items-center w-full max-w-full sm:max-w-md pointer-events-auto" >
23
27
< form
24
- className = "w-full p-4"
28
+ className = "w-full p-2 sm:p- 4"
25
29
onSubmit = { ( e ) => {
26
30
e . preventDefault ( ) ;
27
31
askLLM ( new FormData ( e . target as HTMLFormElement ) ) ;
28
32
} }
29
33
>
30
- < div className = "flex flex-row w-full gap-4 justify-between" >
34
+ < div className = "flex flex-row w-full gap-2 sm:gap- 4 justify-between" >
31
35
< input
32
36
autoFocus
33
37
type = "text"
34
38
name = "q"
35
39
autoComplete = "off"
36
40
minLength = { 1 }
37
41
placeholder = "Ask me anything"
38
- className = "max-w-prose w-full text-xs bg-transparent focus:outline-none break-words ring-zinc-400 ring-1 px-3 py-2 rounded-lg"
42
+ className = "max-w-prose w-full text-xs bg-transparent focus:outline-none break-words ring-zinc-400 ring-1 px-2 sm:px- 3 py-2 rounded-lg"
39
43
/>
40
44
< button
41
45
onClick = { ( ) => {
@@ -44,7 +48,7 @@ const AIChat = ({
44
48
} }
45
49
type = "reset"
46
50
>
47
- < RotateCcwIcon className = "w-5 h-5 text-zinc-600 hover:text-zinc-300" />
51
+ < RotateCcwIcon className = "w-4 h-4 sm:w-5 sm: h-5 text-zinc-600 hover:text-zinc-300" />
48
52
</ button >
49
53
< button
50
54
onClick = { ( ) => {
@@ -55,28 +59,28 @@ const AIChat = ({
55
59
type = "submit"
56
60
>
57
61
{ ! loading ? (
58
- < SparklesIcon className = "w-5 h-5 text-zinc-300 hover:text-lime-500" />
62
+ < SparklesIcon className = "w-4 h-4 sm:w-5 sm: h-5 text-zinc-300 hover:text-lime-500" />
59
63
) : (
60
- < Loader2Icon className = "w-5 h-5 text-zinc-300 hover:text-lime-500 animate-spin" />
64
+ < Loader2Icon className = "w-4 h-4 sm:w-5 sm: h-5 text-zinc-300 hover:text-lime-500 animate-spin" />
61
65
) }
62
66
</ button >
63
67
</ div >
64
68
</ form >
65
69
66
70
{ answer . length > 1 && (
67
- < div className = "whitespace-pre-line self-start prose prose-zinc break-words max-w-prose max-h-[50vh] overflow-y-scroll scrollbar-thin scrollbar-thumb-lime-500 scrollbar-track-transparent text-sm text-zinc-300 p-4" >
71
+ < div className = "whitespace-pre-line self-start prose prose-zinc break-words max-w-prose max-h-[40vh] sm:max-h-[ 50vh] overflow-y-scroll scrollbar-thin scrollbar-thumb-lime-500 scrollbar-track-transparent text-xs sm:text-sm text-zinc-300 p-2 sm: p-4" >
68
72
{ answer }
69
73
</ div >
70
74
) }
71
75
{ loading && (
72
- < div className = "max-w-prose text-xs self-start text-zinc-500 p-4 " >
76
+ < div className = "max-w-prose text-xs self-start text-zinc-500 p-2 sm:p-4 " >
73
77
< div className = "animate-pulse uppercase" >
74
78
{ answer . length < 1 ? "thinking" : "streaming answers" }
75
79
</ div >
76
80
</ div >
77
81
) }
78
82
{ time && (
79
- < div className = "max-w-prose self-start text-xs text-zinc-500 p-4" >
83
+ < div className = "max-w-prose self-start text-xs text-zinc-500 p-2 sm:p- 4" >
80
84
< div className = "" > { time } </ div >
81
85
</ div >
82
86
) }
0 commit comments