Skip to content

Commit c5fc6c8

Browse files
Amélioration de l’UI et des fonctionnalités du chatbot : nouveaux styles, JS refactorisé, indicateurs d’écriture, HTML optimisé et gestion améliorée du statut LLM
1 parent edf0b1a commit c5fc6c8

13 files changed

Lines changed: 1696 additions & 350 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ cache/
2727
# Backup
2828
*.backup
2929

30+
data/new_questions.json
3031

3132

3233

data/new_questions.json

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

static/assets/chatbot.png

21.5 KB
Loading

static/css/animations.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@keyframes fadeIn {
2+
from {
3+
opacity: 0;
4+
}
5+
to {
6+
opacity: 1;
7+
}
8+
}
9+
10+
.fade-in {
11+
animation: fadeIn 0.3s ease-out;
12+
}
13+
14+
/* Loading States */
15+
.loading-spinner {
16+
display: inline-block;
17+
width: 16px;
18+
height: 16px;
19+
border: 2px solid rgba(255, 255, 255, 0.3);
20+
border-top-color: currentColor;
21+
border-radius: 50%;
22+
animation: spin 0.8s linear infinite;
23+
}
24+
25+
@keyframes spin {
26+
to {
27+
transform: rotate(360deg);
28+
}
29+
}

static/css/chatbot.css

Lines changed: 75 additions & 224 deletions
Original file line numberDiff line numberDiff line change
@@ -1,246 +1,97 @@
1-
@import url("theme.css");
1+
@import "theme.css";
2+
@import "./components/header.css";
3+
@import "./components/controls-bar.css";
4+
@import "./components/chat-messages.css";
5+
@import "./components/typing-indicator.css";
6+
@import "./components/input-area.css";
7+
@import "./animations.css";
28

39
* {
410
box-sizing: border-box;
11+
margin: 0;
12+
padding: 0;
13+
}
14+
15+
:root {
16+
--primary: hsl(228, 81%, 63%);
17+
--primary-dark: hsl(233, 73%, 59%);
18+
--primary-light: hsl(224, 86%, 74%);
19+
--secondary: hsl(198, 81%, 63%);
20+
--success: hsl(142, 71%, 45%);
21+
--warning: hsl(38, 92%, 50%);
22+
--error: hsl(0, 84%, 60%);
23+
24+
--bg-primary: #ffffff;
25+
--bg-secondary: #f8f9fa;
26+
--bg-tertiary: #f1f3f5;
27+
--bg-header: var(--primary);
28+
29+
--text-primary: #1a1a1a;
30+
--text-secondary: #6c757d;
31+
--text-tertiary: #adb5bd;
32+
--text-inverse: #ffffff;
33+
34+
--border-color: #e9ecef;
35+
--border-radius: 12px;
36+
--border-radius-lg: 16px;
37+
--border-radius-xl: 20px;
38+
39+
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
40+
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
41+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
42+
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
43+
0 4px 6px -2px rgba(0, 0, 0, 0.05);
44+
--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
45+
0 10px 10px -5px rgba(0, 0, 0, 0.04);
46+
47+
--spacing-xs: 4px;
48+
--spacing-sm: 8px;
49+
--spacing-md: 16px;
50+
--spacing-lg: 24px;
51+
--spacing-xl: 32px;
52+
53+
--transition-fast: 150ms ease;
54+
--transition-base: 250ms ease;
55+
--transition-slow: 350ms ease;
556
}
657

758
body {
8-
font-family: "Segoe UI", Roboto, sans-serif;
9-
background: var(--foreground-color);
10-
height: 100vh;
59+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
60+
"Helvetica Neue", Arial, sans-serif;
61+
background: var(--bg-secondary);
62+
min-height: 100vh;
1163
display: flex;
1264
justify-content: center;
1365
align-items: center;
14-
}
15-
16-
.container {
17-
width: 90%;
18-
max-width: 700px;
19-
height: 85vh;
20-
background: var(--foreground-color);
21-
border-radius: 20px;
22-
border: 1px solid var(--p-200);
23-
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
66+
padding: var(--spacing-md);
67+
color: var(--text-primary);
68+
line-height: 1.6;
69+
-webkit-font-smoothing: antialiased;
70+
-moz-osx-font-smoothing: grayscale;
71+
}
72+
73+
/*CHATBOT CONTAINER*/
74+
.chatbot-container {
75+
width: 100%;
76+
max-width: 900px;
77+
height: 90vh;
78+
max-height: 800px;
79+
background: var(--bg-primary);
80+
border-radius: var(--border-radius-xl);
81+
box-shadow: var(--shadow-xl);
2482
display: flex;
2583
flex-direction: column;
2684
overflow: hidden;
85+
animation: slideUp 0.4s ease-out;
2786
}
2887

