Live data from Hacker News

CSS-Native Parallax Effect

dan-webnotes.com

31–40 of 63 posts

Re: CSS-Native Parallax Effect

#31
I played around with this API some time ago. It’s simple and high-performance, but one feature I wish existed is damping. Scroll-driven animations are tied directly to the scroll timeline, so there’s no concept of the parallax object “catching up” to the scroll progress over, say, one second. From what I remember, `animation-timing-function` feels weird when you scroll, so it’s not the right solution. GSAP offers this, but it’s JS-only.

Re: CSS-Native Parallax Effect

#33
post #4
post #3

A demo https://codepen.io/editor/phelm/pen/019e87f5-dfec-7372-9849-...

There's me scrolling up and down and thinking "hey, it's not working!" But it's behind a flag on Firefox: https://caniuse.com/?search=view-timeline-name

For people saying it's not working in any browser - do you have some kind of reduced motion preference setting turned on? I can imagine that would have an effect on something like this and it's definitely working in Chrome for me.

Re: CSS-Native Parallax Effect

#34
post #4

Earlier quoted context omitted.

There's me scrolling up and down and thinking "hey, it's not working!" But it's behind a flag on Firefox: https://caniuse.com/?search=view-timeline-name

For people saying it's not working in any browser - do you have some kind of reduced motion preference setting turned on? I can imagine that would have an effect on something like this and it's definitely working in Chrome for me.

Yes... there's a media query in the codepen disabling animation for people with reduced motion enabled.

Re: CSS-Native Parallax Effect

#38
This [0] seems to be the main meta bug, with [1] being for CSS and [2] for JS, for FF to ship it without the flag. There seems to be slow work towards it, kinda funny that FF was the first browser to have it (flag-gated, according to CIU) and now is the only one without it in stable ;)

[0]: https://bugzilla.mozilla.org/show_bug.cgi?id=1676779

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1676780

[2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1676781

Post reply on HN