Zhaohan-Meng commited on
Commit
188dada
Β·
verified Β·
1 Parent(s): 3cb50fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +74 -76
app.py CHANGED
@@ -924,105 +924,82 @@ def clear_cb():
924
 
925
  # ───── Gradio interface definition ───────────────────────────────
926
  css = """
 
 
927
  :root{
928
- --bg:#f8fafc; --card:#f8fafc; --text:#0f172a;
929
- --muted:#6b7280; --border:#e5e7eb; --shadow:0 6px 24px rgba(2,6,23,.06);
930
- --radius:14px; --icon-size:20px;
 
 
 
 
 
931
  }
932
 
933
  *{box-sizing:border-box}
934
- html,body{background:#fff!important;color:var(--text)!important}
935
- .gradio-container{max-width:1120px;margin:0 auto}
936
 
937
- /* Title and subtitle */
938
- h1{
939
- font-family:Inter,ui-sans-serif;letter-spacing:.2px;font-weight:700;
940
- font-size:32px;margin:22px 0 12px;text-align:center
941
  }
942
- .subtle{color:var(--muted);font-size:14px;text-align:center;margin:-6px 0 18px}
943
 
944
- /* Card style */
945
- .card{
946
- background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
947
- box-shadow:var(--shadow); padding:22px;
948
  }
949
 
950
- /* Top links */
951
- .link-row{display:flex;justify-content:center;gap:14px;margin:0 auto 18px;flex-wrap:wrap}
952
-
953
- /* Two-column grid: left=input, right=controls */
954
- .grid-2{display:grid;grid-template-columns:1.4fr .9fr;gap:16px}
955
- .grid-2 .col{display:flex;flex-direction:column;gap:12px}
956
-
957
- /* Buttons */
958
- .gr-button{border-radius:12px !important;font-weight:700 !important;letter-spacing:.2px}
959
- #extract-btn{background:linear-gradient(90deg,#EFAFB2,#EFAFB2); color:#0f172a}
960
- #inference-btn{background:linear-gradient(90deg,#B2CBDF,#B2CBDF); color:#0f172a}
961
- #clear-btn{background:#FFE2B5; color:#0A0A0A; border:1px solid var(--border)}
962
 
963
- /* Result spacing */
964
- #result-table{margin-bottom:16px}
 
 
 
 
965
 
966
- /* Figure container */
967
- .figure-wrap{border:1px solid var(--border);border-radius:12px;overflow:hidden;box-shadow:var(--shadow)}
968
- .figure-wrap img{display:block;width:100%;height:auto}
 
 
 
 
 
969
 
970
- /* Right pane: vertical radio layout and full-width controls (kept for button styling) */
971
- .right-pane .gr-button{
972
- width:100% !important;
973
- height:48px !important;
974
  border-radius:12px !important;
975
  font-weight:700 !important;
976
  letter-spacing:.2px;
977
  }
978
- /* ───────── Publication links (Bulma-like) ───────── */
979
-
980
- .publication-links {
981
- display: flex;
982
- justify-content: center;
983
- gap: 14px;
984
- flex-wrap: wrap;
985
- margin: 6px 0 18px;
986
- }
987
-
988
- .link-block a {
989
- display: inline-flex;
990
- align-items: center;
991
- gap: 8px;
992
- padding: 10px 18px;
993
- font-size: 14px;
994
- font-weight: 600;
995
- border-radius: 9999px;
996
- text-decoration: none;
997
- transition: all 0.15s ease-in-out;
998
- }
999
-
1000
- /* colour variants */
1001
- .btn-danger { background:#e2e8f0; color:#0f172a; }
1002
- .btn-dark { background:#e2e8f0; color:#0f172a; }
1003
- .btn-link { background:#e2e8f0; color:#0f172a; }
1004
- .btn-warning { background:#e2e8f0; color:#0f172a; }
1005
 
1006
- .link-block a:hover {
1007
- filter: brightness(0.95);
1008
- transform: translateY(-1px);
1009
  }
1010
 
1011
- .loscalzo-block img {
1012
- height: 100px;
1013
- width: auto;
1014
- object-fit: contain;
1015
  }
1016
 
1017
- .loscalzo-block {
1018
- display: flex;
1019
- align-items: center;
1020
- gap: 10px;
1021
-
1022
- margin: 0 auto;
1023
- justify-content: center;
1024
  }
1025
 
 
1026
  .link-btn{
1027
  display:inline-flex !important;
1028
  align-items:center !important;
@@ -1043,6 +1020,27 @@ h1{
1043
  transform:translateY(-1px);
1044
  }
1045
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1046
  """
