Nischal Subedi commited on
Commit
7ef7420
·
1 Parent(s): 17ad9c6
Files changed (1) hide show
  1. app.py +25 -26
app.py CHANGED
@@ -292,16 +292,16 @@ Answer:"""
292
  custom_css = """
293
  /* Import legible fonts from Google Fonts */
294
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
295
-
296
  /* Root variables for consistent theming (light mode) */
297
  :root {
298
  --primary-color: #FF8C00;
299
  --primary-hover: #E07B00;
300
- --background-primary: hsl(30, 100%, 99.9%);
301
- --background-secondary: hsl(30, 100%, 96%);
302
- --text-primary: #4A3C32;
303
- --text-secondary: #8C7B6F;
304
- --border-color: hsl(30, 70%, 85%);
305
  --border-focus: #FF8C00;
306
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
307
  --shadow-md: 0 4px 10px rgba(0,0,0,0.1);
@@ -310,7 +310,7 @@ Answer:"""
310
  --error-border: #FFD2B2;
311
  --error-text: #E05C00;
312
  }
313
-
314
  /* Dark mode variables */
315
  @media (prefers-color-scheme: dark) {
316
  body {
@@ -318,9 +318,9 @@ Answer:"""
318
  --primary-hover: #CC8400;
319
  --background-primary: #2C2C2C;
320
  --background-secondary: #1F1F1F;
321
- --text-primary: #F0F0F0;
322
- --text-secondary: #B0B0B0;
323
- --border-color: #555555;
324
  --border-focus: #FFA500;
325
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
326
  --shadow-md: 0 4px 10px rgba(0,0,0,0.4);
@@ -330,7 +330,8 @@ Answer:"""
330
  --error-text: #FF6666;
331
  }
332
  }
333
-
 
334
  body, html {
335
  background-color: var(--background-secondary) !important;
336
  color: var(--text-primary) !important;
@@ -381,11 +382,6 @@ Answer:"""
381
  z-index: 1;
382
  animation: float-icon 3s ease-in-out infinite alternate;
383
  }
384
- @keyframes float-icon {
385
- 0% { transform: translateY(0px); }
386
- 50% { transform: translateY(-5px); }
387
- 100% { transform: translateY(0px); }
388
- }
389
  .app-header-title {
390
  font-family: 'Poppins', sans-serif !important;
391
  font-size: 3rem !important;
@@ -432,7 +428,7 @@ Answer:"""
432
  display: flex !important;
433
  justify-content: center !important;
434
  align-items: center !important;
435
- width: 100% !important;
436
  flex-direction: column !important;
437
  background-color: transparent !important;
438
  }
@@ -496,6 +492,7 @@ Answer:"""
496
  .placeholder {
497
  background-color: var(--background-primary) !important;
498
  color: var(--text-primary) !important;
 
499
  }
500
  .gradio-textbox {
501
  margin-bottom: 0.5rem !important;
@@ -511,9 +508,6 @@ Answer:"""
511
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
512
  box-shadow: var(--shadow-sm) !important;
513
  }
514
- .gradio-textbox .scroll-hide {
515
- background-color: var(--background-primary) !important;
516
- }
517
  .gradio-textbox textarea:focus,
518
  .gradio-textbox input:focus {
519
  outline: none !important;
@@ -591,7 +585,7 @@ Answer:"""
591
  }
592
  .input-field {
593
  flex: none !important;
594
- width: 100% !important;
595
  }
596
  .button-row {
597
  display: flex !important;
@@ -660,10 +654,6 @@ Answer:"""
660
  text-align: left !important;
661
  color: var(--text-primary) !important;
662
  }
663
- @keyframes fadeInAndSlideUp {
664
- from { opacity: 0; transform: translateY(15px); }
665
- to { opacity: 1; transform: translateY(0); }
666
- }
667
  .response-header {
668
  font-size: 1.3rem !important;
669
  font-weight: 700 !important;
@@ -833,6 +823,15 @@ Answer:"""
833
  font-size: 1rem !important;
834
  }
835
  }
 
 
 
 
 
 
 
 
 