29-
.header {
30-
background: var(--main-gradient-color);
31-
color: white;
32-
padding: 20px;
33-
text-align: center;
34-
}
35-
36-
.header h1 {
37-
font-size: var(--h1-font-size);
38-
line-height: var(--h1-line-height);
39-
margin-bottom: 5px;
40-
}
41-
42-
.header p {
43-
font-size: var(--caption-font-size);
44-
opacity: 0.9;
45-
}
46-
47-
.llm-badge {
48-
display: inline-block;
49-
background: rgba(255, 255, 255, 0.2);
50-
padding: 4px 12px;
51-
border-radius: 12px;
52-
font-size: 11px;
53-
margin-top: 8px;
54-
font-weight: bold;
55-
}
56-
57-
.controls {
58-
padding: 12px 20px;
59-
background: var(--n-50);
60-
border-bottom: 1px solid var(--p-100);
61-
display: flex;
62-
justify-content: space-between;
63-
align-items: center;
64-
}
65-
66-
.switch-container {
67-
display: flex;
68-
align-items: center;
69-
gap: 10px;
70-
font-size: var(--caption-font-size);
71-
}
72-
73-
.switch {
74-
position: relative;
75-
width: 50px;
76-
height: 24px;
77-
}
78-
.switch input {
79-
opacity: 0;
80-
width: 0;
81-
height: 0;
82-
}
83-
.slider {
84-
position: absolute;
85-
cursor: pointer;
86-
top: 0;
87-
left: 0;
88-
right: 0;
89-
bottom: 0;
90-
background-color: #ccc;
91-
transition: 0.4s;
92-
border-radius: 24px;
93-
}
94-
.slider:before {
95-
position: absolute;
96-
content: "";
97-
height: 18px;
98-
width: 18px;
99-
left: 3px;
100-
bottom: 3px;
101-
background-color: white;
102-
transition: 0.4s;
103-
border-radius: 50%;
104-
}
105-
input:checked + .slider {
106-
background-color: var(--p-500);
107-
}
108-
input:checked + .slider:before {
109-
transform: translateX(26px);
110-
}
111-
112-
#clearChatBtn {
113-
padding: 6px 16px;
114-
border: 1px solid var(--p-200);
115-
border-radius: 15px;
116-
background: white;
117-
cursor: pointer;
118-
font-size: 12px;
119-
transition: background 0.3s;
120-
}
121-
#clearChatBtn:hover {
122-
background: var(--p-100);
123-
}
124-
125-
.chat-box {
126-
flex: 1;
127-
padding: 20px;
128-
overflow-y: auto;
129-
background: var(--n-50);
130-
}
131-
132-
.message {
133-
margin-bottom: 15px;
134-
animation: fadeIn 0.3s;
135-
}
136-
@keyframes fadeIn {
88+
@keyframes slideUp {
13789
from {
13890
opacity: 0;
139-
transform: translateY(10px);
91+
transform: translateY(20px);
14092
}
14193
to {
14294
opacity: 1;
14395
transform: translateY(0);
14496
}
14597
}
146-
.message.user {
147-
text-align: right;
148-
}
149-
.message-content {
150-
display: inline-block;
151-
padding: 12px 18px;
152-
border-radius: 18px;
153-
max-width: 80%;
154-
word-wrap: break-word;
155-
font-size: var(--p-font-size);
156-
}
157-
.user .message-content {
158-
background: var(--p-500);
159-
color: white;
160-
}
161-
.bot .message-content {
162-
background: white;
163-
color: var(--p-900);
164-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
165-
}
166-
167-
.message-meta {
168-
font-size: 11px;
169-
color: var(--n-500);
170-
margin-top: 5px;
171-
display: flex;
172-
align-items: center;
173-
gap: 8px;
174-
}
175-
.user .message-meta {
176-
justify-content: flex-end;
177-
}
178-
179-
.confidence-badge {
180-
display: inline-block;
181-
padding: 2px 8px;
182-
border-radius: 10px;
183-
font-weight: bold;
184-
}
185-
.provider-badge {
186-
background: var(--p-500);
187-
color: white;
188-
padding: 2px 8px;
189-
border-radius: 10px;
190-
}
191-
192-
.input-area {
193-
padding: 20px;
194-
background: white;
195-
border-top: 1px solid var(--p-100);
196-
display: flex;
197-
gap: 10px;
198-
}
199-
#userInput {
200-
flex: 1;
201-
padding: 12px 18px;
202-
border: 2px solid var(--p-100);
203-
border-radius: 25px;
204-
font-size: var(--p-font-size);
205-
outline: none;
206-
transition: border-color 0.3s;
207-
}
208-
#userInput:focus {
209-
border-color: var(--p-500);
210-
}
211-
#sendBtn {
212-
padding: 12px 30px;
213-
background: var(--main-gradient-color);
214-
color: white;
215-
border: none;
216-
border-radius: 25px;
217-
cursor: pointer;
218-
font-weight: bold;
219-
transition: transform 0.2s;
220-
}
221-
#sendBtn:hover {
222-
transform: scale(1.05);
223-
}
224-
#sendBtn:disabled {
225-
opacity: 0.5;
226-
cursor: not-allowed;
227-
}
228-
229-
.loading {
230-
display: inline-block;
231-
width: 8px;
232-
height: 8px;
233-
border-radius: 50%;
234-
background: var(--p-500);
235-
animation: bounce 1.4s infinite ease-in-out;
236-
}
237-
@keyframes bounce {
238-
0%,
239-
80%,
240-
100% {
241-
transform: scale(0);
242-
}
243-
40% {
244-
transform: scale(1);
245-
}
246-
}

0 commit comments

Comments
 (0)