Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ZeroDragon
Last active April 10, 2016 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeroDragon/d1799b2cb10459e9ee19c136737b0db6 to your computer and use it in GitHub Desktop.
Save ZeroDragon/d1799b2cb10459e9ee19c136737b0db6 to your computer and use it in GitHub Desktop.
image on dev tools for chrome
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
@ZeroDragon
Copy link
Author

demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment