ElMETRICO commited on
Commit
95fb395
·
verified ·
1 Parent(s): 4b5d27d

Update CrossTalk AI to vertical clean layout

Browse files
Files changed (1) hide show
  1. app.py +84 -75
app.py CHANGED
@@ -259,6 +259,7 @@ def safe_search(query):
259
 
260
 
261
 
 
262
  custom_css = """
263
  .gradio-container {
264
  background: #0B0F19 !important;
@@ -332,6 +333,7 @@ custom_css = """
332
  border-radius: 18px !important;
333
  padding: 22px !important;
334
  box-shadow: 0 16px 38px rgba(0,0,0,0.22);
 
335
  }
336
 
337
  .search-card {
@@ -344,16 +346,16 @@ custom_css = """
344
 
345
  .section-title {
346
  color: #F8FAFC;
347
- font-size: 19px;
348
  font-weight: 800;
349
- margin-bottom: 4px;
350
  }
351
 
352
  .section-subtitle {
353
  color: #94A3B8;
354
- font-size: 13px;
355
- line-height: 1.5;
356
- margin-bottom: 16px;
357
  }
358
 
359
  textarea, input {
@@ -375,7 +377,7 @@ button.search-button {
375
  border-radius: 12px !important;
376
  color: #FFFFFF !important;
377
  font-weight: 800 !important;
378
- min-height: 46px !important;
379
  }
380
 
381
  button.search-button:hover {
@@ -388,7 +390,7 @@ button.clear-button {
388
  border-radius: 12px !important;
389
  color: #E5E7EB !important;
390
  font-weight: 750 !important;
391
- min-height: 46px !important;
392
  }
393
 
394
  .status-panel textarea {
@@ -423,7 +425,12 @@ button.clear-button {
423
  }
424
 
425
  #examples-block {
426
- margin-top: 12px;
 
 
 
 
 
427
  }
428
 
429
  @media (max-width: 900px) {
@@ -480,73 +487,75 @@ with gr.Blocks(
480
  """
481
  )
482
 
483
- with gr.Row(equal_height=False):
484
- with gr.Column(scale=5, elem_classes=["main-card", "search-card"]):
485
- gr.HTML(
486
- """
487
- <div class="section-title">Search input</div>
488
- <div class="section-subtitle">
489
- Enter an ethnic source word. Exact and base-form matches are treated as verified dictionary outputs.
490
- </div>
491
- """
492
- )
493
-
494
- query = gr.Textbox(
495
- label="Source word",
496
- placeholder="Example: kəkhyáŋ, Hula, Aina, aam, bajaoo",
497
- lines=1
498
- )
499
-
500
- with gr.Row():
501
- clear_btn = gr.Button("Clear", elem_classes=["clear-button"])
502
- submit_btn = gr.Button("Search", elem_classes=["search-button"])
503
-
504
- gr.Examples(
505
- examples=[
506
- ["kəkhyáŋ"],
507
- ["Hula"],
508
- ["Aina"],
509
- ["aam"],
510
- ["bajaoo"],
511
- ["unknown tribal word"]
512
- ],
513
- inputs=query,
514
- label="Examples",
515
- elem_id="examples-block"
516
- )
517
-
518
- with gr.Column(scale=7, elem_classes=["main-card", "output-card"]):
519
- gr.HTML(
520
- """
521
- <div class="section-title">Retrieval output</div>
522
- <div class="section-subtitle">
523
- The system returns verified dictionary matches first. Semantic fallback appears only when no verified match is found.
524
- </div>
525
- """
526
- )
527
-
528
- status = gr.Textbox(
529
- label="System status",
530
- lines=1,
531
- elem_classes=["status-panel"],
532
- value="Ready."
533
- )
534
-
535
- summary = gr.Markdown(
536
- value="""
537
- <div class="result-note">
538
- Enter a source word and click Search. Results will appear below.
539
- </div>
540
- """
541
- )
542
-
543
- results = gr.Dataframe(
544
- label="Results table",
545
- value=EMPTY_RESULTS,
546
- interactive=False,
547
- wrap=True,
548
- max_height=420
549
- )
 
 
550
 
