Live data from Hacker News

Show HN: HN Avatars in 357 bytes

news.ycombinator.com

431–440 of 536 posts

Re: Show HN: HN Avatars in 357 bytes

#433
post #69

Earlier quoted context omitted.

Why not create your own web extension? It will take just a few lines of code, you can look at this example for reference[0] (also on Github[1]). [0]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web... [1]: https://github.com/mdn/webextensions-examples/tree/master/bo...

I don't know about you, but I really don't want an extension for every small change one might want to apply to one specific site.

That's fair how about Tampermonkey -- I use it occasionally to apply js/css/html fixups to sites, e.g. Add browser titles to sites for better bookmarks, re-organize/add site html, etc. I did use it for removing content but ublock origin is much better imo for most cases.

Re: Show HN: HN Avatars in 357 bytes

#434

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 hope mine's purple. Huh, it's a like a pale ceiling death laser.

test

Re: Show HN: HN Avatars in 357 bytes

#435
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 nice improvement! An unfortunate side-effect of it is that it introduces some jitter during macOS's smooth scrolling in Firefox at time of first render, though.
Post reply on HN