egon.io icon indicating copy to clipboard operation
egon.io copied to clipboard

generate animated GIF

Open hofstef opened this issue 6 years ago • 2 comments

Is your feature request related to a problem? Please describe. When I share a Domain Story as SVG or PNG with people who do not use the modeler, they have trouble to read (larger) stories in the right sequence.

Describe the solution you'd like Additionally to the possibility of downloading a static picture, I would like to download an animated GIF. The animation should be slow enough so I can follow the story.

Describe alternatives you've considered We could provide a "replay mode only" version of the modeler that runs in the web (e.g. www.wps.de/modeler/play) and that provides a super simple way for uploading and animating a .dst file. There might be other solutions that I have not considered yet.

hofstef avatar Jul 04 '19 08:07 hofstef

I think we should animate SVGs instead of GIFs (and thus change the title to “generate animated SVG”). I experimented a bit with SVG's <animate> tag and think it does what we want. We could add something like the following to the sentences of a domain story:

<animate
    attributetype="XML"
    attributename="visibility" 
    from="hidden" 
    to="visible" 
    dur="1s">
</animate>

That would lead to an image where sentence after sentence will fade in.

Interesting sources:

  • https://en.wikipedia.org/wiki/SVG_animation
  • https://css-tricks.com/guide-svg-animations-smil/
  • https://www.w3.org/TR/2001/REC-smil-animation-20010904/
  • https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animate?retiredLocale=de

hschwentner avatar Nov 16 '22 07:11 hschwentner

Update: maybe <set> is enough. We could write something like the following on every domain story sentence and increment the seconds.

<set end="1s" attributeName="visibility" to="hidden"/>

hschwentner avatar Nov 23 '22 14:11 hschwentner