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

Restart CSS animations when switching page in bespoke template #222

Merged
merged 3 commits into from
Jun 8, 2020

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Apr 26, 2020

If using CSS animations in the HTML slide deck, the animation keyframe may not restart in some browsers even if switched page.

css-anim

---
style: @import url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css');
---

# Animation example

---

# CSS Animation

Powered by [Animate.css](https://daneden.github.io/animate.css/)

```css
@import url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css');

h1 {
  animation: rollIn 0.75s ease-out 0s 1;
  width: max-content;
}
p {
  animation: jackInTheBox 0.75s ease-out 0.5s 1 backwards;
  width: max-content;
}
pre {
  animation: bounceIn 0.75s ease-out 0.5s 1 backwards;
}
```

<style scoped>
h1 {
  animation: rollIn 0.75s ease-out 0s 1;
  width: max-content;
}
p {
  animation: jackInTheBox 0.75s ease-out 0.5s 1 backwards;
  width: max-content;
}
pre {
  animation: bounceIn 0.75s ease-out 1s 1 backwards;
}
</style>

Now bespoke classes plugin has been updated to reset CSS animation keyframe, by disabling all animations in the slide page only for a moment.

css-anim-fixed

@yhatt yhatt merged commit 0737e35 into master Jun 8, 2020
@yhatt yhatt deleted the restart-animation-when-switching-page branch June 8, 2020 14:43
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

Successfully merging this pull request may close these issues.

1 participant