Hi, I wanted to build a simple timer that Starts counting up, Stops and Resets.
I got the buttons and text ready but Im not sure how to proceed. Which would be some first steps? Where to go?
Hi, I wanted to build a simple timer that Starts counting up, Stops and Resets.
I got the buttons and text ready but Im not sure how to proceed. Which would be some first steps? Where to go?
You need to take the current time and save it in an element state, and refresh the current time every 1 second (there is where you use the “do every x seconds” workflow) and in the text to display the numbers yo need to do an operation which is going to be the difference between the time in which the timer was started and the current time refreshed every second and make an operation and use of <–module --> in dynamic text to display seconds and minutes, after that you need to create the functions that stops the timer. In this case it can be that the “do every x seconds” is active only if one condition is true, and every time you click on “stop” make that condition false, so the counter will stop
Hey thanks for the detailed answer Bluflame. What do you mean when you say ´take the current time and save it in an element state´? I created a field called Time in the database and saved it as a number. Is that it?
After this Im not sure how to do the operation (I cant find the Time field I created for a start, neither the module option).
Here my app so far: https://pomodororo.bubbleapps.io/version-test?debug_mode=true
https://buildingonbubble.com/block/countdown-timer-1466528802569x695336233767534600
This is a timer, but the idea is much the same. Using a state to hold the “start”.
This topic was automatically closed after 70 days. New replies are no longer allowed.