Default avatars

This commit is contained in:
Remy Sharp 2014-08-11 13:29:07 +01:00
parent 5672811dd6
commit 31fd05e449
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,3 @@
<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><title>jsbin-avatar.svg</title><g id="eyes" fill="#fff"><path d="M0 10v10h30V10H0z" id="face" fill="#183E49"/><path d="M22.455 18c1.656 0 3-1.343 3-3s-1.344-3-3-3c-1.657 0-3 1.343-3 3s1.343 3 3 3z" id="right"/><path d="M7.727 18c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z" id="left"/><path id="head-top" fill="#93A6AD" d="M0 20h30v10H0z"/><path id="head-bottom" fill="#93A6AD" d="M0 0h30v10H0z"/></g><script type="text/javascript" id="jsbin-javascript"><![CDATA[
!function(){function b(a){var b,c,d=void 0===a?2166136261:a;for(b=0,c=a.length;c>b;b++)d^=a.charCodeAt(b),d+=(d<<1)+(d<<4)+(d<<7)+(d<<8)+(d<<24);return(d>>>0).toString().substr(-8)}var a=document.defaultView.location.href.split("?")[1];document.getElementById("eyes").style.fill=a?"hsl("+b(a,!0)+",100%,50%)":"rgb(144, 218, 255)"}();
]]></script></svg>

After

Width:  |  Height:  |  Size: 913 B

View File

@ -0,0 +1,45 @@
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!--
Created using JS Bin
http://jsbin.com
Copyright (c) 2014 by rem (http://jsbin.com/fagub/3/edit)
Released under the MIT license: http://jsbin.mit-license.org
-->
<title>jsbin-avatar.svg</title>
<g id="avatar" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="jsbin.fagub">
<g id="Page-1">
<g id="eyes" fill="white">
<path d="M0,10 L0,20 L30,20 L30,10 L0,10 L0,10 Z" id="face" fill="#183E49"></path>
<g transform="translate(5.000000, 12.000000)">
<path d="M17.4545455,6 C19.1113997,6 20.4545455,4.6568542 20.4545455,3 C20.4545455,1.3431458 19.1113997,0 17.4545455,0 C15.7976912,0 14.4545455,1.3431458 14.4545455,3 C14.4545455,4.6568542 15.7976912,6 17.4545455,6 L17.4545455,6 Z" id="right"></path>
<path d="M2.72727273,6 C4.38412698,6 5.72727273,4.6568542 5.72727273,3 C5.72727273,1.3431458 4.38412698,0 2.72727273,0 C1.07041848,0 -0.27272727,1.3431458 -0.27272727,3 C-0.27272727,4.6568542 1.07041848,6 2.72727273,6 L2.72727273,6 Z" id="left"></path>
</g>
<rect id="head-top" fill="#93A6AD" x="0" y="20" width="30" height="10"></rect>
<rect id="head-bottom" fill="#93A6AD" x="0" y="0" width="30" height="10"></rect>
</g>
</g>
</g>
</g>
<script type="text/javascript" id="jsbin-javascript"><![CDATA[
var string = document.defaultView.location.href.split('?')[1];
function hash(seed) {
/*jshint bitwise:false */
var i, l,
// username as seed instead of a string and a possible string?
hval = (seed === undefined) ? 0x811c9dc5 : seed;
// i didn't change this, i have absolutely no knowledge of creating hashes.
for (i = 0, l = seed.length; i < l; i++) {
hval ^= seed.charCodeAt(i);
hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
}
// max of 8 numbers to prevent hitting upper level, no
return ((hval >>> 0).toString()).substr(-8);
}
document.getElementById('eyes').style.fill = string ? 'hsl(' + hash(string, true) + ',100%,50%)' : 'rgb(144, 218, 255)';
]]></script>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB