Created
November 18, 2020 00:07
-
-
Save daniel-schroeder-dev/5ba2ff4df236b294d7b2f804d5a86a7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AFRAME.registerComponent('clock', { | |
| tick: function(time, timeDelta) { | |
| var milliseconds = Math.round(time % 1000); | |
| var seconds = Math.round(time / 1000); | |
| seconds = seconds == 60 ? 0 : seconds; | |
| var minutes = Math.round(seconds / 60); | |
| $('#time-text-ms').attr('value', milliseconds); | |
| $('#time-text-s').attr('value', seconds); | |
| $('#time-text-m').attr('value', minutes); | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment