ChatBotPro / static /style.css
hayabusa
Refactor: Move from Gradio to FastAPI with Custom Vanilla Frontend
2d677a5
Raw
History Blame Contribute Delete
5.96 kB
:root {
--bg-gradient: linear-gradient(135deg, #09090b 0%, #171720 100%);
--panel-bg: rgba(255, 255, 255, 0.03);
--panel-border: rgba(255, 255, 255, 0.08);
--primary: #8b5cf6;
--primary-hover: #7c3aed;
--text-main: #f8fafc;
--text-muted: #94a3b8;
--bot-msg-bg: rgba(30, 41, 59, 0.6);
--user-msg-bg: linear-gradient(135deg, #6366f1, #8b5cf6);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Outfit', sans-serif;
}
body {
background: var(--bg-gradient);
color: var(--text-main);
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
.app-container {
width: 100%;
max-width: 900px;
height: 95vh;
display: flex;
flex-direction: column;
background: rgba(15, 23, 42, 0.4);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid var(--panel-border);
border-radius: 24px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
overflow: hidden;
margin: 0 1rem;
}
/* Header */
.app-header {
padding: 1.5rem 2rem;
border-bottom: 1px solid var(--panel-border);
background: rgba(0, 0, 0, 0.2);
text-align: center;
}
.logo {
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
}
.logo i {
color: #c084fc;
font-size: 1.8rem;
}
.app-header h1 {
font-size: 2rem;
font-weight: 700;
background: linear-gradient(to right, #38bdf8, #c084fc, #f472b6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: -0.5px;
}
.subtitle {
color: var(--text-muted);
font-size: 0.9rem;
margin-top: 0.25rem;
font-weight: 400;
}
/* Chat Area */
.chat-container {
flex: 1;
overflow-y: auto;
padding: 2rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
position: relative;
scrollbar-width: thin;
scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.chat-container::-webkit-scrollbar {
width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
background-color: rgba(255,255,255,0.2);
border-radius: 10px;
}
.message {
display: flex;
width: 100%;
animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
opacity: 0;
transform: translateY(20px);
}
@keyframes slideUp {
to {
opacity: 1;
transform: translateY(0);
}
}
.message-content {
max-width: 80%;
padding: 1rem 1.25rem;
font-size: 1.05rem;
line-height: 1.5;
word-wrap: break-word;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.message-content p {
margin-bottom: 0.75rem;
}
.message-content p:last-child {
margin-bottom: 0;
}
.message-content pre {
background: #0f172a;
padding: 1rem;
border-radius: 8px;
overflow-x: auto;
margin: 0.75rem 0;
border: 1px solid rgba(255,255,255,0.1);
}
.message-content code {
font-family: monospace;
background: rgba(0,0,0,0.3);
padding: 0.2rem 0.4rem;
border-radius: 4px;
font-size: 0.9em;
}
.bot-message {
justify-content: flex-start;
}
.bot-message .message-content {
background: var(--bot-msg-bg);
border: 1px solid var(--panel-border);
border-radius: 20px 20px 20px 4px;
color: #e2e8f0;
}
.user-message {
justify-content: flex-end;
}
.user-message .message-content {
background: var(--user-msg-bg);
border-radius: 20px 20px 4px 20px;
color: white;
}
/* Input Area */
.input-container {
padding: 1.25rem 2rem;
background: rgba(0, 0, 0, 0.2);
border-top: 1px solid var(--panel-border);
display: flex;
gap: 1rem;
align-items: flex-end;
}
.input-box {
flex: 1;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 18px;
padding: 0.5rem 1rem;
transition: all 0.3s ease;
}
.input-box:focus-within {
border-color: var(--primary);
background: rgba(255, 255, 255, 0.08);
box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
#message-input {
width: 100%;
background: transparent;
border: none;
color: white;
font-size: 1.05rem;
resize: none;
outline: none;
max-height: 150px;
min-height: 24px;
padding: 0.5rem 0;
}
#message-input::placeholder {
color: rgba(255, 255, 255, 0.3);
}
.action-btn {
width: 46px;
height: 46px;
border-radius: 50%;
border: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 1.2rem;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
flex-shrink: 0;
}
.send-btn {
background: var(--primary);
color: white;
}
.send-btn:hover {
background: var(--primary-hover);
transform: scale(1.05) translateY(-2px);
box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}
.send-btn:active {
transform: scale(0.95);
}
.clear-btn {
background: rgba(255, 255, 255, 0.05);
color: var(--text-muted);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.clear-btn:hover {
background: rgba(239, 68, 68, 0.2);
color: #ef4444;
border-color: rgba(239, 68, 68, 0.5);
transform: scale(1.05);
}
/* Typing Indicator */
.typing-indicator {
display: flex;
gap: 0.4rem;
padding: 1rem 1.5rem;
background: var(--bot-msg-bg);
border-radius: 20px 20px 20px 4px;
width: fit-content;
border: 1px solid var(--panel-border);
animation: fadeIn 0.3s ease;
}
.typing-indicator span {
width: 8px;
height: 8px;
background: var(--primary);
border-radius: 50%;
animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
0%, 80%, 100% { transform: scale(0); }
40% { transform: scale(1); }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}