Show HN: HN Avatars in 357 bytes
701 pointsPaste the following into the console of any HN page - for annotated avatars on all HN comments. (self contained code)
for(u of document.querySelectorAll('.hnuser'))for(u.prepend(c=document.createElement('canvas')),x=c.getContext('2d'),c.width=18,c.height=14,s=u.innerText,r=1,i=28+s.length;i--;i<28?r>>>29>X*X/3+Y/2&&x.fillRect(6+2*X,2*Y,2,2)&x.fillRect(6-2*X,2*Y,2,2):r+=s.charCodeAt(i-28,x.fillStyle='#'+(r>>8&0xFFFFFF).toString(16)))r^=r<<13,r^=r>>>17,r^=r<<5,X=i&3,Y=i>>2
Comments (493) 108 threads
Show all comments
Showing thread 2 of 108
MAKE. THIS. PERMANENT!
On the functional side, this really helps you see who is who in a long threaded discussion. Your eye is much quicker at following the little color icons than their names.
Continue this thread — 4 replies
Continue this thread — 2 replies
Continue this thread — 1 reply
I second this. (Also I wanted to see what my avatar looks like, sry)
Continue this thread — 9 replies
(function() { // Initial concept is from: https://news.ycombinator.com/item?id=30668137 (tomxor) // The script we are using is from: https://news.ycombinator.com/item?id=30670079 (onion2k) 'use strict'; let observer = new IntersectionObserver( (entries) => { entries.forEach((entry, i) => { if (entry.isIntersecting) { const p = 2; const c = document.createElement('canvas'); const x = c.getContext('2d'); c.width = 18; c.height = 14; const s = entry.target.innerText; const r = 1;
})();Continue this thread — 2 replies
also i wanted to see mine too
I think it's a skeleton holding his arms up!
edit: Looks like I'm some green bug-monster
Unique, fixed little color doodads make it easier to see who's who in a thread.
Edit: Huh, I got an alien house. Reminds me of some game.
Continue this thread — 3 more replies