1047
  with gr.Blocks() as demo:
1048
 
 
924
 
925
  # ───── Gradio interface definition ───────────────────────────────
926
  css = """
927
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
928
+
929
  :root{
930
+ --bg:#f8fafc;
931
+ --card:#f8fafc;
932
+ --text:#0f172a;
933
+ --muted:#6b7280;
934
+ --border:#e5e7eb;
935
+ --shadow:0 6px 24px rgba(2,6,23,.06);
936
+ --radius:14px;
937
+ --icon-size:20px;
938
  }
939
 
940
  *{box-sizing:border-box}
 
 
941
 
942
+ html, body, .gradio-container {
943
+ background:#fff !important;
944
+ color:var(--text) !important;
945
+ font-family:'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
946
  }
 
947
 
948
+ .gradio-container{
949
+ max-width:1120px;
950
+ margin:0 auto;
 
951
  }
952
 
953
+ /* ───── Title and subtitle ───── */
954
+ h1{
955
+ font-family:'Inter', system-ui, sans-serif !important;
956
+ letter-spacing:.2px;
957
+ font-weight:700 !important;
958
+ font-size:32px !important;
959
+ margin:22px 0 12px;
960
+ text-align:center;
961
+ }
 
 
 
962
 
963
+ .subtle{
964
+ color:var(--muted);
965
+ font-size:14px;
966
+ text-align:center;
967
+ margin:-6px 0 18px;
968
+ }
969
 
970
+ /* ───── Card style ───── */
971
+ .card{
972
+ background:var(--card);
973
+ border:1px solid var(--border);
974
+ border-radius:var(--radius);
975
+ box-shadow:var(--shadow);
976
+ padding:22px;
977
+ }
978
 
979
+ /* ───── Buttons ───── */
980
+ .gr-button{
 
 
981
  border-radius:12px !important;
982
  font-weight:700 !important;
983
  letter-spacing:.2px;
984
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
985
 
986
+ #extract-btn{
987
+ background:linear-gradient(90deg,#EFAFB2,#EFAFB2);
988
+ color:#0f172a;
989
  }
990
 
991
+ #inference-btn{
992
+ background:linear-gradient(90deg,#B2CBDF,#B2CBDF);
993
+ color:#0f172a;
 
994
  }
995
 
996
+ #clear-btn{
997
+ background:#FFE2B5;
998
+ color:#0A0A0A;
999
+ border:1px solid var(--border);
 
 
 
1000
  }
1001
 
1002
+ /* ───── SVG Link Buttons ───── */
1003
  .link-btn{
1004
  display:inline-flex !important;
1005
  align-items:center !important;
 
1020
  transform:translateY(-1px);
1021
  }
1022
 
1023
+ /* ───── Figure container ───── */
1024
+ .figure-wrap{
1025
+ border:1px solid var(--border);
1026
+ border-radius:12px;
1027
+ overflow:hidden;
1028
+ box-shadow:var(--shadow);
1029
+ }
1030
+
1031
+ .figure-wrap img{
1032
+ display:block;
1033
+ width:100%;
1034
+ height:auto;
1035
+ }
1036
+
1037
+ /* ───── Right pane buttons full width ───── */
1038
+ .right-pane .gr-button{
1039
+ width:100% !important;
1040
+ height:48px !important;
1041
+ }
1042
+
1043
+
1044
  """
1045
  with gr.Blocks() as demo:
1046