Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,10 +21,11 @@ THEME: Dict[str, Any] = {
|
|
| 21 |
"pill_pad_h": 14, # px
|
| 22 |
"pill_font": 16, # px
|
| 23 |
"tagline_font": 15, # px
|
| 24 |
-
|
| 25 |
-
"
|
| 26 |
-
"
|
| 27 |
-
"
|
|
|
|
| 28 |
},
|
| 29 |
"page": {
|
| 30 |
"top_padding": 50, # px top padding for page
|
|
@@ -46,9 +47,10 @@ THEME: Dict[str, Any] = {
|
|
| 46 |
"pad_v": 24, # px
|
| 47 |
"pad_h": 20, # px
|
| 48 |
"border": "#0B1220", # dark outline
|
| 49 |
-
"border_hover": "#
|
| 50 |
-
|
| 51 |
-
"
|
|
|
|
| 52 |
"title_color": "#0B1220",
|
| 53 |
"blurb_color": "#566275",
|
| 54 |
},
|
|
@@ -62,15 +64,16 @@ THEME: Dict[str, Any] = {
|
|
| 62 |
"pad_v": 12, # px
|
| 63 |
"pad_h": 20, # px
|
| 64 |
"radius": 14, # px
|
| 65 |
-
|
| 66 |
-
"
|
|
|
|
| 67 |
"text": "#FFFFFF",
|
| 68 |
-
"border": "rgba(11,18,32,.
|
| 69 |
},
|
| 70 |
}
|
| 71 |
|
| 72 |
# ========= CARDS (content + per-card overrides) =========
|
| 73 |
-
#
|
| 74 |
CARDS = [
|
| 75 |
{
|
| 76 |
"title": "ST_Log_GR",
|
|
@@ -78,8 +81,9 @@ CARDS = [
|
|
| 78 |
"url": "https://smart-thinking-gr.hf.space/",
|
| 79 |
"icon": ASSETS / "GR_logo.png",
|
| 80 |
"style": {
|
| 81 |
-
"bg_top": "
|
| 82 |
-
"bg_bot": "
|
|
|
|
| 83 |
},
|
| 84 |
},
|
| 85 |
{
|
|
@@ -88,8 +92,9 @@ CARDS = [
|
|
| 88 |
"url": "https://smart-thinking-sonic-ts.hf.space",
|
| 89 |
"icon": ASSETS / "Ts_logo.png",
|
| 90 |
"style": {
|
| 91 |
-
"bg_top": "
|
| 92 |
-
"bg_bot": "
|
|
|
|
| 93 |
},
|
| 94 |
},
|
| 95 |
{
|
|
@@ -98,8 +103,9 @@ CARDS = [
|
|
| 98 |
"url": "https://smart-thinking-sonic-tc.hf.space",
|
| 99 |
"icon": ASSETS / "Tc_logo.png",
|
| 100 |
"style": {
|
| 101 |
-
"bg_top": "
|
| 102 |
-
"bg_bot": "
|
|
|
|
| 103 |
},
|
| 104 |
},
|
| 105 |
]
|
|
@@ -239,7 +245,7 @@ st.markdown(f"""
|
|
| 239 |
padding: var(--c-pv, var(--card-pv)) var(--c-ph, var(--card-ph));
|
| 240 |
background: linear-gradient(180deg, var(--c-bg-top, {card["bg_top"]}) 0%, var(--c-bg-bot, {card["bg_bot"]}) 100%);
|
| 241 |
border: var(--c-bw, var(--card-bw)) solid var(--c-border, var(--cardStroke));
|
| 242 |
-
/*
|
| 243 |
box-shadow:
|
| 244 |
0 14px 32px rgba(2,20,35,.12),
|
| 245 |
0 1px 0 rgba(255,255,255,0.70) inset,
|
|
@@ -314,23 +320,6 @@ st.markdown(
|
|
| 314 |
)
|
| 315 |
|
| 316 |
# ========= Hero =========
|
| 317 |
-
def data_uri(path: Path) -> Optional[str]:
|
| 318 |
-
if not path or not path.exists():
|
| 319 |
-
return None
|
| 320 |
-
mime, _ = mimetypes.guess_type(path.name)
|
| 321 |
-
if not mime:
|
| 322 |
-
mime = "image/png"
|
| 323 |
-
b64 = base64.b64encode(path.read_bytes()).decode("utf-8")
|
| 324 |
-
return f"data:{mime};base64,{b64}"
|
| 325 |
-
|
| 326 |
-
def img_tag(path: Path, alt: str, cls: str = "", style: str = "") -> str:
|
| 327 |
-
uri = data_uri(path)
|
| 328 |
-
if not uri:
|
| 329 |
-
return ""
|
| 330 |
-
cls_attr = f' class="{cls}"' if cls else ""
|
| 331 |
-
style_attr = f' style="{style}"' if style else ""
|
| 332 |
-
return f'<img{cls_attr}{style_attr} src="{uri}" alt="{escape(alt)}" />'
|
| 333 |
-
|
| 334 |
hero_html = img_tag(THEME["hero"]["logo"], "ST_LOG SUITE")
|
| 335 |
st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
|
| 336 |
|
|
|
|
| 21 |
"pill_pad_h": 14, # px
|
| 22 |
"pill_font": 16, # px
|
| 23 |
"tagline_font": 15, # px
|
| 24 |
+
# Premium header palette
|
| 25 |
+
"bg1": "#0B1220", # charcoal
|
| 26 |
+
"bg2": "#142136", # deep navy
|
| 27 |
+
"text": "#E4B83A", # gold text inside pill
|
| 28 |
+
"tagline_color": "#475569",
|
| 29 |
},
|
| 30 |
"page": {
|
| 31 |
"top_padding": 50, # px top padding for page
|
|
|
|
| 47 |
"pad_v": 24, # px
|
| 48 |
"pad_h": 20, # px
|
| 49 |
"border": "#0B1220", # dark outline
|
| 50 |
+
"border_hover": "#243447",
|
| 51 |
+
# defaults (overridden per card below)
|
| 52 |
+
"bg_top": "#FFFFFF",
|
| 53 |
+
"bg_bot": "#FBFCFE",
|
| 54 |
"title_color": "#0B1220",
|
| 55 |
"blurb_color": "#566275",
|
| 56 |
},
|
|
|
|
| 64 |
"pad_v": 12, # px
|
| 65 |
"pad_h": 20, # px
|
| 66 |
"radius": 14, # px
|
| 67 |
+
# premium navy CTA
|
| 68 |
+
"bg1": "#0B1220",
|
| 69 |
+
"bg2": "#162338",
|
| 70 |
"text": "#FFFFFF",
|
| 71 |
+
"border": "rgba(11,18,32,.55)",
|
| 72 |
},
|
| 73 |
}
|
| 74 |
|
| 75 |
# ========= CARDS (content + per-card overrides) =========
|
| 76 |
+
# Solid, very-light tints for a premium feel (no washed-out rgba)
|
| 77 |
CARDS = [
|
| 78 |
{
|
| 79 |
"title": "ST_Log_GR",
|
|
|
|
| 81 |
"url": "https://smart-thinking-gr.hf.space/",
|
| 82 |
"icon": ASSETS / "GR_logo.png",
|
| 83 |
"style": {
|
| 84 |
+
"bg_top": "#EAF7F1", # minty light
|
| 85 |
+
"bg_bot": "#F6FBF8",
|
| 86 |
+
"border": "#0F3D3E",
|
| 87 |
},
|
| 88 |
},
|
| 89 |
{
|
|
|
|
| 92 |
"url": "https://smart-thinking-sonic-ts.hf.space",
|
| 93 |
"icon": ASSETS / "Ts_logo.png",
|
| 94 |
"style": {
|
| 95 |
+
"bg_top": "#EAF7FD", # airy cyan
|
| 96 |
+
"bg_bot": "#F5FBFF",
|
| 97 |
+
"border": "#0E4A6E",
|
| 98 |
},
|
| 99 |
},
|
| 100 |
{
|
|
|
|
| 103 |
"url": "https://smart-thinking-sonic-tc.hf.space",
|
| 104 |
"icon": ASSETS / "Tc_logo.png",
|
| 105 |
"style": {
|
| 106 |
+
"bg_top": "#EEF0FF", # soft indigo
|
| 107 |
+
"bg_bot": "#F7F8FF",
|
| 108 |
+
"border": "#3E4EB8",
|
| 109 |
},
|
| 110 |
},
|
| 111 |
]
|
|
|
|
| 245 |
padding: var(--c-pv, var(--card-pv)) var(--c-ph, var(--card-ph));
|
| 246 |
background: linear-gradient(180deg, var(--c-bg-top, {card["bg_top"]}) 0%, var(--c-bg-bot, {card["bg_bot"]}) 100%);
|
| 247 |
border: var(--c-bw, var(--card-bw)) solid var(--c-border, var(--cardStroke));
|
| 248 |
+
/* Softer inner highlights → color shows more, keeps 3D */
|
| 249 |
box-shadow:
|
| 250 |
0 14px 32px rgba(2,20,35,.12),
|
| 251 |
0 1px 0 rgba(255,255,255,0.70) inset,
|
|
|
|
| 320 |
)
|
| 321 |
|
| 322 |
# ========= Hero =========
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
hero_html = img_tag(THEME["hero"]["logo"], "ST_LOG SUITE")
|
| 324 |
st.markdown(f"<div class='hero'>{hero_html}</div>", unsafe_allow_html=True)
|
| 325 |
|