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

Is there a support for animating between code blocks? #428

Open
joyfulelement opened this issue Aug 14, 2022 · 2 comments
Open

Is there a support for animating between code blocks? #428

joyfulelement opened this issue Aug 14, 2022 · 2 comments

Comments

@joyfulelement
Copy link

Hi:

Do we know if reveal-md will eventually support the animating between code blocks as demostrated on https://revealjs.com/auto-animate/#example%3A-animating-between-code-blocks ?

Have been trying to experiment with the following syntax, but not successful.

## 1st slide
<!-- .slide: data-auto-animate -->
<!-- .element: data-id="code-animation"-->
```js data-trim data-line-numbers
    let planets = [
      { name: 'mars', diameter: 6779 },
    ]
``` <!--end of slide 1-->

## 2nd slide
<!-- .slide: data-auto-animate data-trim data-line-numbers-->
<!-- .element: data-id="code-animation"-->
```js data-trim data-line-numbers
    let planets = [
      { name: 'mars', diameter: 6779 },
      { name: 'earth', diameter: 12742 },
      { name: 'jupiter', diameter: 139820 }
    ]
``` <!--end of slide 2-->
## 3rd slide
<!-- .slide: data-auto-animate data-trim data-line-numbers-->
<!-- .element: data-id="code-animation"-->
```js data-trim data-line-numbers
    let circumferenceReducer = ( c, planet ) => {
      return c + planet.diameter * Math.PI;
    }

    let planets = [
      { name: 'mars', diameter: 6779 },
      { name: 'earth', diameter: 12742 },
      { name: 'jupiter', diameter: 139820 }
    ]

    let c = planets.reduce( circumferenceReducer, 0 )
``` <!--end of slide 3-->

Any guidance would be much apprechiated. Thank you.
@Artmorse
Copy link
Contributor

Hi,

I'm not sure... It support the Code Highlighting and the Highlight of lines (example in the revealjs website) but i'm not sure for the Code Animation...

@ChongChengAC
Copy link

I've tried various ways of writing it before and it worked. Here is an example. Please do not ignore any part of the example, even blank lines.

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

No branches or pull requests

3 participants