SteamLUG / steamlug.org

SteamLUG
https://steamlug.org
9 stars 11 forks source link

Scroll to note automatically on cast page while playing #127

Closed johndrinkwater closed 7 years ago

johndrinkwater commented 9 years ago

Per this comment https://github.com/SteamLUG/steamlug.org/pull/80#issuecomment-68420242 look at adding auto-scroll to cast listen pages.

johndrinkwater commented 9 years ago

Mozilla has this experimental function, element.scrollIntoView(false); and we can kinda emulate for the rest with window.scroll(0,findPos(document.getElementById("ts-00:00:00")));

Cheeseness commented 9 years ago

Does the latter give us "good enough" behaviour in Mozilla browsers as well?

I feel like we should be making the audio widget position:static or shift it off into a non-scrolling column during these events so that the user doesn't have to lose their scroll position to pause, etc., and that it'd be good to do this at the same time as rolling out auto scrolling.

johndrinkwater commented 9 years ago

‘Good enough’, would prefer both options, as the latter method has caveats which is why a browser function was suggested for standardisation. No biggie, i’ll keep it generic.

As for keeping the player on screen, would prefer to use position:sticky; over position: fixed, but know support isn’t 100% yet. Is there a reason for keeping the widget on screen, beyond being able to pause the audio?

Cheeseness commented 9 years ago

Being able to pause/play/adjust volume/manually seek/observe progress/observe seeking when clicking on different timestamps without losing the current scroll position - that's a whole bunch of UI/UX stuff solved in one fell swoop).

I'm not really fussed about browser specific stuff in code that I'm not maintaining. Without knowing what those caveats are though, I can't really comment on the best course of action there.

Looks like position: sticky is a long way off (it's still in draft with a bunch of unresolved issues and not part of any recommendation yet). If I were doing this on my own, I think I'd probably just give the shownotes element overflow-y:scroll or something in the short term.

Lejoni commented 9 years ago

Dose not work on Google Chrome for me

Cheeseness commented 9 years ago

@Lejoni is referring to the player staying on screen.

Cheeseness commented 9 years ago

Something I just noticed which is probably fairly important is that when browsing to fragment URLs, the floating player will obscure the desired item.

johndrinkwater commented 9 years ago

That was a comment reference, silly github.

johndrinkwater commented 9 years ago

Been playing more with scrollIntoView() as (unknown to me) most browsers support it now. It is terrible. Might just retire this feature request.