-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option and theme updates v2 #24
base: master
Are you sure you want to change the base?
Conversation
Thanks for cleaning this up. I have a question regarding the Also, the |
Ah yes, I think the issue is here. c0b3ded#diff-995524a2f71c68dc4e564cb1c358aee9R391 This should be dayRotor.style.display = 'none'; Yes, the occurnce event is intended to fire an event at a specified time during the countdown. I agree that it would be better to allow multiple target times to be chained together though I wasn't sure how best to implement this. I'm happy to rename this if you've got a less confusing suggestion, I picked hasOccured to fit with the existing hasEnded but maybe this can just be an event method. |
That was it, thanks. There's definitely value in being able to trigger events during the countdown so I'll put some thought into how to name that feature and how best to allow multiple events during the countdown. Perhaps something like this?: .events([
{
at: 10, // Could be a UTS or a number in seconds after the UTS value flipdown was initialised with
func: () => { /* Do something */ }
},
/* More events here */ ]) This would open up some interesting possibilities:
...
{
every: 60000,
func: () => {}
} |
Yes, that looks good :) I like the idea of the every functionality as well, perhaps it would be possible to do using cron, though maybe that's making things too complicated. |
The problem there is that the element does not resize to reflect the number of visible rotors. The containing element should be resized based on the number of visible rotors. I'd appreciate a PR for that if you're up for it. Once this current PR is ready, that centring feature should be added with it though. |
Check if this works .flipdown {
overflow: visible;
/*width: 510px;*/
width: max-content;
height: 110px;
margin-left: auto;
margin-right: auto;
display: block;
} |
My current brute-force approach to hiding unneeded rotors is a couple of small modifications to the flipdown code. This obviously not a general solution.
|
As far as countdown events, another nice one would be to trigger things at certain points, like when only 30 seconds remain or when each day/hour/minute/second finishes. |
Hi, I really like this project. I've added a couple of features that I've included in this PR which I think could come in handy for others.
The multiple theme option just accepts a comma seperated string and splits it, possibly this should take a string or an arroay of strings?
I'm not a native javascript developer so there may well be better ways of adding some of the functionality above so feel free to change if you think it can be improved.
I've also added an hasOccurred event in in my local brance in addition to your hasEnded event so I'll create a seperate PR for that once we're happy with this one if you think it would be useful.