Skip to content

minute and hour hand gradual update - #55

Closed
stanleynguyen wants to merge 2 commits into
wesbos:masterfrom
stanleynguyen:master
Closed

stanleynguyen wants to merge 2 commits into
wesbos:masterfrom
stanleynguyen:master

Conversation

@stanleynguyen

Copy link
Copy Markdown

For an actual clock, the minute and hour and doesn't stay still and wait until it's the next minute/hour to move but gradually move towards the next point in accord with how the second hand moves. I think the clock will look more realistic if we can add in this.

@dxcqcv

dxcqcv commented Dec 19, 2016 •

Copy link
Copy Markdown

I wanna know how to keep counting the second hand when the rotation became 90.

and sometime the degrees will duplicate, so it's a setInterval problem, right?

@stanleynguyen

Copy link
Copy Markdown
Author

@dxcqcv it got to do with the transition animation, you can try this

if (secondsDegree === 90) secondHand.style.transition = 'all 0s';
else secondHand.style.transition = 'all 0.05s';

@dxcqcv

dxcqcv commented Dec 19, 2016

Copy link
Copy Markdown

@stanleynguyen thank you very much, so the only way is remove the transition property, I'm serious about keeping couting way heard from the vedio, but cannot find out how to do it.

@wesbos

wesbos commented Dec 20, 2016

Copy link
Copy Markdown
Owner

I appreciate the PR but I will be keeping these files the same as the videos in order to maintain consistency. Thanks though!

@wesbos wesbos closed this Dec 20, 2016
@soyaine

soyaine commented Jan 5, 2017 •

Copy link
Copy Markdown
Contributor

@dxcqcv Counting may mean increasing the degree per setInterval, rather than assign the rotate value based on the calculated degree by time. You can see the code here.

@dxcqcv

dxcqcv commented Jan 5, 2017

Copy link
Copy Markdown

@soyaine I'll learn it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants