Update app.py
Browse files
app.py
CHANGED
|
@@ -44,190 +44,53 @@ for k, v in [("seq_val", ""), ("smi_val", ""), ("bseq_val", ""),
|
|
| 44 |
|
| 45 |
is_dark = st.session_state.theme == "dark"
|
| 46 |
|
| 47 |
-
# CSS and Theming
|
| 48 |
if is_dark:
|
| 49 |
-
theme_css = ""
|
| 50 |
-
:root {
|
| 51 |
-
--bg: #0f172a;
|
| 52 |
-
--surface: #1e293b;
|
| 53 |
-
--border: #334155;
|
| 54 |
-
--border-light: #475569;
|
| 55 |
-
--text: #f8fafc;
|
| 56 |
-
--muted: #94a3b8;
|
| 57 |
-
--accent: #3b82f6;
|
| 58 |
-
--accent-dim: rgba(59, 130, 246, 0.15);
|
| 59 |
-
--success: #10b981;
|
| 60 |
-
--success-dim: rgba(16, 185, 129, 0.15);
|
| 61 |
-
--danger: #ef4444;
|
| 62 |
-
--danger-dim: rgba(239, 68, 68, 0.15);
|
| 63 |
-
--font-sans: 'Inter', sans-serif;
|
| 64 |
-
--font-mono: 'JetBrains Mono', monospace;
|
| 65 |
-
}
|
| 66 |
-
"""
|
| 67 |
else:
|
| 68 |
-
theme_css = ""
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
--surface: #ffffff;
|
| 72 |
-
--border: #e2e8f0;
|
| 73 |
-
--border-light: #cbd5e1;
|
| 74 |
-
--text: #0f172a;
|
| 75 |
-
--muted: #64748b;
|
| 76 |
-
--accent: #2563eb;
|
| 77 |
-
--accent-dim: rgba(37, 99, 235, 0.10);
|
| 78 |
-
--success: #059669;
|
| 79 |
-
--success-dim: rgba(5, 150, 105, 0.10);
|
| 80 |
-
--danger: #dc2626;
|
| 81 |
-
--danger-dim: rgba(220, 38, 38, 0.10);
|
| 82 |
-
--font-sans: 'Inter', sans-serif;
|
| 83 |
-
--font-mono: 'JetBrains Mono', monospace;
|
| 84 |
-
}
|
| 85 |
-
"""
|
| 86 |
-
|
| 87 |
-
# Standard string concatenation to avoid f-string curly brace conflicts
|
| 88 |
-
base_css = """
|
| 89 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 90 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 91 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
| 92 |
<style>
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
[data-testid="
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
.
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
}
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
.
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
}
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
.
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
}
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
border-radius: 0 !important;
|
| 127 |
-
}
|
| 128 |
-
.stTabs [aria-selected="true"] {
|
| 129 |
-
color: var(--accent) !important;
|
| 130 |
-
border-bottom-color: var(--accent) !important;
|
| 131 |
-
background: transparent !important;
|
| 132 |
-
}
|
| 133 |
-
.stTabs [data-baseweb="tab-highlight"] { background: var(--accent) !important; height: 2px !important; }
|
| 134 |
-
.stTabs [data-baseweb="tab-border"] { display: none !important; }
|
| 135 |
-
.stTabs [data-baseweb="tab-panel"] { padding: 24px 0 0 !important; background: transparent !important; }
|
| 136 |
-
|
| 137 |
-
/* Textarea & Input */
|
| 138 |
-
.stTextArea textarea, .stTextInput input {
|
| 139 |
-
background: var(--surface) !important;
|
| 140 |
-
border: 1px solid var(--border) !important;
|
| 141 |
-
border-radius: 6px !important;
|
| 142 |
-
color: var(--text) !important;
|
| 143 |
-
font-family: var(--font-mono) !important;
|
| 144 |
-
font-size: 13px !important;
|
| 145 |
-
line-height: 1.6 !important;
|
| 146 |
-
}
|
| 147 |
-
.stTextArea textarea:focus, .stTextInput input:focus {
|
| 148 |
-
border-color: var(--accent) !important;
|
| 149 |
-
box-shadow: 0 0 0 2px var(--accent-dim) !important;
|
| 150 |
-
}
|
| 151 |
-
.stTextArea label, .stTextInput label {
|
| 152 |
-
color: var(--muted) !important;
|
| 153 |
-
font-family: var(--font-sans) !important;
|
| 154 |
-
font-size: 12px !important; font-weight: 500 !important;
|
| 155 |
-
}
|
| 156 |
-
|
| 157 |
-
/* File uploader */
|
| 158 |
-
[data-testid="stFileUploader"] {
|
| 159 |
-
background: var(--surface) !important;
|
| 160 |
-
border: 2px dashed var(--border) !important;
|
| 161 |
-
border-radius: 8px !important;
|
| 162 |
-
}
|
| 163 |
-
[data-testid="stFileUploader"] label,
|
| 164 |
-
[data-testid="stFileUploader"] span { color: var(--muted) !important; font-family: var(--font-sans) !important; }
|
| 165 |
-
[data-testid="stFileUploaderDropzone"] { background: transparent !important; }
|
| 166 |
-
|
| 167 |
-
/* Buttons */
|
| 168 |
-
.stButton button[kind="primary"] {
|
| 169 |
-
background: var(--accent) !important;
|
| 170 |
-
color: #ffffff !important;
|
| 171 |
-
border: none !important;
|
| 172 |
-
border-radius: 6px !important;
|
| 173 |
-
font-family: var(--font-sans) !important;
|
| 174 |
-
font-size: 14px !important; font-weight: 600 !important;
|
| 175 |
-
padding: 10px 24px !important;
|
| 176 |
-
width: 100% !important;
|
| 177 |
-
transition: opacity .15s !important;
|
| 178 |
-
}
|
| 179 |
-
.stButton button[kind="primary"]:hover { opacity: 0.90 !important; }
|
| 180 |
-
|
| 181 |
-
/* Standard Buttons (like Theme Toggle) */
|
| 182 |
-
.stButton button[kind="secondary"] {
|
| 183 |
-
background: var(--surface) !important;
|
| 184 |
-
color: var(--text) !important;
|
| 185 |
-
border: 1px solid var(--border) !important;
|
| 186 |
-
border-radius: 6px !important;
|
| 187 |
-
font-family: var(--font-sans) !important;
|
| 188 |
-
font-size: 13px !important; font-weight: 500 !important;
|
| 189 |
-
}
|
| 190 |
-
.stButton button[kind="secondary"]:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
|
| 191 |
-
|
| 192 |
-
/* Pill buttons */
|
| 193 |
-
.pill-btn button {
|
| 194 |
-
background: var(--surface) !important;
|
| 195 |
-
color: var(--muted) !important;
|
| 196 |
-
border: 1px solid var(--border) !important;
|
| 197 |
-
border-radius: 4px !important;
|
| 198 |
-
font-family: var(--font-mono) !important;
|
| 199 |
-
font-size: 11.5px !important;
|
| 200 |
-
padding: 3px 10px !important;
|
| 201 |
-
width: auto !important;
|
| 202 |
-
}
|
| 203 |
-
.pill-btn button:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
|
| 204 |
-
|
| 205 |
-
/* Dataframe */
|
| 206 |
-
[data-testid="stDataFrame"] iframe { background: var(--surface) !important; }
|
| 207 |
-
.stDataFrame { border: 1px solid var(--border) !important; border-radius: 8px !important; }
|
| 208 |
-
|
| 209 |
-
/* Progress bar */
|
| 210 |
-
.stProgress > div > div > div > div { background-color: var(--accent) !important; }
|
| 211 |
-
[data-testid="stProgressBarMessage"] { color: var(--muted) !important; font-family: var(--font-mono) !important; font-size: 11px !important; }
|
| 212 |
-
|
| 213 |
-
/* Spinner */
|
| 214 |
-
.stSpinner > div { border-top-color: var(--accent) !important; }
|
| 215 |
-
[data-testid="stSpinnerMessage"] { color: var(--muted) !important; font-family: var(--font-mono) !important; font-size: 12px !important; }
|
| 216 |
-
|
| 217 |
-
/* Alert/error */
|
| 218 |
-
[data-testid="stAlert"] {
|
| 219 |
-
background: var(--danger-dim) !important;
|
| 220 |
-
border: 1px solid var(--danger) !important;
|
| 221 |
-
border-radius: 6px !important;
|
| 222 |
-
color: var(--danger) !important;
|
| 223 |
-
font-family: var(--font-mono) !important;
|
| 224 |
-
}
|
| 225 |
-
|
| 226 |
-
hr { border: none !important; border-top: 1px solid var(--border) !important; margin: 20px 0 !important; }
|
| 227 |
</style>
|
| 228 |
"""
|
| 229 |
|
| 230 |
-
# Inject the clean CSS directly into the app
|
| 231 |
st.markdown(base_css, unsafe_allow_html=True)
|
| 232 |
|
| 233 |
# Constants / paths
|
|
|
|
| 44 |
|
| 45 |
is_dark = st.session_state.theme == "dark"
|
| 46 |
|
| 47 |
+
# CSS and Theming - Minified to prevent Streamlit Markdown parser from breaking the style tags
|
| 48 |
if is_dark:
|
| 49 |
+
theme_css = ":root { --bg: #0f172a; --surface: #1e293b; --border: #334155; --border-light: #475569; --text: #f8fafc; --muted: #94a3b8; --accent: #3b82f6; --accent-dim: rgba(59, 130, 246, 0.15); --success: #10b981; --success-dim: rgba(16, 185, 129, 0.15); --danger: #ef4444; --danger-dim: rgba(239, 68, 68, 0.15); --font-sans: 'Inter', sans-serif; --font-mono: 'JetBrains Mono', monospace; }"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
else:
|
| 51 |
+
theme_css = ":root { --bg: #f8fafc; --surface: #ffffff; --border: #e2e8f0; --border-light: #cbd5e1; --text: #0f172a; --muted: #64748b; --accent: #2563eb; --accent-dim: rgba(37, 99, 235, 0.10); --success: #059669; --success-dim: rgba(5, 150, 105, 0.10); --danger: #dc2626; --danger-dim: rgba(220, 38, 38, 0.10); --font-sans: 'Inter', sans-serif; --font-mono: 'JetBrains Mono', monospace; }"
|
| 52 |
+
|
| 53 |
+
base_css = f"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 55 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 56 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
| 57 |
<style>
|
| 58 |
+
#MainMenu, footer, header {{ visibility: hidden; }}
|
| 59 |
+
.stDeployButton, [data-testid="stToolbar"] {{ display: none; }}
|
| 60 |
+
[data-testid="collapsedControl"] {{ display: none !important; }}
|
| 61 |
+
section[data-testid="stSidebar"] {{ display: none !important; }}
|
| 62 |
+
{theme_css}
|
| 63 |
+
.stApp {{ background: var(--bg) !important; font-family: var(--font-sans) !important; color: var(--text) !important; }}
|
| 64 |
+
.main .block-container {{ max-width: 1160px !important; margin: 0 auto !important; padding: 0 32px 80px !important; }}
|
| 65 |
+
.stTabs [data-baseweb="tab-list"] {{ background: transparent !important; border-bottom: 1px solid var(--border) !important; gap: 0 !important; padding: 0 !important; }}
|
| 66 |
+
.stTabs [data-baseweb="tab"] {{ background: transparent !important; color: var(--muted) !important; font-family: var(--font-sans) !important; font-size: 13px !important; font-weight: 500 !important; padding: 10px 18px !important; border: none !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; }}
|
| 67 |
+
.stTabs [aria-selected="true"] {{ color: var(--accent) !important; border-bottom-color: var(--accent) !important; background: transparent !important; }}
|
| 68 |
+
.stTabs [data-baseweb="tab-highlight"] {{ background: var(--accent) !important; height: 2px !important; }}
|
| 69 |
+
.stTabs [data-baseweb="tab-border"] {{ display: none !important; }}
|
| 70 |
+
.stTabs [data-baseweb="tab-panel"] {{ padding: 24px 0 0 !important; background: transparent !important; }}
|
| 71 |
+
.stTextArea textarea, .stTextInput input {{ background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 6px !important; color: var(--text) !important; font-family: var(--font-mono) !important; font-size: 13px !important; line-height: 1.6 !important; }}
|
| 72 |
+
.stTextArea textarea:focus, .stTextInput input:focus {{ border-color: var(--accent) !important; box-shadow: 0 0 0 2px var(--accent-dim) !important; }}
|
| 73 |
+
.stTextArea label, .stTextInput label {{ color: var(--muted) !important; font-family: var(--font-sans) !important; font-size: 12px !important; font-weight: 500 !important; }}
|
| 74 |
+
[data-testid="stFileUploader"] {{ background: var(--surface) !important; border: 2px dashed var(--border) !important; border-radius: 8px !important; }}
|
| 75 |
+
[data-testid="stFileUploader"] label, [data-testid="stFileUploader"] span {{ color: var(--muted) !important; font-family: var(--font-sans) !important; }}
|
| 76 |
+
[data-testid="stFileUploaderDropzone"] {{ background: transparent !important; }}
|
| 77 |
+
.stButton button[kind="primary"] {{ background: var(--accent) !important; color: #ffffff !important; border: none !important; border-radius: 6px !important; font-family: var(--font-sans) !important; font-size: 14px !important; font-weight: 600 !important; padding: 10px 24px !important; width: 100% !important; transition: opacity .15s !important; }}
|
| 78 |
+
.stButton button[kind="primary"]:hover {{ opacity: 0.90 !important; }}
|
| 79 |
+
.stButton button[kind="secondary"] {{ background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-radius: 6px !important; font-family: var(--font-sans) !important; font-size: 13px !important; font-weight: 500 !important; }}
|
| 80 |
+
.stButton button[kind="secondary"]:hover {{ border-color: var(--accent) !important; color: var(--accent) !important; }}
|
| 81 |
+
.pill-btn button {{ background: var(--surface) !important; color: var(--muted) !important; border: 1px solid var(--border) !important; border-radius: 4px !important; font-family: var(--font-mono) !important; font-size: 11.5px !important; padding: 3px 10px !important; width: auto !important; }}
|
| 82 |
+
.pill-btn button:hover {{ border-color: var(--accent) !important; color: var(--accent) !important; }}
|
| 83 |
+
[data-testid="stDataFrame"] iframe {{ background: var(--surface) !important; }}
|
| 84 |
+
.stDataFrame {{ border: 1px solid var(--border) !important; border-radius: 8px !important; }}
|
| 85 |
+
.stProgress > div > div > div > div {{ background-color: var(--accent) !important; }}
|
| 86 |
+
[data-testid="stProgressBarMessage"] {{ color: var(--muted) !important; font-family: var(--font-mono) !important; font-size: 11px !important; }}
|
| 87 |
+
.stSpinner > div {{ border-top-color: var(--accent) !important; }}
|
| 88 |
+
[data-testid="stSpinnerMessage"] {{ color: var(--muted) !important; font-family: var(--font-mono) !important; font-size: 12px !important; }}
|
| 89 |
+
[data-testid="stAlert"] {{ background: var(--danger-dim) !important; border: 1px solid var(--danger) !important; border-radius: 6px !important; color: var(--danger) !important; font-family: var(--font-mono) !important; }}
|
| 90 |
+
hr {{ border: none !important; border-top: 1px solid var(--border) !important; margin: 20px 0 !important; }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
</style>
|
| 92 |
"""
|
| 93 |
|
|
|
|
| 94 |
st.markdown(base_css, unsafe_allow_html=True)
|
| 95 |
|
| 96 |
# Constants / paths
|