UCS2014 commited on
Commit
ea51ae8
·
verified ·
1 Parent(s): 300e603

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +56 -35
app.py CHANGED
@@ -7,19 +7,21 @@ import streamlit as st
7
  BASE_DIR = Path(__file__).parent # -> Landing_Page/
8
  ASSETS = BASE_DIR / "assets" # -> Landing_Page/assets/
9
 
10
- # ========= CONTROLS =========
11
- HERO_LOGO_SIZE = 170 # px (top company logo size)
12
- TOP_SPACER = 160 # px (extra top padding so logo never looks clipped)
13
- CARD_THUMB_HEIGHT = 85 # px (image height inside each card)
 
 
14
  BUTTON_TEXT = "Click to Run APP"
15
- OPEN_IN_NEW_TAB = False # True = open app in new tab
16
 
17
  # ========= BRAND / APPS =========
18
  COMPANY_NAME = "Smart Thinking"
19
  TAGLINE = "We Deliver Smart AI-Based Solutions For O&G Industry"
20
 
21
  APP1 = {
22
- "title": "ST_Geo_Mech",
23
  "url": "https://smart-thinking-ucs.hf.space/",
24
  "thumb": ASSETS / "app1.png",
25
  "blurb": "Real-Time UCS Prediction",
@@ -36,44 +38,59 @@ LOGO_PATH = ASSETS / "logo.png"
36
  page_icon = str(LOGO_PATH) if LOGO_PATH.exists() else "🧭"
37
  st.set_page_config(page_title=f"{COMPANY_NAME} — Apps", page_icon=page_icon, layout="wide")
38
 
39
- # ========= CSS (one-screen desktop, logo not “trimmed”) =========
40
  st.markdown(
41
  f"""
42
  <style>
 
 
 
 
 
 
43
  html, body, [data-testid="stAppViewContainer"] {{ height: 100%; }}
44
- [data-testid="stAppViewContainer"] > .main {{ min-height: 100vh; }}
 
45
  .block-container {{
46
  max-width: 1120px;
47
- min-height: 100vh;
48
  display: flex; flex-direction: column;
49
- justify-content: center; /* keep in-viewport on desktops */
50
- padding-top: {TOP_SPACER}px !important; /* <-- gives the logo breathing room */
51
- padding-bottom: 10px !important;
52
  }}
53
 
54
  /* HERO */
55
- .hero {{ text-align:center; margin: 4px 0 18px; }}
56
  .hero img {{
57
  width: {HERO_LOGO_SIZE}px; max-width: 95vw; height: auto;
58
- display:block; margin: 8px auto 8px; /* no top clipping */
59
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.12));
60
  }}
61
- .hero h1 {{ font-size: 2.3rem; margin: .6rem 0 .2rem; }}
62
  .hero p {{ color: #5a5f6a; margin: 0 auto; max-width: 720px; }}
63
 
64
- /* Two-card grid on desktop, stack on small screens */
65
- .grid {{ display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }}
66
- @media (max-width: 980px) {{
67
- .grid {{ grid-template-columns: 1fr; }}
68
- .block-container {{ justify-content: flex-start; }}
 
 
 
 
 
 
 
69
  }}
70
 
71
  .card {{
72
- background:#fff; border-radius:16px; padding:16px;
 
73
  border:1px solid rgba(0,0,0,.06);
74
  box-shadow:0 4px 18px rgba(0,0,0,.05);
75
  transition:transform .12s ease, box-shadow .12s ease;
76
- text-align:center;
77
  }}
78
  .card:hover {{ transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }}
79
 
@@ -86,8 +103,8 @@ st.markdown(
86
  background:#fff;
87
  }}
88
 
89
- .card h3 {{ margin:12px 0 6px; }}
90
- .card p {{ color:#5a5f6a; min-height:36px; margin-bottom:10px; }}
91
 
92
  /* Light button with dark text */
93
  .btn {{
@@ -96,6 +113,10 @@ st.markdown(
96
  background:#f3f4f6; color:#111827; font-weight:500;
97
  }}
98
  .btn:hover {{ background:#e5e7eb; }}
 
 
 
 
99
  </style>
100
  """,
101
  unsafe_allow_html=True,
@@ -139,14 +160,14 @@ def app_card(app: dict) -> str:
139
 
140
  st.markdown("<div class='grid'>" + app_card(APP1) + app_card(APP2) + "</div>", unsafe_allow_html=True)
141
 
142
- # =========================
143
- # Footer
144
- # =========================
145
- st.markdown("""
146
- <br><br><br>
147
- <hr>
148
- <div style='text-align:center;color:#6b7280;font-size:1.0em;'>
149
- © 2025 Smart Thinking AI-Solutions Team. All rights reserved.<br>
150
- Website: <a href="https://smartthinking.com.sa" target="_blank" rel="noopener noreferrer">smartthinking.com.sa</a>
151
- </div>
152
- """, unsafe_allow_html=True)
 
7
  BASE_DIR = Path(__file__).parent # -> Landing_Page/
8
  ASSETS = BASE_DIR / "assets" # -> Landing_Page/assets/
9
 
10
+ # ========= CONTROLS (tweak these) =========
11
+ HERO_LOGO_SIZE = 160 # px (top company logo size)
12
+ TOP_SPACER = 24 # px (breathing room above hero; raise if the logo looks "trimmed")
13
+ CARD_WIDTH = 300 # px (fixed width per card on desktop)
14
+ CARD_THUMB_HEIGHT = 120 # px (image area inside each card)
15
+ GRID_GAP = 20 # px (space between the two cards)
16
  BUTTON_TEXT = "Click to Run APP"
17
+ OPEN_IN_NEW_TAB = False # True = open links in a new tab
18
 
19
  # ========= BRAND / APPS =========
20
  COMPANY_NAME = "Smart Thinking"
21
  TAGLINE = "We Deliver Smart AI-Based Solutions For O&G Industry"
22
 
23
  APP1 = {
24
+ "title": "ST_GeoMech_UCS",
25
  "url": "https://smart-thinking-ucs.hf.space/",
26
  "thumb": ASSETS / "app1.png",
27
  "blurb": "Real-Time UCS Prediction",
 
38
  page_icon = str(LOGO_PATH) if LOGO_PATH.exists() else "🧭"
39
  st.set_page_config(page_title=f"{COMPANY_NAME} — Apps", page_icon=page_icon, layout="wide")
40
 
41
+ # ========= CSS (fits one screen on desktop; no blank area under cards) =========
42
  st.markdown(
43
  f"""
44
  <style>
45
+ :root {{
46
+ --top-spacer: {TOP_SPACER}px;
47
+ --card-width: {CARD_WIDTH}px;
48
+ --grid-gap: {GRID_GAP}px;
49
+ }}
50
+
51
  html, body, [data-testid="stAppViewContainer"] {{ height: 100%; }}
52
+ /* Remove Streamlit's default big paddings to reclaim space */
53
+ [data-testid="stAppViewContainer"] > .main {{ padding-top: 0 !important; padding-bottom: 0 !important; }}
54
  .block-container {{
55
  max-width: 1120px;
56
+ min-height: 100vh; /* take the viewport height */
57
  display: flex; flex-direction: column;
58
+ justify-content: center; /* vertically center hero + grid + footer */
59
+ gap: 10px;
60
+ padding: var(--top-spacer) 0 8px !important; /* tiny bottom so footer never adds scroll */
61
  }}
62
 
63
  /* HERO */
64
+ .hero {{ text-align:center; margin: 0 0 8px; }}
65
  .hero img {{
66
  width: {HERO_LOGO_SIZE}px; max-width: 95vw; height: auto;
67
+ display:block; margin: 0 auto 8px;
68
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.12));
69
  }}
70
+ .hero h1 {{ font-size: 2.3rem; margin: .4rem 0 .2rem; }}
71
  .hero p {{ color: #5a5f6a; margin: 0 auto; max-width: 720px; }}
72
 
73
+ /* GRID: use flex so we can control card width precisely */
74
+ .grid {{
75
+ display: flex;
76
+ gap: var(--grid-gap);
77
+ justify-content: center;
78
+ align-items: stretch;
79
+ flex-wrap: nowrap; /* keep 2-up on desktop */
80
+ }}
81
+
82
+ /* If the screen is too small, allow wrapping to avoid horizontal scroll */
83
+ @media (max-width: calc(2 * var(--card-width) + var(--grid-gap) + 64px)) {{
84
+ .grid {{ flex-wrap: wrap; }}
85
  }}
86
 
87
  .card {{
88
+ width: var(--card-width);
89
+ background:#fff; border-radius:16px; padding:14px;
90
  border:1px solid rgba(0,0,0,.06);
91
  box-shadow:0 4px 18px rgba(0,0,0,.05);
92
  transition:transform .12s ease, box-shadow .12s ease;
93
+ text-align:center; display:flex; flex-direction:column; gap:10px;
94
  }}
95
  .card:hover {{ transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }}
96
 
 
103
  background:#fff;
104
  }}
105
 
106
+ .card h3 {{ margin:6px 0 2px; }}
107
+ .card p {{ color:#5a5f6a; min-height:30px; margin:0 8px 2px; }}
108
 
109
  /* Light button with dark text */
110
  .btn {{
 
113
  background:#f3f4f6; color:#111827; font-weight:500;
114
  }}
115
  .btn:hover {{ background:#e5e7eb; }}
116
+
117
+ /* Compact footer; no extra vertical space */
118
+ .footer {{ text-align:center; color:#6b7280; font-size:1.0em; margin-top: 6px; }}
119
+ .footer hr {{ margin: 6px 0; }}
120
  </style>
121
  """,
122
  unsafe_allow_html=True,
 
160
 
161
  st.markdown("<div class='grid'>" + app_card(APP1) + app_card(APP2) + "</div>", unsafe_allow_html=True)
162
 
163
+ # ========= FOOTER (compact; no extra spacing) =========
164
+ st.markdown(
165
+ """
166
+ <hr>
167
+ <div class='footer'>
168
+ © 2025 Smart Thinking AI-Solutions Team. All rights reserved.<br>
169
+ Website: <a href="https://smartthinking.com.sa" target="_blank" rel="noopener noreferrer">smartthinking.com.sa</a>
170
+ </div>
171
+ """,
172
+ unsafe_allow_html=True,
173
+ )