Animated diagram/schema inside a slide #308
-
I would like to have an animated diagram inside a slide, something to describe a step by step workflow. The diagram is in SVG format. In the past, I have successfully done this kind of thing with RevealJS and some specific JS to manipulate the SVG, but with Marp, I don't know how to achieve the same effect. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Unlike reveal.js, Marp is mainly targeted to the static slide such as a PDF slide. Optional animations for each rendered elements, that are triggered when appearing a slide page in HTML, can set through CSS, but detailed animations that are triggered from fragment navigations within a single page are out of the scope of Marp ecosystem. If you want more interactive slides, using suitable tool for the your purpose is the best. In Marp, you can animate elements rendered by Markdown through inline style A following example is presenting animated steps. It must be required to enable raw HTML tag rendering in Markdown by the preference ( # Animated SVG
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 300" width="100" height="300">
<path class="stroke step1" d="M10 76.79l53.57-53.58v53.58H10z"></path>
<path class="stroke step2" d="M10 176.79l53.57-53.58v53.58H10z"></path>
<path class="stroke step3" d="M10 276.79l53.57-53.58v53.58H10z"></path>
<defs>
<style>
.stroke {
fill: none;
stroke: #0288d1;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 5px;
}
.step1, .step2, .step3 {
stroke-dasharray: 183 185;
stroke-dashoffset: 184;
animation: animated-stroke 1s linear 1 both;
}
.step2 {
animation-delay: 1.5s;
}
.step3 {
animation-delay: 3s;
}
@keyframes animated-stroke {
to { stroke-dashoffset: 0; }
}
</style>
</defs>
</svg>
(Required to enable HTML in Markdown)
|
Beta Was this translation helpful? Give feedback.
Unlike reveal.js, Marp is mainly targeted to the static slide such as a PDF slide. Optional animations for each rendered elements, that are triggered when appearing a slide page in HTML, can set through CSS, but detailed animations that are triggered from fragment navigations within a single page are out of the scope of Marp ecosystem.
If you want more interactive slides, using suitable tool for the your purpose is the best.
In Marp, you can animate elements rendered by Markdown through inline style
<style>
, or embed SVG image that has predeclared animations.A following example is presenting animated steps. It must be required to enable raw HTML tag rendering in Markdown by the preferen…