-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
96 lines (83 loc) · 2.57 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
<!DOCTYPE html>
<html>
<head>
<title>Conservaround</title>
<meta name="description"
content="Numbers to human-friendly strings, rounded conservatively">
<link id="favicon"
rel="icon"
href="https://glitch.com/edit/favicon-app.ico"
type="image/x-icon">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/style.css">
<script src="https://code.jquery.com/jquery-3.4.1.min.js" defer></script>
<script src="/cround.js" defer></script>
</head>
<body>
<header>
<h1>Conservaround</h1>
</header>
<main>
<form autocomplete="off" id="nform">
<input id="nfield" tabindex="1"
type="text" size="40" placeholder="123.456">
±
<input id="quantum" tabindex="2"
type="text" size="10" value="0.1">
<!--
<input type="submit" style="display: none">
-->
   
<input value="Submit" type="submit" tabindex="3"
class="pure-button pure-button-primary">
</form>
<br>
<div id="ancient-browser-warning"></div>
<script>
// -----------------------------------------------------------------------------
function $(id) { return document.getElementById(id) } // convenience function
function ancient_browser_check() {
"use strict" // does this matter?
try { eval("let foo = (x)=>x+1") } // feature detection: "let" & arrow funcs
catch (e) { return true } // bad browser, not understanding ES6
return false // good browser, not being ancient
}
if (ancient_browser_check()) {
$('ancient-browser-warning').innerHTML =
"<h1>Ancient browser warning: nothing's gonna work here!</h1>"
}
// -----------------------------------------------------------------------------
</script>
<table>
<thead>
<tr>
<th><div title="number as the user entered it">input</div></th>
<th></th>
<th><div title="human-friendly rounded version">≈</div></th>
<th><div title="round conservatively down (err low)">err⬇</div></th>
<th><div title="round conservatively up (err high)">err⬆</div></th>
<th><div title="aka what quantize() returns">inferred<br>precision</div></th>
</tr>
</thead>
<tbody id="ntable">
</tbody>
</table>
<!--
🤖 robot face
💻 computer
≈ approx
웃 stick figure
⬇ thick down arrow
⬆ thick up arrow
-->
</main>
<footer>
<a href="https://glitch.com/#!/project/conservaround"
title="This is where the code for this lives">
Made by dreev of Beeminder
</a>
</footer>
</body>
</html>