rafaldembski commited on
Commit
663eaab
1 Parent(s): 31ca449

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +88 -20
app.py CHANGED
@@ -166,6 +166,8 @@ body {
166
  background-color: #1e293b; /* Ciemne tło pasujące do karty */
167
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
168
  color: #cbd5e1; /* Jasny kolor tekstu dla kontrastu */
 
 
169
  }
170
 
171
  /* Główny kontener */
@@ -174,18 +176,20 @@ body {
174
  margin: auto;
175
  padding: 20px;
176
  width: 100%; /* Rozciągnięcie na całą szerokość */
 
177
  }
178
 
179
  /* Nagłówek */
180
  h1, .gr-markdown h1 {
181
  color: #60a5fa; /* Niebieski kolor nagłówka */
182
  text-align: center;
183
- margin-bottom: 10px;
184
  font-size: 2.5em;
185
  }
186
 
187
  h2, .gr-markdown h2 {
188
  color: #cbd5e1;
 
189
  }
190
 
191
  /* Karty i panele */
@@ -196,6 +200,7 @@ h2, .gr-markdown h2 {
196
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); /* Większy kontrast dla ciemnego tła */
197
  margin-bottom: 20px;
198
  width: 100%;
 
199
  }
200
 
201
  /* Przycisk Wyślij */
@@ -209,6 +214,8 @@ button.primary {
209
  cursor: pointer;
210
  transition: background-color 0.3s ease;
211
  width: 100%;
 
 
212
  }
213
 
