Spaces:
Running
Running
Upload 14 files
Browse files- interface/about_interface.py +2 -2
- interface/portfolio_rebalancing_interface.py +3 -3
- modules/portfolio_rebalancing.py +3 -2
- modules/retirement_planning.py +1 -1
- style.css +43 -62
interface/about_interface.py
CHANGED
@@ -13,7 +13,7 @@ def render():
|
|
13 |
|
14 |
# Portfolio Rebalancing Tool Section
|
15 |
create_tool_section(
|
16 |
-
"
|
17 |
"""
|
18 |
# ν¬νΈν΄λ¦¬μ€ 리밸λ°μ± λꡬ
|
19 |
|
@@ -216,7 +216,7 @@ def render():
|
|
216 |
|
217 |
# Retirement Planning Tool Section
|
218 |
create_tool_section(
|
219 |
-
"
|
220 |
"""
|
221 |
# μν΄ κ³ν λꡬ
|
222 |
|
|
|
13 |
|
14 |
# Portfolio Rebalancing Tool Section
|
15 |
create_tool_section(
|
16 |
+
"π Portfolio",
|
17 |
"""
|
18 |
# ν¬νΈν΄λ¦¬μ€ 리밸λ°μ± λꡬ
|
19 |
|
|
|
216 |
|
217 |
# Retirement Planning Tool Section
|
218 |
create_tool_section(
|
219 |
+
"π
Retirement Planning",
|
220 |
"""
|
221 |
# μν΄ κ³ν λꡬ
|
222 |
|
interface/portfolio_rebalancing_interface.py
CHANGED
@@ -15,9 +15,9 @@ examples = [
|
|
15 |
|
16 |
portfolio_inputs = [
|
17 |
gr.Dropdown(label="π± Main Currency", choices=currency_codes, value="KRW", info="Assets converted to main currency."),
|
18 |
-
gr.Textbox(label="
|
19 |
-
gr.Number(label="
|
20 |
-
gr.Slider(label="
|
21 |
]
|
22 |
|
23 |
output = gr.HTML()
|
|
|
15 |
|
16 |
portfolio_inputs = [
|
17 |
gr.Dropdown(label="π± Main Currency", choices=currency_codes, value="KRW", info="Assets converted to main currency."),
|
18 |
+
gr.Textbox(label="π Holdings", lines=2, info="Format: ticker currency quantity weight, ... ", placeholder="e.g., SCHD USD 500 8, QQQ USD 200 2", value="SCHD USD 500 8,\nQQQ USD 200 2,\n458730 krw 1000 8,\n368590 krw 1000 2"),
|
19 |
+
gr.Number(label="π§ Cash", value=10000000),
|
20 |
+
gr.Slider(label="πͺ£ Cash Ratio (%)", value=15, minimum=0, maximum=100, step=1)
|
21 |
]
|
22 |
|
23 |
output = gr.HTML()
|
modules/portfolio_rebalancing.py
CHANGED
@@ -90,8 +90,9 @@ def get_portfolio_rebalancing_info(portfolio, target_weights, main_currency_cash
|
|
90 |
<div>
|
91 |
<div style="margin-bottom: 1.5rem;">
|
92 |
<!-- μ 체 νκ°κΈμ‘ νμ -->
|
93 |
-
<div style="font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 1.5rem;">
|
94 |
-
<span style='font-size: 1.5rem; font-weight: bold; color: #1678fb'>{currency_symbol}{total_value:,.0f}</span>
|
|
|
95 |
<hr style="margin: 1.5rem 0;">
|
96 |
</div>
|
97 |
</div>
|
|
|
90 |
<div>
|
91 |
<div style="margin-bottom: 1.5rem;">
|
92 |
<!-- μ 체 νκ°κΈμ‘ νμ -->
|
93 |
+
<div style="font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 1.5rem;">Market Value</div>
|
94 |
+
<span style='font-size: 1.5rem; font-weight: bold; color: #1678fb'>{currency_symbol}{total_value:,.0f}</span>
|
95 |
+
As of {current_time}
|
96 |
<hr style="margin: 1.5rem 0;">
|
97 |
</div>
|
98 |
</div>
|
modules/retirement_planning.py
CHANGED
@@ -84,7 +84,7 @@ def retirement_planning(current_age=None, retirement_age=None, current_investmen
|
|
84 |
</div>
|
85 |
<h3>Dividend Income After Retirement</h3>
|
86 |
<div class='table-container'>
|
87 |
-
<table
|
88 |
<thead>
|
89 |
<tr>
|
90 |
<th>Age</th>
|
|
|
84 |
</div>
|
85 |
<h3>Dividend Income After Retirement</h3>
|
86 |
<div class='table-container'>
|
87 |
+
<table>
|
88 |
<thead>
|
89 |
<tr>
|
90 |
<th>Age</th>
|
style.css
CHANGED
@@ -9,9 +9,6 @@
|
|
9 |
@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');
|
10 |
@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400;700&display=swap');
|
11 |
|
12 |
-
/* Comic Sans MS */
|
13 |
-
|
14 |
-
|
15 |
#col-container {
|
16 |
margin: 0 auto;
|
17 |
max-width: 100%;
|
@@ -23,9 +20,9 @@
|
|
23 |
}
|
24 |
|
25 |
.wrap-text {
|
26 |
-
word-wrap: break-word;
|
27 |
-
overflow-wrap: break-word;
|
28 |
-
white-space: normal;
|
29 |
}
|
30 |
|
31 |
:root {
|
@@ -41,8 +38,8 @@
|
|
41 |
--sell-color: #f44336;
|
42 |
--highlight-edit-bg-color-light: #fff2cc;
|
43 |
--highlight-edit-text-color-light: #0000ff;
|
44 |
-
--highlight-edit-bg-color-dark: hsl(45, 100%, 70%);
|
45 |
-
--highlight-edit-text-color-dark: hsl(240, 100%, 50%);
|
46 |
--highlight-yellow-bg-color-light: #ffeb3b;
|
47 |
--highlight-yellow-bg-color-dark: #ffca28;
|
48 |
--highlight-yellow-text-color-light: #000000;
|
@@ -116,27 +113,10 @@
|
|
116 |
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
117 |
}
|
118 |
|
119 |
-
/* .container {
|
120 |
-
font-size: 1.2rem;
|
121 |
-
margin-bottom: 15px;
|
122 |
-
padding: 20px;
|
123 |
-
border: 1px solid #ddd;
|
124 |
-
border-radius: 5px;
|
125 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
126 |
-
background-color: var(--highlight-color-light);
|
127 |
-
} */
|
128 |
-
|
129 |
-
|
130 |
-
/* λ€ν¬λͺ¨λ μ€νμΌ */
|
131 |
@media (prefers-color-scheme: dark) {
|
132 |
-
/* .container {
|
133 |
-
background-color: var(--highlight-color-dark);
|
134 |
-
}
|
135 |
-
*/
|
136 |
-
|
137 |
.highlight-yellow {
|
138 |
background-color: var(--highlight-yellow-bg-color-dark);
|
139 |
-
color: var
|
140 |
}
|
141 |
|
142 |
.highlight-black {
|
@@ -157,61 +137,63 @@
|
|
157 |
.buy-sell, .highlight-black, .highlight-yellow, .highlight-sky, .highlight-edit {
|
158 |
box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
|
159 |
}
|
160 |
-
|
161 |
}
|
162 |
-
|
163 |
.table-container {
|
164 |
-
|
165 |
-
overflow
|
166 |
-
|
|
|
|
|
|
|
167 |
}
|
168 |
-
|
169 |
.table-container table {
|
170 |
width: 100%;
|
171 |
border-collapse: collapse;
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
padding: 8px 16px;
|
178 |
-
border: 1px solid #ddd;
|
179 |
-
background: #fff;
|
180 |
-
/* white-space: nowrap; */
|
181 |
text-align: left;
|
182 |
-
|
183 |
}
|
184 |
-
|
185 |
-
.table-container
|
186 |
-
background: #
|
187 |
}
|
188 |
-
|
189 |
-
.table-container th
|
190 |
-
|
191 |
position: sticky;
|
192 |
-
|
193 |
-
background: #f9f9f9;
|
194 |
z-index: 2;
|
195 |
}
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
}
|
201 |
-
|
202 |
-
/* λ€ν¬ λͺ¨λ */
|
203 |
@media (prefers-color-scheme: dark) {
|
204 |
.table-container {
|
205 |
-
border: 1px
|
206 |
}
|
207 |
-
|
208 |
.table-container th,
|
209 |
.table-container td {
|
210 |
-
border: 1px
|
211 |
background: #333;
|
212 |
color: #ccc;
|
213 |
}
|
214 |
-
|
215 |
.table-container thead {
|
216 |
background: #444;
|
217 |
}
|
@@ -221,8 +203,7 @@
|
|
221 |
background: #444;
|
222 |
}
|
223 |
|
224 |
-
/* λ€ν¬ λͺ¨λ λ§μ°μ€ μ€λ² ν¨κ³Ό */
|
225 |
.table-container tr:hover td {
|
226 |
-
background: #
|
227 |
}
|
228 |
}
|
|
|
9 |
@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');
|
10 |
@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400;700&display=swap');
|
11 |
|
|
|
|
|
|
|
12 |
#col-container {
|
13 |
margin: 0 auto;
|
14 |
max-width: 100%;
|
|
|
20 |
}
|
21 |
|
22 |
.wrap-text {
|
23 |
+
word-wrap: break-word;
|
24 |
+
overflow-wrap: break-word;
|
25 |
+
white-space: normal;
|
26 |
}
|
27 |
|
28 |
:root {
|
|
|
38 |
--sell-color: #f44336;
|
39 |
--highlight-edit-bg-color-light: #fff2cc;
|
40 |
--highlight-edit-text-color-light: #0000ff;
|
41 |
+
--highlight-edit-bg-color-dark: hsl(45, 100%, 70%);
|
42 |
+
--highlight-edit-text-color-dark: hsl(240, 100%, 50%);
|
43 |
--highlight-yellow-bg-color-light: #ffeb3b;
|
44 |
--highlight-yellow-bg-color-dark: #ffca28;
|
45 |
--highlight-yellow-text-color-light: #000000;
|
|
|
113 |
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
114 |
}
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
@media (prefers-color-scheme: dark) {
|
|
|
|
|
|
|
|
|
|
|
117 |
.highlight-yellow {
|
118 |
background-color: var(--highlight-yellow-bg-color-dark);
|
119 |
+
color: var(--highlight-yellow-text-color-dark) !important;
|
120 |
}
|
121 |
|
122 |
.highlight-black {
|
|
|
137 |
.buy-sell, .highlight-black, .highlight-yellow, .highlight-sky, .highlight-edit {
|
138 |
box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
|
139 |
}
|
|
|
140 |
}
|
141 |
+
|
142 |
.table-container {
|
143 |
+
width: 100%;
|
144 |
+
overflow: auto;
|
145 |
+
margin-bottom: 20px;
|
146 |
+
position: relative;
|
147 |
+
max-height: 600px;
|
148 |
+
/* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
|
149 |
}
|
150 |
+
|
151 |
.table-container table {
|
152 |
width: 100%;
|
153 |
border-collapse: collapse;
|
154 |
+
}
|
155 |
+
|
156 |
+
.table-container th, .table-container td {
|
157 |
+
border: 1px hidden #ddd;
|
158 |
+
padding: 8px;
|
|
|
|
|
|
|
|
|
159 |
text-align: left;
|
160 |
+
background-color: var(--background-color-light);
|
161 |
}
|
162 |
+
|
163 |
+
.table-container tr:hover td {
|
164 |
+
background: #e7f9ef;
|
165 |
}
|
166 |
+
|
167 |
+
.table-container th {
|
168 |
+
background-color: var(--highlight-color-light);
|
169 |
position: sticky;
|
170 |
+
top: 0;
|
|
|
171 |
z-index: 2;
|
172 |
}
|
173 |
+
|
174 |
+
.table-container td:first-child, .table-container th:first-child {
|
175 |
+
position: sticky;
|
176 |
+
left: 0;
|
177 |
+
z-index: 1;
|
178 |
+
background-color: var(--highlight-color-light);
|
179 |
+
}
|
180 |
+
|
181 |
+
.table-container th:first-child {
|
182 |
+
z-index: 3;
|
183 |
}
|
184 |
+
|
|
|
185 |
@media (prefers-color-scheme: dark) {
|
186 |
.table-container {
|
187 |
+
border: 1px hidden #444;
|
188 |
}
|
189 |
+
|
190 |
.table-container th,
|
191 |
.table-container td {
|
192 |
+
border: 1px hidden #444;
|
193 |
background: #333;
|
194 |
color: #ccc;
|
195 |
}
|
196 |
+
|
197 |
.table-container thead {
|
198 |
background: #444;
|
199 |
}
|
|
|
203 |
background: #444;
|
204 |
}
|
205 |
|
|
|
206 |
.table-container tr:hover td {
|
207 |
+
background: #e7f9ef;
|
208 |
}
|
209 |
}
|