-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
242 lines (213 loc) · 6.13 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
<!DOCTYPE HTML>
<html>
<head>
<title>Population calculator</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.js"></script>
<script src="assets/rickshaw.min.js"></script>
<script src="assets/geller.js"></script>
<link rel="stylesheet" type="text/css" href="assets/rickshaw.min.css">
<link rel="icon" type="image/png" href="assets/083.png">
<meta charset="utf-8">
<style>
body {
font: 14px Arial, Helvetica, sans-serif;
margin:0;
padding:0;
background: #fff;
}
#controls {
margin: 30px auto 0 40px;
vertical-align: middle;
}
#controls > div
{
margin: 20px 0;
}
#controls label span:hover {
background: #666;
border: solid 1px #222;
}
#controls label span {
cursor: pointer;
}
#controls span {
color: #fff;
background: #999;
border-radius: 22px;
padding: 1px 8px;
display: inline-block;
margin-left:4px;
text-shadow: 1px 1px 0 #777;
border: solid 1px transparent;
transition: 0.3s ease all;
}
#controls * {
vertical-align: middle;
}
.wrap {
margin: 0 auto;
padding: 0 30px;
max-width: 1000px;
position: relative;
box-sizing: border-box;
}
label {
width: 200px;
display: inline-block;
}
input[type=range] {
width: 100%;
}
input[type=text]:focus, input[type=text]:hover {
background: #fafafa;
box-shadow: 0 0 7px rgba(0,0,0,0.1) inset;
transition: 0.2s all ease;
}
input[type=text] {
border: solid 1px #ccc;
border-radius: 4px;
padding: 2px 5px;
font: bold 30px Arial, sans-serif;
border-width: 0;
color: #666;
outline: none;
width: 420px;
display: block;
}
#y_axis {
position: absolute;
top: 0;
bottom: 0;
width: 40px;
}
#chart {
margin-left: 40px;
}
header h1 {
font: bold 50px Arial, Helvetica, sans-serif;
text-rendering: optimizeLegibility ;
margin: 20px 0 0 0;
display: inline-block;
}
header {
margin-bottom: 40px;
padding: 10px;
text-rendering: optimizeLegibility ;
}
header a {
text-decoration: none;
color: #000;
}
footer
{
padding: 50px;
background: #fafaf8;
color:#999;
text-shadow: 1px 1px #fff;
font-size:12px;
margin-top: 200px;
border-top: solid 1px #eee;
}
footer a {
color: #999;
}
select {
padding: 5px 10px;
border: solid 3px #aaa;
border-radius: 4px;
}
#storage {
margin-top: 100px;
font-size:22px;
list-style-type: none;
}
#storage li:first-child {
margin-top: 10px;
}
#storage:not(:empty):before {
content: 'Saved graphs';
font: bold 42px Arial;
color: #999;
}
#storage span {
margin-left: 20px;
font-size: 13px;
cursor: pointer;
color: #c33;
}
#storage a {
text-decoration: none;
color:#777;
font-weight: bold
}
#storage a:hover {
text-decoration: underline;
}
#message {
opacity: 0;
position: fixed;
top: 10px;
right: 10px;
width: 200px;
background: rgba(44,44,44,0.95);
color: #eee;
padding: 10px;
border-radius: 5px;
box-shadow: 0 0 16px rgba(0,0,0,0.2);
transition: 0.1s opacity;
}
#message.show {
opacity: 1;
}
.x_label {
display: none;
}
::-webkit-input-placeholder {
color: #bbb;
}
:-moz-placeholder {
color: #bbb;
}
::-moz-placeholder {
color: #bbb;
}
:-ms-input-placeholder {
color: #bbb;
}
</style>
</head>
<body>
<header>
<div class="wrap" style="padding-left:80px">
<h1><a href="/population-calculator/">Population calculator</a></h1>
<input class="vars" type="text" id="title" placeholder="(type title to save...)">
</div>
</header>
<div class="wrap">
<div id="chart_container">
<div id="y_axis"></div>
<div id="chart"></div>
</div>
<div id="controls">
<div><label for="birth_rate">Total fertility rate <span data-for="birth_rate" id="birth_rate_v"></span></label> <input class="vars" type="range" min="0" max="10" step="0.01" id="birth_rate"></div>
<div>Growth rate (yearly) <span data-for="growth_rate" id="growth_rate"></span></div>
<div><label for="immigration">Immigration/year <span data-for="immigration" id="immigration_v"></span></label> <input class="vars" type="range" min="0" max="100000" step="100" id="immigration"></div>
<div><label for="start_pop">Starting population <span data-for="start_pop" id="start_pop_v"></span></label> <input class="vars" type="range" min="0" max="10000000" step="1000" id="start_pop" value=""></div>
<div><label for="birth_age">First birth given (age) <span data-for="birth_age" id="birth_age_v"></span></label> <input class="vars" type="range" min="16" max="40" step="1" id="birth_age" value=""></div>
<div><label for="human_age">Human age (average) <span data-for="human_age" id="human_age_v"></span></label> <input class="vars" type="range" min="30" max="1000" step="1" id="human_age" value=""></div>
<div><label for="timespan">Timespan (years) <span data-for="timespan" id="timespan_v"></span></label> <input class="vars" type="range" min="10" max="1000" step="1" id="timespan" value=""></div>
<div>
<label for="pyramid">Age pyramid</label>
<select class="vars" id="pyramid">
<option value="flat">Flat</option>
<option value="youth">Ages 10-40 emphasized</option>
</select>
</div>
</div>
<ul id="storage"></ul>
</div>
<footer><div class="wrap"><p>Population / demographics calculator</p><p>© <a href="https://github.com/ile/population-calculator">Ilkka Huotari 2013</a></p></div></footer>
<a href="https://github.com/ile/population-calculator"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<script src="src/index.js"></script>
</body>
</html>