Commit Graph

40 Commits

Author SHA1 Message Date
Paul Melnikow
84c60c8730 Optimization + cleanup in makeBadge (#1405)
- Avoid mutating the inputs
- Declare all the input and output keys
- Avoid recomputing escapeXml on the same values
- Capitalize social badge labels before measuring
2017-12-28 21:28:47 -05:00
Danial
18f6d44e8d remove extra whitespace in social style badge (#1337) 2017-12-06 17:05:55 +13:00
Marcin Mielnicki
0570a9e920 License badge colour corresponding to license type (#1190) 2017-12-05 16:43:29 -05:00
Danial
a4bce73da6 For-the-badge | Convert labels to string then uppercase (#1281) 2017-11-22 23:35:33 -05:00
RedSparr0w
a83d43a485 Add link support for all badges
Add link support to the following badges:
- flat
- flat-square
- plastic
Adjust social badge
- if only 1 link supplied the whole badge will use that link
- only use hover effects if badge contains a link
2017-10-16 23:30:31 -04:00
Danial
c026ebf235 for the badge style badges (#1166)
https://forthebadge.com/ style of badges, with link support

Close #818
2017-10-15 16:52:28 -04:00
Danial
7945db8f57 Fix letter spacing on Windows Firefox, Badge padding to spec (#1161)
Update of #1132
Fix #746 #848
2017-10-12 18:35:29 -04:00
Paul Melnikow
37bcddb23e Revert letter spacing adjustment until we can track down the problem (#1154)
See #1132
2017-10-11 14:14:03 -04:00
Danial
7db325c640 Fix enlarged text when min-font-size is enabled (#1132)
Fixes #746 
Fixes #848 

Works by making the font-size `110px` instead of `11px` so the browser doesnt enforce the minimum font size and then scales the text down to 10%.

Also fixes the padding issue on Firefox.
2017-10-09 15:29:08 -04:00
David Tolnay
66635c510c Eliminate padding on social badges if rhs is empty (#998) 2017-06-01 23:35:56 +02:00
Thaddee Tyl
2f97be9118 Pre-compress badge templates with SVGO
Prior to this patch, time spend in badge.js (computing text width and
compressing the SVG with SVGO) averaged 8.4 ms.

After this patch, it clocks at 2.4 ms on average.

Assuming this is the CPU bottleneck, it means that servers used to only be able
to handle 119 req/s (empirically, it is closer to 100 req/s). It should now
handle 416 req/s (although a better guess is at 1/0.004 = 250 req/s).
2017-02-25 18:20:07 +01:00
Thaddee Tyl
78494dd6ff Fix blurry rounded corners on WebKit
WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=135616
Fixes #732
2016-12-15 02:09:07 +01:00
Thaddee Tyl
b74107eb3d Stop using a link for default badge template
npm cannot handle links.
See https://github.com/npm/npm/issues/13884.
2016-09-08 23:23:43 +01:00
Konstantin Molchanov
51021679b0 Template: Flat Square: Shadows removed, xlink namespace declaration added. 2016-04-19 13:14:54 +04:00
Konstantin Molchanov
4b3b8bd49b Attempt to add logo to flat-square template
I'm really not sure this would work, I just copied a code chunk from flat.
2016-03-22 10:58:35 +03:00
Greg Cochard
79ccfef467 Comments 2015-12-01 10:34:08 -08:00
Greg Cochard
18cd0c15b9 Add twitter follow badge. Fixes #527
This adds a twitter follow badge. It also updates the social template
to include a `nobubble` option which will ignore the data in text[1]
and not draw the bubble to the right of the badge. Simply add
&nobubble=true to the URL of your badge.
2015-10-13 19:16:20 -07:00
Alexandr Kondrashov
802327030e Fix corners in social-template
Before: https://pp.vk.me/c622223/v622223775/476e5/wqWY1eD4BO8.jpg
After: https://pp.vk.me/c622223/v622223775/476de/pgqBGgD_sQ4.jpg
2015-08-18 02:27:45 +03:00
Thaddee Tyl
87b098a53d social: right hand-side should not be capitalized 2015-07-26 17:09:08 +02:00
Thaddee Tyl
ca2bf2ea07 Capitalize social badges 2015-06-20 15:51:56 +02:00
Thaddee Tyl
649e9638c0 Working social template
Fixes #337
2015-05-11 08:49:53 +02:00
Thaddee Tyl
75bc3cb90c Initial social button implementation 2015-05-08 23:58:42 +02:00
Thaddee Tyl
b1d3e00a21 Support for logos in flat design
Closes #401
Part of #337
2015-04-25 14:46:49 +02:00
Thaddee Tyl
cb34a90fc4 Apply rummik's great flat changes to plastic
Part of #352
2015-02-11 15:25:46 +01:00
Thaddee Tyl
f2319a2d48 Default to flat badges
Closes #185
2015-02-01 17:56:18 +01:00
Thaddee Tyl
27db523202 Merge remote-tracking branch 'rummik/flat-adjustment' 2015-01-31 12:35:24 +01:00
rummik
250536cd30 Minor cleanup after flat template changes 2015-01-14 03:09:54 -05:00
rummik
6513ed7607 Fix gray fuzzy edges around the right-hand color in the flat template 2015-01-13 21:12:44 -05:00
rummik
42bef2e3be Update flat-square template for better color matching 2015-01-06 12:22:27 -05:00
Thaddee Tyl
d9347fffe4 Plastic style (instead of default)
The default style is now a link.

Fixes #296
2014-11-26 22:34:26 +01:00
Thaddee Tyl
ecaf11a50e Prevent possible invalid colors.
They're only theoretical, but better safe than sad.
2014-11-19 09:40:30 +01:00
Thaddee Tyl
b6a0970699 templates: escape invalid XML 2014-11-19 00:23:40 +01:00
Jonathan Reinink
e69d52ae1c Add the ability to output badges as JSON. 2014-10-13 22:48:39 -04:00
Thaddee Tyl
9c9df2f641 Support the old flat style as flat-square.
Part of issue #185.
2014-08-11 08:45:50 +02:00
Thaddee Tyl
f7ee1cb71a Flat design: drop-shadow.
Part of issue #185.
2014-08-05 08:37:12 +02:00
Thaddee Tyl
048bf9206a Flat design: use @jasonlong's work.
Part of issue #185.
2014-08-05 08:05:53 +02:00
Ivan Kuchin
6c0f24f983 replaced usage of linearGradient with fill colour and fill-opacity on intended rect 2014-07-18 19:07:32 +02:00
Thaddee Tyl
03e7013bf5 Text baseline nudged down by 1px.
Fixes #141.
2014-06-30 15:28:02 +02:00
Max Ogden
c6163c9a4f move colorscheme back to original location, add @ syntax to cli for specifying style, cache templates on server start 2014-04-19 10:27:20 -07:00
Max Ogden
f97fbf0dd0 add templates support and new flat style option 2014-04-19 01:11:06 -07:00