Creating a feature on an app that involves breathing exercises using CSS animations. The challenge I'm facing is ensuring the words "exhale" and "inhale" appear synchronously with the animation of a circle shrinking and enlarging. However, the animation doesn't always start from the same point, causing display issues.
function toggleDropdown() {
var dropdownContent = document.getElementById("dropdown-content");
dropdownContent.classList.toggle("show");
}
var timer;
// More JavaScript code...
body {
background: #005eb8;
margin: 0;
padding: 0;
// More CSS styles...
}
<div class="container">
<h1>Breathing Exercises</h1>
// More HTML code...
</div>
Despite trying various approaches to resetting the animation for each exercise selection, I have not yet found a successful solution.