-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
176 lines (154 loc) · 4.53 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
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<head>
<title>How much is?</title>
<script src='d3.min.js'></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48290024-1', 'tamc.github.io');
ga('send', 'pageview');
</script>
<style>
body {
font-family: Arial, sans-serif;
}
div {
box-sizing: border-box;
}
h2 {
font-size: 1em;
margin-bottom: 0em;
}
p {
margin: 0.1em;
}
em {
font-weight: normal;
background-color: yellow;
}
/* Thanks to http://davidwalsh.name/css-slide */
div.slider {
overflow-y: hidden;
max-height: 1000px; /* approximate max height */
transition-property: max-height, padding-top, padding-bottom;
transition-duration: 0.5s;
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
}
div.slider.closed {
max-height: 0px;
padding-top: 0px !important;
padding-bottom: 0px !important;
}
div.round {
padding: 10px;
border: solid black 1px;
border-radius: 5px;
margin-top: 10px;
}
#wrapper {
margin: 10px auto;
width: 100%;
max-width: 35em;
}
#question {
font-size: 2em;
}
input#input {
font-size: 1em;
width: 250px;
color: red;
}
.barwrapper {
margin: 0;
padding: 0;
border: 0;
}
.outerbar {
height: 10px;
border: solid black 1px;
margin-right: 1%;
display: inline-block;
}
.innerbar {
height: 8px;
background-color: red;
}
.comparison .description, .preciseValue {
font-size: smaller;
color: grey;
}
.comparison a {
color: grey;
}
#input_description b, .unit b {
font-weight: normal;
}
#apology {
background-color: yellow;
}
</style>
</head>
<body>
<div id='wrapper'>
<div id='question' class='round'>
How much is <input autofocus id='input' placeholder='type here'>?
</div>
<div id='apology' class='round slider closed'>
Sorry. I don't know that unit. Please <a href='mailto:[email protected]'>drop me an email</a> with the unit and some context as to where it appears.
</div>
<div id='examples' class='round slider'>
I wrote this tool to help me understand numbers in different units.
Try:
<ul>
<li>
Energy:
<a class='example' href='#'>100 TWh</a>,
<a class='example' href='#'>123 ktoe</a>,
<a class='example' href='#'>1000 therms</a> or
<a class='example' href='#'>1 boe</a>
</li>
<li>
Power:
<a class='example' href='#'>100 MW</a>,
<a class='example' href='#'>10 mscm/d</a>
</li>
<li>
Area:
<a class='example' href='#'>100 ares</a>
<a class='example' href='#'>10.3 hectares</a> or
<a class='example' href='#'>19 m2</a>
</li>
<li>
Emissions:
<a class='example' href='#'>1 pgC</a> or
<a class='example' href='#'>700 MtCO2e</a>
</li>
</ul>
You can also see <a href='https://github.com/tamc/how-much-is/blob/gh-pages/units.tsv'>a list of all the units that this tool knows</a>.
</div>
<div id='input_description' class='round slider closed'>
<h2 class='name'></h2>
<p><span class='name'></span><span class='description'></span></p>
</div>
<div id='comparisons' class='round slider closed'>
<h2 class='title'></h2>
</div>
<div id='output' class='round slider closed'>
<h2 class='title'></h2>
</div>
<div id='footnote' class='round'>
<p>This tool was produced by <a href='http://tom.counsell.org'>Tom Counsell</a>. It is open source. Make a copy and report problems at <a href='http://github.com/tamc/how-much-is'>github</a>.
The underlying data is in <a href='units.tsv' download>units.tsv</a> and <a href='comparisons.tsv'>comparisons.tsv</a> (You can open those files in Excel).
I have written <a href='https://github.com/tamc/how-much-is/blob/gh-pages/README.md'>some instructions</a> on how to add or edit units.</p>
</div>
<script src='application.js' type='text/javascript'></script>
<!--[if IE 9 ]>
<script type='text/javascript'>
inputForm.on('selectionchange', userInput);
</script>
<![endif]-->
</body>