-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
240 lines (196 loc) · 14 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
<!DOCTYPE html>
<html lang="en-us" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>uke-chord by pianosnake</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css?family=Open+Sans:400,700'>
<link rel="stylesheet" type="text/css" href="https://jasonlong.github.io/cayman-theme/css/cayman.css" media="screen">
<link rel="stylesheet" type="text/css" href="https://jasonlong.github.io/cayman-theme/css/normalize.css" media="screen">
<link rel="stylesheet" type="text/css" href="https://jasonlong.github.io/cayman-theme/css/github-light.css" media="screen">
<script src="webcomponents-lite.min.js"></script>
<script>
function addScript(src){
const js = document.createElement("script");
js.src = src;
document.head.appendChild(js)
}
if(window.location.href.includes('.github.io')){
addScript("//pianosnake.github.io/blogger-list/blogger-list.js");
addScript("uke-chord.min.js");
}else{
addScript("uke-chord.js");
}
</script>
</head>
<body>
<section class="page-header">
<h1 class="project-name"><uke-chord></h1>
<h2 class="project-tagline">Easy chord diagrams. Not just ukulele.</h2>
<a href="https://github.com/pianosnake/uke-chord" class="btn">View on GitHub</a>
<a href="https://github.com/pianosnake/uke-chord/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/pianosnake/uke-chord/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<p><code><uke-chord></code> is a custom HTML element for tab chord diagrams using SVG graphics. It is
tuning agnostic and can be used for any fretted string instrument including the mandolin, 3 string dulcimer, ukulele, guitar, and 7 string guitar.
</p>
<h2>Install</h2>
<p>Download this repo using the 'Download' button and load <b>uke-chord.js</b> (unminified version) or <b>uke-chord.min.js</b> (minified) into your page's HEAD tag. The <b>webcomponents-lite.min.js</b> file offers support for older browsers, so it is <b>optional</b>.
The scripts can also be referenced directly from github:</p>
<pre><code><script src="//pianosnake.github.io/uke-chord/webcomponents-lite.min.js"></script>
<script src="//pianosnake.github.io/uke-chord/uke-chord.min.js"></script>
</code></pre>
<h2>Use</h2>
Add a <code><uke-chord></code> element wherever you need a chord diagram in your web page. Then set the following parameters:
<h3>frets</h3>
<p>This attribute is <b>required</b>. Set the <code>frets</code> attribute to the numeric value of the frets that should be played, left to right. The number of frets determines
the width of the diagram. The limit is 10 strings. Pass an 'x' to indicate a string should not be played and '0' if it should remain open. Make sure to
use <b>quotes</b> around this value.</p>
<pre><code><uke-chord frets="2010"></uke-chord><br><uke-chord frets="x32010"></uke-chord><br><uke-chord frets="320"></uke-chord><br><uke-chord frets="4xx30xx"></uke-chord></code></pre>
<uke-chord frets="2010"></uke-chord>
<uke-chord frets="x32010"></uke-chord>
<uke-chord frets="320"></uke-chord>
<uke-chord frets="4xx30xx"></uke-chord>
<h3>fingers</h3>
<p>To add fingerings inside the bubbles use a <code>fingers</code> attribute. List these from left to right.</p>
<pre><code><uke-chord frets="1323" fingers="1324"></uke-chord><br><uke-chord frets="x32000" fingers="021"></uke-chord></code></pre>
<uke-chord frets="1323" fingers="1324"></uke-chord>
<uke-chord frets="x32000" fingers="021"></uke-chord>
<h3>name</h3>
<p>To add a chord name above the diagram use a <code>name</code> attribute. </p>
<pre><code><uke-chord frets="2313" fingers="3214" position=0 name="F7"></uke-chord><br><uke-chord frets="xx0232" fingers="00132" position=0 name="D"></uke-chord></code></pre>
<uke-chord frets="2310" fingers="231" position=0 name="F7"></uke-chord>
<uke-chord frets="xx0232" fingers="000132" position=0 name="D"></uke-chord>
<h3>position</h3>
<p>Use the <code>position</code> attribute to show a position indicator to the left of the diagram. To show the nut set <code>position</code> to 0. Since this value is an integer it doesn't need to be in quotes.</p>
<pre><code><uke-chord frets="1323" fingers="1324" position=7></uke-chord><br><uke-chord frets="x32010" fingers="03201" position=0></uke-chord><br><uke-chord frets="222" fingers="111" position=12></uke-chord></code></pre>
<uke-chord frets="1323" fingers="1324" position=7></uke-chord>
<uke-chord frets="x32010" fingers="03201" position=0></uke-chord>
<uke-chord frets="222" fingers="111" position=12></uke-chord>
<h3>sub</h3>
<p>To add text under each string use a <code>sub</code> attribute with underscores for blanks. If
using more than one letter per string use a comma to separate the values.</p>
<pre><code><uke-chord frets="2313" fingers="3214" sub="__R_" position=0></uke-chord><br><uke-chord frets="320003" fingers="210003" sub="EADGBE" position=0></uke-chord><br><uke-chord frets="310" fingers="21" sub="D,A,A/D" position=0></uke-chord><br><uke-chord frets="4222" sub="R,♭3,5,R"></uke-chord></code></pre>
<uke-chord frets="2313" fingers="3214" sub="__R_" position=0 ></uke-chord>
<uke-chord frets="320003" fingers="210003" sub="EADGBE" position=0></uke-chord>
<uke-chord frets="310" fingers="21" sub="D,A,A/D" position=0></uke-chord>
<uke-chord frets="4222" sub="R,♭3,5,R"></uke-chord>
<h3>length</h3>
<p>By default, there are only 4 frets shown. Set <code>length</code> to another number to show more or less frets.</p>
<pre><code><uke-chord frets="330013" fingers="230014" length=8 position=0></uke-chord><br><uke-chord frets="222" fingers="111" length=3 position=0></uke-chord></code></pre>
<uke-chord frets="330013" fingers="230014" length=8 position=0 name="Gsus4"></uke-chord>
<uke-chord frets="222" fingers="111" length=3 position=0 name="F#"></uke-chord>
<h3>size</h3>
<p>Change the diagram size by passing a <code>size</code> attribute set to a number. Numbers greater than 1 will make the
diagram bigger. Numbers smaller than 1 will make it smaller.</p>
<pre><code><uke-chord frets="2310" fingers="231" size=0.4 position=0 name="F7"></uke-chord><br><uke-chord frets="2310" fingers="231" size=1 position=0 name="F7"></uke-chord><br><uke-chord frets="2310" fingers="231" size=1.5 position=0 name="F7"></uke-chord></code></pre>
<uke-chord frets="2310" fingers="231" size=0.4 position=0 name="F7"></uke-chord>
<uke-chord frets="2310" fingers="231" size=1 position=0 name="F7"></uke-chord>
<uke-chord frets="2310" fingers="231" size=1.5 position=0 name="F7"></uke-chord>
<h3>r</h3>
<p>Some publishers show the root of the chord with a
diamond head. To do this pass an <code>r</code> attribute set to the string where the root of the chord is found.
A root can be duplicated on two strings, so this parameter can contain several digits. The strings are counted from right to left.</p>
<pre><code><uke-chord frets="5433" length=5 fingers="3211" name="C" position=0 r=14></uke-chord></code></pre>
<uke-chord frets="5433" length=5 fingers="3211" position=0 name="C" r=14></uke-chord>
<h3>img</h3>
<p>To allow styling with CSS, the SVG output is inlined by default. To get the SVG inside an image, set an <code>img</code> attribute. This allows right clicking on an image and saving it, or in some browsers, dragging the image from the browser.</p>
<pre><code><uke-chord img frets="2310" fingers="231" position=0></uke-chord></code></pre>
<uke-chord img frets="2310" fingers="231" position=0 img></uke-chord>
<h2>In the wild</h2>
<p>This component was originally built for a series of posts on ukulele playing, hence the name.</p>
<script>
if(customElements.get('blogger-list')){
document.write(`
<blogger-list labels="ukulele" blog-id="6321600142310040063" asc api-key="AIzaSyDmDP-qIOWHi7slq3DXr7Swpe55KjmHCQQ"></blogger-list>
`)
}
</script>
<h2>More examples</h2>
<h3>Guitar chords with root on 6th string</h3>
<uke-chord img frets="133211" r=146 name="Major" sub="R5R35R" fingers="134211"></uke-chord>
<uke-chord img frets="133111" r=146 name="Minor" sub="R,5,R,m3,5,R" fingers="134111"></uke-chord>
<uke-chord img frets="131211" r=16 name="Dom 7" sub="R,5,m7,3,5,R" fingers="131211"></uke-chord>
<uke-chord img frets="131111" r=16 name="Minor 7" sub="R,5,m7,m3,5,R" fingers="131111"></uke-chord>
<uke-chord img frets="132211" r=16 name="Major 7" sub="R,5,M7,3,5,R" fingers="143211"></uke-chord>
<h3>Guitar chords with root on 5th string</h3>
<uke-chord img frets="x13331" r=35 name="Major" sub="_R5R35" fingers="013331"></uke-chord>
<uke-chord img frets="x13321" r=35 name="Minor" sub="_,R,5,R,m3,5" fingers="013421"></uke-chord>
<uke-chord img frets="x13131" r=5 name="Dom 7" sub="_,R,5,m7,3,5" fingers="013141"></uke-chord>
<uke-chord img frets="x13121" r=5 name="Minor 7" sub="_,R,5,m7,m3,5" fingers="013121"></uke-chord>
<uke-chord img frets="x13231" r=5 name="Major 7" sub="_,R,5,M7,3,5" fingers="013241"></uke-chord>
<h3>Ukulele major chords</h3>
<uke-chord img frets="4322" sub="R35R" r=14></uke-chord>
<uke-chord img frets="4442" sub="5R35" r=3></uke-chord>
<uke-chord img frets="1114" sub="5R3R" r=13></uke-chord>
<uke-chord img frets="1343" sub="R5R3" r=24></uke-chord>
<uke-chord img frets="4232" sub="35R3" r=2></uke-chord>
<h3>Ukulele minor chords</h3>
<uke-chord img frets="4222" sub="R,♭3,5,R" r=14></uke-chord>
<uke-chord img frets="1444" sub="5,♭3,5,R" r=1></uke-chord>
<uke-chord img frets="4432" sub="5,R,♭3,5" r=3></uke-chord>
<uke-chord img frets="1342" sub="R,5,R,♭3" r=24></uke-chord>
<uke-chord img frets="4342" sub="♭3,5,R,♭3" r=2></uke-chord>
<h3>Ukulele dominant 7th chords</h3>
<uke-chord img frets="3433" sub="735R" r=1></uke-chord>
<uke-chord img frets="3334" sub="5R37" r=3></uke-chord>
<uke-chord img frets="2434" sub="R573" r=4></uke-chord>
<uke-chord img frets="3424" sub="37R5" r=2></uke-chord>
<uke-chord img frets="3241" sub="R37R" r=14></uke-chord>
<uke-chord img frets="4242" sub="5735"></uke-chord>
<h3>Ukulele minor 7th chords</h3>
<uke-chord img frets="3141" sub="R37R" r=14></uke-chord>
<uke-chord img frets="3333" sub="735R" r=1></uke-chord>
<uke-chord img frets="3324" sub="5R37" r=3></uke-chord>
<uke-chord img frets="2433" sub="R573" r=4></uke-chord>
<uke-chord img frets="2424" sub="37R5" r=2></uke-chord>
<h3>Ukulele major 7th chords</h3>
<uke-chord frets="4321" sub="R357" r=4></uke-chord>
<uke-chord frets="4342" sub="5735"></uke-chord>
<uke-chord frets="2224" sub="5R37" r=3></uke-chord>
<uke-chord frets="2444" sub="R573" r=4></uke-chord>
<uke-chord frets="3322" sub="735R" r=1></uke-chord>
<h3>Ukulele dominant 9th chords</h3>
<uke-chord frets="3243" sub="R372" r=4></uke-chord>
<uke-chord frets="2423" sub="5237"></uke-chord>
<uke-chord frets="2333" sub="3725"></uke-chord>
<uke-chord frets="2324" sub="7352"></uke-chord>
<h3>Ukulele major 6th chords</h3>
<uke-chord frets="4342" sub="R36R" r=14></uke-chord>
<uke-chord frets="2433" sub="635R" r=1></uke-chord>
<uke-chord frets="3333" sub="5R36" r=3></uke-chord>
<uke-chord frets="2424" sub="R563" r=4></uke-chord>
<h3>Ukulele minor 6th chords</h3>
<uke-chord frets="4242" sub="R36R" r=14></uke-chord>
<uke-chord frets="2423" sub="R563" r=4></uke-chord>
<uke-chord frets="3323" sub="5R36" r=3></uke-chord>
<uke-chord frets="2333" sub="635R" r=1></uke-chord>
<h3>Ukulele augmented chord</h3>
<uke-chord frets="3221"></uke-chord>
<h3>Ukulele iiø V i progressions</h3>
<uke-chord frets="3323" r=1 name="iiø" fingers="2314"></uke-chord>
<uke-chord frets="2313" r=2 name="V7" fingers="2314"></uke-chord>
<uke-chord frets="3111" r=14 name="i" fingers="4111"></uke-chord>
<br>
<uke-chord frets="2423" r=2 fingers="1423"></uke-chord>
<uke-chord frets="2322" r=1 fingers="1311"></uke-chord>
<uke-chord frets="4432" r=3 fingers="4321"></uke-chord>
<br>
<uke-chord frets="2333" r=4 fingers="1333"></uke-chord>
<uke-chord frets="2223" r=3 fingers="1113"></uke-chord>
<uke-chord frets="3231" r=2 fingers="4231"></uke-chord>
<br>
<uke-chord frets="2324" r=3 fingers="1324"></uke-chord>
<uke-chord frets="1323" r=4 fingers="1324"></uke-chord>
<uke-chord frets="1444" r=1 fingers="1444"></uke-chord>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/pianosnake/uke-chord"><uke-chord></a> is
maintained by <a href="https://github.com/pianosnake">pianosnake</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>
using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason
Long</a>.</span>
</footer>
</section>
</body>
</html>