Hi. I want to add a countdown timer to my dashboard UI. I am going to use it as an alarm, using a buzzer connected to a GPIO pin on the Pi. The user must have fixed, different times. Imagine a dropdown with options of 15, 30, 45, and 60 minutes. Then, the user will click on the Alarm switch.
The problem is, I put the dropdown first, then the switch, and a text output to the end, but I am not able to carry the value from the dropdown to the text output. If I could do that, I could use a switch (not the button one, the one which can be used as if-else) to get the value and make it countdown according to the value. I don't know how to get that value from the dropdown, and how to make it count in seconds. Never written a js code before, and timers I found were complex. So, I decided to do it this way. Lastly, the 2nd press on the alarm switch will set it back to the default value.
I am open to any advice or help. Specially, if you think there is a better option than dropdown in terms of cool looks, while still being easy to use.