This repository has been archived by the owner on Nov 21, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
225 lines (200 loc) · 9.01 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
<!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.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="ico/favicon.png">
<title>Retina Badges</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy this line! -->
<!--[if lt IE 9]><script src="js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46702793-1', 'badges.github.io');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Retina badges [beta]</h1>
<p class="lead">Because I am sick of all those blurry images on otherwise pixel perfect GitHub pages.</p>
<p class="lead">This service also can also turn your Travis CI, Coveralls and VersionEye badges to retina versions.</p>
<script data-gittip-username="Mikulas"
data-gittip-widget="button"
src="//gttp.co/v1.js"></script>
</div>
<div class="border service-form">
<h3>Retinify Travis CI, Coveralls or VersionEye.</h3>
<p>Paste original url to ugly png badge:</p>
<input type="text" class="form-control waiting" id="url-original" value="https://travis-ci.org/Mikulas/csfd-api.png?branch=master">
<img src="" id="image-original" class="preview">
<p>This is url with awesome (still fully dynamic) svg badge:</p>
<input type="text" class="form-control waiting" id="url-svg">
<img src="" id="image-svg" class="preview">
</div>
<form class="form-inline border demo-form" role="form">
<h3>Create your own badge</h3>
<div class="colors">
<div class="radio">
<label>
<input type="radio" name="color" value="lightgrey">
<img src="https://khancdn.eu/badges.php?key=&value=&color=lightgrey" height="18" width="18">
Light grey
</label>
</div>
<div class="radio checked">
<label>
<input type="radio" name="color" value="brightgreen" checked>
<img src="https://khancdn.eu/badges.php?key=&value=&color=brightgreen" height="18" width="18">
Bright green
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="color" value="yellow">
<img src="https://khancdn.eu/badges.php?key=&value=&color=yellow" height="18" width="18">
Yellow
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="color" value="red">
<img src="https://khancdn.eu/badges.php?key=&value=&color=red" height="18" width="18">
Red
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="color" value="blue">
<img src="https://khancdn.eu/badges.php?key=&value=&color=blue" height="18" width="18">
Blue
</label>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" id="key" value="build">
</div>
<div class="form-group">
<input type="text" class="form-control" id="value" value="passing">
</div>
<img src="" height="24" id="demo">
<div class="form-group" id="url">
<input type="text" class="form-control" value="" readonly>
</div>
</form>
<div class="row marketing">
<div class="col-lg-7">
<h4>Does it work?</h4>
Svg images are supported pretty much everywhere except IE8 — as of early 2014, this means more than 90 % users are covered. But frankly, I'm quite sure nobody views GitHub with IE8. Works on Firefox 4.0, Chrome 13, iOS 4, Opera 10.9, IE9, Safari 4 and above.
</ul>
<h4>Beta — things will change!</h4>
<p>
Frankly, this is a proof of concept. Once this gets enough traction,
I will rewrite the codebase, publish it a open source on GitHub and
setup proper domain with extensive serverside caching etc. The good
thing is, it already works like a charm now!
</p>
<h4>Acknowledgments</h4>
<p><a href="https://github.com/gittip/shields.io">gittip/shields.io</a> for the shield template</p>
<p><a href="https://github.com/gittip/img.shields.io">gittip/img.shields.io</a> for the idea</p>
<p>Steve Matteson for Open Sans font</p>
</div>
<div class="col-lg-5">
<h4>Multiple colors</h4>
<p><img src="https://khancdn.eu/badges.php?key=color&value=grey&color=lightgrey" height="18"></p>
<p><img src="https://khancdn.eu/badges.php?key=color&value=green&color=brightgreen" height="18"></p>
<p><img src="https://khancdn.eu/badges.php?key=color&value=yellow&color=yellow" height="18"></p>
<p><img src="https://khancdn.eu/badges.php?key=color&value=red&color=red" height="18"></p>
<p><img src="https://khancdn.eu/badges.php?key=color&value=blue&color=blue" height="18"></p>
<h4>Vectors — they scale!</h4>
<p><img src="https://khancdn.eu/badges.php?key=increase&value=size&color=blue" height="18"></p>
<p><img src="https://khancdn.eu/badges.php?key=increase&value=size&color=blue" height="24"></p>
<p><img src="https://khancdn.eu/badges.php?key=increase&value=size&color=blue" height="32"></p>
<h4>Support this service</h4>
<ul>
<li>
<a target="_blank" href="https://www.gittip.com/Mikulas/">Gittip</a>
</li>
<li>or just leave a shout at <a href="https://twitter.com/MikulasDite">@MikulasDite</a>
</li>
</ul>
</div>
<!-- <div class="col-lg-3 pngdemo">
<div class="notice">Prerendered png sample:</div>
<img src="demo.png" width="190">
</div> -->
</div>
<div class="footer">
<p>© Mikuláš Dítě 2013, <a href="https://twitter.com/mikulasdite">@MikulasDite</a></p>
</div>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
(function() {
var $key = $('#key');
var $value = $('#value');
var $demo = $('#demo');
var demoUrl = true;
$(function() {
$key.change(update).keyup(update);
$value.change(update).keyup(update);
$value.change(update).keyup(update);
$('input[type=radio][name=color]').change(update).change(function() {
$('.radio.checked').removeClass('checked');
$(this).parent().parent().addClass('checked');
});
update();
$('#url-original').on('keyup', service);
service(); // first demo
$('#url-original').focus(function() {
$(this).removeClass('waiting').val('');
$('#url-svg').removeClass('waiting').val('');
$(this).unbind('focus');
})
});
function service()
{
var uo = $('#url-original');
var orig = uo.val();
$('#image-original').attr('src', orig);
var url = '';
if (orig) {
url = 'https://khancdn.eu/badges.php?service=' + encodeURIComponent(orig);
}
$('#url-svg').val(url);
$('#image-svg').attr('src', url);
}
function update()
{
var color = $('input[name=color]:checked').val();
$demo.attr('src', 'https://khancdn.eu/badges.php?key='
+ encodeURIComponent($key.val())
+ '&value='
+ encodeURIComponent($value.val())
+ '&color='
+ encodeURIComponent(color)
);
$('#url input').val($demo.attr('src'));
}
})();
</script>
</body>
</html>