Live data from Hacker News

Show HN: HN Avatars in 357 bytes

news.ycombinator.com

471–480 of 536 posts

Re: Show HN: HN Avatars in 357 bytes

#471
post #43

This is fun. One suggestion.. rather than creating a canvas for each user using a querySelectorAll and a loop, I'd use an IntersectionObserver and only create the canvases as they scroll into view. That way the user's device won't need to create hundreds of elements when the code runs. let observer = new IntersectionObserver( (entries) => { entries.forEach((entry, i) => { if (entry.isIntersecting) { const p = 2; cons…

A better optimization would be adding appropriately sized SVG tags to comments before first paint (to prevent re-flowing the layout) and lazily generate avatars to a SVG sprite sheet. No canvas required.

Re: Show HN: HN Avatars in 357 bytes

#479

Earlier quoted context omitted.

I do feel like HN needs avatars of some kind... just don't know if they should be customizable or fixed (like this one).

I'm for the fixed avatars. We are all born with certain unchangeable aspects.

Hey man, we were just discussing avatars, not trying to create an existential crisis.

Re: Show HN: HN Avatars in 357 bytes

#480

Hah! I got a really cool little icon that looks almost like the cassette tape pirate logo of Piratbyrån back in the day. I have old t-shirts with that logo. 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.

Trying mine.

Trying mine as well
Post reply on HN