diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..cb07e35 --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1,13 @@ +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. \ No newline at end of file diff --git a/console.image.js b/console.image.js index a3c29db..55bb27c 100644 --- a/console.image.js +++ b/console.image.js @@ -163,7 +163,7 @@ var img = new Image(); img.onload = function() { - var dim = getBox(this.width * scale, this.height * scale); + var dim = getBox(this.width * scale, this.height * scale / 2); console.log("%c" + dim.string, dim.style + "background: url(" + url + "); background-size: " + (this.width * scale) + "px " + (this.height * scale) + "px; color: transparent;"); }; diff --git a/console.image.min.js b/console.image.min.js index d955ff6..c1555b2 100644 --- a/console.image.min.js +++ b/console.image.min.js @@ -1,4 +1,4 @@ /** * Dubiously created by Adrian Cooney * http://dunxrion.github.io - */(function(e){"use strict";function n(e,t){return{string:"+",style:"font-size: 1px; padding: "+Math.floor(t/2)+"px "+Math.floor(e/2)+"px; line-height: "+t+"px;"}}function r(e,t,n,r,o){n=n.toUpperCase();if(n.length<24){var u=Math.max(0,n.length-12),a=70+u*-3;i(e,a,n,r/2,o)}else if(n.length<29)i(e,40,n,r/2,o);else{var f=s(n,27);f.forEach(function(n,s){i(e,40,n,r/2,t=="lower"?o-(f.length-1)*40+s*40:o+s*40)})}}function i(e,t,n,r,i){e.font="bold "+t+"px Impact";e.fillStyle="#fff";e.textAlign="center";e.textBaseline="middle";e.lineWidth=7;e.strokeStyle="#000";e.strokeText(n,r,i);e.fillText(n,r,i)}function s(e,t){var n=[],r=e.split(" "),i=[];for(var s=0,o=r.length;s "+Object.keys(t).join("\n> "));var a=document.createElement("canvas"),f=a.getContext("2d"),o=o||500,u=o||500,l=500,c=500,h=new Image;h.setAttribute("crossOrigin","anonymous");h.onload=function(){a.width=o;a.height=u;var t=n.toUpperCase();f.scale(o/500,u/500);f.drawImage(this,0,0,l,c);r(f,"upper",n,l,50);r(f,"lower",i,l,c-50);e.image(a.toDataURL())};if(t[s])var p=t[s];else var p=s;h.src=p};e.image=function(t,r){r=r||1;var i=new Image;i.onload=function(){var i=n(this.width*r,this.height*r);e.log("%c"+i.string,i.style+"background: url("+t+"); color: transparent;")};i.src=t;i.style.background="url("+t+")"}})(console); + */(function(e){"use strict";function n(e,t){return{string:"+",style:"font-size: 1px; padding: "+Math.floor(t/2)+"px "+Math.floor(e/2)+"px; line-height: "+t+"px;"}}function r(e,t,n,r,o){n=n.toUpperCase();if(n.length<24){var u=Math.max(0,n.length-12),a=70+u*-3;i(e,a,n,r/2,o)}else if(n.length<29)i(e,40,n,r/2,o);else{var f=s(n,27);f.forEach(function(n,s){i(e,40,n,r/2,t=="lower"?o-(f.length-1)*40+s*40:o+s*40)})}}function i(e,t,n,r,i){e.font="bold "+t+"px Impact";e.fillStyle="#fff";e.textAlign="center";e.textBaseline="middle";e.lineWidth=7;e.strokeStyle="#000";e.strokeText(n,r,i);e.fillText(n,r,i)}function s(e,t){var n=[],r=e.split(" "),i=[];for(var s=0,o=r.length;s "+Object.keys(t).join("\n> "));var a=document.createElement("canvas"),f=a.getContext("2d"),o=o||500,u=o||500,l=500,c=500,h=new Image;h.setAttribute("crossOrigin","anonymous");h.onload=function(){a.width=o;a.height=u;var t=n.toUpperCase();f.scale(o/500,u/500);f.drawImage(this,0,0,l,c);r(f,"upper",n,l,50);r(f,"lower",i,l,c-50);e.image(a.toDataURL())};if(t[s])var p=t[s];else var p=s;h.src=p};e.image=function(t,r){r=r||1;var i=new Image;i.onload=function(){var i=n(this.width*r,this.height*r/2);e.log("%c"+i.string,i.style+"background: url("+t+"); color: transparent;")};i.src=t;i.style.background="url("+t+")"}})(console);