Giter Site home page Giter Site logo

Comments (6)

oucil avatar oucil commented on July 19, 2024

I've forked and will try a couple things and hopefully shoot up a pull req soon, just a quick question to save some time...

I see on line 215, 216 you've used Math.abs(), just curious if you've tried Math.round() already and seen any adverse affects?

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

The benefit of not using round there, is that if you do- the circle animation can only update once per second.

Also, I agree that total should not be an abs value, so I'm committing a fix for that now.

See:
21a7298

from timecircles.

oucil avatar oucil commented on July 19, 2024

FYI, the effect of this change has altered the value of total in a Count-down scenario to a negative prior to reaching zero and a positive post zero, that would affect anyone previously testing for a positive value, you may want to update the docs for that. Count-up is not affected, it's always zero.

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

That's a good point. Actually makes me think whether or not I should reverse that (negative after 0?). I think the most conventional use is "count down", in which case total is the "time left until".

from timecircles.

oucil avatar oucil commented on July 19, 2024

I think that would be more intuitive, and probably affect a smaller number of users based on the typical use case like you point out.

from timecircles.

oucil avatar oucil commented on July 19, 2024

Found one other quirk, this is prior to reversing the neg/pos you want to do though, so you may want to test... when doing a count-down, I exposed an input field with id="timer-count" and then added $('#timer-count').val(total); and noticed that the negative numbers were one behind (i.e. the timer shows 10, but the input shows -11), it would linger at 0 for 2 seconds, and then the positive numbers would all be correct.

from timecircles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.