-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
255 lines (210 loc) · 5.28 KB
/
index.html
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!doctype html>
<html lang=en>
<head>
<style>
body {
margin: 0;
}
* {
box-sizing: border-box;
}
html {
background-color: #151515;
color: white;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
padding: 2rem;
}
a,
a:visited {
color: #3794ff
}
section {
margin-bottom: 7rem;
}
h2 {
font-size: 2rem;
}
p {
font-style: italic;
opacity: 0.7;
}
td {
padding: 0 0 1rem 0;
}
td:last-child {
width: 50%;
text-align: right;
}
td:first-child {
width: 50%;
text-align: right;
font-style: italic;
opacity: 0.7;
}
button {
display: inline-block;
margin: 0;
padding: 0.5rem 0.75rem;
border: 0;
border-radius: 0.317rem;
background-color: #aaa;
color: #fff;
text-decoration: none;
font-weight: 700;
font-size: 1rem;
line-height: 1.5;
font-family: "Helvetica Neue", Arial, sans-serif;
cursor: pointer;
-webkit-appearance: none;
-webkit-font-smoothing: antialiased;
opacity: 0.9;
}
button:hover {
opacity: 1;
}
.flex {
display: flex;
flex-direction: row;
column-gap: 1rem;
}
section>div,
.flex>div {
flex: 1;
}
.big {
font-size: 5rem;
}
.center {
text-align: center;
}
.ease-in-out {
transition: 200ms ease-in-out;
}
.color-block {
display: inline-block;
height: 1rem;
width: 1rem;
margin-left: 0.5rem;
margin-bottom: -2px;
}
.grid {
display: grid;
grid-gap: 1rem;
grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
#historical-spending .marker {
display: none;
}
#networth-stacked .series {
opacity: 0.8;
}
#networth-stacked .series:hover {
opacity: 1;
stroke-width: 1px;
stroke: white;
}
</style>
<meta charset=utf-8>
<title>Monthly finances</title>
</head>
<body>
<div id=alert
style="background-color: #a49d78;
color: black;
position: absolute;
left: 0;
right: 0;
top: 0;
padding: 0.5rem 2rem;
font-size: 1.5rem;
">
This was made with sample data.
Check out <a style="color: #33486e" href=/writings/visualizing-personal-finances>the post</a> which explains more.
<button style="float: right;
color: black;
background-color: transparent;
padding: 0"
onclick="document.getElementById('alert').remove()">X</button>
</div>
<h1>Monthly report for October 2022</h1>
<section class=flex>
<div class="flex center" style="flex-direction: column">
<div class=flex style="align-items:center; height: 12rem">
<div>
<div class=big>$10,149</div>
<em>Income last month</em>
</div>
<div>
<div class=big>87.4%</div>
<em>Saved of yearly goal</em>
</div>
</div>
<div class=flex style="align-items:center">
<div>
<div class=big>$3,883</div>
<em>Discretionary spending last month <br/>
$6,696 total</em>
</div>
<div class=flex style="align-items: center; text-align: right">
<h2 style="flex: 0.9; font-size: 2rem">
Giving
</h2>
<ul style="flex: 1;
display: inline-block;
text-align: left;
font-size: 1.2rem;
list-style: none;
padding: 1rem;
border-left: 1px solid gray;
line-height: 2rem">
<li>
<a style="width: 7.4rem; text-align: right; display: inline-block" href="https://fosterangelsctx.org">Foster Angels</a>
$417
</li>
<li>
<a style="width: 7.4rem; text-align: right; display: inline-block" href="https://www.williamsoncountycasa.org">CASA WilCo</a>
$287
</li>
<li>
<a style="width: 7.4rem; text-align: right; display: inline-block" href="http://www.catholiccharitiesrgv.org">CCRGV</a>
$309
</li>
<ul>
</div>
</div>
</div>
<div id=savings class=flex style="height: 30rem"></div>
</section>
<section class=flex>
<div class=flex>
<div id=spending class=flex style="height: 40rem; justify-content: center"></div>
<div id=discretionary-spending class=flex style="height: 40rem; justify-content: center"></div>
</div>
</section>
<h1>Historical data</h1>
<section id=historical-spending class=flex>
<svg style="height: 40rem; width: 100%"></svg>
<div class=label style="min-width: 30rem"></div>
</section>
<section id=networth class=flex>
<div class=label style="min-width: 30rem"></div>
<svg style="height: 40rem; width: 100%"></svg>
</section>
<section id=yearly class=flex>
<svg style="height: 40rem; width: 100%"></svg>
<div class=label style="min-width: 30rem"></div>
</section>
<section id=yearly-normalized class=flex>
<div class=label style="min-width: 30rem"></div>
<svg style="height: 40rem; width: 100%"></svg>
</section>
<section id=networth-stacked>
<h2>Net worth by asset</h2>
<svg style="height: 60rem; width: 100%"></svg>
<div class=label></div>
</section>
<script src=./d3-7.6.1.js></script>
<script type=module src=./data.js></script>
<script type=module src=./index.js></script>
</body>
</html>