Implement fixed/sticky header and footer with minimal space usage
Browse filesHEADER IMPROVEMENTS:
- Make header fixed/sticky at top with position: fixed
- Compact design: smaller logo (24px vs 32px), reduced padding (0.5rem vs 0.75rem)
- Single-line layout with VayuChat + Environmental Data Analysis + AI Model
- Minimal height (~50px) to maximize content space
- Shows current AI model (DeepSeek-R1) in header for quick reference
- Hidden model selector still functional but not taking visual space
FOOTER IMPROVEMENTS:
- Make footer fixed/sticky at bottom with position: fixed
- Ultra-compact: reduced padding (0.3rem vs 0.5rem), smaller font (0.65rem vs 0.7rem)
- Minimal height (~30px) for maximum content area
SPACE OPTIMIZATION:
- Add proper top/bottom padding (60px top, 40px bottom) to account for fixed elements
- Content now scrolls independently while header/footer stay in place
- Much more space efficient - header + footer only use ~90px total vs ~150px+ before
- Better user experience with always-visible branding and model info
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- app.py +29 -25
- questions.txt +14 -14
|
@@ -530,33 +530,34 @@ default_index = 0
|
|
| 530 |
if "deepseek-R1" in available_models:
|
| 531 |
default_index = available_models.index("deepseek-R1")
|
| 532 |
|
| 533 |
-
# Header with
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
<div style='display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem;'>
|
| 539 |
-
<div style='width: 32px; height: 32px; background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 1rem; box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);'>V</div>
|
| 540 |
<div>
|
| 541 |
-
<
|
| 542 |
-
|
| 543 |
-
<span style='font-size: 0.875rem; font-weight: 400; color: #6b7280; margin-left: 0.5rem;'>• Environmental Data Analysis</span>
|
| 544 |
-
</h1>
|
| 545 |
</div>
|
| 546 |
</div>
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
"Model:",
|
| 553 |
-
available_models,
|
| 554 |
-
index=default_index,
|
| 555 |
-
help="Choose your AI model",
|
| 556 |
-
label_visibility="collapsed"
|
| 557 |
-
)
|
| 558 |
|
| 559 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 560 |
|
| 561 |
|
| 562 |
# Load data with caching for better performance
|
|
@@ -939,10 +940,13 @@ if st.session_state.get("processing"):
|
|
| 939 |
</div>
|
| 940 |
""", unsafe_allow_html=True)
|
| 941 |
|
| 942 |
-
#
|
| 943 |
st.markdown("""
|
| 944 |
-
<div style='position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #e2e8f0; text-align: center; padding: 0.
|
| 945 |
© 2024 IIT Gandhinagar Sustainability Lab
|
| 946 |
</div>
|
| 947 |
""", unsafe_allow_html=True)
|
| 948 |
|
|
|
|
|
|
|
|
|
|
|
|
| 530 |
if "deepseek-R1" in available_models:
|
| 531 |
default_index = available_models.index("deepseek-R1")
|
| 532 |
|
| 533 |
+
# Fixed/Sticky Header with minimal space
|
| 534 |
+
st.markdown("""
|
| 535 |
+
<div style='position: fixed; top: 0; left: 0; right: 0; background: white; border-bottom: 1px solid #e2e8f0; padding: 0.5rem 1rem; z-index: 1000; display: flex; justify-content: space-between; align-items: center;'>
|
| 536 |
+
<div style='display: flex; align-items: center; gap: 0.5rem;'>
|
| 537 |
+
<div style='width: 24px; height: 24px; background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 0.8rem;'>V</div>
|
|
|
|
|
|
|
| 538 |
<div>
|
| 539 |
+
<span style='font-size: 1rem; font-weight: 600; color: #1e293b;'>VayuChat</span>
|
| 540 |
+
<span style='font-size: 0.75rem; font-weight: 400; color: #6b7280; margin-left: 0.5rem;'>Environmental Data Analysis</span>
|
|
|
|
|
|
|
| 541 |
</div>
|
| 542 |
</div>
|
| 543 |
+
<div style='font-size: 0.7rem; color: #6b7280;'>
|
| 544 |
+
AI Model: <span style='color: #1e293b; font-weight: 500;'>""" + list(available_models)[default_index] + """</span>
|
| 545 |
+
</div>
|
| 546 |
+
</div>
|
| 547 |
+
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 548 |
|
| 549 |
+
# Add top padding to account for fixed header
|
| 550 |
+
st.markdown("""<div style='margin-top: 60px;'></div>""", unsafe_allow_html=True)
|
| 551 |
+
|
| 552 |
+
# Hidden model selector (still functional but not visible)
|
| 553 |
+
model_name = st.selectbox(
|
| 554 |
+
"Model:",
|
| 555 |
+
available_models,
|
| 556 |
+
index=default_index,
|
| 557 |
+
help="Choose your AI model",
|
| 558 |
+
label_visibility="collapsed",
|
| 559 |
+
key="hidden_model_selector"
|
| 560 |
+
)
|
| 561 |
|
| 562 |
|
| 563 |
# Load data with caching for better performance
|
|
|
|
| 940 |
</div>
|
| 941 |
""", unsafe_allow_html=True)
|
| 942 |
|
| 943 |
+
# Compact Fixed Footer
|
| 944 |
st.markdown("""
|
| 945 |
+
<div style='position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #e2e8f0; text-align: center; padding: 0.3rem; font-size: 0.65rem; color: #6b7280; z-index: 1000;'>
|
| 946 |
© 2024 IIT Gandhinagar Sustainability Lab
|
| 947 |
</div>
|
| 948 |
""", unsafe_allow_html=True)
|
| 949 |
|
| 950 |
+
# Add bottom padding to account for fixed footer
|
| 951 |
+
st.markdown("""<div style='margin-bottom: 40px;'></div>""", unsafe_allow_html=True)
|
| 952 |
+
|
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
Which month had highest pollution?
|
| 2 |
-
Which city has worst air quality?
|
| 3 |
-
|
| 4 |
-
Plot monthly average PM2.5 for 2023
|
| 5 |
-
|
| 6 |
-
Compare winter vs summer
|
| 7 |
-
Show seasonal pollution
|
| 8 |
-
Which
|
| 9 |
-
|
| 10 |
-
|
| 11 |
Which station in Ahmedabad shows highest PM2.5 variability in winter 2023?
|
| 12 |
Calculate PM2.5 improvement rate from 2022 to 2023 for Mumbai vs Delhi
|
| 13 |
Identify Gujarat cities with PM2.5 >50 μg/m³ for 6+ consecutive months in 2023
|
| 14 |
Compare PM2.5 vs PM10 correlation: winter vs summer across top 5 polluted cities
|
| 15 |
-
Compare
|
| 16 |
-
Plot
|
| 17 |
-
Show
|
| 18 |
-
Create
|
|
|
|
| 1 |
+
Which month in 2023 had the highest average PM2.5 pollution levels?
|
| 2 |
+
Which city has the worst air quality based on average PM2.5 levels?
|
| 3 |
+
Calculate the overall annual average PM2.5 concentration across all cities in 2023
|
| 4 |
+
Plot monthly average PM2.5 trends for 2023 across all cities
|
| 5 |
+
Rank all cities by average PM2.5 levels from highest to lowest pollution
|
| 6 |
+
Compare average PM2.5 levels: winter months (Dec-Feb) vs summer months (Apr-Jun)
|
| 7 |
+
Show seasonal PM2.5 patterns: which season has highest pollution levels?
|
| 8 |
+
Which cities have annual average PM2.5 exceeding WHO guideline of 15 μg/m³?
|
| 9 |
+
Identify the top 10 most polluted cities based on PM2.5 in 2023
|
| 10 |
+
Compare PM10 vs PM2.5 correlation strength across different cities
|
| 11 |
Which station in Ahmedabad shows highest PM2.5 variability in winter 2023?
|
| 12 |
Calculate PM2.5 improvement rate from 2022 to 2023 for Mumbai vs Delhi
|
| 13 |
Identify Gujarat cities with PM2.5 >50 μg/m³ for 6+ consecutive months in 2023
|
| 14 |
Compare PM2.5 vs PM10 correlation: winter vs summer across top 5 polluted cities
|
| 15 |
+
Compare average pollution levels: weekdays (Mon-Fri) vs weekends (Sat-Sun)
|
| 16 |
+
Plot year-over-year PM2.5 trend from 2022 to 2023 for major cities
|
| 17 |
+
Show PM2.5 distribution histogram across all cities and time periods
|
| 18 |
+
Create scatter plot showing PM2.5 vs PM10 correlation with trend line
|