-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathabout.html
308 lines (277 loc) · 12.3 KB
/
about.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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>What is Rosplata</title>
<title data-translate-id="page-title">Rosplata</title>
<meta data-translate-id="description" data-translate-prop="content" name="description"
content="Rosplata is an opensource self hosted collaborative finance manager. Create budgets, share them with friends and easily split the bills" />
<meta data-translate-id="keywords" data-translate-prop="content" name="keywords"
content="opensource, collaborative, finance, budget, split, bill" />
<link rel="canonical" href="https://ros-plata.ru" />
<link rel="icon" href="/images/favicons/icon.svg" type="image/svg+xml">
<link rel="stylesheet" async href="/styles/paper.min.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@800&display=swap" rel="stylesheet">
<script src="https://d3js.org/d3.v4.js"></script>
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script>
<style type="text/css">
body,
html {
margin: 0;
padding: 0;
position: relative;
}
#stats {
max-width: 60%;
margin: auto;
}
.stats__block {
display: flex;
animation: reveal-left linear;
animation-timeline: scroll(block root);
animation-range: 0 100vh;
}
.stats__block:nth-child(2) {
animation-name: reveal-right;
}
@keyframes reveal-left {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(0);
}
}
@keyframes reveal-right {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
#welcome {
position: relative;
z-index: 1;
padding: 0 1rem;
}
#welcome::after {
content: '';
z-index: -1;
background: linear-gradient(#aacdfc, beige, transparent);
background-size: contain;
height: 80vh;
position: absolute;
top: 0;
left: 0;
width: 100%;
}
#welcome h1 {
color: white;
font-family: 'Montserrat', sans-serif;
margin: 0;
display: flex;
justify-content: space-between;
align-items: baseline;
font-size: 10vw;
}
#welcome p {
max-width: 50%;
margin: 2rem auto;
line-height: 1.6;
}
#welcome h1 .dash {
flex-grow: 1;
border-bottom: 1vw solid white;
position: relative;
top: -2vw;
font-size: medium;
}
@media (min-width: 320px) and (max-width: 480px) {
.stats__block {
flex-direction: column;
overflow: auto;
}
#stats {
max-width: 100%;
}
#welcome p {
max-width: 80%;
}
}
</style>
</head>
<body>
<section id="welcome">
<h1>Ros <span class="dash"></span>plata</h1>
<p>Rosplata is an opensource self hosted collaborative finance manager. Create budgets, share them with friends and easily split the bills.</p>
<p><strong>This is an app from the future.</strong></p>
<p>Most likely you won't be able to run it now.</p>
<p>Imagine a situation: you and your friends go to a bar (possibly abroad with no internet available). You order something, have fun. In the end you get the check and no one remembers what did they order and who spent how much. This is exactly the problem Rosplata is here to solve.</p>
<p><a href="https://github.com/johnSamilin/rosplata" target="_blank">Github</a></p>
</section>
<section id="stats">
<div class="stats__block">
<div class="stats__block--langs"></div>
<div>
<h3>Lanugages</h3>
<p>The most popular language among our users is <strong id="toplang"></strong></p>
<p>Besides, there are others: <span id="langs"></span></p>
</div>
</div>
<div class="stats__block">
<div>
<h3>Operating systems</h3>
<p>Most of you use <strong id="topos"></strong>. But also <span id="os"></span></p>
</div>
<div class="stats__block--os"></div>
</div>
<div class="stats__block">
<div class="stats__block--browsers"></div>
<div>
<h3>Browsers</h3>
<p>It's worth noting that <strong id="topbrowser"></strong> most widely-spread. Of course, <span
id="browsers"></span> are used as well.</p>
</div>
</div>
<script>
function drawDonut(id, data) {
// set the dimensions and margins of the graph
const width = 500
const height = 450
const margin = 40
// The radius of the pieplot is half the width or half the height (smallest one). I subtract a bit of margin.
const radius = Math.min(width, height) / 2 - margin
// append the svg object to the div called 'my_dataviz'
const svg = d3.select(`.stats__block--${id}`)
.append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
// Create dummy data
// const data = { a: 9, b: 20, c: 30, d: 8, e: 12, f: 3, g: 7, h: 14 }
// set the color scale
const color = d3.scaleOrdinal()
.domain(Object.keys(data))
.range(d3.schemeDark2);
// Compute the position of each group on the pie:
const pie = d3.pie()
.sort(null) // Do not sort group by size
.value(function (d) { return d.value; })
const data_ready = pie(d3.entries(data))
// The arc generator
const arc = d3.arc()
.innerRadius(radius * 0.5) // This is the size of the donut hole
.outerRadius(radius * 0.8)
// Another arc that won't be drawn. Just for labels positioning
const outerArc = d3.arc()
.innerRadius(radius * 0.9)
.outerRadius(radius * 0.9)
// Build the pie chart: Basically, each part of the pie is a path that we build using the arc function.
svg
.selectAll('allSlices')
.data(data_ready)
.enter()
.append('path')
.attr('d', arc)
.attr('fill', function (d) { return (color(d.data.key)) })
.attr("stroke", "white")
.style("stroke-width", "2px")
.style("opacity", 0.7)
// Add the polylines between chart and labels:
svg
.selectAll('allPolylines')
.data(data_ready)
.enter()
.append('polyline')
.attr("stroke", "black")
.style("fill", "none")
.attr("stroke-width", 1)
.attr('points', function (d) {
const posA = arc.centroid(d) // line insertion in the slice
const posB = outerArc.centroid(d) // line break: we use the other arc generator that has been built only for that
const posC = outerArc.centroid(d); // Label position = almost the same as posB
const midangle = d.startAngle + (d.endAngle - d.startAngle) / 2 // we need the angle to see if the X position will be at the extreme right or extreme left
posC[0] = radius * 0.95 * (midangle < Math.PI ? 1 : -1); // multiply by 1 or -1 to put it on the right or on the left
return [posA, posB, posC]
})
// Add the polylines between chart and labels:
svg
.selectAll('allLabels')
.data(data_ready)
.enter()
.append('text')
.text(function (d) { console.log(d.data.key); return d.data.key })
.attr('transform', function (d) {
const pos = outerArc.centroid(d);
const midangle = d.startAngle + (d.endAngle - d.startAngle) / 2
pos[0] = radius * 0.99 * (midangle < Math.PI ? 1 : -1);
return 'translate(' + pos + ')';
})
.style('text-anchor', function (d) {
const midangle = d.startAngle + (d.endAngle - d.startAngle) / 2
return (midangle < Math.PI ? 'start' : 'end')
})
}
fetch('/api/stats')
.then(res => res.json())
.then(data => {
let topLang = '';
let topLangOccurancies = 0;
const langs = [];
Object.entries(data.langsMap).forEach(([lang, count]) => {
if (topLangOccurancies < count) {
topLang = lang;
topLangOccurancies = count;
}
langs.push(lang);
});
document.querySelector('#toplang').textContent = topLang;
document.querySelector('#langs').textContent = langs.join(', ');
drawDonut('langs', data.langsMap);
let topOs;
let topBrowser;
let topOsOccurancies = 0;
let topBrowserOccurancies = 0;
const os = [];
const osChartData = {};
const browsers = [];
const browsersChartData = {};
Object.entries(data.uasMap.os).forEach(([name, versions]) => {
osChartData[name] = 0;
Object.entries(versions).forEach(([version, count]) => {
osChartData[name] += 1;
if (topOsOccurancies < count) {
topOs = `${name} ${version}`;
topOsOccurancies = count;
}
os.push(`${name} ${version}`);
})
});
drawDonut('os', osChartData);
Object.entries(data.uasMap.browser).forEach(([name, versions]) => {
browsersChartData[name] = 0;
Object.entries(versions).forEach(([version, count]) => {
browsersChartData[name] += 1;
if (topBrowserOccurancies < count) {
topBrowser = `${name} ${version}`;
topBrowserOccurancies = count;
}
browsers.push(`${name} ${version}`);
})
});
drawDonut('browsers', browsersChartData);
document.querySelector('#topos').textContent = topOs;
document.querySelector('#os').textContent = os.join(', ');
document.querySelector('#topbrowser').textContent = topBrowser;
document.querySelector('#browsers').textContent = browsers.join(', ');
})
</script>
</section>
</body>
</html>