-
Notifications
You must be signed in to change notification settings - Fork 700
Expand file tree
/
Copy pathstyles.js
More file actions
279 lines (241 loc) · 5.69 KB
/
Copy pathstyles.js
File metadata and controls
279 lines (241 loc) · 5.69 KB
1
2
3
4
5
6
7
8
9
10
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
/**
* CSS Styles for the streaming chat interface
* Exported as a module for better organization
*/
// Main CSS styles for the chat interface
export const STYLES = `
/* Container styles */
.chat-container {
height: 600px; /* Fixed overall container height */
width: 80%;
margin: 0 auto;
padding: 20px;
font-family: sans-serif;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
/* Selector styles */
.site-selector {
margin-bottom: 20px;
flex-shrink: 0; /* Don't allow to shrink */
}
.site-selector select {
padding: 8px;
font-size: 14px;
border-radius: 4px;
border: 1px solid #ccc;
}
.selector-label {
margin: 0 5px;
}
.selector-icon {
vertical-align: middle;
cursor: pointer;
margin-left: 8px;
width: 16px;
height: 16px;
}
/* Messages area styles */
.messages {
height: calc(100% - 80px); /* Subtract input area height */
width: 100%;
overflow-y: auto;
border: 1px solid #ccc;
border-bottom: none; /* Remove bottom border */
padding: 20px;
padding-bottom: 10px; /* Add padding at bottom */
flex-grow: 1; /* Allow to grow and take available space */
border-radius: 5px 5px 0 0; /* Rounded corners only on top */
box-sizing: border-box;
}
.messages_full {
height: calc(100% - 80px); /* Subtract input area height */
width: 100%;
overflow-y: auto;
border: 1px solid #ccc;
border-bottom: none; /* Remove bottom border */
padding: 20px;
padding-bottom: 10px; /* Add padding at bottom */
flex-grow: 1; /* Allow to grow and take available space */
border-radius: 5px 5px 0 0; /* Rounded corners only on top */
box-sizing: border-box;
}
/* Input area styles - connected to messages area */
.input-area {
display: flex;
gap: 10px;
width: 100%;
border: 1px solid #ccc;
border-top: 1px solid #e0e0e0; /* Lighter border for separation */
padding: 10px;
border-radius: 0 0 5px 5px; /* Rounded corners only on bottom */
background-color: #f9f9f9; /* Slight background difference */
flex-shrink: 0; /* Don't allow to shrink */
min-height: 80px; /* Taller fixed height */
box-sizing: border-box;
}
.input-area_full {
display: flex;
gap: 10px;
width: 100%;
border: 1px solid #ccc;
border-top: 1px solid #e0e0e0; /* Lighter border for separation */
padding: 10px;
border-radius: 0 0 5px 5px; /* Rounded corners only on bottom */
background-color: #f9f9f9; /* Slight background difference */
flex-shrink: 0; /* Don't allow to shrink */
min-height: 80px; /* Taller fixed height */
box-sizing: border-box;
}
/* Message styles */
.message {
margin-bottom: 15px;
display: flex;
}
.user-message {
justify-content: flex-end;
}
.assistant-message {
justify-content: flex-start;
}
.remember-message {
font-weight: bold;
color: #333333;
justify-content: flex-start;
margin-bottom: 1em;
}
.item-details-message {
font-size: 0.95em;
color: #333333;
justify-content: flex-start;
margin-bottom: 2em;
display: flex;
font-family: sans-serif;
}
.message-bubble {
max-width: 90%;
padding: 10px 15px;
border-radius: 15px;
}
.user-message .message-bubble {
background: #007bff;
color: white;
}
.assistant-message .message-bubble {
background: #f9f9f9;
color: black;
}
/* Item styles */
.item-container {
display: flex;
margin-bottom: 1em;
gap: 1em;
}
.item-content {
flex: 1;
}
.item-title-row {
display: flex;
align-items: center;
gap: 0.5em;
margin-bottom: 0.5em;
}
.item-title-link {
font-weight: 600;
text-decoration: none;
color: #2962ff;
}
.item-info-icon {
font-size: 0.5em;
position: relative;
}
.item-info-icon img {
width: 16px;
height: 16px;
}
.item-description {
font-size: 0.9em;
}
.item-site-link {
font-size: 0.9em;
text-decoration: none;
color: #2962ff;
font-weight: 500;
padding: 8px 0;
display: inline-block;
}
.item-image {
width: 80px;
height: 80px;
object-fit: cover;
}
.item-details-text {
font-size: 0.85em;
}
.item-explanation {
font-size: 0.95em;
color: #333333;
margin-bottom: 1em;
}
.item-real-estate-details {
margin-top: 0.5em;
}
.message-input {
flex-grow: 1;
padding: 10px;
border: 1px solid #ccc;
border-radius: 20px; /* Rounded input field like ChatGPT */
font-size: 16px;
min-height: 60px; /* Taller input for more text */
resize: none; /* Prevent manual resizing */
}
.send-button {
padding: 10px 20px;
background: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
align-self: flex-end; /* Align button to bottom */
}
.send-button:hover {
background: #0056b3;
}
.intermediate-container {
padding: 20px 0;
font-weight: bold;
font-size: 0.95em;
color: #333333;
}
/* Context URL styles */
.context-url-container {
margin-top: 8px;
display: none;
}
.context-url-input {
width: 200px;
padding: 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
/* Special message types */
.ask-user-message {
font-style: italic;
color: #555;
margin-bottom: 1em;
}
.site-is-irrelevant-to-query {
color: #d32f2f;
font-weight: bold;
margin-bottom: 1em;
}
`;
/**
* Applies the CSS styles to the document
*/
export function applyStyles() {
const styleSheet = document.createElement("style");
styleSheet.textContent = STYLES;
document.head.appendChild(styleSheet);
}