Most of the changes comes from #26 so I would merge that first. But this new feature really looks cool, it is like our competitor :D
I would give the id compass
to the compass img
itself so only the compass graphic would rotate. But then this line should look like this to keep the default translate of the image:
For semantical reasons I would use div
instead of span
because span
is intended to be an inline element, however this a block element here.
This semantically belongs to reset
(after line 334) and resetRound
(after line 360). Yes it will be some ugly code duplication but easier to find there and I plan to refactor this JS in the future.
This may not look perfect on mobile devices so it might be moved to a popup in the future, but I like the feature!
I would execute context menu -> Format Document on this file in VSCode. Formatting JS files should work well in VSCode without any extension.