UCS2014 commited on
Commit
d5b988e
·
verified ·
1 Parent(s): 3edff9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +54 -64
app.py CHANGED
@@ -12,19 +12,21 @@ ASSETS = BASE_DIR / "assets"
12
  st.set_page_config(page_title="ST_LOG SUITE — Apps", page_icon="🧭", layout="wide")
13
 
14
  # ========= SUITE / BRAND =========
15
- SUITE_NAME = "ST_LOG SUITE"
16
  SUITE_TAGLINE = "Generating AI-Based Well Logging Profiles While Drilling"
17
 
18
  # Buttons: deep navy for strong contrast
19
  BTN_DARK_1 = "#0B1220"
20
  BTN_DARK_2 = "#1F2937"
21
 
22
- # Suite strip theme — "slate" (navy) or "gold"
23
- STRIP_THEME = "slate" # change to "gold" to try brand yellow
24
- SHOW_CARD_CHIP = False # repeat small chip inside each card? (False = cleaner)
 
25
 
26
- # Per-card backgrounds (super subtle tints)
27
- USE_TINTED_CARD_BG = False # set True to try soft tint per app
 
28
 
29
  # ========= ASSETS =========
30
  HERO_LOGO = ASSETS / "AI_Suite_Log_logo.png"
@@ -73,22 +75,16 @@ def img_tag(path: Path, alt: str, cls: str = "", style: str = "") -> str:
73
  style_attr = f' style="{style}"' if style else ""
74
  return f'<img{cls_attr}{style_attr} src="{uri}" alt="{escape(alt)}" />'
75
 
76
- # ========= STRIP THEME COLORS =========
77
- if STRIP_THEME.lower() == "gold":
78
- STRIP_1, STRIP_2, STRIP_TEXT = "#EAB308", "#F59E0B", "#0B1220" # gold, dark text
79
- else: # "slate"
80
- STRIP_1, STRIP_2, STRIP_TEXT = "#0B1220", "#1F2937", "#FFFFFF" # navy, white text
81
-
82
  # ========= STYLES =========
