Hi Hype Hooligans!
I was wondering if anyone had a solution to count up (and down) between set numbers (years) controlled via a drag with target numbers at set intervals?
I've attached a setup for the drag with the years. Looking for help with the logic.
You're already on the right track. The idea with the AG Timeline is absolutely correct. The only thing you need to do is change the innerHTML of the 'Date' text field, just like I did for the first four dates. Additionally, I've increased the size of the bounding box around the drag button to prevent it from snapping back if you don't release it precisely.
Thank you for taking a look at this fellas!
What I'm going for is an animated count up that stops at each date.
But...I have also realized that I would need to make the data monospaced to stop it bouncing around while counting up/down. To do this I think I would need to make each digit a separate number/layer and animate each one on and off.
PS: Could also be easily done with Hype Action Events, but I wanted to keep as simple as possible. Tracks the width of the element .year and adds 1800 (rounded) to set the .yearDisplay innerHTML based on it.
Nice one @max,
That's pretty neat using the width as a counter.
You could also do away with the MutationObserver and just add the call to the function on the end of the existing on drag.
The function would just need to be
var year_ = hypeDocument.getElementById('year')|
document.querySelector('.yearDisplay').innerHTML = Math.round(hypeDocument.getElementProperty(year_, 'width') + 1800)
(Although , just realised why yo use MutationObserver. due to the continue timeline.)