Last active
April 10, 2016 05:00
-
-
Save ZeroDragon/d1799b2cb10459e9ee19c136737b0db6 to your computer and use it in GitHub Desktop.
image on dev tools for chrome
This file contains 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
if console?.log? | |
url = "http://i.imgur.com/oGiMR.gif" | |
getBox = (width, height)-> | |
return { | |
string: "+", | |
style: "font-size: 1px; padding: " + Math.floor(height/2) + "px " + Math.floor(width/2) + "px; line-height: " + height + "px;" | |
} | |
img = new Image() | |
img.onload = -> | |
dim = getBox(@.width, @.height); | |
console.log("%c" + dim.string, dim.style + "background: linear-gradient(to top, transparent, transparent), url(" + url + ") no-repeat; background-size: " + (this.width) + "px " + (this.height) + "px; color: transparent;"); | |
console.log "%c#{copyright}","font: 15px sans-serif; color: #444;font-weight:700;" | |
img.src = url |
Author
ZeroDragon
commented
Apr 10, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment