GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: A simple chord viewing interface layered upon pngs of mandolin chords I found somewhere a while ago.
Clone URL: git://github.com/kjell/chords.git
Show more than one chord at a time.
kjell (author)
Sat Aug 09 20:12:52 -0700 2008
commit  19bcbfd59ee1330cac0664b8a15b28a69ef9e831
tree    dea8f96b28ed6477de2eb7620ebea3218a72e900
parent  a82c22c06aebf7df67ff6ad496f957653be533d0
...
19
20
21
 
22
23
24
...
34
35
36
37
 
 
 
 
 
38
39
40
 
...
19
20
21
22
23
24
25
...
35
36
37
 
38
39
40
41
42
43
 
44
45
0
@@ -19,6 +19,7 @@ def find(chord)
0
     case chord
0
     when Regexp then c.chord.gsub(/\s|-|_/, '') =~ chord
0
     when String then c.chord == chord
0
+ when Array then chord.member?(c.chord)
0
     end
0
   end
0
 end
0
@@ -34,6 +35,10 @@ get('/find') do
0
 end
0
 
0
 get('/c/:name') do
0
- @chord = find(params[:name]).first
0
+ @chord = if (_chords = params[:name].split('|')).size > 1
0
+ find(_chords)
0
+ else
0
+ find(params[:name]).first
0
+ end
0
   haml :chord
0
-end
0
\ No newline at end of file
0
+end
...
1
2
3
 
4
5
6
...
25
26
27
28
 
 
 
29
 
 
30
31
...
1
2
 
3
4
5
6
...
25
26
27
 
28
29
30
31
32
33
34
35
0
@@ -1,6 +1,6 @@
0
 @media screen and (max-device-width: 481px) {
0
   input[type=search] {
0
- width: 292px;
0
+ width: 202px;
0
     height: 22px;
0
     margin: 0 auto;
0
   }
0
@@ -25,6 +25,10 @@
0
   }
0
   
0
   #chord img {
0
- height: 353px;
0
+ max-height: 357px;
0
+ max-width: 357px;
0
+ -webkit-transition-property: -webkit-transform;
0
   }
0
+
0
+ .fat #chord {-webkit-transform: rotate(90deg);}
0
 }
0
\ No newline at end of file
...
1
2
3
4
 
 
 
 
 
 
 
 
5
...
 
 
 
1
2
3
4
5
6
7
8
9
10
0
@@ -1,3 +1,8 @@
0
-- @title = "#{@chord.chord} — mandolin"
0
-#chord
0
- %img{:src => @chord.path}
0
\ No newline at end of file
0
+- @title = @chord.respond_to?(:chord) ? @chord.chord : @chord.map(&:chord).join(', ') + " — mandolin"
0
+- if @chord.size == 1
0
+ #chord
0
+ %img{:src => @chord.path, :id => 'chord-img'}
0
+- else
0
+ #chord
0
+ - @chord.each do |chord|
0
+ %img{:src => chord.path}
0
\ No newline at end of file
...
2
3
4
5
6
7
8
9
10
...
2
3
4
 
 
 
5
6
7
0
@@ -2,9 +2,6 @@
0
   %head
0
     %title= @title || 'Chords!'
0
     %link{:rel => 'stylesheet', :href => "/ornamentation.css", :type => 'text/css'}
0
- %meta{:name => 'viewport', :content => 'width=320px'}
0
- - %w[jquery search].each do |js|
0
- %script{:src => "/#{js}.js", :type => 'text/javascript'}
0
 
0
   %body
0
     = yield

Comments

    No one has commented yet.