Live data from Hacker News

Show HN: HN Avatars in 357 bytes

news.ycombinator.com

191–200 of 536 posts

Re: Show HN: HN Avatars in 357 bytes

#198
post #68
post #67

Earlier quoted context omitted.

Does the canvas need to be created and removed as it comes in and out of view? Using requestAnimationFrame() might also further improve responsiveness.

Does the canvas need to be created and removed as it comes in and out of view? Not really. You could just create them and not bother removing them. You'd need to check if the user already had an avatar if you did that though, or you'd end up with lots of repeated avatars when you scroll up and down the page.

Or just generate them on page load and call it a day. No bugs, no complexity, no edge cases.

Could it be faster? Sure, but should it be faster? Not really, IMO, the avatars load very quick, even on a big page.

Re: Show HN: HN Avatars in 357 bytes

#200

Reply here if you just want to see how your username looks like, so we avoid noise and keep that Show HN on the top. comments are really interesting

I'll add that this will work on your profile as well - basically anywhere with an anchor to "news.ycombinator.com/user?id=blahblahblah"
Post reply on HN