-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
164 lines (147 loc) · 7.58 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
<!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">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Codometer</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/codometer.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body role="document">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Codometer</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#">Top</a></li>
<li><a href="#about">About</a></li>
<li><a href="#method">How does it work?</a></li>
<li><a href="#source">Source code</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container" role="main">
<div class="row rowoffset">
<div class="col-md-12 text-center">
<canvas id="keyboardCanvas" width="960" height="320"></canvas>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<button type="button" class="btn btn-primary btn-lg btn-block" id="buttonStart">Codometrify!</button>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-default btn-lg btn-block dropdown-toggle" data-toggle="dropdown">
Layout <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#" onclick="set_layout(0);">German (QWERTZ)</a></li>
<li><a href="#" onclick="set_layout(1);">English UK (QWERTY)</a></li>
</ul>
</div>
</div>
<div class="col-md-6">
<div class="input-group input-group-lg">
<span class="input-group-addon">Total distance</span>
<input type="text" class="form-control" placeholder="0" id="total" readonly>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="input-group">
<span class="input-group-addon" style="background-color: #ca8142; color: #FFFFFF">L1</span>
<input type="text" class="form-control" placeholder="0" id="l1" readonly>
<span class="input-group-addon" style="background-color: #cac542; color: #FFFFFF">L2</span>
<input type="text" class="form-control" placeholder="0" id="l2" readonly>
<span class="input-group-addon" style="background-color: #8bca42; color: #FFFFFF">L3</span>
<input type="text" class="form-control" placeholder="0" id="l3" readonly>
<span class="input-group-addon" style="background-color: #47ca42; color: #FFFFFF">L4</span>
<input type="text" class="form-control" placeholder="0" id="l4" readonly>
<span class="input-group-addon" style="background-color: #42ca81; color: #FFFFFF">L5</span>
<input type="text" class="form-control" placeholder="0" id="l5" readonly>
<span class="input-group-addon" style="background-color: #42cac5; color: #FFFFFF">R1</span>
<input type="text" class="form-control" placeholder="0" id="r1" readonly>
<span class="input-group-addon" style="background-color: #428bca; color: #FFFFFF">R2</span>
<input type="text" class="form-control" placeholder="0" id="r2" readonly>
<span class="input-group-addon" style="background-color: #4247ca; color: #FFFFFF">R3</span>
<input type="text" class="form-control" placeholder="0" id="r3" readonly>
<span class="input-group-addon" style="background-color: #8142ca; color: #FFFFFF">R4</span>
<input type="text" class="form-control" placeholder="0" id="r4" readonly>
<span class="input-group-addon" style="background-color: #c542ca; color: #FFFFFF">R5</span>
<input type="text" class="form-control" placeholder="0" id="r5" readonly>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<textarea class="form-control" rows="10" id="inputText">This is an example text for Codometer!</textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2><a name="about">About Codometer</a></h2>
<div>Codometer calculates how much your fingers need to move on a PC keyboard in order to type in a given text. Distances are output for each finger and as a total distance of all fingers.</div>
<div>This program was created for a programming contest at <a href="https://kif.fsinf.de/wiki/KIF425:Hauptseite">KIF 42,5</a> hosted by <a href="https://www.get-in-it.de/">get in IT</a>.</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2><a name="method">How does it work?</a></h2>
<div>ToDo</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2><a name="source">See the source code</a></h2>
<div>The source code of Codometer is available at <a href="https://github.com/fabian-rump/codometer">GitHub</a>. The code is licensed as GPLv3, so feel free to share and modify the code. Additionally, if you have any suggestions or requests concerning the program, feel free to <a href="mailto:[email protected]">contact me</a>.</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/codometer.js"></script>
<script src="js/layout-generic.js"></script>
<script src="js/layout-de.js"></script>
<script src="js/layout-en.js"></script>
<script>
$( document ).ready(function() {
set_layout(1);
});
$('#buttonStart').on('click', function (e) {
process_text(input_text.value);
});
</script>
</body>
</html>