Created
September 20, 2018 07:47
-
-
Save ouweiya/85419d25a6efcf8d9580ee1cc0b2d041 to your computer and use it in GitHub Desktop.
Chrome console print picture 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(c) { | |
c.image = function(t) { | |
var img = new Image; | |
img.src = t; | |
img.onload = function (){ | |
var style = [ | |
"padding:" + Math.floor(img.height / 2) + "px " + Math.floor(img.width / 2)+ "px", | |
"background: url("+ encodeURI(t) +")", | |
"color: transparent", | |
"font-size:0", | |
].join(';'); | |
console.log('%c.', style); | |
} | |
} | |
})(console); | |
console.image("https://github.com/ouweiya/ouweiya.github.io/blob/master/my-blog/chrome1.png?raw=true"); |
Author
ouweiya
commented
Sep 20, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment