Live data from Hacker News

CSS-Native Parallax Effect

dan-webnotes.com

11–20 of 63 posts

Re: CSS-Native Parallax Effect

#12
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

tried 4 browsers, didn't work in any of them

Re: CSS-Native Parallax Effect

#13
In a world where it's increasingly overlooked, I'm glad the author mentions disabling it respecting user settings. I do think it should be reversed and only enabled with the `@media (prefers-reduced-motion: no-preference)`, but that is the opinion of someone who gets negative value from animations and is bemused by how much dev and compute time is spent on them.

Re: CSS-Native Parallax Effect

#15
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

tried 4 browsers, didn't work in any of them

FWIW it works on iPhone safari

Re: CSS-Native Parallax Effect

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

No doubt quite a few folk with the same question. Keen to understand performance tradeoffs.

Obvious comparison note would be that the "new" method currently enjoys somewhat limited browser support (no Firefox without a flag, and only since Safari 26)

Re: CSS-Native Parallax Effect

#19
post #3

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

What an age where we need a pile of javascript as well as a bot check to demo a simple CSS trick.

The JS and bot check are for making additional functionality, beyond just showing the example, work easily. I.e. editing and sharing edits from a browser. If all you want is a static example, feel free to make it without these things.

Re: CSS-Native Parallax Effect

#20
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

Doesnt work on any browser for me
Post reply on HN