836
  """
837
 
838
  with gr.Blocks(css=custom_css, title="Landlord-Tenant Rights Assistant") as demo:
@@ -952,7 +951,7 @@ Answer:"""
952
  outputs=[api_key_input, query_input, state_input, output]
953
  )
954
 
955
- return demo
956
 
957
  # --- Main Execution Block (UNCHANGED from original logic) ---
958
  if __name__ == "__main__":
 
292
  custom_css = """
293
  /* Import legible fonts from Google Fonts */
294
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
295
+
296
  /* Root variables for consistent theming (light mode) */
297
  :root {
298
  --primary-color: #FF8C00;
299
  --primary-hover: #E07B00;
300
+ --background-primary: #FFFFFF;
301
+ --background-secondary: #F9F5F1;
302
+ --text-primary: #2D1B00;
303
+ --text-secondary: #5C4033;
304
+ --border-color: #D9C4B0;
305
  --border-focus: #FF8C00;
306
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
307
  --shadow-md: 0 4px 10px rgba(0,0,0,0.1);
 
310
  --error-border: #FFD2B2;
311
  --error-text: #E05C00;
312
  }
313
+
314
  /* Dark mode variables */
315
  @media (prefers-color-scheme: dark) {
316
  body {
 
318
  --primary-hover: #CC8400;
319
  --background-primary: #2C2C2C;
320
  --background-secondary: #1F1F1F;
321
+ --text-primary: #F5E8E0;
322
+ --text-secondary: #C0B0A0;
323
+ --border-color: #4A4035;
324
  --border-focus: #FFA500;
325
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
326
  --shadow-md: 0 4px 10px rgba(0,0,0,0.4);
 
330
  --error-text: #FF6666;
331
  }
332
  }
333
+
334
+ /* General styles */
335
  body, html {
336
  background-color: var(--background-secondary) !important;
337
  color: var(--text-primary) !important;
 
382
  z-index: 1;
383
  animation: float-icon 3s ease-in-out infinite alternate;
384
  }
 
 
 
 
 
385
  .app-header-title {
386
  font-family: 'Poppins', sans-serif !important;
387
  font-size: 3rem !important;
 
428
  display: flex !important;
429
  justify-content: center !important;
430
  align-items: center !important;
431
+ width: 100 !important;
432
  flex-direction: column !important;
433
  background-color: transparent !important;
434
  }
 
492
  .placeholder {
493
  background-color: var(--background-primary) !important;
494
  color: var(--text-primary) !important;
495
+ border: 2px solid var(--border-color) !important;
496
  }
497
  .gradio-textbox {
498
  margin-bottom: 0.5rem !important;
 
508
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
509
  box-shadow: var(--shadow-sm) !important;
510
  }
 
 
 
511
  .gradio-textbox textarea:focus,
512
  .gradio-textbox input:focus {
513
  outline: none !important;
 
585
  }
586
  .input-field {
587
  flex: none !important;
588
+ width: 100 !important;
589
  }
590
  .button-row {
591
  display: flex !important;
 
654
  text-align: left !important;
655
  color: var(--text-primary) !important;
656
  }
 
 
 
 
657
  .response-header {
658
  font-size: 1.3rem !important;
659
  font-weight: 700 !important;
 
823
  font-size: 1rem !important;
824
  }
825
  }
826
+ @keyframes float-icon {
827
+ 0% { transform: translateY(0px); }
828
+ 50% { transform: translateY(-5px); }
829
+ 100% { transform: translateY(0px); }
830
+ }
831
+ @keyframes fadeInAndSlideUp {
832
+ from { opacity: 0; transform: translateY(15px); }
833
+ to { opacity: 1; transform: translateY(0); }
834
+ }
835
  """
836
 
837
  with gr.Blocks(css=custom_css, title="Landlord-Tenant Rights Assistant") as demo:
 
951
  outputs=[api_key_input, query_input, state_input, output]
952
  )
953
 
954
+ return demo
955
 
956
  # --- Main Execution Block (UNCHANGED from original logic) ---
957
  if __name__ == "__main__":