The Circle Counter animation starts and ends on page load, and doesn't start animation automatically when the user comes into view of the element.
v1.4
Google Chrome (happens in every browser)
macOS
Reproduction Steps
Open the website with the Circle Counter animation.
The animation will start and end on page load.
Scroll the page so that the Circle Counter element is in the viewport.
The Circle Counter will show as played through.
The animation should not start automatically on page load but rather when the user is in viewport.
To fix this bug, you can add the following code to the Circle Counter element:
var circleCounter = document.getElementById("circle-counter");
circleCounter.addEventListener("scroll", function() {
if (circleCounter.isIntersectingViewport()) {
circleCounter.startAnimation();
}
});
Not sure if this code is exact for Breakdance, but it works in other frameworks. Basically, the code should listen for the scroll event on the Circle Counter element. When the element is scrolled into view, the startAnimation() function will be called. This function will start the animation again.
Im really tired though so take the code with a grain of salt. Either way, what's the point of an animated circle counter if it doesn't animate when the user comes into view of it.
The Circle Counter animation starts and ends on page load, and doesn't start animation automatically when the user comes into view of the element.
v1.4
Google Chrome (happens in every browser)
macOS
Reproduction Steps
To fix this bug, you can add the following code to the Circle Counter element:
Not sure if this code is exact for Breakdance, but it works in other frameworks. Basically, the code should listen for the scroll event on the Circle Counter element. When the element is scrolled into view, the startAnimation() function will be called. This function will start the animation again.
Im really tired though so take the code with a grain of salt. Either way, what's the point of an animated circle counter if it doesn't animate when the user comes into view of it.
Reproduction Video
https://github.com/soflyy/breakdance-bugs/assets/97276735/0d98ce8c-ceee-49a2-9aa7-775097a7d853