MSU576 commited on
Commit
fc85c1d
Β·
verified Β·
1 Parent(s): 5338de9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +109 -122
app.py CHANGED
@@ -751,136 +751,123 @@ soil_classes = ["Gravel", "Sand", "Silt", "Clay", "Loam"]
751
 
752
  # -------------------- LANDING PAGE --------------------
753
  def landing_page():
754
- BACKGROUND_IMAGES = [
755
- "/app/bg1.jpg", # replace with your images
756
- "/app/bg2.jpg",
757
- "/app/bg3.jpg"
758
- ]
759
 
760
- # Inject CSS + animations
761
- st.markdown("""
762
- <style>
763
- body {background:#000}
764
- /* Background slider */
765
- @keyframes bgFade {
766
- 0% {opacity:1;}
767
- 30% {opacity:1;}
768
- 33% {opacity:0;}
769
- 97% {opacity:0;}
770
- 100% {opacity:1;}
771
- }
772
- .hero {
773
- position: relative;
774
- border-radius: 16px;
775
- overflow: hidden;
776
- height: 420px;
777
- margin-bottom: 24px;
778
- box-shadow: 0 8px 28px rgba(0,0,0,0.65);
779
- }
780
- .hero img {
781
- position: absolute;
782
- top:0;left:0;
783
- width:100%;height:100%;
784
- object-fit: cover;
785
- animation: bgFade 15s infinite;
786
- }
787
- .hero img:nth-child(2) { animation-delay: 5s; }
788
- .hero img:nth-child(3) { animation-delay: 10s; }
789
-
790
- /* Overlay content */
791
- .overlay {
792
- position: absolute;
793
- top:0;left:0;
794
- width:100%;height:100%;
795
- background: rgba(15,15,15,0.65);
796
- display:flex;
797
- flex-direction:column;
798
- justify-content:center;
799
- padding: 40px;
800
- animation: fadeIn 1.5s ease-in-out;
801
- }
802
- @keyframes fadeIn {
803
- from {opacity:0; transform: translateY(20px);}
804
- to {opacity:1; transform: translateY(0);}
805
- }
806
- h1.hero-title {
807
- color:#FF8C00;
808
- font-size:44px;
809
- margin:0;
810
- font-weight:800;
811
- }
812
- p.hero-sub {
813
- color:#f0f0f0;
814
- font-size:18px;
815
- margin-top:12px;
816
- line-height:1.6;
817
- }
818
- .quick-btn {
819
- display:inline-block;
820
- margin:10px 8px 0 0;
821
- padding:12px 22px;
822
- border-radius:10px;
823
- background: linear-gradient(135deg,#ff7a00,#ff3a3a);
824
- color:white;
825
- font-weight:600;
826
- text-decoration:none;
827
- transition: all .3s ease;
828
- }
829
- .quick-btn:hover {
830
- transform: translateY(-3px);
831
- box-shadow:0 6px 18px rgba(0,0,0,0.4);
832
- }
833
- </style>
834
- """, unsafe_allow_html=True)
835
-
836
- # Hero with slider
837
- st.markdown(f"""
838
- <div class="hero">
839
- <img src="{BACKGROUND_IMAGES[0]}"/>
840
- <img src="{BACKGROUND_IMAGES[1]}"/>
841
- <img src="{BACKGROUND_IMAGES[2]}"/>
842
-
843
- <div class="overlay">
844
- <h1 class="hero-title">GeoMate V2</h1>
845
- <p class="hero-sub">
846
- AI Geotechnical Copilot β€” soil recognition, classification,
847
- locator (EE), RAG-powered Q&A, OCR, and dynamic reports.
848
- </p>
849
- <div style="margin-top:18px">
850
- <a href="#" onclick="window.parent.postMessage({{type: 'streamlit:setSessionState', key:'page', value:'Classifier'}}, '*')" class="quick-btn">πŸ§ͺ Classifier</a>
851
- <a href="#" onclick="window.parent.postMessage({{type: 'streamlit:setSessionState', key:'page', value:'GSD'}}, '*')" class="quick-btn">πŸ“ˆ GSD</a>
852
- <a href="#" onclick="window.parent.postMessage({{type: 'streamlit:setSessionState', key:'page', value:'Locator'}}, '*')" class="quick-btn">🌍 Locator</a>
853
- <a href="#" onclick="window.parent.postMessage({{type: 'streamlit:setSessionState', key:'page', value:'RAG'}}, '*')" class="quick-btn">πŸ€– Ask</a>
854
- <a href="#" onclick="window.parent.postMessage({{type: 'streamlit:setSessionState', key:'page', value:'Reports'}}, '*')" class="quick-btn">πŸ“‘ Reports</a>
855
- </div>
856
- </div>
857
- </div>
858
- """, unsafe_allow_html=True)
859
 
860
- # Live site summary
861
- site = st.session_state["sites"][st.session_state["active_site"]]
862
- st.markdown(f"""
863
- <div style="
864
- background:#1e1e1e;
865
- border-radius:14px;
866
- padding:20px;
867
- margin-top:16px;
868
- text-align:center;
869
- box-shadow:0 4px 14px rgba(0,0,0,0.5);
870
- animation: fadeIn 1.2s ease-in-out;
871
  ">
872
- <h3 style='color:#FF8C00; margin:0 0 10px'>πŸ“ Live Site Summary</h3>
873
- <p style='color:#fff'>πŸ—οΈ <b>Site:</b> {site.get('Site Name')}</p>
874
- <p style='color:#fff'>🧱 <b>USCS:</b> {site.get('USCS') or "β€”"}</p>
875
- <p style='color:#fff'>πŸ›£οΈ <b>AASHTO:</b> {site.get('AASHTO') or "β€”"}</p>
876
- <p style='color:#fff'>πŸ“Š <b>GSD saved:</b> {"βœ… Yes" if site.get("GSD") else "❌ No"}</p>
 
 
 
 
 
 
 
 
 
 
877
  </div>
878
- """, unsafe_allow_html=True)
879
 
