Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,12 +12,19 @@ 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
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# ========= ASSETS =========
|
| 23 |
HERO_LOGO = ASSETS / "AI_Suite_Log_logo.png"
|
|
@@ -31,18 +38,21 @@ APPS = [
|
|
| 31 |
"url": "https://smart-thinking-gr.hf.space/",
|
| 32 |
"blurb": "Real-time gamma-ray log prediction.",
|
| 33 |
"icon": ICON_GR,
|
|
|
|
| 34 |
},
|
| 35 |
{
|
| 36 |
"title": "ST_Log_Sonic (Ts)",
|
| 37 |
"url": "https://smart-thinking-sonic-ts.hf.space",
|
| 38 |
"blurb": "Predict shear slowness (DtS) in real time.",
|
| 39 |
"icon": ICON_TS,
|
|
|
|
| 40 |
},
|
| 41 |
{
|
| 42 |
"title": "ST_Log_Sonic (Tc)",
|
| 43 |
"url": "https://smart-thinking-sonic-tc.hf.space",
|
| 44 |
"blurb": "Predict compressional slowness (DtC) in real time.",
|
| 45 |
"icon": ICON_TC,
|
|
|
|
| 46 |
},
|
| 47 |
]
|
| 48 |
|
|
@@ -63,14 +73,23 @@ def img_tag(path: Path, alt: str, cls: str = "", style: str = "") -> str:
|
|
| 63 |
style_attr = f' style="{style}"' if style else ""
|
| 64 |
return f'<img{cls_attr}{style_attr} src="{uri}" alt="{escape(alt)}" />'
|
| 65 |
|
| 66 |
-
# =========
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
st.markdown(f"""
|
| 68 |
<style>
|
| 69 |
:root {{
|
| 70 |
-
--
|
| 71 |
-
--
|
| 72 |
-
--
|
| 73 |
-
--
|
|
|
|
|
|
|
|
|
|
| 74 |
}}
|
| 75 |
|
| 76 |
html, body, [data-testid="stAppViewContainer"] {{ height: 100%; }}
|
|
@@ -86,8 +105,8 @@ st.markdown(f"""
|
|
| 86 |
padding: 68px 0 28px !important;
|
| 87 |
background:
|
| 88 |
radial-gradient(980px 460px at 50% -140px,
|
| 89 |
-
rgba(
|
| 90 |
-
rgba(
|
| 91 |
rgba(255,255,255,0.98) 60%,
|
| 92 |
rgba(255,255,255,1) 100%);
|
| 93 |
}}
|
|
@@ -103,18 +122,17 @@ st.markdown(f"""
|
|
| 103 |
/* SUITE STRIP ABOVE CARDS */
|
| 104 |
.suite-banner {{
|
| 105 |
display:flex; gap:14px; justify-content:center; align-items:center;
|
| 106 |
-
margin:
|
| 107 |
-
flex-wrap: wrap;
|
| 108 |
}}
|
| 109 |
.suite-pill {{
|
| 110 |
-
background: linear-gradient(90deg, var(--
|
| 111 |
-
color
|
| 112 |
font-weight:800; letter-spacing:.25px;
|
| 113 |
-
box-shadow: 0 6px 14px rgba(
|
| 114 |
white-space: nowrap;
|
| 115 |
}}
|
| 116 |
.suite-tagline {{
|
| 117 |
-
color:#
|
| 118 |
}}
|
| 119 |
|
| 120 |
/* GRID (3 → 2 → 1) */
|
|
@@ -133,45 +151,41 @@ st.markdown(f"""
|
|
| 133 |
.grid {{ grid-template-columns: 1fr; }}
|
| 134 |
}}
|
| 135 |
|
| 136 |
-
/* CARD —
|
| 137 |
.card {{
|
| 138 |
position: relative;
|
| 139 |
width: 340px;
|
| 140 |
border-radius:22px;
|
| 141 |
-
padding: 24px 20px
|
| 142 |
-
background:
|
| 143 |
-
|
| 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.
|
| 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 |
-
/*
|
| 163 |
.suite-chip {{
|
| 164 |
position: absolute; top: 12px; right: 12px;
|
| 165 |
-
background: linear-gradient(90deg, var(--
|
| 166 |
-
color
|
| 167 |
font-weight:700; font-size:.82rem; letter-spacing:.2px;
|
| 168 |
-
box-shadow: 0 6px 14px rgba(
|
| 169 |
}}
|
| 170 |
|
| 171 |
-
/*
|
| 172 |
.icon-wrap {{
|
| 173 |
width: 118px; height: 118px; border-radius: 9999px;
|
| 174 |
-
background: #
|
| 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);
|
|
@@ -180,34 +194,31 @@ st.markdown(f"""
|
|
| 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.
|
| 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
|
| 193 |
.btn {{
|
| 194 |
display:inline-block; padding:12px 20px; border-radius:14px;
|
| 195 |
-
border: 1px solid rgba(
|
| 196 |
-
background: linear-gradient(
|
| 197 |
-
color:
|
| 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(
|
| 207 |
}}
|
| 208 |
.btn:focus {{
|
| 209 |
outline: none;
|
| 210 |
-
box-shadow: 0 0 0 4px rgba(
|
| 211 |
}}
|
| 212 |
|
| 213 |
.footer {{ text-align:center; color:#3f4a5a; font-size:0.96em; margin-top: 26px; }}
|
|
@@ -219,12 +230,12 @@ st.markdown(f"""
|
|
| 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
|
| 223 |
st.markdown(
|
| 224 |
f"""
|
| 225 |
<div class="suite-banner">
|
| 226 |
<span class="suite-pill">{escape(SUITE_NAME)}</span>
|
| 227 |
-
<span class="suite-tagline">
|
| 228 |
</div>
|
| 229 |
""",
|
| 230 |
unsafe_allow_html=True,
|
|
@@ -232,12 +243,16 @@ st.markdown(
|
|
| 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"
|
|
|
|
|
|
|
| 238 |
return (
|
| 239 |
-
"<div class='card'>"
|
| 240 |
-
+
|
| 241 |
+ f"<div class='icon-wrap'>{icon_html}</div>"
|
| 242 |
+ f"<h3>{escape(app['title'])}</h3>"
|
| 243 |
+ f"<p>{escape(app['blurb'])}</p>"
|
|
|
|
| 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"
|
|
|
|
| 38 |
"url": "https://smart-thinking-gr.hf.space/",
|
| 39 |
"blurb": "Real-time gamma-ray log prediction.",
|
| 40 |
"icon": ICON_GR,
|
| 41 |
+
"tint": "linear-gradient(180deg, rgba(14,116,144,0.05) 0%, rgba(14,116,144,0.02) 100%)",
|
| 42 |
},
|
| 43 |
{
|
| 44 |
"title": "ST_Log_Sonic (Ts)",
|
| 45 |
"url": "https://smart-thinking-sonic-ts.hf.space",
|
| 46 |
"blurb": "Predict shear slowness (DtS) in real time.",
|
| 47 |
"icon": ICON_TS,
|
| 48 |
+
"tint": "linear-gradient(180deg, rgba(2,132,199,0.05) 0%, rgba(2,132,199,0.02) 100%)",
|
| 49 |
},
|
| 50 |
{
|
| 51 |
"title": "ST_Log_Sonic (Tc)",
|
| 52 |
"url": "https://smart-thinking-sonic-tc.hf.space",
|
| 53 |
"blurb": "Predict compressional slowness (DtC) in real time.",
|
| 54 |
"icon": ICON_TC,
|
| 55 |
+
"tint": "linear-gradient(180deg, rgba(99,102,241,0.05) 0%, rgba(99,102,241,0.02) 100%)",
|
| 56 |
},
|
| 57 |
]
|
| 58 |
|
|
|
|
| 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 |
|
| 95 |
html, body, [data-testid="stAppViewContainer"] {{ height: 100%; }}
|
|
|
|
| 105 |
padding: 68px 0 28px !important;
|
| 106 |
background:
|
| 107 |
radial-gradient(980px 460px at 50% -140px,
|
| 108 |
+
rgba(2,12,30,0.06) 0%,
|
| 109 |
+
rgba(2,12,30,0.04) 28%,
|
| 110 |
rgba(255,255,255,0.98) 60%,
|
| 111 |
rgba(255,255,255,1) 100%);
|
| 112 |
}}
|
|
|
|
| 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) */
|
|
|
|
| 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),
|
| 164 |
+
0 1px 0 rgba(255,255,255,0.85) inset;
|
| 165 |
transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
|
| 166 |
text-align:center; display:flex; flex-direction:column; gap:16px;
|
| 167 |
align-items: center;
|
| 168 |
}}
|
| 169 |
.card:hover {{
|
| 170 |
transform: translateY(-4px);
|
| 171 |
+
border-color: var(--cardStrokeHover);
|
| 172 |
box-shadow: 0 18px 52px rgba(2,20,35,.16);
|
| 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 |
}}
|
| 184 |
|
| 185 |
+
/* Big round icon */
|
| 186 |
.icon-wrap {{
|
| 187 |
width: 118px; height: 118px; border-radius: 9999px;
|
| 188 |
+
background: #F1F5F9;
|
| 189 |
display:grid; place-items:center;
|
| 190 |
border: 1px solid rgba(12,18,32,0.10);
|
| 191 |
box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 10px 22px rgba(2,20,35,.07);
|
|
|
|
| 194 |
width: 106px; height: 106px; border-radius:9999px; display:block;
|
| 195 |
}}
|
| 196 |
|
|
|
|
| 197 |
.card h3 {{
|
| 198 |
+
margin: 0; font-size: 1.55rem; font-weight: 900; color:#0b1220;
|
| 199 |
letter-spacing: .15px;
|
| 200 |
}}
|
| 201 |
.card p {{
|
| 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);
|
| 217 |
+
box-shadow: 0 16px 38px rgba(11,18,32,.36);
|
| 218 |
}}
|
| 219 |
.btn:focus {{
|
| 220 |
outline: none;
|
| 221 |
+
box-shadow: 0 0 0 4px rgba(30,41,59,.28), 0 16px 38px rgba(11,18,32,.36);
|
| 222 |
}}
|
| 223 |
|
| 224 |
.footer {{ text-align:center; color:#3f4a5a; font-size:0.96em; margin-top: 26px; }}
|
|
|
|
| 230 |
hero_html = img_tag(HERO_LOGO, "ST_LOG SUITE")
|
| 231 |
st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
|
| 232 |
|
| 233 |
+
# ========= SUITE STRIP =========
|
| 234 |
st.markdown(
|
| 235 |
f"""
|
| 236 |
<div class="suite-banner">
|
| 237 |
<span class="suite-pill">{escape(SUITE_NAME)}</span>
|
| 238 |
+
<span class="suite-tagline">{escape(SUITE_TAGLINE)}</span>
|
| 239 |
</div>
|
| 240 |
""",
|
| 241 |
unsafe_allow_html=True,
|
|
|
|
| 243 |
|
| 244 |
# ========= CARDS =========
|
| 245 |
def app_card(app: dict) -> str:
|
| 246 |
+
# choose background: white vs subtle tint
|
| 247 |
+
tint = app.get("tint") if {USE_TINTED_CARD_BG} else "linear-gradient(#FFFFFF, #FBFCFE)"
|
| 248 |
icon_html = img_tag(app.get("icon"), "icon",
|
| 249 |
style="width:106px;height:106px;border-radius:9999px;") if app.get("icon") and app["icon"].exists() else ""
|
| 250 |
+
target = "_self"
|
| 251 |
+
chip = f"<div class='suite-chip'>{escape(SUITE_NAME)}</div>" if {SHOW_CARD_CHIP} else ""
|
| 252 |
+
style_vars = f"--card-bg:{tint}; --card-stroke: var(--cardStroke);"
|
| 253 |
return (
|
| 254 |
+
f"<div class='card' style='{style_vars}'>"
|
| 255 |
+
+ chip
|
| 256 |
+ f"<div class='icon-wrap'>{icon_html}</div>"
|
| 257 |
+ f"<h3>{escape(app['title'])}</h3>"
|
| 258 |
+ f"<p>{escape(app['blurb'])}</p>"
|