-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
78 lines (71 loc) · 2.61 KB
/
Copy pathapp.py
File metadata and controls
78 lines (71 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -*- coding: utf-8 -*-
"""
YieldBridge — Fixed Income Analytics Platform
Entry point: navigation shell + global CSS injection.
Run with: streamlit run app.py
"""
import streamlit as st
from utils.styling import inject_css
st.set_page_config(
page_title="YieldBridge | Fixed Income Analytics",
page_icon="📈",
layout="wide",
initial_sidebar_state="expanded",
)
inject_css()
# ── Language initialisation (default: Chinese) ───────────────────────────────
if "lang" not in st.session_state:
st.session_state.lang = "zh"
# ── Sidebar branding + language toggle ───────────────────────────────────────
with st.sidebar:
st.markdown(
"""
<div style="
padding: 1.5rem 0 1.25rem;
text-align: center;
border-bottom: 1px solid #C9A84C;
margin-bottom: 1.25rem;
">
<div style="font-size: 1.8rem; margin-bottom: 0.25rem;">📈</div>
<h2 style="
color: #C9A84C;
margin: 0;
font-size: 1.5rem;
font-weight: 800;
letter-spacing: 0.04em;
font-family: 'Segoe UI', Arial, sans-serif;
">YieldBridge</h2>
<p id="subtitle" style="
color: #9CA3AF;
margin: 0.3rem 0 0;
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.14em;
font-family: 'Segoe UI', Arial, sans-serif;
">Fixed Income Analytics</p>
</div>
""",
unsafe_allow_html=True,
)
# Language toggle
lang_choice = st.radio(
"🌐",
options=["中文", "EN"],
index=0 if st.session_state.lang == "zh" else 1,
horizontal=True,
label_visibility="collapsed",
)
st.session_state.lang = "zh" if lang_choice == "中文" else "en"
st.markdown(
"<div style='margin-bottom:0.5rem; border-bottom:1px solid #1B3A6B;'></div>",
unsafe_allow_html=True,
)
# ── Multi-page navigation ─────────────────────────────────────────────────────
pg = st.navigation(
[
st.Page("pages/mortgage.py", title="房贷计算机 / Mortgage", icon="🏠"),
st.Page("pages/fixed_income.py", title="固定收益 / Fixed Income", icon="📊"),
st.Page("pages/glossary.py", title="CFA词汇表 / Glossary", icon="📖"),
]
)
pg.run()