UCS2014 commited on
Commit
280e045
·
verified ·
1 Parent(s): 8b91916

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +87 -58
app.py CHANGED
@@ -11,16 +11,19 @@ ASSETS = BASE_DIR / "assets"
11
  # ========= META =========
12
  st.set_page_config(page_title="ST_LOG SUITE — Apps", page_icon="🧭", layout="wide")
13
 
14
- # ========= BRAND / DATA =========
15
- SUITE_NAME = "ST_LOG SUITE"
16
- ACCENT = "#0E7490" # teal start (kept subtly in chips)
17
- ACCENT_END = "#14B8A6" # teal end
 
 
 
18
 
19
- # Logos (put these PNGs in assets/)
20
- HERO_LOGO = ASSETS / "AI_Suite_Log_logo.png"
21
- ICON_GR = ASSETS / "GR_logo.png"
22
- ICON_TS = ASSETS / "Ts_logo.png"
23
- ICON_TC = ASSETS / "Tc_logo.png"
24
 
25
  APPS = [
26
  {
@@ -48,8 +51,7 @@ def data_uri(path: Path) -> str | None:
48
  if not path or not path.exists():
49
  return None
50
  mime, _ = mimetypes.guess_type(path.name)
51
- if not mime:
52
- mime = "image/png"
53
  b64 = base64.b64encode(path.read_bytes()).decode("utf-8")
54
  return f"data:{mime};base64,{b64}"
55
 
@@ -61,14 +63,14 @@ def img_tag(path: Path, alt: str, cls: str = "", style: str = "") -> str:
61
  style_attr = f' style="{style}"' if style else ""
62
  return f'<img{cls_attr}{style_attr} src="{uri}" alt="{escape(alt)}" />'
63
 
64
- # ========= BACKGROUND (clean, calm gradient) =========
65
  st.markdown(f"""
66
  <style>
67
  :root {{
68
  --brand: {ACCENT};
69
- --brand2: {ACCENT_END};
70
- --btnDark1: #0B1220; /* dark slate for button */
71
- --btnDark2: #334155; /* slate */
72
  }}
73
 
74
  html, body, [data-testid="stAppViewContainer"] {{ height: 100%; }}
@@ -77,11 +79,11 @@ st.markdown(f"""
77
  }}
78
 
79
  .block-container {{
80
- max-width: 1100px;
81
  min-height: 100vh;
82
  display: flex; flex-direction: column;
83
  gap: 16px;
84
- padding: 72px 0 28px !important;
85
  background:
86
  radial-gradient(980px 460px at 50% -140px,
87
  rgba(20,184,166,0.08) 0%,
@@ -90,58 +92,71 @@ st.markdown(f"""
90
  rgba(255,255,255,1) 100%);
91
  }}
92
 
93
- /* HERO (logo only — title/tagline removed) */
94
  .hero {{ text-align:center; margin: 0; }}
95
  .hero img {{
96
- width: 560px; max-width: 92vw; height: auto;
97
  display:block; margin: 0 auto 6px;
98
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.10));
99
  }}
100
 
101
- /* SUITE BANNER (tiny, elegant) */
102
  .suite-banner {{
103
- display:flex; gap:10px; justify-content:center; align-items:center;
104
- margin: 4px 0 10px;
 
105
  }}
106
  .suite-pill {{
107
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand2) 100%);
108
- color:#fff; padding:6px 12px; border-radius:999px;
109
- font-weight:700; letter-spacing:.2px;
110
  box-shadow: 0 6px 14px rgba(14,116,144,.20);
 
 
 
 
111
  }}
112
 
113
  /* GRID (3 → 2 → 1) */
114
  .grid {{
115
  display: grid;
116
- grid-template-columns: repeat(3, 320px);
117
- gap: 36px;
118
  justify-content: center;
119
  align-items: stretch;
120
- margin-top: 8px;
121
  }}
122
- @media (max-width: 1100px) {{
123
- .grid {{ grid-template-columns: repeat(2, 320px); gap: 28px; }}
124
  }}
125
- @media (max-width: 700px) {{
126
  .grid {{ grid-template-columns: 1fr; }}
127
  }}
128
 
129
- /* CARD — premium look */
130
  .card {{
131
  position: relative;
132
- width: 320px;
133
- background: linear-gradient(180deg, #ffffff 0%, #FBFCFE 100%);
134
- border: 1px solid rgba(12,18,32,.08);
135
- border-radius:20px; padding:22px 18px 18px;
136
- box-shadow: 0 10px 34px rgba(2,20,35,.08), 0 1px 0 rgba(255,255,255,0.9) inset;
137
- transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
138
- text-align:center; display:flex; flex-direction:column; gap:14px;
 
 
 
 
 
139
  align-items: center;
140
  }}
141
  .card:hover {{
142
  transform: translateY(-4px);
143
  box-shadow: 0 18px 52px rgba(2,20,35,.16);
144
- border-color: rgba(14,116,144,0.18);
 
 
 
145
  }}
146
 
147
  /* Corner suite chip */
@@ -155,41 +170,47 @@ st.markdown(f"""
155
 
156
  /* Larger round icon */
157
  .icon-wrap {{
158
- width: 104px; height: 104px; border-radius: 9999px;
159
  background: #F0F5F9;
160
  display:grid; place-items:center;
161
  border: 1px solid rgba(12,18,32,0.10);
162
- box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 8px 20px rgba(2,20,35,.06);
163
  }}
164
  .icon-wrap img {{
165
- width: 92px; height: 92px; border-radius:9999px; display:block;
166
  }}
167
 
168
- /* Enlarged app title */
169
  .card h3 {{
170
- margin: 2px 0 0; font-size: 1.26rem; font-weight: 900; color:#0b1220;
171
- letter-spacing: .1px;
172
  }}
173
  .card p {{
174
- color:#566275; min-height: 40px; margin: 0 10px; font-size: .98rem;
175
  }}
176
 
177
- /* PREMIUM BUTTON (dark slate, not green) */
178
  .btn {{
179
- display:inline-block; padding:12px 18px; border-radius:14px;
180
- border: 1px solid rgba(15,23,42,.35); text-decoration:none;
181
- background: linear-gradient(180deg, var(--btnDark1) 0%, var(--btnDark2) 100%);
182
- color: white; font-weight: 700; letter-spacing:.25px;
183
  margin: 6px auto 0;
184
- box-shadow: 0 10px 26px rgba(15,23,42,.25), inset 0 1px 0 rgba(255,255,255,.08);
 
 
185
  }}
186
  .btn:hover {{
187
- filter: brightness(1.02) saturate(1.02);
188
  transform: translateY(-1px);
189
- box-shadow: 0 14px 34px rgba(15,23,42,.30);
 
 
 
 
190
  }}
191
 
192
- .footer {{ text-align:center; color:#3f4a5a; font-size:0.96em; margin-top: 24px; }}
193
  .footer hr {{ margin: 12px 0; border-color: rgba(0,0,0,.08); }}
194
  </style>
195
  """, unsafe_allow_html=True)
@@ -198,13 +219,21 @@ st.markdown(f"""
198
  hero_html = img_tag(HERO_LOGO, "ST_LOG SUITE")
199
  st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
200
 
201
- # ========= SUITE BANNER =========
202
- st.markdown(f"<div class='suite-banner'><span class='suite-pill'>{escape(SUITE_NAME)}</span></div>", unsafe_allow_html=True)
 
 
 
 
 
 
 
 
203
 
204
  # ========= CARDS =========
205
  def app_card(app: dict) -> str:
206
  icon_html = img_tag(app.get("icon"), "icon",
207
- style="width:92px;height:92px;border-radius:9999px;") if app.get("icon") and app["icon"].exists() else ""
208
  target = "_self" # change to "_blank" if you prefer new tab
209
  return (
210
  "<div class='card'>"
 
11
  # ========= META =========
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
+ # Brand teal used in accents; bright button uses cyan→blue for strong contrast
17
+ ACCENT = "#0E7490"
18
+ ACCENT_END = "#14B8A6"
19
+ BTN_BRIGHT_1 = "#06B6D4" # cyan
20
+ BTN_BRIGHT_2 = "#2563EB" # blue
21
 
22
+ # ========= ASSETS =========
23
+ HERO_LOGO = ASSETS / "AI_Suite_Log_logo.png"
24
+ ICON_GR = ASSETS / "GR_logo.png"
25
+ ICON_TS = ASSETS / "Ts_logo.png"
26
+ ICON_TC = ASSETS / "Tc_logo.png"
27
 
28
  APPS = [
29
  {
 
51
  if not path or not path.exists():
52
  return None
53
  mime, _ = mimetypes.guess_type(path.name)
54
+ if not mime: mime = "image/png"
 
55
  b64 = base64.b64encode(path.read_bytes()).decode("utf-8")
56
  return f"data:{mime};base64,{b64}"
57
 
 
63
  style_attr = f' style="{style}"' if style else ""
64
  return f'<img{cls_attr}{style_attr} src="{uri}" alt="{escape(alt)}" />'
65
 
66
+ # ========= BACKGROUND & CORE STYLES =========
67
  st.markdown(f"""
68
  <style>
69
  :root {{
70
  --brand: {ACCENT};
71
+ --brand2:{ACCENT_END};
72
+ --btn1: {BTN_BRIGHT_1};
73
+ --btn2: {BTN_BRIGHT_2};
74
  }}
75
 
76
  html, body, [data-testid="stAppViewContainer"] {{ height: 100%; }}
 
79
  }}
80
 
81
  .block-container {{
82
+ max-width: 1120px;
83
  min-height: 100vh;
84
  display: flex; flex-direction: column;
85
  gap: 16px;
86
+ padding: 68px 0 28px !important;
87
  background:
88
  radial-gradient(980px 460px at 50% -140px,
89
  rgba(20,184,166,0.08) 0%,
 
92
  rgba(255,255,255,1) 100%);
93
  }}
94
 
95
+ /* HERO (logo only) */
96
  .hero {{ text-align:center; margin: 0; }}
97
  .hero img {{
98
+ width: 580px; max-width: 92vw; height: auto;
99
  display:block; margin: 0 auto 6px;
100
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.10));
101
  }}
102
 
103
+ /* SUITE STRIP ABOVE CARDS */
104
  .suite-banner {{
105
+ display:flex; gap:14px; justify-content:center; align-items:center;
106
+ margin: 6px 0 14px;
107
+ flex-wrap: wrap;
108
  }}
109
  .suite-pill {{
110
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand2) 100%);
111
+ color:#fff; padding:7px 14px; border-radius:999px;
112
+ font-weight:800; letter-spacing:.25px;
113
  box-shadow: 0 6px 14px rgba(14,116,144,.20);
114
+ white-space: nowrap;
115
+ }}
116
+ .suite-tagline {{
117
+ color:#364152; font-weight:600; opacity:.95;
118
  }}
119
 
120
  /* GRID (3 → 2 → 1) */
121
  .grid {{
122
  display: grid;
123
+ grid-template-columns: repeat(3, 340px);
124
+ gap: 40px;
125
  justify-content: center;
126
  align-items: stretch;
127
+ margin-top: 6px;
128
  }}
129
+ @media (max-width: 1120px) {{
130
+ .grid {{ grid-template-columns: repeat(2, 340px); gap: 28px; }}
131
  }}
132
+ @media (max-width: 720px) {{
133
  .grid {{ grid-template-columns: 1fr; }}
134
  }}
135
 
136
+ /* CARD — premium frame + elevation */
137
  .card {{
138
  position: relative;
139
+ width: 340px;
140
+ border-radius:22px;
141
+ padding: 24px 20px 18px;
142
+ background:
143
+ linear-gradient(#ffffff, #FBFCFE) padding-box,
144
+ linear-gradient(135deg, rgba(14,116,144,0.45), rgba(20,184,166,0.15)) border-box;
145
+ border: 1.5px solid transparent;
146
+ box-shadow:
147
+ 0 10px 32px rgba(2,20,35,.10),
148
+ 0 1px 0 rgba(255,255,255,0.9) inset;
149
+ transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
150
+ text-align:center; display:flex; flex-direction:column; gap:16px;
151
  align-items: center;
152
  }}
153
  .card:hover {{
154
  transform: translateY(-4px);
155
  box-shadow: 0 18px 52px rgba(2,20,35,.16);
156
+ filter: saturate(1.02);
157
+ background:
158
+ linear-gradient(#ffffff, #F7FAFF) padding-box,
159
+ linear-gradient(135deg, rgba(14,116,144,0.70), rgba(20,184,166,0.25)) border-box;
160
  }}
161
 
162
  /* Corner suite chip */
 
170
 
171
  /* Larger round icon */
172
  .icon-wrap {{
173
+ width: 118px; height: 118px; border-radius: 9999px;
174
  background: #F0F5F9;
175
  display:grid; place-items:center;
176
  border: 1px solid rgba(12,18,32,0.10);
177
+ box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 10px 22px rgba(2,20,35,.07);
178
  }}
179
  .icon-wrap img {{
180
+ width: 106px; height: 106px; border-radius:9999px; display:block;
181
  }}
182
 
183
+ /* BIGGER APP TITLE */
184
  .card h3 {{
185
+ margin: 0; font-size: 1.48rem; font-weight: 900; color:#0b1220;
186
+ letter-spacing: .15px;
187
  }}
188
  .card p {{
189
+ color:#566275; min-height: 40px; margin: 0 10px; font-size: 1.0rem;
190
  }}
191
 
192
+ /* BRIGHT CTA BUTTON */
193
  .btn {{
194
+ display:inline-block; padding:12px 20px; border-radius:14px;
195
+ border: 1px solid rgba(37,99,235,.45); text-decoration:none;
196
+ background: linear-gradient(90deg, var(--btn1) 0%, var(--btn2) 100%);
197
+ color: white; font-weight: 800; letter-spacing:.3px;
198
  margin: 6px auto 0;
199
+ box-shadow:
200
+ 0 12px 28px rgba(37,99,235,.28),
201
+ inset 0 1px 0 rgba(255,255,255,.10);
202
  }}
203
  .btn:hover {{
204
+ filter: brightness(1.03) saturate(1.04);
205
  transform: translateY(-1px);
206
+ box-shadow: 0 16px 38px rgba(37,99,235,.36);
207
+ }}
208
+ .btn:focus {{
209
+ outline: none;
210
+ box-shadow: 0 0 0 4px rgba(37,99,235,.2), 0 16px 38px rgba(37,99,235,.36);
211
  }}
212
 
213
+ .footer {{ text-align:center; color:#3f4a5a; font-size:0.96em; margin-top: 26px; }}
214
  .footer hr {{ margin: 12px 0; border-color: rgba(0,0,0,.08); }}
215
  </style>
216
  """, unsafe_allow_html=True)
 
219
  hero_html = img_tag(HERO_LOGO, "ST_LOG SUITE")
220
  st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
221
 
222
+ # ========= SUITE STRIP (with your requested line) =========
223
+ st.markdown(
224
+ f"""
225
+ <div class="suite-banner">
226
+ <span class="suite-pill">{escape(SUITE_NAME)}</span>
227
+ <span class="suite-tagline">Generating AI-Based Well Logging Profiles While Drilling</span>
228
+ </div>
229
+ """,
230
+ unsafe_allow_html=True,
231
+ )
232
 
233
  # ========= CARDS =========
234
  def app_card(app: dict) -> str:
235
  icon_html = img_tag(app.get("icon"), "icon",
236
+ style="width:106px;height:106px;border-radius:9999px;") if app.get("icon") and app["icon"].exists() else ""
237
  target = "_self" # change to "_blank" if you prefer new tab
238
  return (
239
  "<div class='card'>"