Update src/streamlit_app.py
Browse files- src/streamlit_app.py +70 -19
src/streamlit_app.py
CHANGED
|
@@ -8,10 +8,6 @@ import time
|
|
| 8 |
import tempfile
|
| 9 |
import os
|
| 10 |
|
| 11 |
-
import os
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
###########################################################################
|
| 16 |
# Configure Streamlit page
|
| 17 |
st.set_page_config(
|
|
@@ -31,13 +27,45 @@ try:
|
|
| 31 |
except ImportError:
|
| 32 |
TENSORFLOW_AVAILABLE = False
|
| 33 |
|
| 34 |
-
# ULTRA-AGGRESSIVE CSS FIX - Complete stability
|
| 35 |
st.markdown("""
|
| 36 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
/* FORCE HEADER TO BE COMPLETELY FIXED AND STABLE */
|
| 38 |
.main-header {
|
| 39 |
font-size: 2.5rem !important;
|
| 40 |
-
color: #
|
| 41 |
text-align: center !important;
|
| 42 |
margin-bottom: 2rem !important;
|
| 43 |
position: fixed !important;
|
|
@@ -45,10 +73,11 @@ st.markdown("""
|
|
| 45 |
left: 0 !important;
|
| 46 |
right: 0 !important;
|
| 47 |
width: 100% !important;
|
| 48 |
-
background:
|
|
|
|
| 49 |
z-index: 99999 !important;
|
| 50 |
padding: 1rem 0 !important;
|
| 51 |
-
border-bottom: 3px solid #
|
| 52 |
box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
|
| 53 |
transform: translateZ(0) !important;
|
| 54 |
will-change: auto !important;
|
|
@@ -58,31 +87,50 @@ st.markdown("""
|
|
| 58 |
.main > .block-container {
|
| 59 |
margin-top: 120px !important;
|
| 60 |
padding-top: 20px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
}
|
| 62 |
|
|
|
|
| 63 |
.section-header {
|
| 64 |
font-size: 1.5rem;
|
| 65 |
-
color: #
|
| 66 |
margin-top: 2rem;
|
| 67 |
margin-bottom: 1rem;
|
|
|
|
| 68 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
.metric-card {
|
| 70 |
-
background
|
|
|
|
| 71 |
padding: 1rem;
|
| 72 |
border-radius: 0.5rem;
|
| 73 |
margin: 0.5rem 0;
|
| 74 |
}
|
| 75 |
.success-box {
|
| 76 |
-
background
|
| 77 |
-
|
|
|
|
| 78 |
padding: 1rem;
|
| 79 |
margin: 1rem 0;
|
|
|
|
| 80 |
}
|
| 81 |
.warning-box {
|
| 82 |
-
background
|
| 83 |
-
|
|
|
|
| 84 |
padding: 1rem;
|
| 85 |
margin: 1rem 0;
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
/* NUCLEAR OPTION: DISABLE ALL ANIMATIONS AND TRANSITIONS EVERYWHERE */
|
|
@@ -521,8 +569,8 @@ class OptimizedBubbleSimulation:
|
|
| 521 |
|
| 522 |
# Main Streamlit App
|
| 523 |
def main():
|
| 524 |
-
# Header - ULTRA-STABLE with fixed positioning
|
| 525 |
-
st.markdown('<h1 class="main-header">π«§ Bubble Dynamics
|
| 526 |
|
| 527 |
# Initialize current page in session state
|
| 528 |
if 'current_page' not in st.session_state:
|
|
@@ -597,9 +645,12 @@ def show_home():
|
|
| 597 |
|
| 598 |
with col1:
|
| 599 |
st.markdown("""
|
| 600 |
-
### Welcome to the Bubble Dynamics
|
|
|
|
|
|
|
|
|
|
| 601 |
|
| 602 |
-
This web application provides comprehensive tools for analyzing bubble dynamics data:
|
| 603 |
|
| 604 |
**Features:**
|
| 605 |
- π **Data Loading**: Upload and analyze .mat files containing bubble dynamics data
|
|
@@ -1453,7 +1504,7 @@ def show_validation():
|
|
| 1453 |
|
| 1454 |
# Show status in fixed container
|
| 1455 |
status_placeholder = st.empty()
|
| 1456 |
-
status_placeholder.info("π Running simulation... Please wait.")
|
| 1457 |
|
| 1458 |
try:
|
| 1459 |
# Use cached values - absolutely no re-computation
|
|
|
|
| 8 |
import tempfile
|
| 9 |
import os
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
###########################################################################
|
| 12 |
# Configure Streamlit page
|
| 13 |
st.set_page_config(
|
|
|
|
| 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 */
|
| 34 |
+
.stApp {
|
| 35 |
+
background-image: url('data:image/jpeg;base64,BACKGROUND_IMAGE_BASE64_HERE');
|
| 36 |
+
background-size: cover;
|
| 37 |
+
background-position: center;
|
| 38 |
+
background-repeat: no-repeat;
|
| 39 |
+
background-attachment: fixed;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/* ALTERNATIVE: If you have the image in assets folder, use this instead:
|
| 43 |
+
.stApp {
|
| 44 |
+
background-image: url('./ut_yang_background.jpg');
|
| 45 |
+
background-size: cover;
|
| 46 |
+
background-position: center;
|
| 47 |
+
background-repeat: no-repeat;
|
| 48 |
+
background-attachment: fixed;
|
| 49 |
+
}
|
| 50 |
+
*/
|
| 51 |
+
|
| 52 |
+
/* OVERLAY FOR BETTER TEXT READABILITY */
|
| 53 |
+
.stApp::before {
|
| 54 |
+
content: '';
|
| 55 |
+
position: fixed;
|
| 56 |
+
top: 0;
|
| 57 |
+
left: 0;
|
| 58 |
+
width: 100%;
|
| 59 |
+
height: 100%;
|
| 60 |
+
background: rgba(255, 255, 255, 0.85);
|
| 61 |
+
z-index: -1;
|
| 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;
|
|
|
|
| 73 |
left: 0 !important;
|
| 74 |
right: 0 !important;
|
| 75 |
width: 100% !important;
|
| 76 |
+
background: rgba(255, 255, 255, 0.95) !important;
|
| 77 |
+
backdrop-filter: blur(10px) !important;
|
| 78 |
z-index: 99999 !important;
|
| 79 |
padding: 1rem 0 !important;
|
| 80 |
+
border-bottom: 3px solid #bf5700 !important;
|
| 81 |
box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
|
| 82 |
transform: translateZ(0) !important;
|
| 83 |
will-change: auto !important;
|
|
|
|
| 87 |
.main > .block-container {
|
| 88 |
margin-top: 120px !important;
|
| 89 |
padding-top: 20px !important;
|
| 90 |
+
background: rgba(255, 255, 255, 0.9) !important;
|
| 91 |
+
border-radius: 10px !important;
|
| 92 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
|
| 93 |
+
backdrop-filter: blur(5px) !important;
|
| 94 |
}
|
| 95 |
|
| 96 |
+
/* UT AUSTIN THEMING */
|
| 97 |
.section-header {
|
| 98 |
font-size: 1.5rem;
|
| 99 |
+
color: #bf5700; /* UT Austin burnt orange */
|
| 100 |
margin-top: 2rem;
|
| 101 |
margin-bottom: 1rem;
|
| 102 |
+
font-weight: bold;
|
| 103 |
}
|
| 104 |
+
|
| 105 |
+
/* SIDEBAR STYLING WITH UT THEME */
|
| 106 |
+
.css-1d391kg {
|
| 107 |
+
background: rgba(255, 255, 255, 0.95) !important;
|
| 108 |
+
backdrop-filter: blur(10px) !important;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
/* ENHANCED CONTAINERS WITH UT THEMING */
|
| 112 |
.metric-card {
|
| 113 |
+
background: linear-gradient(135deg, #bf5700, #d67700) !important;
|
| 114 |
+
color: white !important;
|
| 115 |
padding: 1rem;
|
| 116 |
border-radius: 0.5rem;
|
| 117 |
margin: 0.5rem 0;
|
| 118 |
}
|
| 119 |
.success-box {
|
| 120 |
+
background: linear-gradient(135deg, #28a745, #20c997) !important;
|
| 121 |
+
color: white !important;
|
| 122 |
+
border-left: 5px solid #155724;
|
| 123 |
padding: 1rem;
|
| 124 |
margin: 1rem 0;
|
| 125 |
+
border-radius: 8px;
|
| 126 |
}
|
| 127 |
.warning-box {
|
| 128 |
+
background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
|
| 129 |
+
color: #212529 !important;
|
| 130 |
+
border-left: 5px solid #856404;
|
| 131 |
padding: 1rem;
|
| 132 |
margin: 1rem 0;
|
| 133 |
+
border-radius: 8px;
|
| 134 |
}
|
| 135 |
|
| 136 |
/* NUCLEAR OPTION: DISABLE ALL ANIMATIONS AND TRANSITIONS EVERYWHERE */
|
|
|
|
| 569 |
|
| 570 |
# Main Streamlit App
|
| 571 |
def main():
|
| 572 |
+
# Header - ULTRA-STABLE with fixed positioning and UT Austin branding
|
| 573 |
+
st.markdown('<h1 class="main-header">π«§ YANG Research Group - Bubble Dynamics Analysis</h1>', unsafe_allow_html=True)
|
| 574 |
|
| 575 |
# Initialize current page in session state
|
| 576 |
if 'current_page' not in st.session_state:
|
|
|
|
| 645 |
|
| 646 |
with col1:
|
| 647 |
st.markdown("""
|
| 648 |
+
### Welcome to the YANG Research Group Bubble Dynamics Analysis Platform
|
| 649 |
+
|
| 650 |
+
**The University of Texas at Austin - Aerospace Engineering and Engineering Mechanics**
|
| 651 |
+
**Cockrell School of Engineering**
|
| 652 |
|
| 653 |
+
This advanced web application provides comprehensive tools for analyzing bubble dynamics data:
|
| 654 |
|
| 655 |
**Features:**
|
| 656 |
- π **Data Loading**: Upload and analyze .mat files containing bubble dynamics data
|
|
|
|
| 1504 |
|
| 1505 |
# Show status in fixed container
|
| 1506 |
status_placeholder = st.empty()
|
| 1507 |
+
status_placeholder.info("π Running simulation... Please wait (this will not cause trembling).")
|
| 1508 |
|
| 1509 |
try:
|
| 1510 |
# Use cached values - absolutely no re-computation
|