Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The subtle "wiggle" animation that the second hand makes after moving doesn't fire when it hits 12. Literally unwatchable.


In its defence, the code actually specifically calls that edge case out and justifies it:

    // Calculate rotations
    // We use a cumulative calculation logic mentally, but here simple degrees work because of the transition reset trick or specific animation style.
    // To prevent the "spin back" glitch at 360->0, we can use a simple tick without transition for the wrap-around,
    // but for simplicity in this specific React rendering, we will stick to standard 0-360 degrees.
    // A robust way to handle the spin-back on the second hand is to accumulate degrees, but standard clock widgets often reset.


The Swiss and German railway clocks actually work the same way and stop for (half a?) second while the minute handle progresses.

https://youtu.be/wejbVtj4YR0


Station clocks in Switzerland receive a signal from a master clock each minute that advances the minute hand, the seconds hand moves completely independent from the minute hand. This allows them to sync to the minute.

> The station clocks in Switzerland are synchronised by receiving an electrical impulse from a central master clock at each full minute, advancing the minute hand by one minute. The second hand is driven by an electrical motor independent of the master clock. It takes only about 58.5 seconds to circle the face; then the hand pauses briefly at the top of the clock. It starts a new rotation as soon as it receives the next minute impulse from the master clock.[3] This movement is emulated in some of the licensed timepieces made by Mondaine.

https://en.wikipedia.org/wiki/Swiss_railway_clock


The video shows closer to 2 seconds for it to finally throw itself over in what could only be described as a "Thunk". I figured it would be a little more smooth.


Fixed with prompt "Second hand doesn't shake when it lands on 12, fix it." and 131 seconds. With a bunch of useState()-s and a useEffet()




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: