Hacker News new | ask | show | jobs
by Bewelge 339 days ago
How would you implement that scrolling background? Particularly the mouse interaction, where it scrolls with a dynamic speed ( depending on how far to the side the mouse it) and even has some smooth damping when you stop scrolling.

And what part uses the visibility state? The grayscale seems to be triggered by focus which I think would be doable with CSS

3 comments

> How would you implement that scrolling background?

At a glance I'm not sure exactly how I'd implement it, but my guess is that it's possible with some workarounds and hacks, at the very least.

Here's an article showing some demos (at the bottom) on how you can make the mouse cursor affect CSS: https://css-tricks.com/how-to-map-mouse-position-in-css/

Ah, I forgot that (everything except for the interaction should be okay, though). For the visibility state however, checking for focus is insufficient because you can have elements focused without the document being visible.
Scrolling using actual scroll - instead of following the pointer and automatically scrolling - would make the page better anyway IMHO