83
  st.markdown(f"""
84
  <style>
85
  :root {{
86
  --btn1: {BTN_DARK_1};
87
  --btn2: {BTN_DARK_2};
88
- --strip1: {STRIP_1};
89
- --strip2: {STRIP_2};
90
- --stripText: {STRIP_TEXT};
91
- --cardStroke: #0B1220; /* DARK OUTLINE */
92
  --cardStrokeHover: #1E293B;
93
  }}
94
 
@@ -101,8 +97,8 @@ st.markdown(f"""
101
  max-width: 1120px;
102
  min-height: 100vh;
103
  display: flex; flex-direction: column;
104
- gap: 16px;
105
- padding: 68px 0 28px !important;
106
  background:
107
  radial-gradient(980px 460px at 50% -140px,
108
  rgba(2,12,30,0.06) 0%,
@@ -111,28 +107,29 @@ st.markdown(f"""
111
  rgba(255,255,255,1) 100%);
112
  }}
113
 
114
- /* HERO (logo only) */
115
- .hero {{ text-align:center; margin: 0; }}
116
- .hero img {{
117
- width: 400px; max-width: 92vw; height: auto;
118
- display:block; margin: 0 auto 6px;
119
- filter: drop-shadow(0 6px 16px rgba(0,0,0,.10));
120
- }}
121
-
122
- /* SUITE STRIP ABOVE CARDS */
123
- .suite-banner {{
124
- display:flex; gap:14px; justify-content:center; align-items:center;
125
- margin: 8px 0 16px; flex-wrap: wrap;
126
  }}
127
  .suite-pill {{
128
- background: linear-gradient(90deg, var(--strip1) 0%, var(--strip2) 100%);
129
- color: var(--stripText); padding:8px 14px; border-radius:999px;
130
  font-weight:800; letter-spacing:.25px;
131
  box-shadow: 0 6px 14px rgba(2,12,30,.18);
132
  white-space: nowrap;
133
  }}
134
  .suite-tagline {{
135
- color:#344054; font-weight:600; opacity:.95;
 
 
 
 
 
 
 
 
136
  }}
137
 
138
  /* GRID (3 → 2 → 1) */
@@ -142,7 +139,7 @@ st.markdown(f"""
142
  gap: 40px;
143
  justify-content: center;
144
  align-items: stretch;
145
- margin-top: 6px;
146
  }}
147
  @media (max-width: 1120px) {{
148
  .grid {{ grid-template-columns: repeat(2, 340px); gap: 28px; }}
@@ -151,13 +148,13 @@ st.markdown(f"""
151
  .grid {{ grid-template-columns: 1fr; }}
152
  }}
153
 
154
- /* CARD — DARK OUTLINE + premium elevation */
155
  .card {{
156
  position: relative;
157
  width: 340px;
158
  border-radius:22px;
159
  padding: 24px 20px 20px;
160
- background: var(--card-bg, #FFFFFF);
161
  border: 2px solid var(--card-stroke, var(--cardStroke));
162
  box-shadow:
163
  0 10px 32px rgba(2,20,35,.10),
@@ -173,11 +170,11 @@ st.markdown(f"""
173
  filter: saturate(1.02);
174
  }}
175
 
176
- /* Optional: chip inside card (off by default) */
177
  .suite-chip {{
178
  position: absolute; top: 12px; right: 12px;
179
- background: linear-gradient(90deg, var(--strip1) 0%, var(--strip2) 100%);
180
- color: var(--stripText); padding:6px 10px; border-radius:999px;
181
  font-weight:700; font-size:.82rem; letter-spacing:.2px;
182
  box-shadow: 0 6px 14px rgba(2,12,30,.18);
183
  }}
@@ -202,15 +199,22 @@ st.markdown(f"""
202
  color:#566275; min-height: 40px; margin: 0 10px; font-size: 1.0rem;
203
  }}
204
 
205
- /* BRIGHT, HIGH-CONTRAST BUTTON (navy) */
206
  .btn {{
207
  display:inline-block; padding:12px 20px; border-radius:14px;
208
- border: 1px solid rgba(11,18,32,.45); text-decoration:none;
209
  background: linear-gradient(180deg, var(--btn1) 0%, var(--btn2) 100%);
210
- color: #ffffff; font-weight: 800; letter-spacing:.3px;
211
  margin: 6px auto 0;
212
  box-shadow: 0 12px 28px rgba(11,18,32,.28), inset 0 1px 0 rgba(255,255,255,.10);
213
  }}
 
 
 
 
 
 
 
214
  .btn:hover {{
215
  filter: brightness(1.03) saturate(1.04);
216
  transform: translateY(-1px);
@@ -223,31 +227,13 @@ st.markdown(f"""
223
 
224
  .footer {{ text-align:center; color:#3f4a5a; font-size:0.96em; margin-top: 26px; }}
225
  .footer hr {{ margin: 12px 0; border-color: rgba(0,0,0,.08); }}
226
- <style>
227
- /* Force white text + no underline on the CTA link in ALL states */
228
- a.btn,
229
- a.btn:link,
230
- a.btn:visited {
231
- color: #ffffff !important;
232
- text-decoration: none !important;
233
- }
234
- a.btn:hover,
235
- a.btn:active,
236
- a.btn:focus {
237
- color: #ffffff !important;
238
- text-decoration: none !important;
239
- }
240
  </style>
241
  """, unsafe_allow_html=True)
242
 
243
- # ========= HERO (logo only) =========
244
- hero_html = img_tag(HERO_LOGO, "ST_LOG SUITE")
245
- st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
246
-
247
- # ========= SUITE STRIP =========
248
  st.markdown(
249
  f"""
250
- <div class="suite-banner">
251
  <span class="suite-pill">{escape(SUITE_NAME)}</span>
252
  <span class="suite-tagline">{escape(SUITE_TAGLINE)}</span>
253
  </div>
@@ -255,14 +241,18 @@ st.markdown(
255
  unsafe_allow_html=True,
256
  )
257
 
 
 
 
 
258
  # ========= CARDS =========
259
  def app_card(app: dict) -> str:
260
  # choose background: white vs subtle tint
261
- tint = app.get("tint") if {USE_TINTED_CARD_BG} else "linear-gradient(#FFFFFF, #FBFCFE)"
262
  icon_html = img_tag(app.get("icon"), "icon",
263
  style="width:106px;height:106px;border-radius:9999px;") if app.get("icon") and app["icon"].exists() else ""
264
  target = "_self"
265
- chip = f"<div class='suite-chip'>{escape(SUITE_NAME)}</div>" if {SHOW_CARD_CHIP} else ""
266
  style_vars = f"--card-bg:{tint}; --card-stroke: var(--cardStroke);"
267
  return (
268
  f"<div class='card' style='{style_vars}'>"
 
12
  st.set_page_config(page_title="ST_LOG SUITE — Apps", page_icon="🧭", layout="wide")
13
 
14
  # ========= SUITE / BRAND =========
15
+ SUITE_NAME = "ST_LOG SUITE"
16
  SUITE_TAGLINE = "Generating AI-Based Well Logging Profiles While Drilling"
17
 
18
  # Buttons: deep navy for strong contrast
19
  BTN_DARK_1 = "#0B1220"
20
  BTN_DARK_2 = "#1F2937"
21
 
22
+ # Suite strip base (navy bg). Text will be gold.
23
+ STRIP_BG_1 = "#0B1220"
24
+ STRIP_BG_2 = "#1F2937"
25
+ GOLD_TEXT = "#EAB308" # gold text inside the strip
26
 
27
+ # Per-card options
28
+ SHOW_CARD_CHIP = False # small chip inside each card? (False = cleaner)
29
+ USE_TINTED_CARD_BG = False # try soft tints per app background
30
 
31
  # ========= ASSETS =========
32
  HERO_LOGO = ASSETS / "AI_Suite_Log_logo.png"
 
75
  style_attr = f' style="{style}"' if style else ""
76
  return f'<img{cls_attr}{style_attr} src="{uri}" alt="{escape(alt)}" />'
77
 
 
 
 
 
 
 
78
  # ========= STYLES =========
79
  st.markdown(f"""
80
  <style>
81
  :root {{
82
  --btn1: {BTN_DARK_1};
83
  --btn2: {BTN_DARK_2};
84
+ --stripBg1: {STRIP_BG_1};
85
+ --stripBg2: {STRIP_BG_2};
86
+ --stripGold: {GOLD_TEXT};
87
+ --cardStroke: #0B1220; /* dark outline */
88
  --cardStrokeHover: #1E293B;
89
  }}
90
 
 
97
  max-width: 1120px;
98
  min-height: 100vh;
99
  display: flex; flex-direction: column;
100
+ gap: 14px;
101
+ padding: 28px 0 28px !important; /* smaller top padding since strip sits at top-left */
102
  background:
103
  radial-gradient(980px 460px at 50% -140px,
104
  rgba(2,12,30,0.06) 0%,
 
107
  rgba(255,255,255,1) 100%);
108
  }}
109
 
110
+ /* ===== TOP-LEFT STRIP ROW ===== */
111
+ .suite-row {{
112
+ display:flex; align-items:center; gap:12px;
113
+ justify-content:flex-start;
114
+ margin: 0 0 8px 0; flex-wrap: wrap;
 
 
 
 
 
 
 
115
  }}
116
  .suite-pill {{
117
+ background: linear-gradient(90deg, var(--stripBg1) 0%, var(--stripBg2) 100%);
118
+ color: var(--stripGold); padding:8px 14px; border-radius:999px;
119
  font-weight:800; letter-spacing:.25px;
120
  box-shadow: 0 6px 14px rgba(2,12,30,.18);
121
  white-space: nowrap;
122
  }}
123
  .suite-tagline {{
124
+ color:#344054; font-weight:600; opacity:.95; white-space: nowrap;
125
+ }}
126
+
127
+ /* HERO LOGO (below the strip) */
128
+ .hero {{ text-align:center; margin: 0 0 6px; }}
129
+ .hero img {{
130
+ width: 520px; max-width: 92vw; height: auto;
131
+ display:block; margin: 0 auto 6px;
132
+ filter: drop-shadow(0 6px 16px rgba(0,0,0,.10));
133
  }}
134
 
135
  /* GRID (3 → 2 → 1) */
 
139
  gap: 40px;
140
  justify-content: center;
141
  align-items: stretch;
142
+ margin-top: 10px;
143
  }}
144
  @media (max-width: 1120px) {{
145
  .grid {{ grid-template-columns: repeat(2, 340px); gap: 28px; }}
 
148
  .grid {{ grid-template-columns: 1fr; }}
149
  }}
150
 
151
+ /* CARD — dark outline + premium elevation */
152
  .card {{
153
  position: relative;
154
  width: 340px;
155
  border-radius:22px;
156
  padding: 24px 20px 20px;
157
+ background: var(--card-bg, linear-gradient(#FFFFFF, #FBFCFE));
158
  border: 2px solid var(--card-stroke, var(--cardStroke));
159
  box-shadow:
160
  0 10px 32px rgba(2,20,35,.10),
 
170
  filter: saturate(1.02);
171
  }}
172
 
173
+ /* (optional) small chip inside each card */
174
  .suite-chip {{
175
  position: absolute; top: 12px; right: 12px;
176
+ background: linear-gradient(90deg, var(--stripBg1) 0%, var(--stripBg2) 100%);
177
+ color: var(--stripGold); padding:6px 10px; border-radius:999px;
178
  font-weight:700; font-size:.82rem; letter-spacing:.2px;
179
  box-shadow: 0 6px 14px rgba(2,12,30,.18);
180
  }}
 
199
  color:#566275; min-height: 40px; margin: 0 10px; font-size: 1.0rem;
200
  }}
201
 
202
+ /* BUTTON (navy) */
203
  .btn {{
204
  display:inline-block; padding:12px 20px; border-radius:14px;
205
+ border: 1px solid rgba(11,18,32,.45);
206
  background: linear-gradient(180deg, var(--btn1) 0%, var(--btn2) 100%);
207
+ font-weight: 800; letter-spacing:.3px;
208
  margin: 6px auto 0;
209
  box-shadow: 0 12px 28px rgba(11,18,32,.28), inset 0 1px 0 rgba(255,255,255,.10);
210
  }}
211
+
212
+ /* Force white text + no underline on CTA in ALL states */
213
+ a.btn, a.btn:link, a.btn:visited, a.btn:hover, a.btn:active, a.btn:focus {{
214
+ color: #ffffff !important;
215
+ text-decoration: none !important;
216
+ }}
217
+
218
  .btn:hover {{
219
  filter: brightness(1.03) saturate(1.04);
220
  transform: translateY(-1px);
 
227
 
228
  .footer {{ text-align:center; color:#3f4a5a; font-size:0.96em; margin-top: 26px; }}
229
  .footer hr {{ margin: 12px 0; border-color: rgba(0,0,0,.08); }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  </style>
231
  """, unsafe_allow_html=True)
232
 
233
+ # ========= TOP-LEFT STRIP (then hero below) =========
 
 
 
 
234
  st.markdown(
235
  f"""
236
+ <div class="suite-row">
237
  <span class="suite-pill">{escape(SUITE_NAME)}</span>
238
  <span class="suite-tagline">{escape(SUITE_TAGLINE)}</span>
239
  </div>
 
241
  unsafe_allow_html=True,
242
  )
243
 
244
+ # ========= HERO (logo below the strip) =========
245
+ hero_html = img_tag(HERO_LOGO, "ST_LOG SUITE")
246
+ st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
247
+
248
  # ========= CARDS =========
249
  def app_card(app: dict) -> str:
250
  # choose background: white vs subtle tint
251
+ tint = app.get("tint") if USE_TINTED_CARD_BG else "linear-gradient(#FFFFFF, #FBFCFE)"
252
  icon_html = img_tag(app.get("icon"), "icon",
253
  style="width:106px;height:106px;border-radius:9999px;") if app.get("icon") and app["icon"].exists() else ""
254
  target = "_self"
255
+ chip = f"<div class='suite-chip'>{escape(SUITE_NAME)}</div>" if SHOW_CARD_CHIP else ""
256
  style_vars = f"--card-bg:{tint}; --card-stroke: var(--cardStroke);"
257
  return (
258
  f"<div class='card' style='{style_vars}'>"