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

Auto-animation API #40

Merged
merged 5 commits into from
Jan 26, 2024
Merged

Auto-animation API #40

merged 5 commits into from
Jan 26, 2024

Conversation

HugoGranstrom
Copy link
Owner

@HugoGranstrom HugoGranstrom commented Nov 15, 2023

Closes #38

The proposed API is:

autoAnimateSlides(5):
    showOn(1, 2, 3):
      nbText: "1, 2, 3"

    nbText: "Always"

    showOn(3, 4, 5):
      nbText: "3, 4, 5"

You pass the total number of slides you want to auto-animate to autoAnimateSlides and then each showOn will only be shown on the slides it number. In this case the first nbText will be shown for the first three slides and the last one will be shown only on the last three slides. And it all auto-animates!

Still left todo:

  • Basic API
  • nbText API
  • nbCode API

@pietroppeter
Copy link
Contributor

Nice API!

@HugoGranstrom
Copy link
Owner Author

Thanks, the names of the templates are up for grab though. showOn feels a bit off IMO

@pietroppeter
Copy link
Contributor

I do not mind showOn, you could also have a showFrom (or showSince) and showUntil (where you give the last index. Or a difference set could be showBefore, showAfter, showAt

@HugoGranstrom
Copy link
Owner Author

Those are good names, thanks 😁 There are a lot of small details like this to consider. Should it be zero indexed (like Nim) or 1 index (like the rows in animateCode)? Should we use inclusive or exclusive variants of the templates? I think inclusive, 1-indexed makes the most sense in this case. What is your take on this?

@HugoGranstrom
Copy link
Owner Author

This is really sweet actually, the example above became the more readable:

autoAnimateSlides(5):
  showUntil(3):
    nbText: "1, 2, 3"
  nbText: "Always"
  showFrom(3):
    nbText: "3, 4, 5"

@pietroppeter
Copy link
Contributor

yep, inclusive and 1-indexed looks a good choice to me.

@HugoGranstrom
Copy link
Owner Author

I've finally written the the docs. I will proably have another go at supporting other blocks in the future but this is good enough for now.

@HugoGranstrom HugoGranstrom merged commit c9e80b9 into main Jan 26, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

Smoother API for auto-animation
2 participants