From 83ae9793ee714ce6fc1e3b6250dabfa885f03bb6 Mon Sep 17 00:00:00 2001 From: eiselems Date: Thu, 26 Nov 2015 11:16:18 +0100 Subject: [PATCH 1/5] remove vw scaling of fonts refs #133 --- css/rrssb.css | 2 +- js/rrssb.js | 3 ++ js/rrssb.min.js | 2 +- scss/rrssb.scss | 89 +------------------------------------------------ 4 files changed, 6 insertions(+), 90 deletions(-) diff --git a/css/rrssb.css b/css/rrssb.css index 18e8846..38f534c 100755 --- a/css/rrssb.css +++ b/css/rrssb.css @@ -1 +1 @@ -.rrssb-buttons{box-sizing:border-box;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;height:36px;margin:0;padding:0;width:100%}.rrssb-buttons:after{clear:both}.rrssb-buttons:after,.rrssb-buttons:before{content:' ';display:table}.rrssb-buttons li{box-sizing:border-box;float:left;height:100%;line-height:13px;list-style:none;margin:0;padding:0 2px}.rrssb-buttons li.rrssb-email a{background-color:#0a88ff}.rrssb-buttons li.rrssb-email a:hover{background-color:#006ed6}.rrssb-buttons li.rrssb-facebook a{background-color:#306199}.rrssb-buttons li.rrssb-facebook a:hover{background-color:#244872}.rrssb-buttons li.rrssb-tumblr a{background-color:#32506d}.rrssb-buttons li.rrssb-tumblr a:hover{background-color:#22364a}.rrssb-buttons li.rrssb-linkedin a{background-color:#007bb6}.rrssb-buttons li.rrssb-linkedin a:hover{background-color:#005983}.rrssb-buttons li.rrssb-twitter a{background-color:#26c4f1}.rrssb-buttons li.rrssb-twitter a:hover{background-color:#0eaad6}.rrssb-buttons li.rrssb-googleplus a{background-color:#e93f2e}.rrssb-buttons li.rrssb-googleplus a:hover{background-color:#ce2616}.rrssb-buttons li.rrssb-youtube a{background-color:#df1c31}.rrssb-buttons li.rrssb-youtube a:hover{background-color:#b21627}.rrssb-buttons li.rrssb-reddit a{background-color:#8bbbe3}.rrssb-buttons li.rrssb-reddit a:hover{background-color:#62a3d9}.rrssb-buttons li.rrssb-pinterest a{background-color:#b81621}.rrssb-buttons li.rrssb-pinterest a:hover{background-color:#8a1119}.rrssb-buttons li.rrssb-pocket a{background-color:#ed4054}.rrssb-buttons li.rrssb-pocket a:hover{background-color:#e4162d}.rrssb-buttons li.rrssb-github a{background-color:#444}.rrssb-buttons li.rrssb-github a:hover{background-color:#2b2b2b}.rrssb-buttons li.rrssb-instagram a{background-color:#517fa4}.rrssb-buttons li.rrssb-instagram a:hover{background-color:#406582}.rrssb-buttons li.rrssb-delicious a{background-color:#0B79E5}.rrssb-buttons li.rrssb-delicious a:hover{background-color:#095fb4}.rrssb-buttons li.rrssb-vk a{background-color:#4d71a9}.rrssb-buttons li.rrssb-vk a:hover{background-color:#3d5a86}.rrssb-buttons li.rrssb-hackernews a{background-color:#f60}.rrssb-buttons li.rrssb-hackernews a:hover{background-color:#cc5200}.rrssb-buttons li a{background-color:#ccc;border-radius:2px;box-sizing:border-box;display:block;font-size:11px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:700;height:100%;padding:11px 7px 12px 27px;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;width:100%}.rrssb-buttons li a .rrssb-icon{display:block;left:10px;padding-top:9px;position:absolute;top:0;width:10%}.rrssb-buttons li a .rrssb-icon svg{height:17px;width:17px}.rrssb-buttons li a .rrssb-icon svg path{fill:#fff}.rrssb-buttons li a .rrssb-text{color:#fff}.rrssb-buttons li a:active{box-shadow:inset 1px 3px 15px 0 rgba(22,0,0,.25)}.rrssb-buttons li.small a{padding:0}.rrssb-buttons li.small a .rrssb-icon{left:auto;margin:0 auto;overflow:hidden;position:relative;top:auto;width:100%}.rrssb-buttons li.small a .rrssb-text{visibility:hidden}.rrssb-buttons.large-format,.rrssb-buttons.large-format li{height:auto}.rrssb-buttons.large-format li:first-child:nth-last-child(1) a{font-size:20px;font-size:4vw}.rrssb-buttons.large-format li:first-child:nth-last-child(2) a,.rrssb-buttons.large-format li:first-child:nth-last-child(2)~li a{font-size:16px;font-size:2vw}.rrssb-buttons.large-format li:first-child:nth-last-child(3) a,.rrssb-buttons.large-format li:first-child:nth-last-child(3)~li a{font-size:14px;font-size:1.7vw}.rrssb-buttons.large-format li:first-child:nth-last-child(4) a,.rrssb-buttons.large-format li:first-child:nth-last-child(4)~li a{font-size:13px;font-size:1.4vw}.rrssb-buttons.large-format li:first-child:nth-last-child(5) a,.rrssb-buttons.large-format li:first-child:nth-last-child(5)~li a{font-size:13px;font-size:1.2vw}.rrssb-buttons.large-format li:first-child:nth-last-child(6) a,.rrssb-buttons.large-format li:first-child:nth-last-child(6)~li a{font-size:12px;font-size:1.05vw}.rrssb-buttons.large-format li:first-child:nth-last-child(7) a,.rrssb-buttons.large-format li:first-child:nth-last-child(7)~li a{font-size:11px;font-size:.9vw}.rrssb-buttons.large-format li:first-child:nth-last-child(8) a,.rrssb-buttons.large-format li:first-child:nth-last-child(8)~li a{font-size:11px;font-size:.8vw}.rrssb-buttons.large-format li:first-child:nth-last-child(9) a,.rrssb-buttons.large-format li:first-child:nth-last-child(9)~li a{font-size:11px;font-size:.7vw}.rrssb-buttons.large-format li:first-child:nth-last-child(10) a,.rrssb-buttons.large-format li:first-child:nth-last-child(10)~li a{font-size:11px;font-size:.6vw}.rrssb-buttons.large-format li:first-child:nth-last-child(11) a,.rrssb-buttons.large-format li:first-child:nth-last-child(11)~li a{font-size:11px;font-size:.5vw}.rrssb-buttons.large-format li a{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:.2em;padding:8.5% 0 8.5% 12%}.rrssb-buttons.large-format li a .rrssb-icon{height:100%;left:7%;padding-top:0;width:12%}.rrssb-buttons.large-format li a .rrssb-icon svg{height:100%;position:absolute;top:0;width:100%}.rrssb-buttons.large-format li a .rrssb-text{-webkit-backface-visibility:hidden;backface-visibility:hidden}.rrssb-buttons.small-format{padding-top:5px}.rrssb-buttons.small-format li{height:80%;padding:0 1px}.rrssb-buttons.small-format li a .rrssb-icon{height:100%;padding-top:0}.rrssb-buttons.small-format li a .rrssb-icon svg{height:48%;position:relative;top:6px;width:80%}.rrssb-buttons.tiny-format{height:22px;position:relative}.rrssb-buttons.tiny-format li{padding-right:7px}.rrssb-buttons.tiny-format li a{background-color:transparent;padding:0}.rrssb-buttons.tiny-format li a .rrssb-icon svg{height:70%;width:100%}.rrssb-buttons.tiny-format li a:active,.rrssb-buttons.tiny-format li a:hover{background-color:transparent}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon svg path{fill:#0a88ff}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon:hover .rrssb-icon svg path{fill:#0054a3}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon svg path{fill:#306199}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon:hover .rrssb-icon svg path{fill:#18304b}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon svg path{fill:#32506d}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon:hover .rrssb-icon svg path{fill:#121d27}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon svg path{fill:#007bb6}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon:hover .rrssb-icon svg path{fill:#003650}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon svg path{fill:#26c4f1}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon:hover .rrssb-icon svg path{fill:#0b84a6}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon svg path{fill:#e93f2e}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon:hover .rrssb-icon svg path{fill:#a01e11}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon svg path{fill:#df1c31}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon:hover .rrssb-icon svg path{fill:#84111d}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon svg path{fill:#8bbbe3}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon:hover .rrssb-icon svg path{fill:#398bcf}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon svg path{fill:#b81621}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon:hover .rrssb-icon svg path{fill:#5d0b11}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon svg path{fill:#ed4054}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon:hover .rrssb-icon svg path{fill:#b61124}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon svg path{fill:#444}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon:hover .rrssb-icon svg path{fill:#111}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon svg path{fill:#517fa4}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon:hover .rrssb-icon svg path{fill:#2f4a60}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon svg path{fill:#0B79E5}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon:hover .rrssb-icon svg path{fill:#064684}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon svg path{fill:#4d71a9}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon:hover .rrssb-icon svg path{fill:#2d4263}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon svg path{fill:#f60}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon:hover .rrssb-icon svg path{fill:#993d00} \ No newline at end of file +.rrssb-buttons{box-sizing:border-box;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;height:36px;margin:0;padding:0;width:100%}.rrssb-buttons:after{clear:both}.rrssb-buttons:after,.rrssb-buttons:before{content:' ';display:table}.rrssb-buttons li{box-sizing:border-box;float:left;height:100%;line-height:13px;list-style:none;margin:0;padding:0 2px}.rrssb-buttons li.rrssb-email a{background-color:#0a88ff}.rrssb-buttons li.rrssb-email a:hover{background-color:#006ed6}.rrssb-buttons li.rrssb-facebook a{background-color:#306199}.rrssb-buttons li.rrssb-facebook a:hover{background-color:#244872}.rrssb-buttons li.rrssb-tumblr a{background-color:#32506d}.rrssb-buttons li.rrssb-tumblr a:hover{background-color:#22364a}.rrssb-buttons li.rrssb-linkedin a{background-color:#007bb6}.rrssb-buttons li.rrssb-linkedin a:hover{background-color:#005983}.rrssb-buttons li.rrssb-twitter a{background-color:#26c4f1}.rrssb-buttons li.rrssb-twitter a:hover{background-color:#0eaad6}.rrssb-buttons li.rrssb-googleplus a{background-color:#e93f2e}.rrssb-buttons li.rrssb-googleplus a:hover{background-color:#ce2616}.rrssb-buttons li.rrssb-youtube a{background-color:#df1c31}.rrssb-buttons li.rrssb-youtube a:hover{background-color:#b21627}.rrssb-buttons li.rrssb-reddit a{background-color:#8bbbe3}.rrssb-buttons li.rrssb-reddit a:hover{background-color:#62a3d9}.rrssb-buttons li.rrssb-pinterest a{background-color:#b81621}.rrssb-buttons li.rrssb-pinterest a:hover{background-color:#8a1119}.rrssb-buttons li.rrssb-pocket a{background-color:#ed4054}.rrssb-buttons li.rrssb-pocket a:hover{background-color:#e4162d}.rrssb-buttons li.rrssb-github a{background-color:#444}.rrssb-buttons li.rrssb-github a:hover{background-color:#2b2b2b}.rrssb-buttons li.rrssb-instagram a{background-color:#517fa4}.rrssb-buttons li.rrssb-instagram a:hover{background-color:#406582}.rrssb-buttons li.rrssb-delicious a{background-color:#0B79E5}.rrssb-buttons li.rrssb-delicious a:hover{background-color:#095fb4}.rrssb-buttons li.rrssb-vk a{background-color:#4d71a9}.rrssb-buttons li.rrssb-vk a:hover{background-color:#3d5a86}.rrssb-buttons li.rrssb-hackernews a{background-color:#f60}.rrssb-buttons li.rrssb-hackernews a:hover{background-color:#cc5200}.rrssb-buttons li a{background-color:#ccc;border-radius:2px;box-sizing:border-box;display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:700;height:100%;padding:11px 7px 12px 27px;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;width:100%}.rrssb-buttons li a .rrssb-icon{display:block;left:10px;padding-top:9px;position:absolute;top:0;width:10%}.rrssb-buttons li a .rrssb-icon svg{height:17px;width:17px}.rrssb-buttons li a .rrssb-icon svg path{fill:#fff}.rrssb-buttons li a .rrssb-text{color:#fff}.rrssb-buttons li a:active{box-shadow:inset 1px 3px 15px 0 rgba(22,0,0,.25)}.rrssb-buttons li.small a{padding:0}.rrssb-buttons li.small a .rrssb-icon{left:auto;margin:0 auto;overflow:hidden;position:relative;top:auto;width:100%}.rrssb-buttons li.small a .rrssb-text{visibility:hidden}.rrssb-buttons.large-format,.rrssb-buttons.large-format li{height:auto}.rrssb-buttons.large-format li a{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:.2em;padding:8.5% 0 8.5% 12%}.rrssb-buttons.large-format li a .rrssb-icon{height:100%;left:7%;padding-top:0;width:12%}.rrssb-buttons.large-format li a .rrssb-icon svg{height:100%;position:absolute;top:0;width:100%}.rrssb-buttons.large-format li a .rrssb-text{-webkit-backface-visibility:hidden;backface-visibility:hidden}.rrssb-buttons.small-format{padding-top:5px}.rrssb-buttons.small-format li{height:80%;padding:0 1px}.rrssb-buttons.small-format li a .rrssb-icon{height:100%;padding-top:0}.rrssb-buttons.small-format li a .rrssb-icon svg{height:48%;position:relative;top:6px;width:80%}.rrssb-buttons.tiny-format{height:22px;position:relative}.rrssb-buttons.tiny-format li{padding-right:7px}.rrssb-buttons.tiny-format li a{background-color:transparent;padding:0}.rrssb-buttons.tiny-format li a .rrssb-icon svg{height:70%;width:100%}.rrssb-buttons.tiny-format li a:active,.rrssb-buttons.tiny-format li a:hover{background-color:transparent}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon svg path{fill:#0a88ff}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon:hover .rrssb-icon svg path{fill:#0054a3}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon svg path{fill:#306199}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon:hover .rrssb-icon svg path{fill:#18304b}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon svg path{fill:#32506d}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon:hover .rrssb-icon svg path{fill:#121d27}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon svg path{fill:#007bb6}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon:hover .rrssb-icon svg path{fill:#003650}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon svg path{fill:#26c4f1}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon:hover .rrssb-icon svg path{fill:#0b84a6}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon svg path{fill:#e93f2e}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon:hover .rrssb-icon svg path{fill:#a01e11}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon svg path{fill:#df1c31}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon:hover .rrssb-icon svg path{fill:#84111d}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon svg path{fill:#8bbbe3}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon:hover .rrssb-icon svg path{fill:#398bcf}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon svg path{fill:#b81621}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon:hover .rrssb-icon svg path{fill:#5d0b11}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon svg path{fill:#ed4054}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon:hover .rrssb-icon svg path{fill:#b61124}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon svg path{fill:#444}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon:hover .rrssb-icon svg path{fill:#111}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon svg path{fill:#517fa4}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon:hover .rrssb-icon svg path{fill:#2f4a60}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon svg path{fill:#0B79E5}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon:hover .rrssb-icon svg path{fill:#064684}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon svg path{fill:#4d71a9}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon:hover .rrssb-icon svg path{fill:#2d4263}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon svg path{fill:#f60}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon:hover .rrssb-icon svg path{fill:#993d00} \ No newline at end of file diff --git a/js/rrssb.js b/js/rrssb.js index 0e8c407..40d5976 100755 --- a/js/rrssb.js +++ b/js/rrssb.js @@ -128,8 +128,11 @@ // enlarge buttons if they get wide enough if (buttonWidth > 170 && $('li.small', self).length < 1) { self.addClass('large-format'); + var fontSize = buttonWidth / 12 + 'px'; + self.css('font-size', fontSize); } else { self.removeClass('large-format'); + self.css('font-size', ''); } if (containerWidth < 200) { diff --git a/js/rrssb.min.js b/js/rrssb.min.js index 6bff127..a7fc01d 100755 --- a/js/rrssb.min.js +++ b/js/rrssb.min.js @@ -1 +1 @@ -+function(t,e,r){"use strict";var i={calc:!1};e.fn.rrssb=function(t){var i=e.extend({description:r,emailAddress:r,emailBody:r,emailSubject:r,image:r,title:r,url:r},t);for(var s in i)i.hasOwnProperty(s)&&i[s]!==r&&(i[s]=n(i[s]));i.url!==r&&(e(this).find(".rrssb-facebook a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+i.url),e(this).find(".rrssb-tumblr a").attr("href","http://tumblr.com/share/link?url="+i.url+(i.title!==r?"&name="+i.title:"")+(i.description!==r?"&description="+i.description:"")),e(this).find(".rrssb-linkedin a").attr("href","http://www.linkedin.com/shareArticle?mini=true&url="+i.url+(i.title!==r?"&title="+i.title:"")+(i.description!==r?"&summary="+i.description:"")),e(this).find(".rrssb-twitter a").attr("href","https://twitter.com/intent/tweet?text="+(i.description!==r?i.description:"")+"%20"+i.url),e(this).find(".rrssb-hackernews a").attr("href","https://news.ycombinator.com/submitlink?u="+i.url+(i.title!==r?"&text="+i.title:"")),e(this).find(".rrssb-reddit a").attr("href","http://www.reddit.com/submit?url="+i.url+(i.description!==r?"&text="+i.description:"")+(i.title!==r?"&title="+i.title:"")),e(this).find(".rrssb-googleplus a").attr("href","https://plus.google.com/share?url="+(i.description!==r?i.description:"")+"%20"+i.url),e(this).find(".rrssb-pinterest a").attr("href","http://pinterest.com/pin/create/button/?url="+i.url+(i.image!==r?"&media="+i.image:"")+(i.description!==r?"&description="+i.description:"")),e(this).find(".rrssb-pocket a").attr("href","https://getpocket.com/save?url="+i.url),e(this).find(".rrssb-github a").attr("href",i.url)),i.emailAddress!==r&&e(this).find(".rrssb-email a").attr("href","mailto:"+i.emailAddress+"?"+(i.emailSubject!==r?"subject="+i.emailSubject:"")+(i.emailBody!==r?"&body="+i.emailBody:""))};var s=function(){var t=e("
"),r=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var s=0;s170&&e("li.small",r).length<1?r.addClass("large-format"):r.removeClass("large-format"),200>i?r.removeClass("small-format").addClass("tiny-format"):r.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var r=e(this),i=e("li",r),s=i.filter(".small"),n=0,a=0,l=s.first(),o=parseFloat(l.attr("data-size"))+55,c=s.length;if(c===i.length){var d=42*c,m=r.width();m>d+o&&(r.removeClass("small-format"),s.first().removeClass("small"),h())}else{i.not(".small").each(function(t){var r=e(this),i=parseFloat(r.attr("data-size"))+55,s=parseFloat(r.width());n+=s,a+=i});var u=n-a;u>o&&(l.removeClass("small"),h())}})},c=function(t){e(".rrssb-buttons").each(function(t){var r=e(this),i=e("li",r);e(i.get().reverse()).each(function(t,r){var s=e(this);if(s.hasClass("small")===!1){var n=parseFloat(s.attr("data-size"))+55,a=parseFloat(s.width());if(n>a){var l=i.not(".small").last();e(l).addClass("small"),h()}}--r||o()})}),t===!0&&m(h)},h=function(){e(".rrssb-buttons").each(function(t){var r,s,n,l,o,c=e(this),h=e("li",c),d=h.filter(".small"),m=d.length;m>0&&m!==h.length?(c.removeClass("small-format"),d.css("width","42px"),n=42*m,r=h.not(".small").length,s=100/r,o=n/r,i.calc===!1?(l=(c.innerWidth()-1)/r-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=i.calc+"("+s+"% - "+o+"px)",h.not(".small").css("width",l)):m===h.length?(c.addClass("small-format"),a()):(c.removeClass("small-format"),a())}),l()},d=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),s(),a(),e(".rrssb-buttons li .rrssb-text").each(function(t){var r=e(this),i=r.width();r.closest("li").attr("data-size",i)}),c(!0)},m=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},u=function(e,i,s,n){var a=t.screenLeft!==r?t.screenLeft:screen.left,l=t.screenTop!==r?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,h=o/2-s/2+a,d=c/3-n/3+l,m=t.open(e,i,"scrollbars=yes, width="+s+", height="+n+", top="+d+", left="+h);t.focus&&m.focus()},f=function(){var t={};return function(e,r,i){i||(i="Don't call this twice without a uniqueId"),t[i]&&clearTimeout(t[i]),t[i]=setTimeout(e,r)}}();e(document).ready(function(){e(document).on("click",".rrssb-buttons a.popup",{},function(t){var r=e(this);u(r.attr("href"),r.find(".rrssb-text").html(),580,470),t.preventDefault()}),e(t).resize(function(){m(h),f(function(){m(h)},200,"finished resizing")}),d()}),t.rrssbInit=d}(window,jQuery); \ No newline at end of file ++function(t,e,s){"use strict";var i={calc:!1};e.fn.rrssb=function(t){var i=e.extend({description:s,emailAddress:s,emailBody:s,emailSubject:s,image:s,title:s,url:s},t);for(var r in i)i.hasOwnProperty(r)&&i[r]!==s&&(i[r]=n(i[r]));i.url!==s&&(e(this).find(".rrssb-facebook a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+i.url),e(this).find(".rrssb-tumblr a").attr("href","http://tumblr.com/share/link?url="+i.url+(i.title!==s?"&name="+i.title:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-linkedin a").attr("href","http://www.linkedin.com/shareArticle?mini=true&url="+i.url+(i.title!==s?"&title="+i.title:"")+(i.description!==s?"&summary="+i.description:"")),e(this).find(".rrssb-twitter a").attr("href","https://twitter.com/intent/tweet?text="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-hackernews a").attr("href","https://news.ycombinator.com/submitlink?u="+i.url+(i.title!==s?"&text="+i.title:"")),e(this).find(".rrssb-reddit a").attr("href","http://www.reddit.com/submit?url="+i.url+(i.description!==s?"&text="+i.description:"")+(i.title!==s?"&title="+i.title:"")),e(this).find(".rrssb-googleplus a").attr("href","https://plus.google.com/share?url="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-pinterest a").attr("href","http://pinterest.com/pin/create/button/?url="+i.url+(i.image!==s?"&media="+i.image:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-pocket a").attr("href","https://getpocket.com/save?url="+i.url),e(this).find(".rrssb-github a").attr("href",i.url)),i.emailAddress!==s&&e(this).find(".rrssb-email a").attr("href","mailto:"+i.emailAddress+"?"+(i.emailSubject!==s?"subject="+i.emailSubject:"")+(i.emailBody!==s?"&body="+i.emailBody:""))};var r=function(){var t=e("
"),s=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var r=0;r170&&e("li.small",s).length<1){s.addClass("large-format");var n=r/12+"px";console.log("font-size is"+n),s.css("font-size",n)}else s.removeClass("large-format"),s.css("font-size","");200>i?s.removeClass("small-format").addClass("tiny-format"):s.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s),r=i.filter(".small"),n=0,a=0,l=r.first(),o=parseFloat(l.attr("data-size"))+55,c=r.length;if(c===i.length){var d=42*c,m=s.width();m>d+o&&(s.removeClass("small-format"),r.first().removeClass("small"),h())}else{i.not(".small").each(function(t){var s=e(this),i=parseFloat(s.attr("data-size"))+55,r=parseFloat(s.width());n+=r,a+=i});var u=n-a;u>o&&(l.removeClass("small"),h())}})},c=function(t){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s);e(i.get().reverse()).each(function(t,s){var r=e(this);if(r.hasClass("small")===!1){var n=parseFloat(r.attr("data-size"))+55,a=parseFloat(r.width());if(n>a){var l=i.not(".small").last();e(l).addClass("small"),h()}}--s||o()})}),t===!0&&m(h)},h=function(){e(".rrssb-buttons").each(function(t){var s,r,n,l,o,c=e(this),h=e("li",c),d=h.filter(".small"),m=d.length;m>0&&m!==h.length?(c.removeClass("small-format"),d.css("width","42px"),n=42*m,s=h.not(".small").length,r=100/s,o=n/s,i.calc===!1?(l=(c.innerWidth()-1)/s-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=i.calc+"("+r+"% - "+o+"px)",h.not(".small").css("width",l)):m===h.length?(c.addClass("small-format"),a()):(c.removeClass("small-format"),a())}),l()},d=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),r(),a(),e(".rrssb-buttons li .rrssb-text").each(function(t){var s=e(this),i=s.width();s.closest("li").attr("data-size",i)}),c(!0)},m=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},u=function(e,i,r,n){var a=t.screenLeft!==s?t.screenLeft:screen.left,l=t.screenTop!==s?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,h=o/2-r/2+a,d=c/3-n/3+l,m=t.open(e,i,"scrollbars=yes, width="+r+", height="+n+", top="+d+", left="+h);m&&m.focus&&m.focus()},f=function(){var t={};return function(e,s,i){i||(i="Don't call this twice without a uniqueId"),t[i]&&clearTimeout(t[i]),t[i]=setTimeout(e,s)}}();e(document).ready(function(){e(document).on("click",".rrssb-buttons a.popup",{},function(t){var s=e(this);u(s.attr("href"),s.find(".rrssb-text").html(),580,470),t.preventDefault()}),e(t).resize(function(){m(h),f(function(){m(h)},200,"finished resizing")}),d()}),t.rrssbInit=d}(window,jQuery); \ No newline at end of file diff --git a/scss/rrssb.scss b/scss/rrssb.scss index 99551e8..8303b4a 100755 --- a/scss/rrssb.scss +++ b/scss/rrssb.scss @@ -111,7 +111,6 @@ $social-list: ( border-radius: $rrssb-border-radius; box-sizing: border-box; display: block; - font-size: 11px; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-weight: bold; @@ -177,93 +176,7 @@ $social-list: ( li { height: auto; - // Determine font-size based on number of siblings - &:first-child:nth-last-child(1) { - a { - font-size: 20px; //fallback - font-size: 4vw; - } - } - - &:first-child:nth-last-child(2), - &:first-child:nth-last-child(2) ~ li { - a { - font-size: 16px; //fallback - font-size: 2vw; - } - } - - &:first-child:nth-last-child(3), - &:first-child:nth-last-child(3) ~ li { - a { - font-size: 14px; //fallback - font-size: 1.7vw; - } - } - - &:first-child:nth-last-child(4), - &:first-child:nth-last-child(4) ~ li { - a { - font-size: 13px; //fallback - font-size: 1.4vw; - } - } - - &:first-child:nth-last-child(5), - &:first-child:nth-last-child(5) ~ li { - a { - font-size: 13px; //fallback - font-size: 1.2vw; - } - } - - &:first-child:nth-last-child(6), - &:first-child:nth-last-child(6) ~ li { - a { - font-size: 12px; //fallback - font-size: 1.05vw; - } - } - - &:first-child:nth-last-child(7), - &:first-child:nth-last-child(7) ~ li { - a { - font-size: 11px; //fallback - font-size: .9vw; - } - } - - &:first-child:nth-last-child(8), - &:first-child:nth-last-child(8) ~ li { - a { - font-size: 11px; //fallback - font-size: .8vw; - } - } - - &:first-child:nth-last-child(9), - &:first-child:nth-last-child(9) ~ li { - a { - font-size: 11px; //fallback - font-size: .7vw; - } - } - - &:first-child:nth-last-child(10), - &:first-child:nth-last-child(10) ~ li { - a { - font-size: 11px; //fallback - font-size: .6vw; - } - } - - &:first-child:nth-last-child(11), - &:first-child:nth-last-child(11) ~ li { - a { - font-size: 11px; //fallback - font-size: .5vw; - } - } + a { backface-visibility: hidden; From 804802f98d8bc9cfbf71749b435f0da9654ad98e Mon Sep 17 00:00:00 2001 From: dbox Date: Tue, 8 Dec 2015 11:33:58 -0600 Subject: [PATCH 2/5] set default fontsize to 12px, minimize icons --- css/rrssb.css | 2 +- icons/delicious.min.svg | 2 +- icons/github.min.svg | 2 +- icons/hackernews.min.svg | 2 +- icons/instagram.min.svg | 2 +- icons/pocket.min.svg | 2 +- icons/reddit.min.svg | 2 +- icons/tumblr.min.svg | 2 +- icons/twitter.min.svg | 2 +- icons/youtube.min.svg | 2 +- js/rrssb.min.js | 2 +- scss/rrssb.scss | 3 ++- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/css/rrssb.css b/css/rrssb.css index 38f534c..b95d442 100755 --- a/css/rrssb.css +++ b/css/rrssb.css @@ -1 +1 @@ -.rrssb-buttons{box-sizing:border-box;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;height:36px;margin:0;padding:0;width:100%}.rrssb-buttons:after{clear:both}.rrssb-buttons:after,.rrssb-buttons:before{content:' ';display:table}.rrssb-buttons li{box-sizing:border-box;float:left;height:100%;line-height:13px;list-style:none;margin:0;padding:0 2px}.rrssb-buttons li.rrssb-email a{background-color:#0a88ff}.rrssb-buttons li.rrssb-email a:hover{background-color:#006ed6}.rrssb-buttons li.rrssb-facebook a{background-color:#306199}.rrssb-buttons li.rrssb-facebook a:hover{background-color:#244872}.rrssb-buttons li.rrssb-tumblr a{background-color:#32506d}.rrssb-buttons li.rrssb-tumblr a:hover{background-color:#22364a}.rrssb-buttons li.rrssb-linkedin a{background-color:#007bb6}.rrssb-buttons li.rrssb-linkedin a:hover{background-color:#005983}.rrssb-buttons li.rrssb-twitter a{background-color:#26c4f1}.rrssb-buttons li.rrssb-twitter a:hover{background-color:#0eaad6}.rrssb-buttons li.rrssb-googleplus a{background-color:#e93f2e}.rrssb-buttons li.rrssb-googleplus a:hover{background-color:#ce2616}.rrssb-buttons li.rrssb-youtube a{background-color:#df1c31}.rrssb-buttons li.rrssb-youtube a:hover{background-color:#b21627}.rrssb-buttons li.rrssb-reddit a{background-color:#8bbbe3}.rrssb-buttons li.rrssb-reddit a:hover{background-color:#62a3d9}.rrssb-buttons li.rrssb-pinterest a{background-color:#b81621}.rrssb-buttons li.rrssb-pinterest a:hover{background-color:#8a1119}.rrssb-buttons li.rrssb-pocket a{background-color:#ed4054}.rrssb-buttons li.rrssb-pocket a:hover{background-color:#e4162d}.rrssb-buttons li.rrssb-github a{background-color:#444}.rrssb-buttons li.rrssb-github a:hover{background-color:#2b2b2b}.rrssb-buttons li.rrssb-instagram a{background-color:#517fa4}.rrssb-buttons li.rrssb-instagram a:hover{background-color:#406582}.rrssb-buttons li.rrssb-delicious a{background-color:#0B79E5}.rrssb-buttons li.rrssb-delicious a:hover{background-color:#095fb4}.rrssb-buttons li.rrssb-vk a{background-color:#4d71a9}.rrssb-buttons li.rrssb-vk a:hover{background-color:#3d5a86}.rrssb-buttons li.rrssb-hackernews a{background-color:#f60}.rrssb-buttons li.rrssb-hackernews a:hover{background-color:#cc5200}.rrssb-buttons li a{background-color:#ccc;border-radius:2px;box-sizing:border-box;display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:700;height:100%;padding:11px 7px 12px 27px;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;width:100%}.rrssb-buttons li a .rrssb-icon{display:block;left:10px;padding-top:9px;position:absolute;top:0;width:10%}.rrssb-buttons li a .rrssb-icon svg{height:17px;width:17px}.rrssb-buttons li a .rrssb-icon svg path{fill:#fff}.rrssb-buttons li a .rrssb-text{color:#fff}.rrssb-buttons li a:active{box-shadow:inset 1px 3px 15px 0 rgba(22,0,0,.25)}.rrssb-buttons li.small a{padding:0}.rrssb-buttons li.small a .rrssb-icon{left:auto;margin:0 auto;overflow:hidden;position:relative;top:auto;width:100%}.rrssb-buttons li.small a .rrssb-text{visibility:hidden}.rrssb-buttons.large-format,.rrssb-buttons.large-format li{height:auto}.rrssb-buttons.large-format li a{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:.2em;padding:8.5% 0 8.5% 12%}.rrssb-buttons.large-format li a .rrssb-icon{height:100%;left:7%;padding-top:0;width:12%}.rrssb-buttons.large-format li a .rrssb-icon svg{height:100%;position:absolute;top:0;width:100%}.rrssb-buttons.large-format li a .rrssb-text{-webkit-backface-visibility:hidden;backface-visibility:hidden}.rrssb-buttons.small-format{padding-top:5px}.rrssb-buttons.small-format li{height:80%;padding:0 1px}.rrssb-buttons.small-format li a .rrssb-icon{height:100%;padding-top:0}.rrssb-buttons.small-format li a .rrssb-icon svg{height:48%;position:relative;top:6px;width:80%}.rrssb-buttons.tiny-format{height:22px;position:relative}.rrssb-buttons.tiny-format li{padding-right:7px}.rrssb-buttons.tiny-format li a{background-color:transparent;padding:0}.rrssb-buttons.tiny-format li a .rrssb-icon svg{height:70%;width:100%}.rrssb-buttons.tiny-format li a:active,.rrssb-buttons.tiny-format li a:hover{background-color:transparent}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon svg path{fill:#0a88ff}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon:hover .rrssb-icon svg path{fill:#0054a3}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon svg path{fill:#306199}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon:hover .rrssb-icon svg path{fill:#18304b}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon svg path{fill:#32506d}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon:hover .rrssb-icon svg path{fill:#121d27}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon svg path{fill:#007bb6}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon:hover .rrssb-icon svg path{fill:#003650}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon svg path{fill:#26c4f1}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon:hover .rrssb-icon svg path{fill:#0b84a6}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon svg path{fill:#e93f2e}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon:hover .rrssb-icon svg path{fill:#a01e11}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon svg path{fill:#df1c31}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon:hover .rrssb-icon svg path{fill:#84111d}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon svg path{fill:#8bbbe3}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon:hover .rrssb-icon svg path{fill:#398bcf}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon svg path{fill:#b81621}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon:hover .rrssb-icon svg path{fill:#5d0b11}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon svg path{fill:#ed4054}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon:hover .rrssb-icon svg path{fill:#b61124}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon svg path{fill:#444}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon:hover .rrssb-icon svg path{fill:#111}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon svg path{fill:#517fa4}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon:hover .rrssb-icon svg path{fill:#2f4a60}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon svg path{fill:#0B79E5}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon:hover .rrssb-icon svg path{fill:#064684}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon svg path{fill:#4d71a9}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon:hover .rrssb-icon svg path{fill:#2d4263}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon svg path{fill:#f60}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon:hover .rrssb-icon svg path{fill:#993d00} \ No newline at end of file +.rrssb-buttons{box-sizing:border-box;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;height:36px;margin:0;padding:0;width:100%;font-size:12px}.rrssb-buttons:after{clear:both}.rrssb-buttons:after,.rrssb-buttons:before{content:' ';display:table}.rrssb-buttons li{box-sizing:border-box;float:left;height:100%;line-height:13px;list-style:none;margin:0;padding:0 2px}.rrssb-buttons li.rrssb-email a{background-color:#0a88ff}.rrssb-buttons li.rrssb-email a:hover{background-color:#006ed6}.rrssb-buttons li.rrssb-facebook a{background-color:#306199}.rrssb-buttons li.rrssb-facebook a:hover{background-color:#244872}.rrssb-buttons li.rrssb-tumblr a{background-color:#32506d}.rrssb-buttons li.rrssb-tumblr a:hover{background-color:#22364a}.rrssb-buttons li.rrssb-linkedin a{background-color:#007bb6}.rrssb-buttons li.rrssb-linkedin a:hover{background-color:#005983}.rrssb-buttons li.rrssb-twitter a{background-color:#26c4f1}.rrssb-buttons li.rrssb-twitter a:hover{background-color:#0eaad6}.rrssb-buttons li.rrssb-googleplus a{background-color:#e93f2e}.rrssb-buttons li.rrssb-googleplus a:hover{background-color:#ce2616}.rrssb-buttons li.rrssb-youtube a{background-color:#df1c31}.rrssb-buttons li.rrssb-youtube a:hover{background-color:#b21627}.rrssb-buttons li.rrssb-reddit a{background-color:#8bbbe3}.rrssb-buttons li.rrssb-reddit a:hover{background-color:#62a3d9}.rrssb-buttons li.rrssb-pinterest a{background-color:#b81621}.rrssb-buttons li.rrssb-pinterest a:hover{background-color:#8a1119}.rrssb-buttons li.rrssb-pocket a{background-color:#ed4054}.rrssb-buttons li.rrssb-pocket a:hover{background-color:#e4162d}.rrssb-buttons li.rrssb-github a{background-color:#444}.rrssb-buttons li.rrssb-github a:hover{background-color:#2b2b2b}.rrssb-buttons li.rrssb-instagram a{background-color:#517fa4}.rrssb-buttons li.rrssb-instagram a:hover{background-color:#406582}.rrssb-buttons li.rrssb-delicious a{background-color:#0B79E5}.rrssb-buttons li.rrssb-delicious a:hover{background-color:#095fb4}.rrssb-buttons li.rrssb-vk a{background-color:#4d71a9}.rrssb-buttons li.rrssb-vk a:hover{background-color:#3d5a86}.rrssb-buttons li.rrssb-hackernews a{background-color:#f60}.rrssb-buttons li.rrssb-hackernews a:hover{background-color:#cc5200}.rrssb-buttons li a{background-color:#ccc;border-radius:2px;box-sizing:border-box;display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:700;height:100%;padding:11px 7px 12px 27px;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;width:100%}.rrssb-buttons li a .rrssb-icon{display:block;left:10px;padding-top:9px;position:absolute;top:0;width:10%}.rrssb-buttons li a .rrssb-icon svg{height:17px;width:17px}.rrssb-buttons li a .rrssb-icon svg path{fill:#fff}.rrssb-buttons li a .rrssb-text{color:#fff}.rrssb-buttons li a:active{box-shadow:inset 1px 3px 15px 0 rgba(22,0,0,.25)}.rrssb-buttons li.small a{padding:0}.rrssb-buttons li.small a .rrssb-icon{left:auto;margin:0 auto;overflow:hidden;position:relative;top:auto;width:100%}.rrssb-buttons li.small a .rrssb-text{visibility:hidden}.rrssb-buttons.large-format,.rrssb-buttons.large-format li{height:auto}.rrssb-buttons.large-format li a{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:.2em;padding:8.5% 0 8.5% 12%}.rrssb-buttons.large-format li a .rrssb-icon{height:100%;left:7%;padding-top:0;width:12%}.rrssb-buttons.large-format li a .rrssb-icon svg{height:100%;position:absolute;top:0;width:100%}.rrssb-buttons.large-format li a .rrssb-text{-webkit-backface-visibility:hidden;backface-visibility:hidden}.rrssb-buttons.small-format{padding-top:5px}.rrssb-buttons.small-format li{height:80%;padding:0 1px}.rrssb-buttons.small-format li a .rrssb-icon{height:100%;padding-top:0}.rrssb-buttons.small-format li a .rrssb-icon svg{height:48%;position:relative;top:6px;width:80%}.rrssb-buttons.tiny-format{height:22px;position:relative}.rrssb-buttons.tiny-format li{padding-right:7px}.rrssb-buttons.tiny-format li a{background-color:transparent;padding:0}.rrssb-buttons.tiny-format li a .rrssb-icon svg{height:70%;width:100%}.rrssb-buttons.tiny-format li a:active,.rrssb-buttons.tiny-format li a:hover{background-color:transparent}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon svg path{fill:#0a88ff}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon:hover .rrssb-icon svg path{fill:#0054a3}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon svg path{fill:#306199}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon:hover .rrssb-icon svg path{fill:#18304b}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon svg path{fill:#32506d}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon:hover .rrssb-icon svg path{fill:#121d27}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon svg path{fill:#007bb6}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon:hover .rrssb-icon svg path{fill:#003650}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon svg path{fill:#26c4f1}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon:hover .rrssb-icon svg path{fill:#0b84a6}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon svg path{fill:#e93f2e}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon:hover .rrssb-icon svg path{fill:#a01e11}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon svg path{fill:#df1c31}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon:hover .rrssb-icon svg path{fill:#84111d}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon svg path{fill:#8bbbe3}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon:hover .rrssb-icon svg path{fill:#398bcf}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon svg path{fill:#b81621}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon:hover .rrssb-icon svg path{fill:#5d0b11}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon svg path{fill:#ed4054}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon:hover .rrssb-icon svg path{fill:#b61124}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon svg path{fill:#444}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon:hover .rrssb-icon svg path{fill:#111}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon svg path{fill:#517fa4}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon:hover .rrssb-icon svg path{fill:#2f4a60}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon svg path{fill:#0B79E5}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon:hover .rrssb-icon svg path{fill:#064684}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon svg path{fill:#4d71a9}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon:hover .rrssb-icon svg path{fill:#2d4263}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon svg path{fill:#f60}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon:hover .rrssb-icon svg path{fill:#993d00} \ No newline at end of file diff --git a/icons/delicious.min.svg b/icons/delicious.min.svg index 741ca3b..990850a 100644 --- a/icons/delicious.min.svg +++ b/icons/delicious.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/github.min.svg b/icons/github.min.svg index d107246..fd9f64e 100755 --- a/icons/github.min.svg +++ b/icons/github.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/hackernews.min.svg b/icons/hackernews.min.svg index e0da2db..5d4f7d3 100644 --- a/icons/hackernews.min.svg +++ b/icons/hackernews.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/instagram.min.svg b/icons/instagram.min.svg index 90be638..490fb52 100755 --- a/icons/instagram.min.svg +++ b/icons/instagram.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/pocket.min.svg b/icons/pocket.min.svg index 4a11823..70415f6 100755 --- a/icons/pocket.min.svg +++ b/icons/pocket.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/reddit.min.svg b/icons/reddit.min.svg index d8c0030..22de3ed 100755 --- a/icons/reddit.min.svg +++ b/icons/reddit.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/tumblr.min.svg b/icons/tumblr.min.svg index 907dabe..f63154d 100755 --- a/icons/tumblr.min.svg +++ b/icons/tumblr.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/twitter.min.svg b/icons/twitter.min.svg index 7bc2ea0..71891a7 100755 --- a/icons/twitter.min.svg +++ b/icons/twitter.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/youtube.min.svg b/icons/youtube.min.svg index 0292dcb..a1c8afe 100755 --- a/icons/youtube.min.svg +++ b/icons/youtube.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/js/rrssb.min.js b/js/rrssb.min.js index a7fc01d..aa4c4d5 100755 --- a/js/rrssb.min.js +++ b/js/rrssb.min.js @@ -1 +1 @@ -+function(t,e,s){"use strict";var i={calc:!1};e.fn.rrssb=function(t){var i=e.extend({description:s,emailAddress:s,emailBody:s,emailSubject:s,image:s,title:s,url:s},t);for(var r in i)i.hasOwnProperty(r)&&i[r]!==s&&(i[r]=n(i[r]));i.url!==s&&(e(this).find(".rrssb-facebook a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+i.url),e(this).find(".rrssb-tumblr a").attr("href","http://tumblr.com/share/link?url="+i.url+(i.title!==s?"&name="+i.title:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-linkedin a").attr("href","http://www.linkedin.com/shareArticle?mini=true&url="+i.url+(i.title!==s?"&title="+i.title:"")+(i.description!==s?"&summary="+i.description:"")),e(this).find(".rrssb-twitter a").attr("href","https://twitter.com/intent/tweet?text="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-hackernews a").attr("href","https://news.ycombinator.com/submitlink?u="+i.url+(i.title!==s?"&text="+i.title:"")),e(this).find(".rrssb-reddit a").attr("href","http://www.reddit.com/submit?url="+i.url+(i.description!==s?"&text="+i.description:"")+(i.title!==s?"&title="+i.title:"")),e(this).find(".rrssb-googleplus a").attr("href","https://plus.google.com/share?url="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-pinterest a").attr("href","http://pinterest.com/pin/create/button/?url="+i.url+(i.image!==s?"&media="+i.image:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-pocket a").attr("href","https://getpocket.com/save?url="+i.url),e(this).find(".rrssb-github a").attr("href",i.url)),i.emailAddress!==s&&e(this).find(".rrssb-email a").attr("href","mailto:"+i.emailAddress+"?"+(i.emailSubject!==s?"subject="+i.emailSubject:"")+(i.emailBody!==s?"&body="+i.emailBody:""))};var r=function(){var t=e("
"),s=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var r=0;r170&&e("li.small",s).length<1){s.addClass("large-format");var n=r/12+"px";console.log("font-size is"+n),s.css("font-size",n)}else s.removeClass("large-format"),s.css("font-size","");200>i?s.removeClass("small-format").addClass("tiny-format"):s.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s),r=i.filter(".small"),n=0,a=0,l=r.first(),o=parseFloat(l.attr("data-size"))+55,c=r.length;if(c===i.length){var d=42*c,m=s.width();m>d+o&&(s.removeClass("small-format"),r.first().removeClass("small"),h())}else{i.not(".small").each(function(t){var s=e(this),i=parseFloat(s.attr("data-size"))+55,r=parseFloat(s.width());n+=r,a+=i});var u=n-a;u>o&&(l.removeClass("small"),h())}})},c=function(t){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s);e(i.get().reverse()).each(function(t,s){var r=e(this);if(r.hasClass("small")===!1){var n=parseFloat(r.attr("data-size"))+55,a=parseFloat(r.width());if(n>a){var l=i.not(".small").last();e(l).addClass("small"),h()}}--s||o()})}),t===!0&&m(h)},h=function(){e(".rrssb-buttons").each(function(t){var s,r,n,l,o,c=e(this),h=e("li",c),d=h.filter(".small"),m=d.length;m>0&&m!==h.length?(c.removeClass("small-format"),d.css("width","42px"),n=42*m,s=h.not(".small").length,r=100/s,o=n/s,i.calc===!1?(l=(c.innerWidth()-1)/s-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=i.calc+"("+r+"% - "+o+"px)",h.not(".small").css("width",l)):m===h.length?(c.addClass("small-format"),a()):(c.removeClass("small-format"),a())}),l()},d=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),r(),a(),e(".rrssb-buttons li .rrssb-text").each(function(t){var s=e(this),i=s.width();s.closest("li").attr("data-size",i)}),c(!0)},m=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},u=function(e,i,r,n){var a=t.screenLeft!==s?t.screenLeft:screen.left,l=t.screenTop!==s?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,h=o/2-r/2+a,d=c/3-n/3+l,m=t.open(e,i,"scrollbars=yes, width="+r+", height="+n+", top="+d+", left="+h);m&&m.focus&&m.focus()},f=function(){var t={};return function(e,s,i){i||(i="Don't call this twice without a uniqueId"),t[i]&&clearTimeout(t[i]),t[i]=setTimeout(e,s)}}();e(document).ready(function(){e(document).on("click",".rrssb-buttons a.popup",{},function(t){var s=e(this);u(s.attr("href"),s.find(".rrssb-text").html(),580,470),t.preventDefault()}),e(t).resize(function(){m(h),f(function(){m(h)},200,"finished resizing")}),d()}),t.rrssbInit=d}(window,jQuery); \ No newline at end of file ++function(t,e,s){"use strict";var i={calc:!1};e.fn.rrssb=function(t){var i=e.extend({description:s,emailAddress:s,emailBody:s,emailSubject:s,image:s,title:s,url:s},t);for(var r in i)i.hasOwnProperty(r)&&i[r]!==s&&(i[r]=n(i[r]));i.url!==s&&(e(this).find(".rrssb-facebook a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+i.url),e(this).find(".rrssb-tumblr a").attr("href","http://tumblr.com/share/link?url="+i.url+(i.title!==s?"&name="+i.title:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-linkedin a").attr("href","http://www.linkedin.com/shareArticle?mini=true&url="+i.url+(i.title!==s?"&title="+i.title:"")+(i.description!==s?"&summary="+i.description:"")),e(this).find(".rrssb-twitter a").attr("href","https://twitter.com/intent/tweet?text="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-hackernews a").attr("href","https://news.ycombinator.com/submitlink?u="+i.url+(i.title!==s?"&text="+i.title:"")),e(this).find(".rrssb-reddit a").attr("href","http://www.reddit.com/submit?url="+i.url+(i.description!==s?"&text="+i.description:"")+(i.title!==s?"&title="+i.title:"")),e(this).find(".rrssb-googleplus a").attr("href","https://plus.google.com/share?url="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-pinterest a").attr("href","http://pinterest.com/pin/create/button/?url="+i.url+(i.image!==s?"&media="+i.image:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-pocket a").attr("href","https://getpocket.com/save?url="+i.url),e(this).find(".rrssb-github a").attr("href",i.url)),i.emailAddress!==s&&e(this).find(".rrssb-email a").attr("href","mailto:"+i.emailAddress+"?"+(i.emailSubject!==s?"subject="+i.emailSubject:"")+(i.emailBody!==s?"&body="+i.emailBody:""))};var r=function(){var t=e("
"),s=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var r=0;r170&&e("li.small",s).length<1){s.addClass("large-format");var n=r/12+"px";s.css("font-size",n)}else s.removeClass("large-format"),s.css("font-size","");200>i?s.removeClass("small-format").addClass("tiny-format"):s.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s),r=i.filter(".small"),n=0,a=0,l=r.first(),o=parseFloat(l.attr("data-size"))+55,c=r.length;if(c===i.length){var d=42*c,m=s.width();m>d+o&&(s.removeClass("small-format"),r.first().removeClass("small"),h())}else{i.not(".small").each(function(t){var s=e(this),i=parseFloat(s.attr("data-size"))+55,r=parseFloat(s.width());n+=r,a+=i});var u=n-a;u>o&&(l.removeClass("small"),h())}})},c=function(t){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s);e(i.get().reverse()).each(function(t,s){var r=e(this);if(r.hasClass("small")===!1){var n=parseFloat(r.attr("data-size"))+55,a=parseFloat(r.width());if(n>a){var l=i.not(".small").last();e(l).addClass("small"),h()}}--s||o()})}),t===!0&&m(h)},h=function(){e(".rrssb-buttons").each(function(t){var s,r,n,l,o,c=e(this),h=e("li",c),d=h.filter(".small"),m=d.length;m>0&&m!==h.length?(c.removeClass("small-format"),d.css("width","42px"),n=42*m,s=h.not(".small").length,r=100/s,o=n/s,i.calc===!1?(l=(c.innerWidth()-1)/s-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=i.calc+"("+r+"% - "+o+"px)",h.not(".small").css("width",l)):m===h.length?(c.addClass("small-format"),a()):(c.removeClass("small-format"),a())}),l()},d=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),r(),a(),e(".rrssb-buttons li .rrssb-text").each(function(t){var s=e(this),i=s.width();s.closest("li").attr("data-size",i)}),c(!0)},m=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},u=function(e,i,r,n){var a=t.screenLeft!==s?t.screenLeft:screen.left,l=t.screenTop!==s?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,h=o/2-r/2+a,d=c/3-n/3+l,m=t.open(e,i,"scrollbars=yes, width="+r+", height="+n+", top="+d+", left="+h);m&&m.focus&&m.focus()},f=function(){var t={};return function(e,s,i){i||(i="Don't call this twice without a uniqueId"),t[i]&&clearTimeout(t[i]),t[i]=setTimeout(e,s)}}();e(document).ready(function(){e(document).on("click",".rrssb-buttons a.popup",{},function(t){var s=e(this);u(s.attr("href"),s.find(".rrssb-text").html(),580,470),t.preventDefault()}),e(t).resize(function(){m(h),f(function(){m(h)},200,"finished resizing")}),d()}),t.rrssbInit=d}(window,jQuery); \ No newline at end of file diff --git a/scss/rrssb.scss b/scss/rrssb.scss index 8303b4a..b33b557 100755 --- a/scss/rrssb.scss +++ b/scss/rrssb.scss @@ -70,6 +70,7 @@ $social-list: ( margin: 0; padding: 0; width: 100%; + font-size: 12px; // clearfix buttons for large-format &:after { @@ -176,7 +177,7 @@ $social-list: ( li { height: auto; - + a { backface-visibility: hidden; From 21b30cc00fe51b3eee6ebe861e6a105d4cd2e29a Mon Sep 17 00:00:00 2001 From: dbox Date: Tue, 8 Dec 2015 11:45:45 -0600 Subject: [PATCH 3/5] minimize svgs and scss cleanup --- README.md | 14 ++++----- index.html | 81 ++++++++---------------------------------------- scss/rrssb.scss | 82 +++++++++++++++---------------------------------- 3 files changed, 45 insertions(+), 132 deletions(-) diff --git a/README.md b/README.md index 0158fd0..56d377f 100755 --- a/README.md +++ b/README.md @@ -21,24 +21,24 @@ RRSSB is built with [**SASS**](http://sass-lang.com/), so you can easily customi
  • + - + email
  • + - - - + facebook -
  • +
  • + - + twitter
  • diff --git a/index.html b/index.html index 1a02936..a85524e 100755 --- a/index.html +++ b/index.html @@ -51,48 +51,27 @@

    Ridiculously Responsive Social Sharing Buttons

  • - - - - - + email
  • - + - - - - - + facebook
  • - - - - - + linkedin
  • @@ -100,25 +79,13 @@

    Ridiculously Responsive Social Sharing Buttons

    - - - - - + twitter @@ -135,61 +102,39 @@

    Ridiculously Responsive Social Sharing Buttons

  • - - + google+
  • - - - - - + pinterest
  • - - - - - + github
  • diff --git a/scss/rrssb.scss b/scss/rrssb.scss index b33b557..35bddbe 100755 --- a/scss/rrssb.scss +++ b/scss/rrssb.scss @@ -2,7 +2,7 @@ // Team: @dbox, @joshuatuscan // Site: http://www.kurtnoble.com/labs/rrssb // Twitter: @therealkni - +// // ___ ___ // /__/| /__/\ ___ // | |:| \ \:\ / /\ @@ -14,53 +14,34 @@ // \ \:\ \ \:\ /__/:/ // \ \:\ \ \:\ \__\/ // \__\/ \__\/ - - +// // Note: You can and should add or remove buttons from config settings and // $social-list based on your specific needs. // config settings -$rrssb-txt: #fff !default; -$rrssb-email: #0a88ff !default; -$rrssb-facebook: #306199 !default; -$rrssb-tumblr: #32506d !default; -$rrssb-linkedin: #007bb6 !default; -$rrssb-twitter: #26c4f1 !default; -$rrssb-googleplus: #e93f2e !default; -$rrssb-reddit: #8bbbe3 !default; -$rrssb-youtube: #df1c31 !default; -$rrssb-pinterest: #b81621 !default; -$rrssb-pocket: #ed4054 !default; -$rrssb-github: #444 !default; -$rrssb-instagram: #517fa4 !default; -$rrssb-hackernews: #ff6600 !default; -$rrssb-delicious: #0B79E5 !default; -$rrssb-vk: #4d71a9 !default; +$rrssb-txt: #fff !default; +$rrssb-email: #0a88ff !default; +$rrssb-facebook: #306199 !default; +$rrssb-tumblr: #32506d !default; +$rrssb-linkedin: #007bb6 !default; +$rrssb-twitter: #26c4f1 !default; +$rrssb-googleplus: #e93f2e !default; +$rrssb-reddit: #8bbbe3 !default; +$rrssb-youtube: #df1c31 !default; +$rrssb-pinterest: #b81621 !default; +$rrssb-pocket: #ed4054 !default; +$rrssb-github: #444 !default; +$rrssb-instagram: #517fa4 !default; +$rrssb-hackernews: #ff6600 !default; +$rrssb-delicious: #0B79E5 !default; +$rrssb-vk: #4d71a9 !default; // Set the border radius for the buttons $rrssb-border-radius: 2px !default; - $rrssb-main-font: "Helvetica Neue", Helvetica, Arial, sans-serif !default; // Variable list for all social button colors to be iterated over. -$social-list: ( - rrssb-email $rrssb-email, - rrssb-facebook $rrssb-facebook, - rrssb-tumblr $rrssb-tumblr, - rrssb-linkedin $rrssb-linkedin, - rrssb-twitter $rrssb-twitter, - rrssb-googleplus $rrssb-googleplus, - rrssb-youtube $rrssb-youtube, - rrssb-reddit $rrssb-reddit, - rrssb-pinterest $rrssb-pinterest, - rrssb-pocket $rrssb-pocket, - rrssb-github $rrssb-github, - rrssb-instagram $rrssb-instagram, - rrssb-delicious $rrssb-delicious, - rrssb-vk $rrssb-vk, - rrssb-hackernews $rrssb-hackernews -); - +$social-list: ( rrssb-email $rrssb-email, rrssb-facebook $rrssb-facebook, rrssb-tumblr $rrssb-tumblr, rrssb-linkedin $rrssb-linkedin, rrssb-twitter $rrssb-twitter, rrssb-googleplus $rrssb-googleplus, rrssb-youtube $rrssb-youtube, rrssb-reddit $rrssb-reddit, rrssb-pinterest $rrssb-pinterest, rrssb-pocket $rrssb-pocket, rrssb-github $rrssb-github, rrssb-instagram $rrssb-instagram, rrssb-delicious $rrssb-delicious, rrssb-vk $rrssb-vk, rrssb-hackernews $rrssb-hackernews ); // The meat and potatoes .rrssb-buttons { @@ -94,19 +75,17 @@ $social-list: ( // This generates individual button classes for each item in social list on line 39. @each $s-name in $social-list { - &.#{nth($s-name, 1)} { a { background-color: nth($s-name, 2); - + &:hover { background-color: darken(nth($s-name, 2), 10%); } } } - - } // end @each directive - + } + // end @each directive a { background-color: #ccc; border-radius: $rrssb-border-radius; @@ -121,7 +100,7 @@ $social-list: ( text-align: center; text-decoration: none; text-transform: uppercase; - transition: background-color .2s ease-in-out; + transition: background-color 0.2s ease-in-out; width: 100%; .rrssb-icon { @@ -131,17 +110,14 @@ $social-list: ( position: absolute; top: 0; width: 10%; - svg { height: 17px; width: 17px; - path { fill: $rrssb-txt; } } } - .rrssb-text { color: $rrssb-txt; } @@ -154,7 +130,6 @@ $social-list: ( &.small { a { padding: 0; - .rrssb-icon { left: auto; margin: 0 auto; @@ -170,18 +145,15 @@ $social-list: ( } } } - &.large-format { height: auto; li { height: auto; - - a { backface-visibility: hidden; - border-radius: .2em; + border-radius: 0.2em; padding: 8.5% 0 8.5% 12%; .rrssb-icon { @@ -197,14 +169,12 @@ $social-list: ( width: 100%; } } - .rrssb-text { backface-visibility: hidden; } } } } - &.small-format { padding-top: 5px; @@ -227,7 +197,6 @@ $social-list: ( } } } - &.tiny-format { height: 22px; position: relative; @@ -254,7 +223,6 @@ $social-list: ( // This generates individual button classes for each item in social list on line 39. @each $s-name in $social-list { - &.#{nth($s-name, 1)} { a { .rrssb-icon { @@ -276,7 +244,7 @@ $social-list: ( } } } - } // end @each directive + } // end @each directive } } } From 2b4f238e05cff87a3b261e1b57392da5468ae670 Mon Sep 17 00:00:00 2001 From: dbox Date: Tue, 8 Dec 2015 11:47:11 -0600 Subject: [PATCH 4/5] minimize js --- js/rrssb.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/rrssb.min.js b/js/rrssb.min.js index aa4c4d5..ca498b5 100755 --- a/js/rrssb.min.js +++ b/js/rrssb.min.js @@ -1 +1 @@ -+function(t,e,s){"use strict";var i={calc:!1};e.fn.rrssb=function(t){var i=e.extend({description:s,emailAddress:s,emailBody:s,emailSubject:s,image:s,title:s,url:s},t);for(var r in i)i.hasOwnProperty(r)&&i[r]!==s&&(i[r]=n(i[r]));i.url!==s&&(e(this).find(".rrssb-facebook a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+i.url),e(this).find(".rrssb-tumblr a").attr("href","http://tumblr.com/share/link?url="+i.url+(i.title!==s?"&name="+i.title:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-linkedin a").attr("href","http://www.linkedin.com/shareArticle?mini=true&url="+i.url+(i.title!==s?"&title="+i.title:"")+(i.description!==s?"&summary="+i.description:"")),e(this).find(".rrssb-twitter a").attr("href","https://twitter.com/intent/tweet?text="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-hackernews a").attr("href","https://news.ycombinator.com/submitlink?u="+i.url+(i.title!==s?"&text="+i.title:"")),e(this).find(".rrssb-reddit a").attr("href","http://www.reddit.com/submit?url="+i.url+(i.description!==s?"&text="+i.description:"")+(i.title!==s?"&title="+i.title:"")),e(this).find(".rrssb-googleplus a").attr("href","https://plus.google.com/share?url="+(i.description!==s?i.description:"")+"%20"+i.url),e(this).find(".rrssb-pinterest a").attr("href","http://pinterest.com/pin/create/button/?url="+i.url+(i.image!==s?"&media="+i.image:"")+(i.description!==s?"&description="+i.description:"")),e(this).find(".rrssb-pocket a").attr("href","https://getpocket.com/save?url="+i.url),e(this).find(".rrssb-github a").attr("href",i.url)),i.emailAddress!==s&&e(this).find(".rrssb-email a").attr("href","mailto:"+i.emailAddress+"?"+(i.emailSubject!==s?"subject="+i.emailSubject:"")+(i.emailBody!==s?"&body="+i.emailBody:""))};var r=function(){var t=e("
    "),s=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var r=0;r170&&e("li.small",s).length<1){s.addClass("large-format");var n=r/12+"px";s.css("font-size",n)}else s.removeClass("large-format"),s.css("font-size","");200>i?s.removeClass("small-format").addClass("tiny-format"):s.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s),r=i.filter(".small"),n=0,a=0,l=r.first(),o=parseFloat(l.attr("data-size"))+55,c=r.length;if(c===i.length){var d=42*c,m=s.width();m>d+o&&(s.removeClass("small-format"),r.first().removeClass("small"),h())}else{i.not(".small").each(function(t){var s=e(this),i=parseFloat(s.attr("data-size"))+55,r=parseFloat(s.width());n+=r,a+=i});var u=n-a;u>o&&(l.removeClass("small"),h())}})},c=function(t){e(".rrssb-buttons").each(function(t){var s=e(this),i=e("li",s);e(i.get().reverse()).each(function(t,s){var r=e(this);if(r.hasClass("small")===!1){var n=parseFloat(r.attr("data-size"))+55,a=parseFloat(r.width());if(n>a){var l=i.not(".small").last();e(l).addClass("small"),h()}}--s||o()})}),t===!0&&m(h)},h=function(){e(".rrssb-buttons").each(function(t){var s,r,n,l,o,c=e(this),h=e("li",c),d=h.filter(".small"),m=d.length;m>0&&m!==h.length?(c.removeClass("small-format"),d.css("width","42px"),n=42*m,s=h.not(".small").length,r=100/s,o=n/s,i.calc===!1?(l=(c.innerWidth()-1)/s-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=i.calc+"("+r+"% - "+o+"px)",h.not(".small").css("width",l)):m===h.length?(c.addClass("small-format"),a()):(c.removeClass("small-format"),a())}),l()},d=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),r(),a(),e(".rrssb-buttons li .rrssb-text").each(function(t){var s=e(this),i=s.width();s.closest("li").attr("data-size",i)}),c(!0)},m=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},u=function(e,i,r,n){var a=t.screenLeft!==s?t.screenLeft:screen.left,l=t.screenTop!==s?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,h=o/2-r/2+a,d=c/3-n/3+l,m=t.open(e,i,"scrollbars=yes, width="+r+", height="+n+", top="+d+", left="+h);m&&m.focus&&m.focus()},f=function(){var t={};return function(e,s,i){i||(i="Don't call this twice without a uniqueId"),t[i]&&clearTimeout(t[i]),t[i]=setTimeout(e,s)}}();e(document).ready(function(){e(document).on("click",".rrssb-buttons a.popup",{},function(t){var s=e(this);u(s.attr("href"),s.find(".rrssb-text").html(),580,470),t.preventDefault()}),e(t).resize(function(){m(h),f(function(){m(h)},200,"finished resizing")}),d()}),t.rrssbInit=d}(window,jQuery); \ No newline at end of file ++function(t,e,i){"use strict";var s={calc:!1};e.fn.rrssb=function(t){var s=e.extend({description:i,emailAddress:i,emailBody:i,emailSubject:i,image:i,title:i,url:i},t);s.emailSubject=s.emailSubject||s.title,s.emailBody=s.emailBody||(s.description?s.description:"")+(s.url?"\n\n"+s.url:"");for(var r in s)s.hasOwnProperty(r)&&s[r]!==i&&(s[r]=n(s[r]));s.url!==i&&(e(this).find(".rrssb-facebook a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+s.url),e(this).find(".rrssb-tumblr a").attr("href","http://tumblr.com/share/link?url="+s.url+(s.title!==i?"&name="+s.title:"")+(s.description!==i?"&description="+s.description:"")),e(this).find(".rrssb-linkedin a").attr("href","http://www.linkedin.com/shareArticle?mini=true&url="+s.url+(s.title!==i?"&title="+s.title:"")+(s.description!==i?"&summary="+s.description:"")),e(this).find(".rrssb-twitter a").attr("href","https://twitter.com/intent/tweet?text="+(s.description!==i?s.description:"")+"%20"+s.url),e(this).find(".rrssb-hackernews a").attr("href","https://news.ycombinator.com/submitlink?u="+s.url+(s.title!==i?"&text="+s.title:"")),e(this).find(".rrssb-reddit a").attr("href","http://www.reddit.com/submit?url="+s.url+(s.description!==i?"&text="+s.description:"")+(s.title!==i?"&title="+s.title:"")),e(this).find(".rrssb-googleplus a").attr("href","https://plus.google.com/share?url="+(s.description!==i?s.description:"")+"%20"+s.url),e(this).find(".rrssb-pinterest a").attr("href","http://pinterest.com/pin/create/button/?url="+s.url+(s.image!==i?"&media="+s.image:"")+(s.description!==i?"&description="+s.description:"")),e(this).find(".rrssb-pocket a").attr("href","https://getpocket.com/save?url="+s.url),e(this).find(".rrssb-github a").attr("href",s.url)),(s.emailAddress!==i||s.emailSubject)&&e(this).find(".rrssb-email a").attr("href","mailto:"+(s.emailAddress?s.emailAddress:"")+"?"+(s.emailSubject!==i?"subject="+s.emailSubject:"")+(s.emailBody!==i?"&body="+s.emailBody:""))};var r=function(){var t=e("
    "),i=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var r=0;r170&&e("li.small",i).length<1){i.addClass("large-format");var n=r/12+"px";i.css("font-size",n)}else i.removeClass("large-format"),i.css("font-size","");200>s?i.removeClass("small-format").addClass("tiny-format"):i.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var i=e(this),s=e("li",i),r=s.filter(".small"),n=0,a=0,l=r.eq(0),o=parseFloat(l.attr("data-size"))+55,c=r.length;if(c===s.length){var h=42*c,u=i.width();u>h+o&&(i.removeClass("small-format"),r.eq(0).removeClass("small"),d())}else{s.not(".small").each(function(t){var i=e(this),s=parseFloat(i.attr("data-size"))+55,r=parseFloat(i.width());n+=r,a+=s});var m=n-a;m>o&&(l.removeClass("small"),d())}})},c=function(t){e(".rrssb-buttons").each(function(t){var i=e(this),s=e("li",i);e(s.get().reverse()).each(function(t,i){var r=e(this);if(r.hasClass("small")===!1){var n=parseFloat(r.attr("data-size"))+55,a=parseFloat(r.width());if(n>a){var l=s.not(".small").last();e(l).addClass("small"),d()}}--i||o()})}),t===!0&&u(d)},d=function(){e(".rrssb-buttons").each(function(t){var i,r,n,l,o,c=e(this),d=e("li",c),h=d.filter(".small"),u=h.length;u>0&&u!==d.length?(c.removeClass("small-format"),h.css("width","42px"),n=42*u,i=d.not(".small").length,r=100/i,o=n/i,s.calc===!1?(l=(c.innerWidth()-1)/i-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=s.calc+"("+r+"% - "+o+"px)",d.not(".small").css("width",l)):u===d.length?(c.addClass("small-format"),a()):(c.removeClass("small-format"),a())}),l()},h=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),r(),a(),e(".rrssb-buttons li .rrssb-text").each(function(t){var i=e(this),s=i.width();i.closest("li").attr("data-size",s)}),c(!0)},u=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},m=function(e,s,r,n){var a=t.screenLeft!==i?t.screenLeft:screen.left,l=t.screenTop!==i?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,d=o/2-r/2+a,h=c/3-n/3+l,u=t.open(e,s,"scrollbars=yes, width="+r+", height="+n+", top="+h+", left="+d);u&&u.focus&&u.focus()},f=function(){var t={};return function(e,i,s){s||(s="Don't call this twice without a uniqueId"),t[s]&&clearTimeout(t[s]),t[s]=setTimeout(e,i)}}();e(document).ready(function(){try{e(document).on("click",".rrssb-buttons a.popup",{},function(t){var i=e(this);m(i.attr("href"),i.find(".rrssb-text").html(),580,470),t.preventDefault()})}catch(i){}e(t).resize(function(){u(d),f(function(){u(d)},200,"finished resizing")}),h()}),t.rrssbInit=h}(window,jQuery); \ No newline at end of file From 7cc3b5b2bbbab49527bfa337b322921df7aae240 Mon Sep 17 00:00:00 2001 From: Daniel Box Date: Tue, 8 Dec 2015 20:28:03 -0600 Subject: [PATCH 5/5] verison up --- icons/delicious.min.svg | 2 +- icons/github.min.svg | 2 +- icons/hackernews.min.svg | 2 +- icons/instagram.min.svg | 2 +- icons/pocket.min.svg | 2 +- icons/reddit.min.svg | 2 +- icons/tumblr.min.svg | 2 +- icons/twitter.min.svg | 2 +- icons/youtube.min.svg | 2 +- package.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/icons/delicious.min.svg b/icons/delicious.min.svg index 990850a..741ca3b 100644 --- a/icons/delicious.min.svg +++ b/icons/delicious.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/github.min.svg b/icons/github.min.svg index fd9f64e..d107246 100755 --- a/icons/github.min.svg +++ b/icons/github.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/hackernews.min.svg b/icons/hackernews.min.svg index 5d4f7d3..e0da2db 100644 --- a/icons/hackernews.min.svg +++ b/icons/hackernews.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/instagram.min.svg b/icons/instagram.min.svg index 490fb52..90be638 100755 --- a/icons/instagram.min.svg +++ b/icons/instagram.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/pocket.min.svg b/icons/pocket.min.svg index 70415f6..4a11823 100755 --- a/icons/pocket.min.svg +++ b/icons/pocket.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/reddit.min.svg b/icons/reddit.min.svg index 22de3ed..d8c0030 100755 --- a/icons/reddit.min.svg +++ b/icons/reddit.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/tumblr.min.svg b/icons/tumblr.min.svg index f63154d..907dabe 100755 --- a/icons/tumblr.min.svg +++ b/icons/tumblr.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/twitter.min.svg b/icons/twitter.min.svg index 71891a7..7bc2ea0 100755 --- a/icons/twitter.min.svg +++ b/icons/twitter.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/youtube.min.svg b/icons/youtube.min.svg index a1c8afe..0292dcb 100755 --- a/icons/youtube.min.svg +++ b/icons/youtube.min.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/package.json b/package.json index aca67a3..b1bc6cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrssb", - "version": "1.8.5", + "version": "1.9.0", "author": "Daniel Box (http://github.com/kni-labs)", "contributors": [ "(Joshua Tuscan )",