Is an animated countdown with numbers possible?

Maybe it’s good to edit the post with a warning not to use it.

2 Likes

Ok, so I’ve come to the same conclusion @NigelG did in another post:

Auction Date Countdown.

The best solution is using an HTML element set to iframe with a javascript timer inside. Any internal Bubble solution would require data to be changed every second, which creates far too many workflow calls.

I used this easy little java widget here:

http://www.hashemian.com/tools/javascript-countdown.htm

The final message is set to “Time’s up! This is your last question.” The next time the user clicks an answer, I’ve set a workflow condition to check if the difference between the User End Time and Current Date/Time is less than zero, triggering a popup that ends the quiz when exited, as opposed to a new question being displayed.

That’s my solution, hope it helps!

1 Like

Actually you can run a workflow every second to set a custom state of “currentdate” on an element. You can then use some modulo maths to get the days/hours/minutes/seconds.

Which is what I am doing here …

As there is no database access, it doesn’t count as a workflow.

3 Likes

That sounds interesting Nigel, could you post an example please?

Sure.

https://buildingonbubble.com/block/formatted-countdown-1471178176900x842421891177381900

P.s. this a tweaked version of airdev’s countdown that uses modulo to make it simpler.And the original idea came from Scott.

8 Likes

That’s a truly awesome solution, thanks Nigel! You’re sure the “Do every 1 second” workflow doesn’t count in the monthly call limit?

1 Like

As long as there is no database access, then it shouldn’t.

I did just check and am not seeing an increase every second.

Just don’t put a data condition on it !

3 Likes

Excellent, I’ve just implemented your solution in my quiz and it’s working perfectly. Thanks so much Nigel!

does anyone know how to make a stopwatch timer? The stopwatch would show 00:00:00 when page is loaded and if user clicks START button the numbers start counting up by .01 seconds? and if they hit STOP the numbers stop counting. if anyone could show an example that would be awesome. Or if @NigelG’s solution above already has the answer just let me know what i need to tweak.

Using the same method is probably not going to work, as it relies on have something run every x seconds … and running every 0.01 seconds… might be interesting.

However, I wonder if you could make it pretend that it is working that way by animating the small numbers… and then using something like this when you stop.

https://buildingonbubble.com/block/difference-between-two-times-1459448496564x115212698237534200

Thanks @NigelG I will check it out and share if I can make it work!

1 Like

@NigelG Hey Nige, the example you provided is very useful, thank you for that. Do you think its possible to pre select the date… I want to select the date for a deadline for my users, i’ve had a play around with the method provided but i cant seem to make it work!

Hey there :smiley:
Actually, as farrrrr as I know, those workflow’s don’t count against your budgeted workflows… That is to say, only workflows that trigger a change to the database would incur a cost… Simply run your clock through a list and you’re gravy.

I have let clocks run punching a task 1000/minute… it does not effect my workflow budget :smiley:

Have a great day!

Ashley

I have got a couple of plugins ready for when the store opens. these plugins animate time, but can also act as controllers, clocks, individual graphic clock components and even infinite dial’s (constant +/-). feel free to flick me a message for more details.

Extra note: for things like finding a users time on a page, or if a user has left the site these plugins are perfect!

Did you figure this out? It’s really quite simple to implement… Haha… I know that speaking Russian is simple for Russians, but hard for me… The trick is internalizing the concepts quickly, amirite bro? :smiley:

Peace bro~!

Ashley

Hey Nigell :smiley: Yeah, working with the timer is funny… Especially since it doesn’t accurately track time… That is to say, if you make a stopwatch, it’ll be off after any duration of time… I flip flip between just letting people believe in this elastic time, or correcting the counter after each minute… (it’d cause a funny jump in the clock if anyone’s watching)…

Have a good day @NigelG

Hey Jarrad. Did you ever create a plugin for this?

YES, use the function ‘repeat every x seconds’.

I mean, do you mean some particle animation where numbers morph into each other? Or do you simply mean that people can watch the numbers click by?

Yes, you can build a stop watch, metronome, click track, etc. here very nicely thank you very much :slight_smile:

Happy Bubblin’!

Ashley

Hi @NigelG I just run into your count down solution, which is very nice. I believe I understand the modulo part to get the remainder in days, hours, minutes or seconds. But on days, hours, and minutes you do -0.5 and then rounded to 0 can you explain why?

Bubble rounds UP by default, so that is a trick to get it to round DOWN.

Otherwise 3.6 days becomes 4. So 3.1 days - 0.5 = 2.6 ROUND UP to 3 :slight_smile:

1 Like