Skip to content

Instantly share code, notes, and snippets.

@aemkei
Forked from 140bytes/LICENSE.txt
Created October 4, 2011 20:57
Show Gist options
  • Save aemkei/1262788 to your computer and use it in GitHub Desktop.
Save aemkei/1262788 to your computer and use it in GitHub Desktop.
JS Logo - 140byt.es

JS Logo - 140byt.es

My quick attempt to draw the JS Community logo in less than 140 bytes using a image tag and the Data-URI-Scheme.

For more information

See the 140byt.es site for a showcase of entries (built itself using 140-byte entries!), and follow @140bytes on Twitter.

To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to the wiki.

140byt.es is brought to you by Jed Schmidt, with help from Alex Kloss. It was inspired by work from Thomas Fuchs and Dustin Diaz.

function(){
return "<img " + // open image tag
"src=" + // set source (no quotes needed!)
"data:image/gif;" + // .gif MIME type
"base64," + // Base64 encoding
"R0lGODlhDAAMAIAAADMzM/DbTyH5BAAHAP8AL" + // add the image data
"AAAAAAMAAwAAAIUjI+py+0ODIgq0kUnRvdYyV3aYxQAOw==" +
">" // browsers will close this tag for you
}
function(){return"<img src=data:image/gif;base64,R0lGODlhDAAMAIAAADMzM/DbTyH5BAAHAP8ALAAAAAAMAAwAAAIUjI+py+0ODIgq0kUnRvdYyV3aYxQAOw==>"}
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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.
{
"name": "logo",
"description": "Renders the JS community logo.",
"keywords": [
"js",
"logo",
"data",
"uri"
]
}
<!DOCTYPE html>
<title>JS Logo - 140Byt.es</title>
<style type="text/css" media="screen"> img { width: 400px;} </style>
<div id="logo"></div>
<script>
var logo =
function(){return"<img src=data:image/gif;base64,R0lGODlhDAAMAIAAADMzM/DbTyH5BAAHAP8ALAAAAAAMAAwAAAIUjI+py+0ODIgq0kUnRvdYyV3aYxQAOw==>"}
document.getElementById( "logo" ).innerHTML = logo();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment