Skip to content
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

Unexpected behavior of the hour hand at 12 am on analog mode #123

Open
prem-k-r opened this issue Oct 28, 2024 · 2 comments
Open

Unexpected behavior of the hour hand at 12 am on analog mode #123

prem-k-r opened this issue Oct 28, 2024 · 2 comments

Comments

@prem-k-r
Copy link
Contributor

prem-k-r commented Oct 28, 2024

Only when time is 12:00 AM

time.12.am.pm.mp4
@prem-k-r
Copy link
Contributor Author

According to ChatGPT, modifying the last if-else block of the updateanalogclock function could solve this issue. Below is the code:

// Handle hour hand rotation only on the minute mark
if (initialMinutes === 0 && initialSeconds === 0 && (initialHours === 0 || initialHours === 12)) {
document.getElementById("hour").style.transition = "transform 1s ease";
document.getElementById("hour").style.transform = `rotate(361deg)`;
hourreset = true;
} else if (initialMinutes === 0 || !hourreset) {
document.getElementById("hour").style.transition = "transform 1s ease";
document.getElementById("hour").style.transform = `rotate(${cumulativeHourRotation}deg)`;
}

Could someone please review the logic and make any necessary adjustments to ensure it functions correctly?

@itz-rj-here
Copy link
Contributor

@Minuga-RC can you check it

@prem-k-r prem-k-r changed the title Unexpected behavior of the hour hand at 12 am/pm on analog mode Unexpected behavior of the hour hand at 12 am on analog mode Nov 6, 2024
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

No branches or pull requests

2 participants