214
  button.primary:hover {
@@ -226,6 +233,7 @@ button.secondary {
226
  cursor: pointer;
227
  transition: background-color 0.3s ease;
228
  width: 100%;
 
229
  }
230
 
231
  button.secondary:hover {
@@ -233,7 +241,7 @@ button.secondary:hover {
233
  }
234
 
235
  /* Pole tekstowe wiadomości */
236
- textarea {
237
  background-color: #1e293b;
238
  border: 1px solid #64748b;
239
  border-radius: 8px;
@@ -242,9 +250,11 @@ textarea {
242
  resize: none;
243
  transition: border-color 0.3s ease;
244
  color: #cbd5e1;
 
 
245
  }
246
 
247
- textarea:focus {
248
  border-color: #60a5fa;
249
  outline: none;
250
  box-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
@@ -259,6 +269,7 @@ textarea:focus {
259
  border-radius: 8px;
260
  background-color: #1e293b;
261
  color: #cbd5e1;
 
262
  }
263
 
264
  /* Panel Informacyjny */
@@ -269,6 +280,8 @@ textarea:focus {
269
  padding: 15px;
270
  font-size: 14px;
271
  color: #cbd5e1;
 
 
272
  }
273
 
274
  /* Linki */
@@ -286,11 +299,14 @@ a:hover {
286
  position: relative;
287
  border-radius: 0.75rem; /* Rounded-lg */
288
  background-color: #1e293b; /* bg-slate-900 */
289
- padding: 0.5rem;
290
  color: #cbd5e1; /* text-slate-500 */
291
  margin-bottom: 20px;
 
 
292
  }
293
 
 
294
  .custom-card-header {
295
  position: relative;
296
  display: flex;
@@ -299,14 +315,18 @@ a:hover {
299
  text-align: center;
300
  font-size: 0.75rem; /* text-xs */
301
  color: #cbd5e1; /* text-slate-500 */
 
302
  }
303
 
 
304
  .icon-group {
305
  display: flex;
306
  padding-left: 0.875rem; /* pl-3.5 */
307
  padding-top: 0.75rem; /* pt-3 */
 
308
  }
309
 
 
310
  .icon {
311
  margin-left: -0.125rem; /* -ml-0.5 */
312
  margin-right: 0.375rem; /* mr-1.5 */
@@ -315,17 +335,18 @@ a:hover {
315
  }
316
 
317
  .icon.red {
318
- color: rgba(239, 68, 68, 0.2); /* text-red-500/20 */
319
  }
320
 
321
  .icon.yellow {
322
- color: rgba(234, 179, 8, 0.2); /* text-yellow-500/20 */
323
  }
324
 
325
  .icon.green {
326
- color: rgba(34, 197, 94, 0.2); /* text-green-500/20 */
327
  }
328
 
 
329
  .file-name {
330
  position: absolute;
331
  top: 0.5rem; /* top-2 */
@@ -335,6 +356,7 @@ a:hover {
335
  color: #94a3b8; /* text-slate-500 */
336
  }
337
 
 
338
  .custom-card-body {
339
  margin-top: 1.25rem; /* mt-5 */
340
  padding-left: 1.25rem; /* px-5 */
@@ -342,15 +364,17 @@ a:hover {
342
  /* space-y-1.5 nie jest bezpośrednio wspierane w CSS, użyj odstępów między elementami */
343
  }
344
 
 
345
  .code-line {
346
- font-family: monospace;
347
- font-size: 0.75rem; /* text-xs */
348
  font-weight: normal;
349
  letter-spacing: 0.05em; /* tracking-wide */
350
  color: #a78bfa; /* text-violet-400 */
351
- margin-top: 1rem; /* mt-4 dla pierwszej linii, dostosuj w razie potrzeby */
352
  }
353
 
 
354
  .text-slate {
355
  color: #64748b; /* text-slate-500 */
356
  }
@@ -362,14 +386,44 @@ a:hover {
362
  .highlight {
363
  position: relative;
364
  display: inline-block;
365
- padding-left: 0.25rem; /* px-1 */
366
- padding-right: 0.25rem;
367
  background-color: rgba(59, 130, 246, 0.1); /* bg-blue-500/10 */
368
  color: #60a5fa; /* text-blue-400 */
 
369
  }
370
 
371
- .text-blue {
372
- color: #60a5fa; /* text-blue-400 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  }
374
  """
375
 
@@ -403,16 +457,16 @@ with gr.Blocks(css=custom_css) as demo:
403
  <span class="text-slate">&lt;</span><span class="text-pink">Features</span><span class="text-slate">&gt;</span>
404
  </p>
405
  <p class="code-line" style="margin-left: 1.5rem;">
406
- <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">Analiza Kontekstu</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
407
  </p>
408
  <p class="code-line" style="margin-left: 1.5rem;">
409
- <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">Planowanie Odpowiedzi</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
410
  </p>
411
  <p class="code-line" style="margin-left: 1.5rem;">
412
- <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">Generowanie Rozwiązań</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
413
  </p>
414
  <p class="code-line" style="margin-left: 1.5rem;">
415
- <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">Refleksja</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
416
  </p>
417
  <p class="code-line">
418
  <span class="text-slate">&lt;/</span><span class="text-pink">Features</span><span class="text-slate">&gt;</span>
@@ -421,7 +475,21 @@ with gr.Blocks(css=custom_css) as demo:
421
  </div>
422
  """)
423
 
424
- # Sekcja wyboru modelu i budżetu myślenia
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  with gr.Row():
426
  with gr.Column(scale=1):
427
  model = gr.Dropdown(
@@ -459,7 +527,7 @@ with gr.Blocks(css=custom_css) as demo:
459
  lines=1
460
  )
461
 
462
- # Przycisk Wyślij i Wyczyść
463
  with gr.Row():
464
  submit_button = gr.Button("🚀 Wyślij", variant="primary")
465
  clear_button = gr.Button("🧹 Wyczyść Chat", variant="secondary")
 
166
  background-color: #1e293b; /* Ciemne tło pasujące do karty */
167
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
168
  color: #cbd5e1; /* Jasny kolor tekstu dla kontrastu */
169
+ margin: 0;
170
+ padding: 0;
171
  }
172
 
173
  /* Główny kontener */
 
176
  margin: auto;
177
  padding: 20px;
178
  width: 100%; /* Rozciągnięcie na całą szerokość */
179
+ box-sizing: border-box;
180
  }
181
 
182
  /* Nagłówek */
183
  h1, .gr-markdown h1 {
184
  color: #60a5fa; /* Niebieski kolor nagłówka */
185
  text-align: center;
186
+ margin-bottom: 20px;
187
  font-size: 2.5em;
188
  }
189
 
190
  h2, .gr-markdown h2 {
191
  color: #cbd5e1;
192
+ margin-top: 1.5em;
193
  }
194
 
195
  /* Karty i panele */
 
200
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); /* Większy kontrast dla ciemnego tła */
201
  margin-bottom: 20px;
202
  width: 100%;
203
+ box-sizing: border-box;
204
  }
205
 
206
  /* Przycisk Wyślij */
 
214
  cursor: pointer;
215
  transition: background-color 0.3s ease;
216
  width: 100%;
217
+ box-sizing: border-box;
218
+ margin-bottom: 10px;
219
  }
220
 
221
  button.primary:hover {
 
233
  cursor: pointer;
234
  transition: background-color 0.3s ease;
235
  width: 100%;
236
+ box-sizing: border-box;
237
  }
238
 
239
  button.secondary:hover {
 
241
  }
242
 
243
  /* Pole tekstowe wiadomości */
244
+ textarea, input[type="text"] {
245
  background-color: #1e293b;
246
  border: 1px solid #64748b;
247
  border-radius: 8px;
 
250
  resize: none;
251
  transition: border-color 0.3s ease;
252
  color: #cbd5e1;
253
+ width: 100%;
254
+ box-sizing: border-box;
255
  }
256
 
257
+ textarea:focus, input[type="text"]:focus {
258
  border-color: #60a5fa;
259
  outline: none;
260
  box-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
 
269
  border-radius: 8px;
270
  background-color: #1e293b;
271
  color: #cbd5e1;
272
+ box-sizing: border-box;
273
  }
274
 
275
  /* Panel Informacyjny */
 
280
  padding: 15px;
281
  font-size: 14px;
282
  color: #cbd5e1;
283
+ box-sizing: border-box;
284
+ margin-top: 20px;
285
  }
286
 
287
  /* Linki */
 
299
  position: relative;
300
  border-radius: 0.75rem; /* Rounded-lg */
301
  background-color: #1e293b; /* bg-slate-900 */
302
+ padding: 1rem;
303
  color: #cbd5e1; /* text-slate-500 */
304
  margin-bottom: 20px;
305
+ box-sizing: border-box;
306
+ width: 100%;
307
  }
308
 
309
+ /* Header Karty */
310
  .custom-card-header {
311
  position: relative;
312
  display: flex;
 
315
  text-align: center;
316
  font-size: 0.75rem; /* text-xs */
317
  color: #cbd5e1; /* text-slate-500 */
318
+ margin-bottom: 1rem;
319
  }
320
 
321
+ /* Grupa ikon w nagłówku */
322
  .icon-group {
323
  display: flex;
324
  padding-left: 0.875rem; /* pl-3.5 */
325
  padding-top: 0.75rem; /* pt-3 */
326
+ margin-right: 0.5rem;
327
  }
328
 
329
+ /* Style ikon */
330
  .icon {
331
  margin-left: -0.125rem; /* -ml-0.5 */
332
  margin-right: 0.375rem; /* mr-1.5 */
 
335
  }
336
 
337
  .icon.red {
338
+ color: rgba(239, 68, 68, 0.8); /* text-red-500/80 */
339
  }
340
 
341
  .icon.yellow {
342
+ color: rgba(234, 179, 8, 0.8); /* text-yellow-500/80 */
343
  }
344
 
345
  .icon.green {
346
+ color: rgba(34, 197, 94, 0.8); /* text-green-500/80 */
347
  }
348
 
349
+ /* Nazwa pliku w nagłówku */
350
  .file-name {
351
  position: absolute;
352
  top: 0.5rem; /* top-2 */
 
356
  color: #94a3b8; /* text-slate-500 */
357
  }
358
 
359
+ /* Body karty */
360
  .custom-card-body {
361
  margin-top: 1.25rem; /* mt-5 */
362
  padding-left: 1.25rem; /* px-5 */
 
364
  /* space-y-1.5 nie jest bezpośrednio wspierane w CSS, użyj odstępów między elementami */
365
  }
366
 
367
+ /* Linie kodu w karcie */
368
  .code-line {
369
+ font-family: 'Courier New', Courier, monospace;
370
+ font-size: 0.85rem; /* Slightly larger for readability */
371
  font-weight: normal;
372
  letter-spacing: 0.05em; /* tracking-wide */
373
  color: #a78bfa; /* text-violet-400 */
374
+ margin-top: 0.5rem; /* mt-2 dla lepszej czytelności */
375
  }
376
 
377
+ /* Kolory tekstu */
378
  .text-slate {
379
  color: #64748b; /* text-slate-500 */
380
  }
 
386
  .highlight {
387
  position: relative;
388
  display: inline-block;
389
+ padding: 0.25rem 0.5rem; /* px-1 */
 
390
  background-color: rgba(59, 130, 246, 0.1); /* bg-blue-500/10 */
391
  color: #60a5fa; /* text-blue-400 */
392
+ border-radius: 4px;
393
  }
394
 
395
+ /* Responsive Design */
396
+ @media (max-width: 768px) {
397
+ .gradio-container {
398
+ padding: 10px;
399
+ }
400
+
401
+ h1, .gr-markdown h1 {
402
+ font-size: 2em;
403
+ }
404
+
405
+ .custom-card {
406
+ padding: 0.75rem;
407
+ }
408
+
409
+ .custom-card-body {
410
+ padding-left: 0.75rem;
411
+ padding-bottom: 1.5rem;
412
+ }
413
+
414
+ .code-line {
415
+ font-size: 0.75rem;
416
+ }
417
+
418
+ button.primary, button.secondary {
419
+ padding: 10px 20px;
420
+ font-size: 14px;
421
+ }
422
+
423
+ textarea, input[type="text"] {
424
+ font-size: 14px;
425
+ padding: 10px;
426
+ }
427
  }
428
  """
429
 
 
457
  <span class="text-slate">&lt;</span><span class="text-pink">Features</span><span class="text-slate">&gt;</span>
458
  </p>
459
  <p class="code-line" style="margin-left: 1.5rem;">
460
+ <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">🔍 Analiza Kontekstu</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
461
  </p>
462
  <p class="code-line" style="margin-left: 1.5rem;">
463
+ <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">📝 Planowanie Odpowiedzi</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
464
  </p>
465
  <p class="code-line" style="margin-left: 1.5rem;">
466
+ <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">💡 Generowanie Rozwiązań</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
467
  </p>
468
  <p class="code-line" style="margin-left: 1.5rem;">
469
+ <span class="text-slate">&lt;</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span><span class="highlight">🔄 Refleksja</span><span class="text-slate">&lt;/</span><span class="text-pink">Feature</span><span class="text-slate">&gt;</span>
470
  </p>
471
  <p class="code-line">
472
  <span class="text-slate">&lt;/</span><span class="text-pink">Features</span><span class="text-slate">&gt;</span>
 
475
  </div>
476
  """)
477
 
478
+ # Nagłówek główny
479
+ gr.Markdown("# 🧠 **D-LOGIC: Twój Inteligentny Asystent AI**")
480
+
481
+ # Opis narzędzia
482
+ gr.Markdown("""
483
+ **D-LOGIC** to zaawansowany asystent AI stworzony przez Rafała Dembskiego. Dzięki zaawansowanemu procesowi myślowemu, **D-LOGIC** analizuje, planuje i dostarcza precyzyjne odpowiedzi na Twoje pytania, zapewniając jednocześnie interaktywną i angażującą konwersację.
484
+
485
+ ### **Proces Myślowy ChatBota**:
486
+ - **Analiza Kontekstu**: Zrozumienie intencji i emocji użytkownika.
487
+ - **Planowanie Odpowiedzi**: Rozbicie problemu na mniejsze kroki.
488
+ - **Generowanie Rozwiązań**: Proponowanie najlepszych możliwych odpowiedzi.
489
+ - **Refleksja**: Samoocena jakości odpowiedzi i procesów myślowych.
490
+ """)
491
+
492
+ # Wybór modelu i budżet myślenia
493
  with gr.Row():
494
  with gr.Column(scale=1):
495
  model = gr.Dropdown(
 
527
  lines=1
528
  )
529
 
530
+ # Przycisk Wyślij i Wyczyść
531
  with gr.Row():
532
  submit_button = gr.Button("🚀 Wyślij", variant="primary")
533
  clear_button = gr.Button("🧹 Wyczyść Chat", variant="secondary")