Hadiil commited on
Commit
d01ea29
·
verified ·
1 Parent(s): 6fd685c

Update static/styles.css

Browse files
Files changed (1) hide show
  1. static/styles.css +363 -150
static/styles.css CHANGED
@@ -1,150 +1,363 @@
1
- // Theme toggle
2
- const themeToggler = document.getElementById('themeToggler');
3
- themeToggler.addEventListener('click', () => {
4
- document.body.classList.toggle('light_mode');
5
- themeToggler.innerHTML = document.body.classList.contains('light_mode') ? "<i class='bx bx-moon'></i>" : "<i class='bx bx-sun'></i>";
6
- });
7
-
8
- // Chat bar functionality
9
- const chatBar = document.getElementById('chatBar');
10
- const suggests = document.querySelector('.suggests');
11
- const inputField = document.querySelector('.prompt__form-input');
12
- const processingDots = document.getElementById('processingDots');
13
- const welcomeText = document.getElementById('welcome-text');
14
-
15
- // Bubble customization
16
- const bubbleToggle = document.getElementById('bubbleToggle');
17
- let bubbleStyles = ['bubble-rounded', 'bubble-sharp', 'bubble-starry'];
18
- let currentBubbleIndex = 0;
19
-
20
- function applyBubbleStyle() {
21
- const userMessages = document.querySelectorAll('.chat-message.user');
22
- userMessages.forEach(msg => {
23
- bubbleStyles.forEach(style => msg.classList.remove(style));
24
- msg.classList.add(bubbleStyles[currentBubbleIndex]);
25
- });
26
- }
27
-
28
- bubbleToggle.addEventListener('click', () => {
29
- currentBubbleIndex = (currentBubbleIndex + 1) % bubbleStyles.length;
30
- applyBubbleStyle();
31
- });
32
-
33
- function addMessage(content, isUser = false) {
34
- const messageDiv = document.createElement('div');
35
- messageDiv.classList.add('chat-message');
36
- if (isUser) {
37
- messageDiv.classList.add('user');
38
- messageDiv.classList.add(bubbleStyles[currentBubbleIndex]); // Apply current bubble style
39
- } else {
40
- messageDiv.classList.add('bot');
41
- }
42
- messageDiv.textContent = content;
43
- chatBar.appendChild(messageDiv);
44
- if (chatBar.scrollTop + chatBar.clientHeight >= chatBar.scrollHeight - 100) {
45
- chatBar.scrollTop = chatBar.scrollHeight;
46
- }
47
- }
48
-
49
- // Hide suggestions and welcome text when typing starts
50
- inputField.addEventListener('input', () => {
51
- const input = inputField.value.trim();
52
- if (input.length > 0) {
53
- suggests.classList.add('hidden');
54
- welcomeText.classList.add('hidden');
55
- } else {
56
- suggests.classList.remove('hidden');
57
- }
58
- });
59
-
60
- // Keyboard interaction: Enter to send
61
- inputField.addEventListener('keypress', (e) => {
62
- if (e.key === 'Enter') {
63
- e.preventDefault();
64
- sendMessage();
65
- }
66
- });
67
-
68
- // Send message function
69
- function sendMessage() {
70
- const input = inputField.value.trim();
71
- if (!input) return;
72
-
73
- const sendButton = document.getElementById('sendButton');
74
- sendButton.disabled = true;
75
- processingDots.classList.add('active');
76
-
77
- addMessage(input, true);
78
- inputField.value = '';
79
-
80
- fetch('/api/chat', {
81
- method: 'POST',
82
- headers: { 'Content-Type': 'application/json' },
83
- body: JSON.stringify({ query: input })
84
- })
85
- .then(res => res.json())
86
- .then(data => {
87
- if (data.response) {
88
- addMessage(data.response);
89
- suggests.classList.add('hidden');
90
- } else {
91
- alert(data.detail || 'Something went wrong!');
92
- }
93
- })
94
- .catch(error => {
95
- alert('Failed to process the query locally!');
96
- })
97
- .finally(() => {
98
- sendButton.disabled = false;
99
- processingDots.classList.remove('active');
100
- });
101
- }
102
-
103
- // Send button click
104
- document.getElementById('sendButton').addEventListener('click', sendMessage);
105
-
106
- // Placeholder functionality for other buttons
107
- document.getElementById('deepSearchButton').addEventListener('click', () => {
108
- alert('Initiating DeepSearch... (Functionality to be implemented)');
109
- });
110
- document.getElementById('thinkButton').addEventListener('click', () => {
111
- alert('Activating Think mode... (Functionality to be implemented)');
112
- });
113
- document.getElementById('fileInput').addEventListener('change', (e) => {
114
- const file = e.target.files[0];
115
- if (file) alert(`File selected: ${file.name} (Processing to be implemented)`);
116
- });
117
-
118
- // Initialize stars
119
- function initializeStars() {
120
- const starsContainer = document.getElementById('starsContainer');
121
- for (let i = 0; i < 100; i++) {
122
- const star = document.createElement('div');
123
- star.className = 'star';
124
- const x = Math.random() * 100;
125
- const y = Math.random() * 100;
126
- const size = Math.random() * 2 + 1;
127
- const delay = Math.random() * 3;
128
- star.style.left = `${x}%`;
129
- star.style.top = `${y}%`;
130
- star.style.width = `${size}px`;
131
- star.style.height = `${size}px`;
132
- star.style.animationDelay = `${delay}s`;
133
- starsContainer.appendChild(star);
134
- }
135
- }
136
-
137
- // Call initializeStars on page load
138
- document.addEventListener('DOMContentLoaded', initializeStars);
139
-
140
- // Starry background effects (optional, kept from your original)
141
- document.addEventListener('mousemove', (e) => {
142
- let x = e.clientX / window.innerWidth;
143
- let y = e.clientY / window.innerHeight;
144
- document.querySelector('.stars').style.transform = `translate(${x * 50}px, ${y * 50}px)`;
145
- });
146
- window.addEventListener('scroll', () => {
147
- const scrollPosition = window.scrollY;
148
- const stars = document.querySelector('.stars');
149
- stars.style.animationDuration = `${100 - scrollPosition / 10}s`;
150
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;800&display=swap');
2
+
3
+ * {
4
+ margin: 0;
5
+ padding: 0;
6
+ outline: none;
7
+ box-sizing: border-box;
8
+ font-family: "Open Sans", sans-serif;
9
+ }
10
+
11
+ :root {
12
+ --primary-color: #0A0A0B;
13
+ --secondary-color: #1A1B1E;
14
+ --secondary-hover-color: #2A2B2E;
15
+ --focus-color: #242528;
16
+ --focus-hover-color: #343538;
17
+ --button-hover-color: #252627;
18
+ --text-color: #FFFFFF;
19
+ --text-secondary-color: #A0A1A3;
20
+ --heading-secondary-color: #606162;
21
+ --placeholder-color: #78797A;
22
+ --accent-color: #00A3FF;
23
+ --star-color: #FFFFFF;
24
+ --background-color: #000;
25
+ }
26
+
27
+ .light_mode {
28
+ --primary-color: #D8D0E6; /* Dusty Lavender */
29
+ --secondary-color: #E8E2F2; /* Darker lavender */
30
+ --secondary-hover-color: #D0C8E0;
31
+ --focus-color: #ECEDEC;
32
+ --focus-hover-color: #E0E1E0;
33
+ --button-hover-color: #D5CCE8;
34
+ --text-color: #2A2A2A; /* Charcoal */
35
+ --text-secondary-color: #4A4B4C;
36
+ --heading-secondary-color: #BABBBB;
37
+ --placeholder-color: #868788;
38
+ --accent-color: #7A5CFA; /* Vibrant purple */
39
+ --star-color: #666;
40
+ --background-color: #D8D0E6;
41
+ }
42
+
43
+ body {
44
+ min-height: 100vh;
45
+ display: flex;
46
+ flex-direction: row;
47
+ justify-content: space-between;
48
+ background: var(--background-color);
49
+ position: relative;
50
+ overflow-y: hidden;
51
+ }
52
+
53
+ .stars {
54
+ position: fixed;
55
+ width: 100%;
56
+ height: 100%;
57
+ background: url('https://www.transparenttextures.com/patterns/stardust.png');
58
+ animation: starsAnim 100s linear infinite;
59
+ z-index: -1;
60
+ }
61
+
62
+ .light_mode .stars {
63
+ background: url('https://www.transparenttextures.com/patterns/stardust.png') rgba(216, 208, 230, 0.4);
64
+ opacity: 0.2;
65
+ }
66
+
67
+ @keyframes starsAnim {
68
+ from { background-position: 0 0; }
69
+ to { background-position: 10000px 10000px; }
70
+ }
71
+
72
+ .sidebar {
73
+ width: 70px;
74
+ height: 100vh;
75
+ background: rgba(26, 27, 30, 0.95);
76
+ display: flex;
77
+ flex-direction: column;
78
+ align-items: center;
79
+ padding: 1rem 0;
80
+ position: fixed;
81
+ left: 0;
82
+ top: 0;
83
+ transition: width 0.3s ease;
84
+ z-index: 1001;
85
+ }
86
+
87
+ .sidebar:hover {
88
+ width: 200px;
89
+ }
90
+
91
+ .sidebar__item {
92
+ width: 100%;
93
+ padding: 1rem;
94
+ color: var(--text-secondary-color);
95
+ text-decoration: none;
96
+ display: flex;
97
+ align-items: center;
98
+ gap: 1rem;
99
+ transition: all 0.3s ease;
100
+ }
101
+
102
+ .sidebar__item:hover {
103
+ background: var(--secondary-hover-color);
104
+ color: var(--accent-color);
105
+ padding-left: 1.5rem;
106
+ }
107
+
108
+ .sidebar__item i {
109
+ font-size: 1.5rem;
110
+ }
111
+
112
+ .sidebar__item span {
113
+ display: none;
114
+ font-size: 1rem;
115
+ }
116
+
117
+ .sidebar:hover .sidebar__item span {
118
+ display: inline;
119
+ }
120
+
121
+ .light_mode .sidebar {
122
+ background: rgba(232, 226, 242, 0.95);
123
+ }
124
+
125
+ .main-content {
126
+ flex: 1;
127
+ display: flex;
128
+ flex-direction: column;
129
+ padding-bottom: 80px;
130
+ padding-top: 2rem;
131
+ margin-left: 70px;
132
+ height: 100vh;
133
+ overflow: hidden;
134
+ }
135
+
136
+ .header {
137
+ max-width: 900px;
138
+ text-align: center;
139
+ padding: 0 2rem;
140
+ margin: 0 auto;
141
+ }
142
+
143
+ .header__title h1 {
144
+ color: var(--text-color);
145
+ font-size: 3.5rem;
146
+ font-weight: 800;
147
+ margin-bottom: 1rem;
148
+ text-shadow: 0 0 10px rgba(0, 163, 255, 0.5);
149
+ }
150
+
151
+ .header__title h2 {
152
+ color: var(--text-secondary-color);
153
+ font-size: 1.5rem;
154
+ font-weight: 400;
155
+ max-width: 600px;
156
+ margin: 0 auto;
157
+ text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
158
+ transition: opacity 0.3s ease;
159
+ }
160
+
161
+ .suggests {
162
+ display: grid;
163
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
164
+ margin: 2rem auto;
165
+ max-width: 900px;
166
+ gap: 1rem;
167
+ padding: 0 2rem;
168
+ transition: opacity 0.3s ease;
169
+ }
170
+
171
+ .suggests.hidden,
172
+ .header__title h2.hidden {
173
+ opacity: 0;
174
+ height: 0;
175
+ margin: 0;
176
+ overflow: hidden;
177
+ }
178
+
179
+ .suggests__item {
180
+ background: rgba(26, 27, 30, 0.9);
181
+ color: var(--text-secondary-color);
182
+ padding: 1.5rem;
183
+ border-radius: 0.5rem;
184
+ cursor: pointer;
185
+ transition: all 0.3s ease;
186
+ border: 1px solid var(--focus-color);
187
+ }
188
+
189
+ .light_mode .suggests__item {
190
+ background: rgba(232, 226, 242, 0.9);
191
+ }
192
+
193
+ .suggests__item:hover {
194
+ background: var(--secondary-hover-color);
195
+ border-color: var(--accent-color);
196
+ color: var(--text-color);
197
+ }
198
+
199
+ .suggests__item-icon {
200
+ margin-top: 1rem;
201
+ color: var(--accent-color);
202
+ }
203
+
204
+ .prompt {
205
+ position: fixed;
206
+ background: rgba(10, 10, 11, 0.9);
207
+ z-index: 1000;
208
+ width: calc(100% - 70px);
209
+ left: 70px;
210
+ bottom: 0;
211
+ padding: 1rem;
212
+ border-top: 1px solid var(--secondary-color);
213
+ }
214
+
215
+ .light_mode .prompt {
216
+ background: rgba(232, 226, 242, 0.9);
217
+ border-top: 1px solid var(--focus-color);
218
+ }
219
+
220
+ .prompt__input-wrapper {
221
+ max-width: 900px;
222
+ margin: 0 auto;
223
+ position: relative;
224
+ display: flex;
225
+ align-items: center;
226
+ background: var(--secondary-color);
227
+ border: 1px solid var(--focus-color);
228
+ border-radius: 0.5rem;
229
+ padding: 0.2rem;
230
+ transition: all 0.3s ease;
231
+ }
232
+
233
+ .prompt__input-wrapper:focus-within {
234
+ border-color: var(--accent-color);
235
+ background: var(--focus-color);
236
+ }
237
+
238
+ .prompt__form-input {
239
+ flex-grow: 1;
240
+ border: none;
241
+ resize: none;
242
+ font-size: 1.1rem;
243
+ color: var(--text-color);
244
+ padding: 0.3rem 0.5rem;
245
+ background: transparent;
246
+ outline: none;
247
+ }
248
+
249
+ .prompt__form-input::placeholder {
250
+ color: var(--placeholder-color);
251
+ }
252
+
253
+ .prompt__action-buttons {
254
+ display: flex;
255
+ align-items: center;
256
+ gap: 0.3rem;
257
+ padding-right: 0.3rem;
258
+ position: relative;
259
+ }
260
+
261
+ .prompt__form-button {
262
+ background: none;
263
+ border: none;
264
+ color: var(--text-secondary-color);
265
+ font-size: 1.1rem;
266
+ cursor: pointer;
267
+ padding: 0.2rem;
268
+ transition: color 0.3s ease;
269
+ }
270
+
271
+ .prompt__form-button:hover {
272
+ color: var(--accent-color);
273
+ }
274
+
275
+ .prompt__disclaim {
276
+ text-align: center;
277
+ color: var(--placeholder-color);
278
+ font-size: 0.8rem;
279
+ margin-top: 1rem;
280
+ max-width: 900px;
281
+ margin-left: auto;
282
+ margin-right: auto;
283
+ text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
284
+ }
285
+
286
+ .chat-bar {
287
+ max-width: 900px;
288
+ margin: 2rem auto;
289
+ padding: 0 2rem;
290
+ display: flex;
291
+ flex-direction: column;
292
+ overflow-y: auto;
293
+ max-height: calc(100vh - 160px);
294
+ -ms-overflow-style: none;
295
+ scrollbar-width: none;
296
+ }
297
+
298
+ .chat-bar::-webkit-scrollbar {
299
+ display: none;
300
+ }
301
+
302
+ .chat-message {
303
+ margin-bottom: 1rem;
304
+ padding: 1rem;
305
+ border-radius: 0.5rem;
306
+ background: rgba(26, 27, 30, 0.9);
307
+ color: var(--text-color);
308
+ word-wrap: break-word;
309
+ }
310
+
311
+ .light_mode .chat-message {
312
+ background: rgba(232, 226, 242, 0.9);
313
+ }
314
+
315
+ .chat-message.user {
316
+ background: rgba(122, 92, 250, 0.2);
317
+ border: 1px solid var(--accent-color);
318
+ border-radius: 0.5rem;
319
+ }
320
+
321
+ .chat-message.bot {
322
+ background: rgba(36, 37, 40, 0.9);
323
+ }
324
+
325
+ /* Bubble styles */
326
+ .chat-message.user.bubble-rounded {
327
+ border-radius: 1rem;
328
+ }
329
+
330
+ .chat-message.user.bubble-sharp {
331
+ border-radius: 0;
332
+ border: 2px solid var(--accent-color);
333
+ }
334
+
335
+ .chat-message.user.bubble-starry {
336
+ border-radius: 0.5rem;
337
+ border: 1px dashed var(--accent-color);
338
+ background: rgba(122, 92, 250, 0.2) url('https://www.transparenttextures.com/patterns/stardust.png') repeat;
339
+ background-size: 100px 100px;
340
+ }
341
+
342
+ .processing-dots {
343
+ display: none;
344
+ position: absolute;
345
+ right: 60px;
346
+ color: var(--accent-color);
347
+ font-size: 1.2rem;
348
+ }
349
+
350
+ .processing-dots.active {
351
+ display: inline;
352
+ }
353
+
354
+ @keyframes blink {
355
+ 0% { opacity: 1; }
356
+ 50% { opacity: 0.3; }
357
+ 100% { opacity: 1; }
358
+ }
359
+
360
+ .processing-dots span {
361
+ animation: blink 1s infinite;
362
+ animation-delay: calc(0.2s * var(--i));
363
+ }