-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
Implement auto-animate id and restart #2896
Implement auto-animate id and restart #2896
Conversation
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: |
@hakimel Sure! I'll open a PR in the next few days |
Sorry for the delay on the docs :( |
No rush at all—please take your time :) |
Any chance this is also getting added to slides.com? Would be really useful! Cheers |
Just added support for |
This PR implements both
data-auto-animate-id
anddata-auto-animate-restart
, allowing for finer control of auto animate.data-auto-animate
slides has adata-auto-animate-id
attribute, both need to have the same attribute value in order for auto animate to triggerdata-auto-animate
slide has adata-auto-animate-restart
attribute, 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-restart
always negatively overrides auto animate, even breaking two slides with the samedata-auto-animate-id
apart. 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-restart
which 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-animate
slide pairs withoutdata-auto-animate-id
anddata-auto-animate-restart
behave just like beforeWhy both
data-auto-animate-id
anddata-auto-animate-restart
, wouldn't one be enough?In theory yes, but I think having both is handy. Only
data-auto-animate-restart
would 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-id
would 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)