diff options
| author | Tyler <tyler@tylerhoang.xyz> | 2026-05-13 22:39:50 -0700 |
|---|---|---|
| committer | Tyler <tyler@tylerhoang.xyz> | 2026-05-13 22:39:50 -0700 |
| commit | a457bea95358825e55dbc7f48d57183004121109 (patch) | |
| tree | eafafbfa017228bc1efd14a0c63f150576ace9f2 /components/overview.py | |
| parent | 6f1c3a6b73572b3ccc5281dba45de3bba5528f5f (diff) | |
Apply Prism design system — brass/ink palette, EB Garamond + IBM Plex typography
Implements the design kit: champagne brass accent (#C2AA7A), deep midnight
backgrounds, EB Garamond italic headings, IBM Plex Sans/Mono body and numbers,
terminal-density KPI cards, restyled sidebar brand mark, flat pill tabs, and a
global Plotly theme so all charts inherit the dark palette automatically.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'components/overview.py')
| -rw-r--r-- | components/overview.py | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/components/overview.py b/components/overview.py index 1bb65c2..9a0d162 100644 --- a/components/overview.py +++ b/components/overview.py @@ -118,22 +118,22 @@ def _score_card(info: dict) -> None: return color_map = { - "green": ("rgba(46,204,113,0.15)", "#7ce3a1"), - "yellow": ("rgba(243,156,18,0.15)", "#f0c040"), - "red": ("rgba(231,76,60,0.15)", "#ff8a8a"), - "neutral": ("rgba(255,255,255,0.05)", "#9aa0b0"), + "green": ("#15241A", "#4F8C5E"), + "yellow": ("#2A1F0F", "#C49545"), + "red": ("#2A1517", "#B5494B"), + "neutral": ("#181D26", "#5E5849"), } cards_html = "" for label, color, value, desc in signals: bg, fg = color_map[color] cards_html += ( - f'<div style="background:{bg};border:1px solid {fg}44;border-radius:10px;' - f'padding:0.5rem 0.75rem;flex:1;min-width:110px;">' - f'<div style="font-size:0.68rem;font-weight:600;color:#9aa0b0;text-transform:uppercase;' - f'letter-spacing:0.05em;margin-bottom:0.15rem;">{label}</div>' - f'<div style="font-size:0.85rem;font-weight:700;color:{fg};">{value}</div>' - f'<div style="font-size:0.68rem;color:#9aa0b0;margin-top:0.1rem;">{desc}</div>' + f'<div style="background:{bg};border:1px solid {fg}55;border-radius:2px;' + f'padding:8px 12px;flex:1;min-width:110px;">' + f'<div style="font-family:IBM Plex Sans,sans-serif;font-size:10px;font-weight:600;color:#5E5849;text-transform:uppercase;' + f'letter-spacing:0.12em;margin-bottom:3px;">{label}</div>' + f'<div style="font-family:IBM Plex Mono,monospace;font-size:0.875rem;font-weight:500;color:{fg};font-variant-numeric:tabular-nums;">{value}</div>' + f'<div style="font-family:IBM Plex Sans,sans-serif;font-size:0.75rem;color:#8E8676;margin-top:2px;">{desc}</div>' f'</div>' ) @@ -159,23 +159,28 @@ def _render_52w_bar(info: dict) -> None: st.markdown( f""" - <div style="margin:0.4rem 0 0.9rem 0;"> - <div style="display:flex;justify-content:space-between;font-size:0.72rem;color:#9aa0b0;margin-bottom:0.35rem;"> - <span>52W Low: {fmt_currency(low)}</span> - <span style="color:#c6cfdd;font-weight:600;"> - {fmt_currency(price)} · {pct:.0f}% of range + <div style="margin:8px 0 16px 0;"> + <div style="display:flex;justify-content:space-between; + font-family:'IBM Plex Mono',monospace;font-size:11px; + font-variant-numeric:tabular-nums; + color:#8E8676;margin-bottom:6px;"> + <span>{fmt_currency(low)}</span> + <span style="color:#C2AA7A;font-weight:500;"> + {fmt_currency(price)} · {pct:.0f}% </span> - <span>52W High: {fmt_currency(high)}</span> + <span>{fmt_currency(high)}</span> </div> - <div style="position:relative;height:7px;background:rgba(255,255,255,0.08);border-radius:4px;overflow:visible;"> + <div style="position:relative;height:3px;background:#222934;border-radius:999px;overflow:visible;"> <div style="position:absolute;left:0;width:{pct}%;height:100%; - background:linear-gradient(to right,#e74c3c,#f0b27a,#2ecc71);border-radius:4px;"></div> - <div style="position:absolute;left:calc({pct}% - 2px);top:-4px;width:4px;height:15px; - background:#fff;border-radius:2px;box-shadow:0 0 5px rgba(0,0,0,0.5);"></div> + background:#C2AA7A;border-radius:999px;"></div> + <div style="position:absolute;left:calc({pct}% - 1px);top:-4px;width:2px;height:11px; + background:#DCC79E;border-radius:1px;"></div> </div> - <div style="display:flex;justify-content:space-between;font-size:0.68rem;color:#9aa0b0;margin-top:0.3rem;"> - <span>+{from_low_pct:.1f}% above low</span> - <span>{to_high_pct:.1f}% below high</span> + <div style="display:flex;justify-content:space-between; + font-family:'IBM Plex Mono',monospace;font-size:10px; + color:#5E5849;margin-top:5px;"> + <span>+{from_low_pct:.1f}% from low</span> + <span>{to_high_pct:.1f}% to high</span> </div> </div> """, @@ -286,10 +291,10 @@ def _render_relative_chart(ticker: str, info: dict, period: str): y=subject_series.values, mode="lines", name=ticker.upper(), - line=dict(color="#4F8EF7", width=2.5), + line=dict(color="#C2AA7A", width=2.5), )) - palette = ["#7ce3a1", "#F7A24F", "#c084fc", "#ff8a8a", "#9ad1ff"] + palette = ["#7ce3a1", "#C49545", "#c084fc", "#ff8a8a", "#9ad1ff"] plotted = 1 for idx, label in enumerate(selected_labels): symbol = option_map[label] @@ -424,7 +429,7 @@ def render_overview(ticker: str): y=hist["Close"], mode="lines", name="Close", - line=dict(color="#4F8EF7", width=2), + line=dict(color="#C2AA7A", width=2), fill="tozeroy", fillcolor="rgba(79,142,247,0.08)", )) |
