Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -338,7 +338,6 @@ def img_tag(path: Path, alt: str, cls: str = "", style: str = "") -> str:
|
|
| 338 |
hero_html = img_tag(THEME["hero"]["logo"], "ST_GeoMech SUITE")
|
| 339 |
st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
|
| 340 |
|
| 341 |
-
# ========= Cards =========
|
| 342 |
def build_card_vars(style: Dict[str, Any]) -> str:
|
| 343 |
s = []
|
| 344 |
if "width" in style: s.append(f"--c-w:{int(style['width'])}px")
|
|
@@ -346,26 +345,28 @@ def build_card_vars(style: Dict[str, Any]) -> str:
|
|
| 346 |
if "pad_v" in style: s.append(f"--c-pv:{int(style['pad_v'])}px")
|
| 347 |
if "pad_h" in style: s.append(f"--c-ph:{int(style['pad_h'])}px")
|
| 348 |
if "bg_top" in style: s.append(f"--c-bg-top:{style['bg_top']}")
|
| 349 |
-
if "bg_bot" in style: s.append(f"--c-bg-bot:{style['bg_bot
|
| 350 |
-
if "border" in style: s.append(f"--c-border:{style['border
|
| 351 |
if "border_width" in style: s.append(f"--c-bw:{int(style['border_width'])}px")
|
| 352 |
-
if "title_color" in style: s.append(f"--c-title-color:{style['title_color
|
| 353 |
if "title_fs" in style: s.append(f"--c-title-fs:{int(style['title_fs'])}px")
|
| 354 |
-
if "blurb_color" in style: s.append(f"--c-blurb-color:{style['blurb_color
|
| 355 |
if "blurb_fs" in style: s.append(f"--c-blurb-fs:{int(style['blurb_fs'])}px")
|
| 356 |
-
if "btn_bg1" in style: s.append(f"--c-btn-bg1:{style['btn_bg1
|
| 357 |
-
if "btn_bg2" in style: s.append(f"--c-btn-bg2:{style['btn_bg2
|
| 358 |
-
if "btn_text" in style: s.append(f"--c-btn-text:{style['btn_text
|
| 359 |
-
if "btn_border" in style: s.append(f"--c-btn-border:{style['btn_border
|
| 360 |
if "btn_fs" in style: s.append(f"--c-btn-fs:{int(style['btn_fs'])}px")
|
| 361 |
-
if "btn_pad_v" in style: s.append(f"--c-btn-pv:{int(style['btn_pad_v
|
| 362 |
-
if "btn_pad_h" in style: s.append(f"--c-btn-ph:{int(style['btn_pad_h
|
| 363 |
-
if "icon_diam" in style: s.append(f"--c-icon-d:{int(style['icon_diam
|
| 364 |
-
if "icon_img" in style: s.append(f"--c-icon-img:{int(style['icon_img
|
| 365 |
-
if "icon_bg" in style: s.append(f"--c-icon-bg:{style['icon_bg
|
| 366 |
-
if "icon_border" in style: s.append(f"--c-icon-border:{style['icon_border
|
| 367 |
return "; ".join(s)
|
| 368 |
|
|
|
|
|
|
|
| 369 |
def app_card(card_cfg: Dict[str, Any]) -> str:
|
| 370 |
style = card_cfg.get("style", {})
|
| 371 |
vars_inline = build_card_vars(style)
|
|
|
|
| 338 |
hero_html = img_tag(THEME["hero"]["logo"], "ST_GeoMech SUITE")
|
| 339 |
st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
|
| 340 |
|
|
|
|
| 341 |
def build_card_vars(style: Dict[str, Any]) -> str:
|
| 342 |
s = []
|
| 343 |
if "width" in style: s.append(f"--c-w:{int(style['width'])}px")
|
|
|
|
| 345 |
if "pad_v" in style: s.append(f"--c-pv:{int(style['pad_v'])}px")
|
| 346 |
if "pad_h" in style: s.append(f"--c-ph:{int(style['pad_h'])}px")
|
| 347 |
if "bg_top" in style: s.append(f"--c-bg-top:{style['bg_top']}")
|
| 348 |
+
if "bg_bot" in style: s.append(f"--c-bg-bot:{style['bg_bot']}")
|
| 349 |
+
if "border" in style: s.append(f"--c-border:{style['border']}")
|
| 350 |
if "border_width" in style: s.append(f"--c-bw:{int(style['border_width'])}px")
|
| 351 |
+
if "title_color" in style: s.append(f"--c-title-color:{style['title_color']}")
|
| 352 |
if "title_fs" in style: s.append(f"--c-title-fs:{int(style['title_fs'])}px")
|
| 353 |
+
if "blurb_color" in style: s.append(f"--c-blurb-color:{style['blurb_color']}")
|
| 354 |
if "blurb_fs" in style: s.append(f"--c-blurb-fs:{int(style['blurb_fs'])}px")
|
| 355 |
+
if "btn_bg1" in style: s.append(f"--c-btn-bg1:{style['btn_bg1']}")
|
| 356 |
+
if "btn_bg2" in style: s.append(f"--c-btn-bg2:{style['btn_bg2']}")
|
| 357 |
+
if "btn_text" in style: s.append(f"--c-btn-text:{style['btn_text']}")
|
| 358 |
+
if "btn_border" in style: s.append(f"--c-btn-border:{style['btn_border']}")
|
| 359 |
if "btn_fs" in style: s.append(f"--c-btn-fs:{int(style['btn_fs'])}px")
|
| 360 |
+
if "btn_pad_v" in style: s.append(f"--c-btn-pv:{int(style['btn_pad_v'])}px")
|
| 361 |
+
if "btn_pad_h" in style: s.append(f"--c-btn-ph:{int(style['btn_pad_h'])}px")
|
| 362 |
+
if "icon_diam" in style: s.append(f"--c-icon-d:{int(style['icon_diam'])}px")
|
| 363 |
+
if "icon_img" in style: s.append(f"--c-icon-img:{int(style['icon_img'])}px")
|
| 364 |
+
if "icon_bg" in style: s.append(f"--c-icon-bg:{style['icon_bg']}")
|
| 365 |
+
if "icon_border" in style: s.append(f"--c-icon-border:{style['icon_border']}")
|
| 366 |
return "; ".join(s)
|
| 367 |
|
| 368 |
+
|
| 369 |
+
|
| 370 |
def app_card(card_cfg: Dict[str, Any]) -> str:
|
| 371 |
style = card_cfg.get("style", {})
|
| 372 |
vars_inline = build_card_vars(style)
|