UCS2014 commited on
Commit
8ec6473
·
verified ·
1 Parent(s): 44926e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -23
app.py CHANGED
@@ -1,28 +1,34 @@
1
  import streamlit as st
2
  from pathlib import Path
 
 
 
 
 
3
 
4
- # ------------ CONFIG ------------
5
  COMPANY_NAME = "Smart Thinking"
6
  TAGLINE = "We Deliver Smart AI-Based Solutions For O&G Industry"
 
7
  APP1 = {
8
  "title": "ST_Geo_Mech",
9
  "url": "https://smart-thinking-ucs.hf.space/",
10
- "thumb": "assets/app1.png",
11
  "blurb": "Real-Time UCS Prediction",
12
  }
13
  APP2 = {
14
  "title": "ST_Log_GR",
15
  "url": "https://smart-thinking-gr.hf.space/",
16
- "thumb": "assets/app2.png",
17
  "blurb": "Real-Time GR Log Prediction",
18
  }
19
- LOGO_PATH = Path("assets/logo.png")
20
 
21
- # ------------ PAGE META ------------
22
- page_icon = str(LOGO_PATH) if LOGO_PATH.exists() else "🧭"
23
  st.set_page_config(page_title=f"{COMPANY_NAME} — Apps", page_icon=page_icon, layout="wide")
24
 
25
- # ------------ GLOBAL STYLES ------------
26
  st.markdown(
27
  """
28
  <style>
@@ -48,21 +54,14 @@ st.markdown(
48
  unsafe_allow_html=True,
49
  )
50
 
51
- # ------------ HERO ------------
52
- logo_html = (
53
- f'<img src="{LOGO_PATH.as_posix()}" alt="logo" />' if LOGO_PATH.exists() else ""
54
- )
55
  st.markdown(
56
- '<div class="hero">'
57
- + logo_html
58
- + f"<h1>{COMPANY_NAME}</h1>"
59
- + f"<p>{TAGLINE}</p>"
60
- + "</div>",
61
  unsafe_allow_html=True,
62
  )
63
 
64
- # ------------ HELPERS ------------
65
- from html import escape
66
  def img_or_placeholder(src: str, alt: str):
67
  p = Path(src)
68
  if p.exists():
@@ -79,12 +78,11 @@ def app_card(app_dict: dict) -> str:
79
  </div>
80
  """
81
 
82
- # ------------ GRID (2 CARDS) ------------
83
- card1 = app_card(APP1)
84
- card2 = app_card(APP2)
85
- st.markdown(f"<div class='grid'>{card1}{card2}</div>", unsafe_allow_html=True)
86
 
87
- # ------------ FOOTER ------------
88
  st.markdown(
89
  f"\n\n<div style='text-align:center; color:#8a9099; font-size: 0.9rem;'>© {escape(COMPANY_NAME)}</div>",
90
  unsafe_allow_html=True,
 
1
  import streamlit as st
2
  from pathlib import Path
3
+ from html import escape
4
+
5
+ # ---------- PATHS (subfolder-safe) ----------
6
+ BASE_DIR = Path(__file__).parent # -> Landing_Page/
7
+ ASSETS = BASE_DIR / "assets" # -> Landing_Page/assets/
8
 
9
+ # ---------- CONFIG ----------
10
  COMPANY_NAME = "Smart Thinking"
11
  TAGLINE = "We Deliver Smart AI-Based Solutions For O&G Industry"
12
+
13
  APP1 = {
14
  "title": "ST_Geo_Mech",
15
  "url": "https://smart-thinking-ucs.hf.space/",
16
+ "thumb": (ASSETS / "app1.png").as_posix(),
17
  "blurb": "Real-Time UCS Prediction",
18
  }
19
  APP2 = {
20
  "title": "ST_Log_GR",
21
  "url": "https://smart-thinking-gr.hf.space/",
22
+ "thumb": (ASSETS / "app2.png").as_posix(),
23
  "blurb": "Real-Time GR Log Prediction",
24
  }
25
+ LOGO_PATH = ASSETS / "logo.png"
26
 
27
+ # ---------- PAGE META ----------
28
+ page_icon = LOGO_PATH.as_posix() if LOGO_PATH.exists() else "🧭"
29
  st.set_page_config(page_title=f"{COMPANY_NAME} — Apps", page_icon=page_icon, layout="wide")
30
 
31
+ # ---------- GLOBAL STYLES ----------
32
  st.markdown(
33
  """
34
  <style>
 
54
  unsafe_allow_html=True,
55
  )
56
 
57
+ # ---------- HERO ----------
58
+ logo_html = f'<img src="{LOGO_PATH.as_posix()}" alt="logo" />' if LOGO_PATH.exists() else ""
 
 
59
  st.markdown(
60
+ '<div class="hero">' + logo_html + f"<h1>{COMPANY_NAME}</h1>" + f"<p>{TAGLINE}</p>" + "</div>",
 
 
 
 
61
  unsafe_allow_html=True,
62
  )
63
 
64
+ # ---------- HELPERS ----------
 
65
  def img_or_placeholder(src: str, alt: str):
66
  p = Path(src)
67
  if p.exists():
 
78
  </div>
79
  """
80
 
81
+ # ---------- GRID (2 CARDS) ----------
82
+ html_grid = f"<div class='grid'>{app_card(APP1)}{app_card(APP2)}</div>"
83
+ st.markdown(html_grid, unsafe_allow_html=True)
 
84
 
85
+ # ---------- FOOTER ----------
86
  st.markdown(
87
  f"\n\n<div style='text-align:center; color:#8a9099; font-size: 0.9rem;'>© {escape(COMPANY_NAME)}</div>",
88
  unsafe_allow_html=True,