Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: transitions in scroll view mode #3574

Open
bouzidanas opened this issue Feb 7, 2024 · 1 comment
Open

Feature request: transitions in scroll view mode #3574

bouzidanas opened this issue Feb 7, 2024 · 1 comment

Comments

@bouzidanas
Copy link
Contributor

While it makes sense that transitions are removed for scroll view, there are some similar transition-like behaviors that I think are desirable such as vertical slide (scroll to next/prev slide), as well as concave and convex vertical slide.

For me personally, the one I am currently most interested in is simple vertical slide. When using mouse, the scrolling and snapping is desirable behavior, but when using arrow keys or calling prev and next api functions, the next slide immediately appears. This is fine in some instances, but sometimes its still desirable to scroll to the slide in a smooth fashion (like with ease-in-out).

A basic implementation of the latter behavior can probably be achieve using element.scrollTo function. In fact, the scrollSnap implementation probably contains the code needed to achieve this as well.

@tingstad
Copy link

I think I found a possible work around for simple vertical scroll view slides:

Reveal.addKeyBinding({ keyCode: 40, key: 'DOWN', description: 'Next slide' }, () => {
    const viewportElement = Reveal.getViewportElement();
    viewportElement.scrollTo({
        "top": viewportElement.scrollTop + viewportElement.offsetHeight,
        "behavior": "smooth"
    });    
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants