gpt-engineer-app[bot] commited on
Commit ·
fee5554
1
Parent(s): 569f6fb
feat: Design chatbot UI
Browse files- index.html +5 -5
- src/components/chat/ChatHeader.tsx +17 -0
- src/components/chat/ChatInput.tsx +44 -0
- src/components/chat/ChatWindow.tsx +93 -0
- src/components/chat/MessageBubble.tsx +60 -0
- src/components/chat/QuickActions.tsx +28 -0
- src/index.css +130 -51
- src/pages/Index.tsx +3 -6
- tailwind.config.ts +27 -0
index.html
CHANGED
|
@@ -3,12 +3,12 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
-
<title>
|
| 7 |
-
<meta name="description" content="
|
| 8 |
-
<meta name="author" content="
|
| 9 |
|
| 10 |
-
<meta property="og:title" content="
|
| 11 |
-
<meta property="og:description" content="
|
| 12 |
<meta property="og:type" content="website" />
|
| 13 |
<meta property="og:image" content="https://lovable.dev/opengraph-image-p98pqg.png" />
|
| 14 |
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>AI Chat Assistant - Modern Chatbot Interface</title>
|
| 7 |
+
<meta name="description" content="A beautiful, modern chatbot interface with smooth animations and responsive design. Experience seamless AI conversations with an elegant user interface." />
|
| 8 |
+
<meta name="author" content="AI Chat Assistant" />
|
| 9 |
|
| 10 |
+
<meta property="og:title" content="AI Chat Assistant - Modern Chatbot Interface" />
|
| 11 |
+
<meta property="og:description" content="A beautiful, modern chatbot interface with smooth animations and responsive design. Experience seamless AI conversations with an elegant user interface." />
|
| 12 |
<meta property="og:type" content="website" />
|
| 13 |
<meta property="og:image" content="https://lovable.dev/opengraph-image-p98pqg.png" />
|
| 14 |
|
src/components/chat/ChatHeader.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { MessageCircle } from "lucide-react";
|
| 2 |
+
|
| 3 |
+
const ChatHeader = () => {
|
| 4 |
+
return (
|
| 5 |
+
<header className="bg-header-bg border-b border-header-border px-4 py-3 flex items-center gap-3 header-shadow">
|
| 6 |
+
<div className="w-8 h-8 bg-avatar-bg rounded-full flex items-center justify-center">
|
| 7 |
+
<MessageCircle className="w-4 h-4 text-avatar-fg" />
|
| 8 |
+
</div>
|
| 9 |
+
<div>
|
| 10 |
+
<h1 className="text-header-fg font-semibold text-lg">AI Assistant</h1>
|
| 11 |
+
<p className="text-muted-foreground text-xs">Always here to help</p>
|
| 12 |
+
</div>
|
| 13 |
+
</header>
|
| 14 |
+
);
|
| 15 |
+
};
|
| 16 |
+
|
| 17 |
+
export default ChatHeader;
|
src/components/chat/ChatInput.tsx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useState } from "react";
|
| 2 |
+
import { Button } from "@/components/ui/button";
|
| 3 |
+
import { Input } from "@/components/ui/input";
|
| 4 |
+
import { Send } from "lucide-react";
|
| 5 |
+
|
| 6 |
+
interface ChatInputProps {
|
| 7 |
+
onSendMessage: (message: string) => void;
|
| 8 |
+
disabled?: boolean;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
const ChatInput = ({ onSendMessage, disabled = false }: ChatInputProps) => {
|
| 12 |
+
const [message, setMessage] = useState("");
|
| 13 |
+
|
| 14 |
+
const handleSubmit = (e: React.FormEvent) => {
|
| 15 |
+
e.preventDefault();
|
| 16 |
+
if (message.trim() && !disabled) {
|
| 17 |
+
onSendMessage(message.trim());
|
| 18 |
+
setMessage("");
|
| 19 |
+
}
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
return (
|
| 23 |
+
<div className="bg-header-bg border-t border-header-border p-4 input-shadow">
|
| 24 |
+
<form onSubmit={handleSubmit} className="flex gap-2">
|
| 25 |
+
<Input
|
| 26 |
+
value={message}
|
| 27 |
+
onChange={(e) => setMessage(e.target.value)}
|
| 28 |
+
placeholder="Type your message..."
|
| 29 |
+
disabled={disabled}
|
| 30 |
+
className="flex-1 bg-input-bg border-input-border focus:border-input-focus-border text-sm py-3 px-4 rounded-xl"
|
| 31 |
+
/>
|
| 32 |
+
<Button
|
| 33 |
+
type="submit"
|
| 34 |
+
disabled={!message.trim() || disabled}
|
| 35 |
+
className="send-button-gradient text-send-button-fg hover:opacity-90 transition-opacity rounded-xl px-4 py-3 min-w-[44px]"
|
| 36 |
+
>
|
| 37 |
+
<Send className="w-4 h-4" />
|
| 38 |
+
</Button>
|
| 39 |
+
</form>
|
| 40 |
+
</div>
|
| 41 |
+
);
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
export default ChatInput;
|
src/components/chat/ChatWindow.tsx
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useEffect, useRef, useState } from "react";
|
| 2 |
+
import ChatHeader from "./ChatHeader";
|
| 3 |
+
import MessageBubble from "./MessageBubble";
|
| 4 |
+
import QuickActions from "./QuickActions";
|
| 5 |
+
import ChatInput from "./ChatInput";
|
| 6 |
+
|
| 7 |
+
interface Message {
|
| 8 |
+
id: string;
|
| 9 |
+
text: string;
|
| 10 |
+
isUser: boolean;
|
| 11 |
+
timestamp: string;
|
| 12 |
+
quickActions?: string[];
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
const ChatWindow = () => {
|
| 16 |
+
const [messages, setMessages] = useState<Message[]>([
|
| 17 |
+
{
|
| 18 |
+
id: "1",
|
| 19 |
+
text: "Hello! I'm your AI assistant. How can I help you today?",
|
| 20 |
+
isUser: false,
|
| 21 |
+
timestamp: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }),
|
| 22 |
+
quickActions: ["Get started", "Learn more", "Contact support"]
|
| 23 |
+
}
|
| 24 |
+
]);
|
| 25 |
+
|
| 26 |
+
const messagesEndRef = useRef<HTMLDivElement>(null);
|
| 27 |
+
|
| 28 |
+
const scrollToBottom = () => {
|
| 29 |
+
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
| 30 |
+
};
|
| 31 |
+
|
| 32 |
+
useEffect(() => {
|
| 33 |
+
scrollToBottom();
|
| 34 |
+
}, [messages]);
|
| 35 |
+
|
| 36 |
+
const handleSendMessage = (text: string) => {
|
| 37 |
+
const newMessage: Message = {
|
| 38 |
+
id: Date.now().toString(),
|
| 39 |
+
text,
|
| 40 |
+
isUser: true,
|
| 41 |
+
timestamp: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }),
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
setMessages(prev => [...prev, newMessage]);
|
| 45 |
+
|
| 46 |
+
// Simulate bot response
|
| 47 |
+
setTimeout(() => {
|
| 48 |
+
const botResponse: Message = {
|
| 49 |
+
id: (Date.now() + 1).toString(),
|
| 50 |
+
text: "Thank you for your message! I'm processing your request and will provide a helpful response shortly.",
|
| 51 |
+
isUser: false,
|
| 52 |
+
timestamp: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }),
|
| 53 |
+
quickActions: ["Tell me more", "That's helpful", "Start over"]
|
| 54 |
+
};
|
| 55 |
+
setMessages(prev => [...prev, botResponse]);
|
| 56 |
+
}, 1000);
|
| 57 |
+
};
|
| 58 |
+
|
| 59 |
+
const handleQuickAction = (action: string) => {
|
| 60 |
+
handleSendMessage(action);
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
return (
|
| 64 |
+
<div className="flex flex-col h-screen max-w-4xl mx-auto bg-background">
|
| 65 |
+
<ChatHeader />
|
| 66 |
+
|
| 67 |
+
<div className="flex-1 bg-chat-bg overflow-y-auto chat-scrollbar">
|
| 68 |
+
<div className="p-4">
|
| 69 |
+
{messages.map((message, index) => (
|
| 70 |
+
<div key={message.id}>
|
| 71 |
+
<MessageBubble
|
| 72 |
+
message={message.text}
|
| 73 |
+
isUser={message.isUser}
|
| 74 |
+
timestamp={message.timestamp}
|
| 75 |
+
/>
|
| 76 |
+
{message.quickActions && index === messages.length - 1 && (
|
| 77 |
+
<QuickActions
|
| 78 |
+
actions={message.quickActions}
|
| 79 |
+
onActionClick={handleQuickAction}
|
| 80 |
+
/>
|
| 81 |
+
)}
|
| 82 |
+
</div>
|
| 83 |
+
))}
|
| 84 |
+
<div ref={messagesEndRef} />
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<ChatInput onSendMessage={handleSendMessage} />
|
| 89 |
+
</div>
|
| 90 |
+
);
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
export default ChatWindow;
|
src/components/chat/MessageBubble.tsx
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { cn } from "@/lib/utils";
|
| 2 |
+
import { User, Bot } from "lucide-react";
|
| 3 |
+
|
| 4 |
+
interface MessageBubbleProps {
|
| 5 |
+
message: string;
|
| 6 |
+
isUser: boolean;
|
| 7 |
+
timestamp: string;
|
| 8 |
+
avatar?: string;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
const MessageBubble = ({ message, isUser, timestamp, avatar }: MessageBubbleProps) => {
|
| 12 |
+
return (
|
| 13 |
+
<div className={cn(
|
| 14 |
+
"flex gap-3 mb-4 message-fade-in",
|
| 15 |
+
isUser ? "justify-end" : "justify-start"
|
| 16 |
+
)}>
|
| 17 |
+
{!isUser && (
|
| 18 |
+
<div className="w-8 h-8 bg-avatar-bg rounded-full flex items-center justify-center flex-shrink-0 mt-1">
|
| 19 |
+
{avatar ? (
|
| 20 |
+
<img src={avatar} alt="Bot" className="w-8 h-8 rounded-full" />
|
| 21 |
+
) : (
|
| 22 |
+
<Bot className="w-4 h-4 text-avatar-fg" />
|
| 23 |
+
)}
|
| 24 |
+
</div>
|
| 25 |
+
)}
|
| 26 |
+
|
| 27 |
+
<div className={cn(
|
| 28 |
+
"max-w-[85%] sm:max-w-[70%]",
|
| 29 |
+
isUser ? "order-first" : ""
|
| 30 |
+
)}>
|
| 31 |
+
<div className={cn(
|
| 32 |
+
"px-4 py-3 rounded-xl message-shadow",
|
| 33 |
+
isUser
|
| 34 |
+
? "user-message-gradient text-user-message-fg rounded-br-sm"
|
| 35 |
+
: "bg-bot-message-bg text-bot-message-fg border border-bot-message-border rounded-bl-sm"
|
| 36 |
+
)}>
|
| 37 |
+
<p className="text-sm leading-relaxed whitespace-pre-wrap">{message}</p>
|
| 38 |
+
</div>
|
| 39 |
+
<p className={cn(
|
| 40 |
+
"text-xs text-muted-foreground mt-1 px-1",
|
| 41 |
+
isUser ? "text-right" : "text-left"
|
| 42 |
+
)}>
|
| 43 |
+
{timestamp}
|
| 44 |
+
</p>
|
| 45 |
+
</div>
|
| 46 |
+
|
| 47 |
+
{isUser && (
|
| 48 |
+
<div className="w-8 h-8 bg-user-gradient-start rounded-full flex items-center justify-center flex-shrink-0 mt-1">
|
| 49 |
+
{avatar ? (
|
| 50 |
+
<img src={avatar} alt="User" className="w-8 h-8 rounded-full" />
|
| 51 |
+
) : (
|
| 52 |
+
<User className="w-4 h-4 text-user-message-fg" />
|
| 53 |
+
)}
|
| 54 |
+
</div>
|
| 55 |
+
)}
|
| 56 |
+
</div>
|
| 57 |
+
);
|
| 58 |
+
};
|
| 59 |
+
|
| 60 |
+
export default MessageBubble;
|
src/components/chat/QuickActions.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Button } from "@/components/ui/button";
|
| 2 |
+
|
| 3 |
+
interface QuickActionsProps {
|
| 4 |
+
actions: string[];
|
| 5 |
+
onActionClick: (action: string) => void;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
const QuickActions = ({ actions, onActionClick }: QuickActionsProps) => {
|
| 9 |
+
if (!actions.length) return null;
|
| 10 |
+
|
| 11 |
+
return (
|
| 12 |
+
<div className="flex flex-wrap gap-2 mb-4 pl-11">
|
| 13 |
+
{actions.map((action, index) => (
|
| 14 |
+
<Button
|
| 15 |
+
key={index}
|
| 16 |
+
variant="outline"
|
| 17 |
+
size="sm"
|
| 18 |
+
onClick={() => onActionClick(action)}
|
| 19 |
+
className="bg-quick-action-bg text-quick-action-fg border-quick-action-border hover:bg-quick-action-hover transition-colors text-xs px-3 py-1 h-auto rounded-full"
|
| 20 |
+
>
|
| 21 |
+
{action}
|
| 22 |
+
</Button>
|
| 23 |
+
))}
|
| 24 |
+
</div>
|
| 25 |
+
);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
export default QuickActions;
|
src/index.css
CHANGED
|
@@ -2,84 +2,105 @@
|
|
| 2 |
@tailwind components;
|
| 3 |
@tailwind utilities;
|
| 4 |
|
| 5 |
-
/*
|
| 6 |
-
All colors MUST be HSL.
|
| 7 |
-
*/
|
| 8 |
|
| 9 |
@layer base {
|
| 10 |
:root {
|
| 11 |
-
|
| 12 |
-
--
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
--
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
--
|
| 21 |
-
--
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
--
|
| 27 |
-
--
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
--
|
| 31 |
-
|
| 32 |
-
--
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
--
|
| 36 |
-
--
|
| 37 |
-
--
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
--sidebar-background: 0 0% 98%;
|
| 42 |
-
|
| 43 |
--sidebar-foreground: 240 5.3% 26.1%;
|
| 44 |
-
|
| 45 |
--sidebar-primary: 240 5.9% 10%;
|
| 46 |
-
|
| 47 |
--sidebar-primary-foreground: 0 0% 98%;
|
| 48 |
-
|
| 49 |
--sidebar-accent: 240 4.8% 95.9%;
|
| 50 |
-
|
| 51 |
--sidebar-accent-foreground: 240 5.9% 10%;
|
| 52 |
-
|
| 53 |
--sidebar-border: 220 13% 91%;
|
| 54 |
-
|
| 55 |
--sidebar-ring: 217.2 91.2% 59.8%;
|
| 56 |
}
|
| 57 |
|
| 58 |
.dark {
|
|
|
|
| 59 |
--background: 222.2 84% 4.9%;
|
| 60 |
--foreground: 210 40% 98%;
|
| 61 |
-
|
| 62 |
--card: 222.2 84% 4.9%;
|
| 63 |
--card-foreground: 210 40% 98%;
|
| 64 |
-
|
| 65 |
--popover: 222.2 84% 4.9%;
|
| 66 |
--popover-foreground: 210 40% 98%;
|
| 67 |
-
|
| 68 |
--primary: 210 40% 98%;
|
| 69 |
--primary-foreground: 222.2 47.4% 11.2%;
|
| 70 |
-
|
| 71 |
--secondary: 217.2 32.6% 17.5%;
|
| 72 |
--secondary-foreground: 210 40% 98%;
|
| 73 |
-
|
| 74 |
--muted: 217.2 32.6% 17.5%;
|
| 75 |
--muted-foreground: 215 20.2% 65.1%;
|
| 76 |
-
|
| 77 |
--accent: 217.2 32.6% 17.5%;
|
| 78 |
--accent-foreground: 210 40% 98%;
|
| 79 |
-
|
| 80 |
-
--destructive: 0 62.8% 30.6%;
|
| 81 |
-
--destructive-foreground: 210 40% 98%;
|
| 82 |
-
|
| 83 |
--border: 217.2 32.6% 17.5%;
|
| 84 |
--input: 217.2 32.6% 17.5%;
|
| 85 |
--ring: 212.7 26.8% 83.9%;
|
|
@@ -100,6 +121,64 @@ All colors MUST be HSL.
|
|
| 100 |
}
|
| 101 |
|
| 102 |
body {
|
| 103 |
-
@apply bg-background text-foreground;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
}
|
| 105 |
}
|
|
|
|
| 2 |
@tailwind components;
|
| 3 |
@tailwind utilities;
|
| 4 |
|
| 5 |
+
/* Chatbot UI Design System - Modern, clean, and professional */
|
|
|
|
|
|
|
| 6 |
|
| 7 |
@layer base {
|
| 8 |
:root {
|
| 9 |
+
/* Main backgrounds and surfaces */
|
| 10 |
+
--background: 248 250 252; /* slate-50 - main app background */
|
| 11 |
+
--foreground: 215 28% 17%; /* slate-800 - primary text */
|
| 12 |
+
|
| 13 |
+
/* Chat specific backgrounds */
|
| 14 |
+
--chat-background: 241 245 249; /* slate-100 - chat area background */
|
| 15 |
+
--message-background: 0 0% 100%; /* white - bot message cards */
|
| 16 |
+
|
| 17 |
+
/* User message gradient - blue to purple */
|
| 18 |
+
--user-gradient-start: 217 91% 60%; /* blue-500 */
|
| 19 |
+
--user-gradient-end: 251 91% 68%; /* purple-500 */
|
| 20 |
+
--user-message-foreground: 0 0% 100%; /* white text */
|
| 21 |
+
|
| 22 |
+
/* Bot message styling */
|
| 23 |
+
--bot-message-background: 0 0% 100%; /* white */
|
| 24 |
+
--bot-message-foreground: 215 25% 27%; /* slate-700 */
|
| 25 |
+
--bot-message-border: 220 13% 91%; /* slate-200 */
|
| 26 |
+
|
| 27 |
+
/* Input and interactive elements */
|
| 28 |
+
--input-background: 0 0% 100%; /* white */
|
| 29 |
+
--input-border: 220 13% 91%; /* slate-200 */
|
| 30 |
+
--input-focus-border: 217 91% 60%; /* blue-500 */
|
| 31 |
+
|
| 32 |
+
/* Send button gradient */
|
| 33 |
+
--send-button-start: 217 91% 60%; /* blue-500 */
|
| 34 |
+
--send-button-end: 251 91% 68%; /* purple-500 */
|
| 35 |
+
--send-button-foreground: 0 0% 100%; /* white */
|
| 36 |
+
|
| 37 |
+
/* Header styling */
|
| 38 |
+
--header-background: 0 0% 100%; /* white */
|
| 39 |
+
--header-foreground: 215 28% 17%; /* slate-800 */
|
| 40 |
+
--header-border: 220 13% 91%; /* slate-200 */
|
| 41 |
+
|
| 42 |
+
/* Quick actions */
|
| 43 |
+
--quick-action-background: 248 250 252; /* slate-50 */
|
| 44 |
+
--quick-action-foreground: 215 25% 27%; /* slate-700 */
|
| 45 |
+
--quick-action-hover: 241 245 249; /* slate-100 */
|
| 46 |
+
--quick-action-border: 220 13% 91%; /* slate-200 */
|
| 47 |
+
|
| 48 |
+
/* Avatars and accents */
|
| 49 |
+
--avatar-background: 217 91% 60%; /* blue-500 */
|
| 50 |
+
--avatar-foreground: 0 0% 100%; /* white */
|
| 51 |
+
|
| 52 |
+
/* Shadows and effects */
|
| 53 |
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
| 54 |
+
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
| 55 |
+
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
| 56 |
+
|
| 57 |
+
/* Animations and transitions */
|
| 58 |
+
--transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 59 |
+
--animation-bounce-in: cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
| 60 |
+
|
| 61 |
+
/* Legacy compatibility */
|
| 62 |
+
--card: var(--message-background);
|
| 63 |
+
--card-foreground: var(--bot-message-foreground);
|
| 64 |
+
--primary: var(--user-gradient-start);
|
| 65 |
+
--primary-foreground: var(--user-message-foreground);
|
| 66 |
+
--secondary: var(--quick-action-background);
|
| 67 |
+
--secondary-foreground: var(--quick-action-foreground);
|
| 68 |
+
--muted: var(--chat-background);
|
| 69 |
+
--muted-foreground: 215 16% 47%; /* slate-500 */
|
| 70 |
+
--accent: var(--quick-action-hover);
|
| 71 |
+
--accent-foreground: var(--quick-action-foreground);
|
| 72 |
+
--border: var(--input-border);
|
| 73 |
+
--input: var(--input-background);
|
| 74 |
+
--ring: var(--input-focus-border);
|
| 75 |
+
--radius: 0.75rem; /* More rounded for modern look */
|
| 76 |
+
|
| 77 |
+
/* Sidebar (keeping existing) */
|
| 78 |
--sidebar-background: 0 0% 98%;
|
|
|
|
| 79 |
--sidebar-foreground: 240 5.3% 26.1%;
|
|
|
|
| 80 |
--sidebar-primary: 240 5.9% 10%;
|
|
|
|
| 81 |
--sidebar-primary-foreground: 0 0% 98%;
|
|
|
|
| 82 |
--sidebar-accent: 240 4.8% 95.9%;
|
|
|
|
| 83 |
--sidebar-accent-foreground: 240 5.9% 10%;
|
|
|
|
| 84 |
--sidebar-border: 220 13% 91%;
|
|
|
|
| 85 |
--sidebar-ring: 217.2 91.2% 59.8%;
|
| 86 |
}
|
| 87 |
|
| 88 |
.dark {
|
| 89 |
+
/* Dark mode - keeping light theme for now, focusing on the chatbot experience */
|
| 90 |
--background: 222.2 84% 4.9%;
|
| 91 |
--foreground: 210 40% 98%;
|
|
|
|
| 92 |
--card: 222.2 84% 4.9%;
|
| 93 |
--card-foreground: 210 40% 98%;
|
|
|
|
| 94 |
--popover: 222.2 84% 4.9%;
|
| 95 |
--popover-foreground: 210 40% 98%;
|
|
|
|
| 96 |
--primary: 210 40% 98%;
|
| 97 |
--primary-foreground: 222.2 47.4% 11.2%;
|
|
|
|
| 98 |
--secondary: 217.2 32.6% 17.5%;
|
| 99 |
--secondary-foreground: 210 40% 98%;
|
|
|
|
| 100 |
--muted: 217.2 32.6% 17.5%;
|
| 101 |
--muted-foreground: 215 20.2% 65.1%;
|
|
|
|
| 102 |
--accent: 217.2 32.6% 17.5%;
|
| 103 |
--accent-foreground: 210 40% 98%;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
--border: 217.2 32.6% 17.5%;
|
| 105 |
--input: 217.2 32.6% 17.5%;
|
| 106 |
--ring: 212.7 26.8% 83.9%;
|
|
|
|
| 121 |
}
|
| 122 |
|
| 123 |
body {
|
| 124 |
+
@apply bg-background text-foreground font-sans;
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
@layer components {
|
| 129 |
+
/* Chat message animations */
|
| 130 |
+
.message-fade-in {
|
| 131 |
+
animation: messageSlideIn 0.3s ease-out;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
.user-message-gradient {
|
| 135 |
+
background: linear-gradient(135deg, hsl(var(--user-gradient-start)), hsl(var(--user-gradient-end)));
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
.send-button-gradient {
|
| 139 |
+
background: linear-gradient(135deg, hsl(var(--send-button-start)), hsl(var(--send-button-end)));
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
.chat-scrollbar {
|
| 143 |
+
scrollbar-width: thin;
|
| 144 |
+
scrollbar-color: hsl(var(--border)) transparent;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
.chat-scrollbar::-webkit-scrollbar {
|
| 148 |
+
width: 6px;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
.chat-scrollbar::-webkit-scrollbar-track {
|
| 152 |
+
background: transparent;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.chat-scrollbar::-webkit-scrollbar-thumb {
|
| 156 |
+
background-color: hsl(var(--border));
|
| 157 |
+
border-radius: 3px;
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
@layer utilities {
|
| 162 |
+
.message-shadow {
|
| 163 |
+
box-shadow: var(--shadow-sm);
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
.input-shadow {
|
| 167 |
+
box-shadow: var(--shadow-md);
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
.header-shadow {
|
| 171 |
+
box-shadow: var(--shadow-sm);
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
@keyframes messageSlideIn {
|
| 176 |
+
from {
|
| 177 |
+
opacity: 0;
|
| 178 |
+
transform: translateY(10px) scale(0.95);
|
| 179 |
+
}
|
| 180 |
+
to {
|
| 181 |
+
opacity: 1;
|
| 182 |
+
transform: translateY(0) scale(1);
|
| 183 |
}
|
| 184 |
}
|
src/pages/Index.tsx
CHANGED
|
@@ -1,12 +1,9 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
const Index = () => {
|
| 4 |
return (
|
| 5 |
-
<div className="
|
| 6 |
-
<
|
| 7 |
-
<h1 className="mb-4 text-4xl font-bold">Welcome to Your Blank App</h1>
|
| 8 |
-
<p className="text-xl text-muted-foreground">Start building your amazing project here!</p>
|
| 9 |
-
</div>
|
| 10 |
</div>
|
| 11 |
);
|
| 12 |
};
|
|
|
|
| 1 |
+
import ChatWindow from "@/components/chat/ChatWindow";
|
| 2 |
|
| 3 |
const Index = () => {
|
| 4 |
return (
|
| 5 |
+
<div className="min-h-screen bg-background">
|
| 6 |
+
<ChatWindow />
|
|
|
|
|
|
|
|
|
|
| 7 |
</div>
|
| 8 |
);
|
| 9 |
};
|
tailwind.config.ts
CHANGED
|
@@ -19,6 +19,33 @@ export default {
|
|
| 19 |
ring: "hsl(var(--ring))",
|
| 20 |
background: "hsl(var(--background))",
|
| 21 |
foreground: "hsl(var(--foreground))",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
primary: {
|
| 23 |
DEFAULT: "hsl(var(--primary))",
|
| 24 |
foreground: "hsl(var(--primary-foreground))",
|
|
|
|
| 19 |
ring: "hsl(var(--ring))",
|
| 20 |
background: "hsl(var(--background))",
|
| 21 |
foreground: "hsl(var(--foreground))",
|
| 22 |
+
|
| 23 |
+
/* Chat-specific colors */
|
| 24 |
+
"chat-bg": "hsl(var(--chat-background))",
|
| 25 |
+
"message-bg": "hsl(var(--message-background))",
|
| 26 |
+
"user-gradient-start": "hsl(var(--user-gradient-start))",
|
| 27 |
+
"user-gradient-end": "hsl(var(--user-gradient-end))",
|
| 28 |
+
"user-message-fg": "hsl(var(--user-message-foreground))",
|
| 29 |
+
"bot-message-bg": "hsl(var(--bot-message-background))",
|
| 30 |
+
"bot-message-fg": "hsl(var(--bot-message-foreground))",
|
| 31 |
+
"bot-message-border": "hsl(var(--bot-message-border))",
|
| 32 |
+
"input-bg": "hsl(var(--input-background))",
|
| 33 |
+
"input-border": "hsl(var(--input-border))",
|
| 34 |
+
"input-focus-border": "hsl(var(--input-focus-border))",
|
| 35 |
+
"send-button-start": "hsl(var(--send-button-start))",
|
| 36 |
+
"send-button-end": "hsl(var(--send-button-end))",
|
| 37 |
+
"send-button-fg": "hsl(var(--send-button-foreground))",
|
| 38 |
+
"header-bg": "hsl(var(--header-background))",
|
| 39 |
+
"header-fg": "hsl(var(--header-foreground))",
|
| 40 |
+
"header-border": "hsl(var(--header-border))",
|
| 41 |
+
"quick-action-bg": "hsl(var(--quick-action-background))",
|
| 42 |
+
"quick-action-fg": "hsl(var(--quick-action-foreground))",
|
| 43 |
+
"quick-action-hover": "hsl(var(--quick-action-hover))",
|
| 44 |
+
"quick-action-border": "hsl(var(--quick-action-border))",
|
| 45 |
+
"avatar-bg": "hsl(var(--avatar-background))",
|
| 46 |
+
"avatar-fg": "hsl(var(--avatar-foreground))",
|
| 47 |
+
|
| 48 |
+
/* Legacy compatibility */
|
| 49 |
primary: {
|
| 50 |
DEFAULT: "hsl(var(--primary))",
|
| 51 |
foreground: "hsl(var(--primary-foreground))",
|