Live data from Hacker News

CSS-Native Parallax Effect

dan-webnotes.com

51–60 of 63 posts

Re: CSS-Native Parallax Effect

#51
post #2

That sounds interesting but it would be a whole lot more interesting if the page was itself an example of said effect!

I've put together an example here but it doesn't seem to work in Firefox 151.0.2 (64-bit): https://favs.eu.org/parallax/ Edit: if the body has class="no-sda", it uses a js fallback.

This doesn't do anything, just scrolls like a normal page.

Mac on latest chrome.

Re: CSS-Native Parallax Effect

#52
post #51

Earlier quoted context omitted.

I've put together an example here but it doesn't seem to work in Firefox 151.0.2 (64-bit): https://favs.eu.org/parallax/ Edit: if the body has class="no-sda", it uses a js fallback.

This doesn't do anything, just scrolls like a normal page. Mac on latest chrome.

Same observation here, but Chrome on iOS

Re: CSS-Native Parallax Effect

#53
post #51

Earlier quoted context omitted.

I've put together an example here but it doesn't seem to work in Firefox 151.0.2 (64-bit): https://favs.eu.org/parallax/ Edit: if the body has class="no-sda", it uses a js fallback.

This doesn't do anything, just scrolls like a normal page. Mac on latest chrome.

Seems fixed now. Works in both Firefox and Chromium on macOS for me.

Re: CSS-Native Parallax Effect

#54
post #5

How does this compare to the classic css-native parallax effect? Before the scroll timeline APIs you'd use the "perspective" css property to create a container where the z plane is n pixels away from the screen, and then position each layer within it at a different z distance using transform: translateZ That method is GPU accelerated too, so it is performant compared to some js solutions, and has worked well in every…

When using Z, if the element is close to the bottom of the page, or a very large Z, I found it to increase the length of the scroll bar unexpectedly. Or unexpectedly to me looking for parallax, it would make sense as a normal zoom or scale.

Re: CSS-Native Parallax Effect

#57
post #2

That sounds interesting but it would be a whole lot more interesting if the page was itself an example of said effect!

I've put together an example here but it doesn't seem to work in Firefox 151.0.2 (64-bit): https://favs.eu.org/parallax/ Edit: if the body has class="no-sda", it uses a js fallback.

its beautiful! where can I track the compatibility?

and how do I know if I'm hitting the fallback?

Re: CSS-Native Parallax Effect

#59
post #2

That sounds interesting but it would be a whole lot more interesting if the page was itself an example of said effect!

I've put together an example here but it doesn't seem to work in Firefox 151.0.2 (64-bit): https://favs.eu.org/parallax/ Edit: if the body has class="no-sda", it uses a js fallback.

I really like the fact that your "recipe" already includes support for prefers-reduced-motion. Parallax can really trigger motion sensitivity issues up to vomiting or several days of bed rest with severe migraine.

You did leave that part out of your recipe though. Would you mind adding it there, so that people who copy paste are more inclined to actually keep/use that part as well?

Re: CSS-Native Parallax Effect

#60

Earlier quoted context omitted.

I've put together an example here but it doesn't seem to work in Firefox 151.0.2 (64-bit): https://favs.eu.org/parallax/ Edit: if the body has class="no-sda", it uses a js fallback.

I really like the fact that your "recipe" already includes support for prefers-reduced-motion. Parallax can really trigger motion sensitivity issues up to vomiting or several days of bed rest with severe migraine. You did leave that part out of your recipe though. Would you mind adding it there, so that people who copy paste are more inclined to actually keep/use that part as well?

nice catch! added it
Post reply on HN