slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
32.66k stars 1.31k forks source link

Mermaid click animation support #1498

Open pinage404 opened 5 months ago

pinage404 commented 5 months ago

Hello,

Thanks for making slidev, i love it !

Is your feature request related to a problem? Please describe. I have some Mermaid diagrams with many elements

I would like to be able to display the elements one by one

So that the audience has time to understand how it is built step by step

Describe the solution you'd like I would like to have something like <v-click> that would display the element after a click / space

Describe alternatives you've considered I can display everything at once

Advantages :

Disadvantages :


I can duplicate the diagram on several slides, and remove the elements on the first few slides

Advantages :

Disadvantages :


I can duplicate the diagram on several slides, and add a custom style to hide elements

flowchart LR
    First --> Second
    Second --> Third

    classDef Hidden visibility:hidden
    class Second,Third Hidden
flowchart LR
    First --> Second
    Second --> Third

    classDef Hidden visibility:hidden
    class Second,Third Hidden

Advantages :

Disadvantages :

ragavkumarv commented 5 months ago

This feature I really miss it and would be great addition to the already awesome slidev 🎊

twitwi commented 5 months ago

I have done it but with my custom animation syntax (e.g. with svg) so here are some random comments that might help for the implementation using v-clicks:

twitwi commented 5 months ago

Small video of my prototype