551
  gr.HTML(
552
  """
 
259
 
260
 
261
 
262
+
263
  custom_css = """
264
  .gradio-container {
265
  background: #0B0F19 !important;
 
333
  border-radius: 18px !important;
334
  padding: 22px !important;
335
  box-shadow: 0 16px 38px rgba(0,0,0,0.22);
336
+ margin-bottom: 18px !important;
337
  }
338
 
339
  .search-card {
 
346
 
347
  .section-title {
348
  color: #F8FAFC;
349
+ font-size: 22px;
350
  font-weight: 800;
351
+ margin-bottom: 6px;
352
  }
353
 
354
  .section-subtitle {
355
  color: #94A3B8;
356
+ font-size: 14px;
357
+ line-height: 1.55;
358
+ margin-bottom: 18px;
359
  }
360
 
361
  textarea, input {
 
377
  border-radius: 12px !important;
378
  color: #FFFFFF !important;
379
  font-weight: 800 !important;
380
+ min-height: 48px !important;
381
  }
382
 
383
  button.search-button:hover {
 
390
  border-radius: 12px !important;
391
  color: #E5E7EB !important;
392
  font-weight: 750 !important;
393
+ min-height: 48px !important;
394
  }
395
 
396
  .status-panel textarea {
 
425
  }
426
 
427
  #examples-block {
428
+ margin-top: 14px;
429
+ }
430
+
431
+ .input-wide {
432
+ margin-top: 8px;
433
+ margin-bottom: 14px;
434
  }
435
 
436
  @media (max-width: 900px) {
 
487
  """
488
  )
489
 
490
+ # SEARCH SECTION - FULL WIDTH
491
+ with gr.Column(elem_classes=["main-card", "search-card"]):
492
+ gr.HTML(
493
+ """
494
+ <div class="section-title">Search input</div>
495
+ <div class="section-subtitle">
496
+ Enter an ethnic source word. Exact and base-form matches are treated as verified dictionary outputs.
497
+ </div>
498
+ """
499
+ )
500
+
501
+ query = gr.Textbox(
502
+ label="Source word",
503
+ placeholder="Example: kəkhyáŋ, Hula, Aina, aam, bajaoo",
504
+ lines=1,
505
+ elem_classes=["input-wide"]
506
+ )
507
+
508
+ with gr.Row():
509
+ clear_btn = gr.Button("Clear", elem_classes=["clear-button"])
510
+ submit_btn = gr.Button("Search", elem_classes=["search-button"])
511
+
512
+ gr.Examples(
513
+ examples=[
514
+ ["kəkhyáŋ"],
515
+ ["Hula"],
516
+ ["Aina"],
517
+ ["aam"],
518
+ ["bajaoo"],
519
+ ["unknown tribal word"]
520
+ ],
521
+ inputs=query,
522
+ label="Examples",
523
+ elem_id="examples-block"
524
+ )
525
+
526
+ # OUTPUT SECTION - BELOW SEARCH
527
+ with gr.Column(elem_classes=["main-card", "output-card"]):
528
+ gr.HTML(
529
+ """
530
+ <div class="section-title">Retrieval output</div>
531
+ <div class="section-subtitle">
532
+ The system returns verified dictionary matches first. Semantic fallback appears only when no verified match is found.
533
+ </div>
534
+ """
535
+ )
536
+
537
+ status = gr.Textbox(
538
+ label="System status",
539
+ lines=1,
540
+ elem_classes=["status-panel"],
541
+ value="Ready."
542
+ )
543
+
544
+ summary = gr.Markdown(
545
+ value="""
546
+ <div class="result-note">
547
+ Enter a source word and click Search. Results will appear below.
548
+ </div>
549
+ """
550
+ )
551
+
552
+ results = gr.Dataframe(
553
+ label="Results table",
554
+ value=EMPTY_RESULTS,
555
+ interactive=False,
556
+ wrap=True,
557
+ max_height=460
558
+ )
559
 
560
  gr.HTML(
561
  """