Post

#CSS feature faceoff: scroll triggered stuck nav (left) vs scroll driven animation nav (right) which do you prefer? try it codepen.io/argyleink/pe... (use Canary for the scroll-state() support)

4 reposts92 likes

In this example, I'd probably go for the right because the scrolling happens purely over that one image, feels smoother with the velocity of the scroll. If the change would be more subtle such as a shadow or more elements such as text underneath were involved, probably left.

I might chose either, depending on the site, but I do quite prefer the right one. It feels like the nav is somehow more connected/part of the page, rather than something totally autonomous, that’s just pretending to interact with the rest of the page.

Left? I'd think the purpose of the transition is to make the change to the visible background less distracting. By connecting it to the scrolling speed, you let the user control the transition duration, but for what reason? If anything, it's going to attract more attention to the change

FWIW a few months ago I've experimented with all kinds of fixed header nav transitions and in the end found them all distracting. I decided for our site, the nav is not going to be fixed. Which is saving me some headaches in case flyout menus are tall, too!

Aww, you can't use timing functions to delinearize the animation behavior easily when using the animation timeline stuff :/ Alternatively some temporal delay could be a cool thing to be able to edit. I love how the transition one doesn't just instantly disappear when scrolling to the top.

If I'd use this, I'd probably mash these two examples together that when you're going upwards, I change the animation for the transition one and when you've reached the top, I'd use the scroll timeline to fade the bar in when the bar has been made transparent.

My preference is the right side, since that's kind of more how my brain is expecting it to behave. I think it makes more sense to go with the left, since it's a direct, immediate indication that you are no longer at the top of the page. I guess: Right prettier, but left more accessible? (imo)

Looks nice, but triggers my A11y alert. Not a fan of the title becoming hard to read, it's more pronounced when the fade is related to scroll speed.