VyLala commited on
Commit
615fc65
Β·
verified Β·
1 Parent(s): 67fc0bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -1
app.py CHANGED
@@ -18,6 +18,28 @@ with open("offer.html", "r", encoding="utf-8") as f:
18
  with open("mtdna_tool_explainer_updated.html", "r", encoding="utf-8") as f:
19
  flow_chart = f.read()
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  with gr.Blocks() as interface:
23
  # with gr.Tab("CURIOUS ABOUT THIS PRODUCT?"):
@@ -41,7 +63,8 @@ with gr.Blocks() as interface:
41
  #resume_file = gr.File(label="πŸ—ƒοΈ Previously saved Excel output (optional)", file_types=[".xlsx"], interactive=True)
42
  gr.HTML("""<a href="https://docs.google.com/spreadsheets/d/1lKqPp17EfHsshJGZRWEpcNOZlGo3F5qU/edit?usp=sharing" download target="_blank">Download Example Excel Format</a>""")
43
  file_upload = gr.File(label="πŸ“ Or Upload CSV/Excel File", file_types=[".csv", ".xlsx"], interactive=True)
44
-
 
45
  with gr.Row():
46
  run_button = gr.Button("πŸ” Submit and Classify", elem_id="run-btn")
47
  stop_button = gr.Button("❌ Stop Batch", visible=True, elem_id="stop-btn")
@@ -465,6 +488,15 @@ with gr.Blocks() as interface:
465
  )
466
  return
467
  limited_acc = int(max_allowed-usage_count)
 
 
 
 
 
 
 
 
 
468
  # Step 1: Parse input
469
  accessions, error = extract_accessions_from_input(file, text)
470
  log_submission_to_gsheet(email, accessions)
 
18
  with open("mtdna_tool_explainer_updated.html", "r", encoding="utf-8") as f:
19
  flow_chart = f.read()
20
 
21
+ ### NEW: CSS for NPS modal overlay
22
+ custom_css = """
23
+ #nps-overlay {
24
+ position: fixed;
25
+ top: 0; left: 0;
26
+ width: 100%; height: 100%;
27
+ background: rgba(0,0,0,0.6);
28
+ z-index: 9999;
29
+ display: flex;
30
+ flex-direction: column;
31
+ justify-content: center;
32
+ align-items: center;
33
+ }
34
+ #nps-box {
35
+ background: white;
36
+ padding: 20px;
37
+ border-radius: 12px;
38
+ width: 400px;
39
+ max-width: 90%;
40
+ text-align: center;
41
+ }
42
+ """
43
 
44
  with gr.Blocks() as interface:
45
  # with gr.Tab("CURIOUS ABOUT THIS PRODUCT?"):
 
63
  #resume_file = gr.File(label="πŸ—ƒοΈ Previously saved Excel output (optional)", file_types=[".xlsx"], interactive=True)
64
  gr.HTML("""<a href="https://docs.google.com/spreadsheets/d/1lKqPp17EfHsshJGZRWEpcNOZlGo3F5qU/edit?usp=sharing" download target="_blank">Download Example Excel Format</a>""")
65
  file_upload = gr.File(label="πŸ“ Or Upload CSV/Excel File", file_types=[".csv", ".xlsx"], interactive=True)
66
+ processed_info = gr.Markdown(visible=False) # new placeholder for processed list
67
+
68
  with gr.Row():
69
  run_button = gr.Button("πŸ” Submit and Classify", elem_id="run-btn")
70
  stop_button = gr.Button("❌ Stop Batch", visible=True, elem_id="stop-btn")
 
488
  )
489
  return
490
  limited_acc = int(max_allowed-usage_count)
491
+ yield (
492
+ "",
493
+ gr.update(visible=False),
494
+ gr.update(visible=False), # show stop button
495
+ "",
496
+ gr.update(value=f"Processed/Input accessions: {', '.join(accessions)}", visible=True), # processed_info
497
+ "⏳ Processing...",
498
+ )
499
+
500
  # Step 1: Parse input
501
  accessions, error = extract_accessions_from_input(file, text)
502
  log_submission_to_gsheet(email, accessions)