880
- # -------------------- MAIN APP -------------------
 
 
 
 
 
 
 
 
881
 
 
882
 
 
883
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
884
  # Soil Classifier page (conversational, step-by-step)
885
  def soil_classifier_page():
886
  st.header("πŸ§ͺ Soil Classifier β€” Conversational (USCS & AASHTO)")
 
751
 
752
  # -------------------- LANDING PAGE --------------------
753
  def landing_page():
 
 
 
 
 
754
 
755
+ # Background hero with placeholder image (replace BACKGROUND_URL with your image path or URL)
756
+
757
+ BACKGROUND_URL = "/app/background_placeholder.jpg" # <- replace this (or provide URL)
758
+
759
+ st.markdown(f"""
760
+
761
+ <div style="
762
+
763
+ background-image: url('{BACKGROUND_URL}');
764
+
765
+ background-size: cover;
766
+
767
+ background-position: center;
768
+
769
+ padding: 48px 28px;
770
+
771
+ border-radius: 12px;
772
+
773
+ margin-bottom: 18px;
774
+
775
+ position: relative;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
776
 
 
 
 
 
 
 
 
 
 
 
 
777
  ">
778
+
779
+ <div style="background: rgba(11,11,11,0.55); padding:22px; border-radius:10px; max-width:900px;">
780
+
781
+ <h1 style='color:#FF8C00; margin:0'>GeoMate V2</h1>
782
+
783
+ <p style='color:#e8eef6; margin:6px 0 0; font-size:16px'>
784
+
785
+ AI geotechnical copilot β€” soil recognition, classification, locator (EE), RAG-powered Q&A, and dynamic reports.
786
+
787
+ </p>
788
+
789
+ <div style='margin-top:8px; color:#cfcfcf; font-size:13px'>
790
+
791
+ Quick: Classifier β€’ GSD β€’ Locator β€’ RAG β€’ Reports
792
+
793
  </div>
 
794
 
795
+ </div>
796
+
797
+ </div>
798
+
799
+ """, unsafe_allow_html=True)
800
+
801
+
802
+
803
+ st.markdown("<div style='display:flex;align-items:center;gap:12px'>"
804
 
805
+ "<div style='width:76px;height:76px;border-radius:14px;background:linear-gradient(135deg,#ff7a00,#ff3a3a);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(0,0,0,0.6)'>"
806
 
807
+ "<span style='font-size:34px'>πŸ›°οΈ</span></div>"
808
 
809
+ "<div><h1 style='margin:0;color:#FF8C00'>GeoMate V2</h1>"
810
+
811
+ "<div class='small-muted'>AI geotechnical copilot β€” soil recognition, classification, locator, RAG, and reports</div></div></div>", unsafe_allow_html=True)
812
+
813
+ st.markdown("---")
814
+
815
+ col1, col2 = st.columns([2,1])
816
+
817
+ with col1:
818
+
819
+ st.markdown("<div class='gm-card'>", unsafe_allow_html=True)
820
+
821
+ st.write("GeoMate is built to help geotechnical engineers: classify soils (USCS/AASHTO), plot GSD, fetch Earth Engine data, chat with a RAG-backed LLM, and generate professional geotechnical reports.")
822
+
823
+ st.markdown("</div>", unsafe_allow_html=True)
824
+
825
+ st.markdown("### Quick Actions")
826
+
827
+ c1, c2, c3 = st.columns(3)
828
+
829
+ if c1.button("πŸ§ͺ Classifier"):
830
+
831
+ st.session_state["page"] = "Classifier"; st.rerun()
832
+
833
+ if c2.button("πŸ“ˆ GSD Curve"):
834
+
835
+ st.session_state["page"] = "GSD"; st.rerun()
836
+
837
+ if c3.button("🌍 Locator"):
838
+
839
+ st.session_state["page"] = "Locator"; st.rerun()
840
+
841
+ c4, c5, c6 = st.columns(3)
842
+
843
+ if c4.button("πŸ€– GeoMate Ask"):
844
+
845
+ st.session_state["page"] = "RAG"; st.rerun()
846
+
847
+ if c5.button("πŸ“· OCR"):
848
+
849
+ st.session_state["page"] = "OCR"; st.rerun()
850
+
851
+ if c6.button("πŸ“‘ Reports"):
852
+
853
+ st.session_state["page"] = "Reports"; st.rerun()
854
+
855
+ with col2:
856
+
857
+ st.markdown("<div class='gm-card' style='text-align:center'>", unsafe_allow_html=True)
858
+
859
+ st.markdown("<h3 style='color:#FF8C00'>Live Site Summary</h3>", unsafe_allow_html=True)
860
+
861
+ site = st.session_state["sites"][st.session_state["active_site"]]
862
+
863
+ st.write(f"Site: **{site.get('Site Name')}**")
864
+
865
+ st.write(f"USCS: {site.get('USCS')}, AASHTO: {site.get('AASHTO')}")
866
+
867
+ st.write(f"GSD saved: {'Yes' if site.get('GSD') else 'No'}")
868
+
869
+ st.markdown("</div>", unsafe_allow_html=True)
870
+
871
  # Soil Classifier page (conversational, step-by-step)
872
  def soil_classifier_page():
873
  st.header("πŸ§ͺ Soil Classifier β€” Conversational (USCS & AASHTO)")