animotionjs / animotion

🪄 Create beautiful presentations with Svelte
https://animotion.pages.dev
MIT License
1.38k stars 41 forks source link

Add `history` option to persist slide state across page reloads #32

Closed b-d-m-p closed 4 months ago

b-d-m-p commented 4 months ago

Description:

solves https://github.com/animotionjs/animotion/issues/31

Problem: When editing a presentation with Reveal.js and saving changes, the presentation always reloads back to the beginning. This behavior can be disruptive, especially when working on longer presentations, as it requires manually navigating back to the slide being edited.

Solution: Add the history option to the Reveal.js initialization configuration. The history option helps preserve the state of the current slide across page reloads, allowing users to continue from where they left off.

Proposed Configuration:

<Presentation
    options={{ history: true, transition: 'slide', controls: true, progress: true, hash: false }}
>

Rationale: Enabling the history option will significantly enhance the user experience by maintaining the current slide state during development and editing, thus improving workflow efficiency.

Additional Context: The history option utilizes the browser's history API to store the current slide number. This small addition can make a big difference in usability without affecting other functionalities.


Feel free to adjust the content as needed before submitting the pull request.

mattcroat commented 4 months ago

Thank you! 😄