Implement auto-animate id and restart#2896
Merged
hakimel merged 1 commit intohakimel:devfrom May 27, 2021
Merged
Conversation
sradyo
approved these changes
Feb 7, 2021
Owner
|
This is a great addition—thanks @coffeenotfound! Would you mind adding this to the docs at https://revealjs.com/auto-animate/ as well? The source file here: |
Contributor
Author
|
@hakimel Sure! I'll open a PR in the next few days |
Contributor
Author
|
Sorry for the delay on the docs :( |
Owner
|
No rush at all—please take your time :) |
|
Any chance this is also getting added to slides.com? Would be really useful! Cheers |
Owner
|
Just added support for |
srwohl
pushed a commit
to srwohl/phantom-pres
that referenced
this pull request
Sep 2, 2024
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.
This PR implements both
data-auto-animate-idanddata-auto-animate-restart, allowing for finer control of auto animate.data-auto-animateslides has adata-auto-animate-idattribute, both need to have the same attribute value in order for auto animate to triggerdata-auto-animateslide has adata-auto-animate-restartattribute, auto animate does not trigger on the transition between the previous slide and it, but does trigger on the transition between it and the next slide.data-auto-animate-restartalways negatively overrides auto animate, even breaking two slides with the samedata-auto-animate-idapart. Note that "previous" and "next" are meant physically, so "previous" always means a slide to the left or the top of the current one and "next" always means a slide to the right or the bottom instead of "previously shown slide" and "next slide to show" (which might go in any direction, breakingdata-auto-animate-restartwhich isn't symmetric)This design is rather flexible and doesn't introduce a breaking change (apart from new attribute names being used by reveal.js):
data-auto-animateslide pairs withoutdata-auto-animate-idanddata-auto-animate-restartbehave just like beforeWhy both
data-auto-animate-idanddata-auto-animate-restart, wouldn't one be enough?In theory yes, but I think having both is handy. Only
data-auto-animate-restartwould result in an unreadable hell for any non-trivial presentations with multiple auto-animate groups right next to each other and requires a lot of attention to not accidentally mess up the exact break points. While only havingdata-auto-animate-idwould require annotating possibly two dozen slides with a different id when all you want is one simple auto animate break in the middle.Examples: (Slide pairs with different letters won't auto animate)