feat(loop): marquee mode in the editor and carousel events for extensions - #346
Merged
Merged
Conversation
The carousel is a native scroll container, so a CSS marquee could not keep the arrows, dots and drag working. The autoplay runs a continuous move instead and shares its pauses. Scroll holds whole pixels and is kept off the loop's ends, so the rest goes to a translate of the slides. The mode is Pro's: the free editor offers it as a teaser and the list only runs one when Pro writes its attributes.
- Keyboard focus gives the carousel its snap back, so an arrow key steps a slide. - A finger holds the marquee until it lifts, and any pixel the marquee did not scroll counts as someone else's move, so a slow swipe or sideways wheel is no longer scrolled back. - Only the main button holds it: a context menu on a Mac swallows the release. - A held marquee at a stop measures nothing.
- A step started from a focused control keeps its snap off until it lands; the keyboard hold no longer turns it back on under it. - A key on the list gives the snap back before it scrolls, so a list focused by a click steps a slide too. - Only fingers on the list hold it, and a context menu releases it. - The wheel hint is gone: a slow wheel already moves the list off the marquee's pixel.
The marquee is Pro's, so its code moves there. The carousel gains the events an extension needs to drive it without its internals: taking the autoplay's frames with their pauses, placing the carousel on its loop, and being told when a step of the module is under way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Autoplay on a Gallery Loop carousel gets a second mode in the editor, Marquee, and the carousel gets the events an extension needs to drive it. The marquee itself is Pro's and runs from Pro. Without Pro the option shows as a disabled "Marquee (Pro)", and nothing in this plugin moves a carousel continuously.
The carousel is a native scroll container, so a CSS marquee cannot keep the arrows, dots and drag working, and Pro drives the same scroll instead. It needs three things it cannot get from outside the view module, and those are what this adds:
vp-carousel-autoplay-takethenvp-carousel-autoplay-framevp-carousel-placevp-carousel-travel-start/-endThe travel events close a bug found in review. Without them, the marquee turned snapping back on in the middle of a keyboard-started step, and the carousel bounced between two slides at the loop seam.
An autoplay nobody takes behaves exactly as before, so a carousel that cannot loop still steps by its delay under Pro.
Pro's PR runs these events end to end in its e2e spec.