Update src/streamlit_app.py
Browse files- src/streamlit_app.py +55 -22
src/streamlit_app.py
CHANGED
|
@@ -27,7 +27,7 @@ try:
|
|
| 27 |
except ImportError:
|
| 28 |
TENSORFLOW_AVAILABLE = False
|
| 29 |
|
| 30 |
-
# ULTRA-AGGRESSIVE CSS FIX - Complete stability with UT Austin background
|
| 31 |
st.markdown("""
|
| 32 |
<style>
|
| 33 |
/* BACKGROUND IMAGE STYLING */
|
|
@@ -62,12 +62,8 @@ st.markdown("""
|
|
| 62 |
pointer-events: none;
|
| 63 |
}
|
| 64 |
|
| 65 |
-
/* FORCE HEADER TO BE COMPLETELY FIXED AND STABLE */
|
| 66 |
.main-header {
|
| 67 |
-
font-size: 2.5rem !important;
|
| 68 |
-
color: #bf5700 !important; /* UT Austin burnt orange */
|
| 69 |
-
text-align: center !important;
|
| 70 |
-
margin-bottom: 2rem !important;
|
| 71 |
position: fixed !important;
|
| 72 |
top: 0 !important;
|
| 73 |
left: 0 !important;
|
|
@@ -81,11 +77,37 @@ st.markdown("""
|
|
| 81 |
box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
|
| 82 |
transform: translateZ(0) !important;
|
| 83 |
will-change: auto !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
}
|
| 85 |
|
| 86 |
-
/* ADD TOP MARGIN TO MAIN CONTENT TO AVOID OVERLAP */
|
| 87 |
.main > .block-container {
|
| 88 |
-
margin-top:
|
| 89 |
padding-top: 20px !important;
|
| 90 |
background: rgba(255, 255, 255, 0.9) !important;
|
| 91 |
border-radius: 10px !important;
|
|
@@ -93,6 +115,22 @@ st.markdown("""
|
|
| 93 |
backdrop-filter: blur(5px) !important;
|
| 94 |
}
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
/* UT AUSTIN THEMING */
|
| 97 |
.section-header {
|
| 98 |
font-size: 1.5rem;
|
|
@@ -569,8 +607,15 @@ class OptimizedBubbleSimulation:
|
|
| 569 |
|
| 570 |
# Main Streamlit App
|
| 571 |
def main():
|
| 572 |
-
# Header - ULTRA-STABLE with fixed positioning and UT Austin branding
|
| 573 |
-
st.markdown(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 574 |
|
| 575 |
# Initialize current page in session state
|
| 576 |
if 'current_page' not in st.session_state:
|
|
@@ -1262,18 +1307,6 @@ def show_ml_prediction():
|
|
| 1262 |
|
| 1263 |
col1, col2 = st.columns([2, 1])
|
| 1264 |
|
| 1265 |
-
#with col1:
|
| 1266 |
-
#input_file_path = st.text_input(
|
| 1267 |
-
#"Input file path:",
|
| 1268 |
-
#placeholder="Select input file or use current data",
|
| 1269 |
-
#key="input_file_path",
|
| 1270 |
-
#value=st.session_state.get('input_file_path_var', '')
|
| 1271 |
-
#)
|
| 1272 |
-
|
| 1273 |
-
#with col2:
|
| 1274 |
-
#if st.button("📁 Browse Input"):
|
| 1275 |
-
#st.info("Use the file uploader below to select a .txt file with R-t curve data")
|
| 1276 |
-
|
| 1277 |
# File uploader for input data
|
| 1278 |
uploaded_input = st.file_uploader(
|
| 1279 |
"Upload input data file",
|
|
|
|
| 27 |
except ImportError:
|
| 28 |
TENSORFLOW_AVAILABLE = False
|
| 29 |
|
| 30 |
+
# ULTRA-AGGRESSIVE CSS FIX - Complete stability with UT Austin background and Logo
|
| 31 |
st.markdown("""
|
| 32 |
<style>
|
| 33 |
/* BACKGROUND IMAGE STYLING */
|
|
|
|
| 62 |
pointer-events: none;
|
| 63 |
}
|
| 64 |
|
| 65 |
+
/* FORCE HEADER TO BE COMPLETELY FIXED AND STABLE WITH LOGO */
|
| 66 |
.main-header {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
position: fixed !important;
|
| 68 |
top: 0 !important;
|
| 69 |
left: 0 !important;
|
|
|
|
| 77 |
box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
|
| 78 |
transform: translateZ(0) !important;
|
| 79 |
will-change: auto !important;
|
| 80 |
+
display: flex !important;
|
| 81 |
+
align-items: center !important;
|
| 82 |
+
justify-content: center !important;
|
| 83 |
+
flex-direction: column !important;
|
| 84 |
+
gap: 10px !important;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
/* LOGO STYLING */
|
| 88 |
+
.header-logo {
|
| 89 |
+
max-height: 80px !important;
|
| 90 |
+
max-width: 300px !important;
|
| 91 |
+
height: auto !important;
|
| 92 |
+
width: auto !important;
|
| 93 |
+
object-fit: contain !important;
|
| 94 |
+
border-radius: 8px !important;
|
| 95 |
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/* HEADER TEXT STYLING */
|
| 99 |
+
.header-text {
|
| 100 |
+
font-size: 1.8rem !important;
|
| 101 |
+
color: #bf5700 !important; /* UT Austin burnt orange */
|
| 102 |
+
text-align: center !important;
|
| 103 |
+
margin: 0 !important;
|
| 104 |
+
font-weight: bold !important;
|
| 105 |
+
text-shadow: 1px 1px 2px rgba(0,0,0,0.1) !important;
|
| 106 |
}
|
| 107 |
|
| 108 |
+
/* ADD TOP MARGIN TO MAIN CONTENT TO AVOID OVERLAP - INCREASED FOR LOGO */
|
| 109 |
.main > .block-container {
|
| 110 |
+
margin-top: 150px !important; /* Increased from 120px to accommodate logo */
|
| 111 |
padding-top: 20px !important;
|
| 112 |
background: rgba(255, 255, 255, 0.9) !important;
|
| 113 |
border-radius: 10px !important;
|
|
|
|
| 115 |
backdrop-filter: blur(5px) !important;
|
| 116 |
}
|
| 117 |
|
| 118 |
+
/* RESPONSIVE DESIGN FOR MOBILE */
|
| 119 |
+
@media (max-width: 768px) {
|
| 120 |
+
.header-logo {
|
| 121 |
+
max-height: 60px !important;
|
| 122 |
+
max-width: 250px !important;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
.header-text {
|
| 126 |
+
font-size: 1.4rem !important;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
.main > .block-container {
|
| 130 |
+
margin-top: 130px !important;
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
/* UT AUSTIN THEMING */
|
| 135 |
.section-header {
|
| 136 |
font-size: 1.5rem;
|
|
|
|
| 607 |
|
| 608 |
# Main Streamlit App
|
| 609 |
def main():
|
| 610 |
+
# Header - ULTRA-STABLE with fixed positioning and UT Austin branding + Logo
|
| 611 |
+
st.markdown("""
|
| 612 |
+
<div class="main-header">
|
| 613 |
+
<img src="https://huggingface.co/spaces/lehuaaa/Bubble/resolve/main/src/group_logo.JPG"
|
| 614 |
+
alt="YANG Research Group Logo"
|
| 615 |
+
class="header-logo">
|
| 616 |
+
<h1 class="header-text">Bubble Dynamics Analysis</h1>
|
| 617 |
+
</div>
|
| 618 |
+
""", unsafe_allow_html=True)
|
| 619 |
|
| 620 |
# Initialize current page in session state
|
| 621 |
if 'current_page' not in st.session_state:
|
|
|
|
| 1307 |
|
| 1308 |
col1, col2 = st.columns([2, 1])
|
| 1309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1310 |
# File uploader for input data
|
| 1311 |
uploaded_input = st.file_uploader(
|
| 1312 |
"Upload input data file",
|