forked from ddavison/github-badges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
btn.haml
78 lines (73 loc) · 2.4 KB
/
btn.haml
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
!!! XML
%svg{'xmlns' => 'http://www.w3.org/2000/svg',
'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
'width' => '80',
'height' => '20'}
%linearGradient{'id' => 'a', 'x2' => 0, 'y2' => '100%'}
- case opts[:style]
- when 'default'
%stop{'offset' => '0',
'stop-color' => "##{opts[:color]}",
'stop-opacity' => '.7'}
%stop{'offset' => '.1',
'stop-color' => '#aaa',
'stop-opacity' => '.1'}
%stop{'offset' => '1',
'stop-opacity' => '.5'}
- when 'flat'
%stop{'offset' => 0,
'stop-color' => "##{opts[:color]}",
'stop-opacity' => '.1'}
%stop{'offset' => 1,
'stop-opacity' => '.1'}
- else
-# Match default styling.
%stop{'offset' => '0',
'stop-color' => "##{opts[:color]}",
'stop-opacity' => '.7'}
%stop{'offset' => '.1',
'stop-color' => '#aaa',
'stop-opacity' => '.1'}
%stop{'offset' => '1',
'stop-opacity' => '.5'}
%rect{'rx' => '3',
'width' => '80',
'height' => '20',
'fill' => '#555'}
%rect{'rx' => '3',
'x' => '37',
'width' => '43',
'height' => '20',
'fill' => "##{opts[:bg_color]}"}
%path{'fill' => "##{opts[:bg_color]}",
'd' => 'M37 0h4v20h-4z'}
%rect{'rx' => '3',
'width' => '80',
'height' => '20',
'fill' => 'url(#a)'}
%g{'fill' => "##{opts[:color]}",
'text-anchor' => 'middle',
'font-family' => 'DejaVu Sans,Verdana,Geneva,sans-serif',
'font-size' => '11'}
%a#link{'xlink:href' => "#{opts[:button_url]}",
'target' => '_new'}
-# Shadow
%text{'x' => '19.5',
'y' => '15',
'fill-opacity' => '.3',
'fill' => '#010101'}= opts[:button_text]
-# Actual button text
%text{'x' => '19.5',
'y' => '14',
'fill' => "##{opts[:color]}"}= opts[:button_text]
%a#count-link{'xlink:href' => "#{opts[:count_url]}",
'target' => '_new'}
-# Shadow
%text#count{'x' => '57.5',
'y' => '15',
'fill-opacity' => '.3',
'fill' => '#010101'}= opts[:count]
-# Actual count text
%text#count{'x' => '57.5',
'y' => '14',
'fill' => "##{opts[:color]}"}= opts[:count]