Spaces:
Runtime error
Runtime error
tech-envision
commited on
Commit
·
d32544a
1
Parent(s):
9d53f47
feat(frontend): enforce light mode and add glass design
Browse files
frontend/src/app/globals.css
CHANGED
@@ -12,11 +12,38 @@
|
|
12 |
--font-mono: ui-monospace, monospace;
|
13 |
}
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
|
22 |
body {
|
|
|
12 |
--font-mono: ui-monospace, monospace;
|
13 |
}
|
14 |
|
15 |
+
|
16 |
+
.glass-panel {
|
17 |
+
background: rgba(255, 255, 255, 0.6);
|
18 |
+
border: 1px solid rgba(255, 255, 255, 0.8);
|
19 |
+
backdrop-filter: blur(12px);
|
20 |
+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
21 |
+
position: relative;
|
22 |
+
overflow: hidden;
|
23 |
+
}
|
24 |
+
|
25 |
+
.glass-panel::before,
|
26 |
+
.glass-panel::after {
|
27 |
+
content: "";
|
28 |
+
position: absolute;
|
29 |
+
pointer-events: none;
|
30 |
+
}
|
31 |
+
|
32 |
+
.glass-panel::before {
|
33 |
+
top: -20%;
|
34 |
+
left: -20%;
|
35 |
+
width: 50%;
|
36 |
+
height: 50%;
|
37 |
+
background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent);
|
38 |
+
transform: rotate(45deg);
|
39 |
+
}
|
40 |
+
|
41 |
+
.glass-panel::after {
|
42 |
+
bottom: -20%;
|
43 |
+
right: -20%;
|
44 |
+
width: 60%;
|
45 |
+
height: 60%;
|
46 |
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
|
47 |
}
|
48 |
|
49 |
body {
|
frontend/src/components/ChatApp.tsx
CHANGED
@@ -51,8 +51,8 @@ export default function ChatApp() {
|
|
51 |
};
|
52 |
|
53 |
return (
|
54 |
-
<div className="flex flex-col items-center h-screen bg-gradient-to-br from-
|
55 |
-
<div className="w-full max-w-3xl flex flex-col flex-1
|
56 |
<MessageList ref={listRef} messages={messages} />
|
57 |
<MessageInput value={input} onChange={setInput} onSend={sendMessage} disabled={loading} />
|
58 |
</div>
|
|
|
51 |
};
|
52 |
|
53 |
return (
|
54 |
+
<div className="flex flex-col items-center h-screen bg-gradient-to-br from-white to-gray-100 text-gray-900 p-4">
|
55 |
+
<div className="w-full max-w-3xl flex flex-col flex-1 glass-panel rounded-lg overflow-hidden">
|
56 |
<MessageList ref={listRef} messages={messages} />
|
57 |
<MessageInput value={input} onChange={setInput} onSend={sendMessage} disabled={loading} />
|
58 |
</div>
|
frontend/src/components/MessageInput.tsx
CHANGED
@@ -18,7 +18,7 @@ export default function MessageInput({ value, onChange, onSend, disabled }: Mess
|
|
18 |
<form onSubmit={handleSubmit} className="flex gap-2 p-2">
|
19 |
<input
|
20 |
type="text"
|
21 |
-
className="flex-1 bg-white/
|
22 |
value={value}
|
23 |
onChange={(e) => onChange(e.target.value)}
|
24 |
placeholder="Type your message..."
|
|
|
18 |
<form onSubmit={handleSubmit} className="flex gap-2 p-2">
|
19 |
<input
|
20 |
type="text"
|
21 |
+
className="flex-1 bg-white/60 backdrop-blur-sm border border-gray-300 text-gray-900 px-3 py-2 rounded-md focus:outline-none"
|
22 |
value={value}
|
23 |
onChange={(e) => onChange(e.target.value)}
|
24 |
placeholder="Type your message..."
|
frontend/src/components/MessageItem.tsx
CHANGED
@@ -12,8 +12,8 @@ interface MessageItemProps {
|
|
12 |
export default function MessageItem({ message }: MessageItemProps) {
|
13 |
const alignment = message.role === 'user' ? 'items-end' : 'items-start';
|
14 |
return (
|
15 |
-
<div className={`flex flex-col ${alignment} animate-fadeIn`}>
|
16 |
-
<div className="w-full max-w-xl p-3 my-2
|
17 |
<p className="whitespace-pre-wrap">{message.content}</p>
|
18 |
</div>
|
19 |
</div>
|
|
|
12 |
export default function MessageItem({ message }: MessageItemProps) {
|
13 |
const alignment = message.role === 'user' ? 'items-end' : 'items-start';
|
14 |
return (
|
15 |
+
<div className={`flex flex-col ${alignment} animate-fadeIn`}>
|
16 |
+
<div className="w-full max-w-xl p-3 my-2 glass-panel rounded-lg shadow-md">
|
17 |
<p className="whitespace-pre-wrap">{message.content}</p>
|
18 |
</div>
|
19 |
</div>
|
frontend/src/components/ui/GlassButton.tsx
CHANGED
@@ -7,7 +7,7 @@ interface GlassButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
7 |
export default function GlassButton({ children, className = '', ...props }: GlassButtonProps) {
|
8 |
return (
|
9 |
<button
|
10 |
-
className={`bg-white/
|
11 |
{...props}
|
12 |
>
|
13 |
{children}
|
|
|
7 |
export default function GlassButton({ children, className = '', ...props }: GlassButtonProps) {
|
8 |
return (
|
9 |
<button
|
10 |
+
className={`bg-white/60 backdrop-blur-sm border border-gray-300 text-gray-900 px-4 py-2 rounded-md shadow-lg transition-all hover:bg-white active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed ${className}`}
|
11 |
{...props}
|
12 |
>
|
13 |
{children}
|