-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
39 lines (39 loc) · 1.16 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
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body { background-color:#eee; font-family:Arial, sans-serif; }
</style>
<script src="chord.js"></script>
<script>
function show() {
var input = document.getElementsByTagName('input')[0];
if (document.location.search) {
var val = unescape(document.location.search.substr('?chord='.length)).replace(/\+/g, ' ');
} else {
var val = document.getElementsByTagName('input')[0].value;
}
var div = document.getElementById('generated-chords');
input.value = val;
var sp = val.indexOf(' ');
var name = val.substr(0, sp);
var chord = val.substr(sp+1);
div.innerHTML = '';
for (var i = 1; i <= 10; i++) {
var span = document.createElement('span');
span.innerHTML = name;
span.setAttribute('data-chord', chord + ' ' + i);
div.appendChild(span);
Chord.render([span]);
}
}
</script>
</head>
<body onload="show()">
<div id="generated-chords">
</div>
<form method="GET">
<input name="chord" type="text" value="E 022100 [231]"/>
<input type="submit" value="Show chord in all sizes" />
</body>
</html>