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

Update transition experiment for bespoke template (second iteration) #448

Merged
merged 23 commits into from
May 22, 2022

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented May 15, 2022

This is the second iteration of the transition experiment #382.

  • Remaining tasks
    • Fix backward transition when navigation is triggered by from presenter view
    • Allow navigation in presenter view while transition in the main view

Summary

  • Brand-new 33 built-in transitions: Marp CLI provides a bunch of built-in transition effects for ready to apply to the presentation.

  • Custom transitions!: In a new transition experiment, you can set custom transition effect just by defining a few ruled animation keyframes in CSS. (Markdown inline styles / theme CSS)

  • Update of transition local directive

marp-transition-showcase.mov

Available built-in transitions

  • clockwise
  • counterclockwise
  • cover
  • coverflow
  • cube
  • cylinder
  • diamond
  • drop
  • explode
  • fade
  • fade-out
  • fall
  • flip
  • glow
  • implode
  • in-out
  • iris-in
  • iris-out
  • melt
  • overlap
  • pivot
  • pull
  • push
  • reveal
  • rotate
  • slide
  • star
  • swap
  • swipe
  • swoosh
  • wipe
  • wiper
  • zoom

none is a reserved name to disable transition. Other every transitions are able to override by defining custom transition in CSS.

Update of transition local directive

A change of target to assign transition

In the first iteration, transition local directive had assigned an animation when the target slide was gone. This behavior was a bit confusable, so we have improved transition directive assigns the animation for "the next boundary between slides".

For example, previously an animation had triggered when navigating page in the pattern of "2p -> 3p" and "2p -> 1p" if set a transition pattern to the second slide. And now it will trigger when "2p -> 3p" and "3p -> 2p" navigation. We believe this behavior is easier to understand than previous.

By this change, there is no actual meanings to set transition directive to the last slide.

Simplified interface

We always have to think about simplicity. In this iteration, YAML object support to customize transition details (#425) has been reverted.

Especially a custom transition delay has less use in real. I wonder if there is meaning to make delay to a navigate action by the viewer.

The custom duration of transition still can set through a space-separated parameter. (transition: fade 1s).

Known problems

  • Don't forget this is cutting edge of Chrome currently. You might meet not working transition or crashed tab.
  • Currently a local-scoped keyframes by <style scoped> cannot use as transition keyframes.

Specifications

  • Currently animation for transition is targeting to whole of the view that includes slide letterbox / pillarbox.
  • An updated transition support is respecting prefers-reduced-motion media query, for viewers whose opt out of visual overloading. If detected preferring reduced motion, all kind of transitions (including custom transitions) become to force consistent animation fade.
  • Proposed CSS pseudo-elements by Shared Element Transitions API can not use in the context of Marp theme and Markdown inline style. So you cannot modify the style for containers that are wrapped transition animations.

yhatt added 3 commits May 15, 2022 05:48
- 20 built-in transitions
- Define custom transition through CSS
- Simplified directive interface
@yhatt yhatt changed the title Update transition experiment for bespoke template for second iteration Update transition experiment for bespoke template (second iteration) May 15, 2022
@yhatt yhatt marked this pull request as ready for review May 22, 2022 14:14
@yhatt
Copy link
Member Author

yhatt commented May 22, 2022

The second iteration of transition experiment is ready to ship 🚀

@yhatt yhatt merged commit 69772a9 into main May 22, 2022
@yhatt yhatt deleted the transition-v2 branch May 22, 2022 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant