Live data from Hacker News

Show HN: HN Avatars in 357 bytes

news.ycombinator.com

461–470 of 536 posts

Re: Show HN: HN Avatars in 357 bytes

#463
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…

Awesome! I did not know about IntersectionObserver. Will def add this to my toolbox! Thanks!

Re: Show HN: HN Avatars in 357 bytes

#467
post #438

Earlier quoted context omitted.

How dare you, you cyan flower vase on wheels :) I'm a spiky small yellow watchtower, yay.

And me? A green butterfly?

Yup. Or a trophy/ a goblet maybe? Not sure if green stands for 1st, 2nd or 3rd price though, up to you to decide :)
Post reply on HN