Skip to content

Commit

Permalink
Animation frame update
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonsturges committed Feb 29, 2024
1 parent 2dae9ef commit 971f1a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Moon } from "./src";
import { Julian } from "./src";

setInterval(() => {
const update = () => {
document.querySelector("#julianDay").innerHTML = Julian.fromDate().toFixed(10);
document.querySelector("#lunarAge").innerHTML = Moon.lunarAge().toFixed(10);
document.querySelector("#lunarAgePercent").innerHTML = Moon.lunarAgePercent().toFixed(10);
Expand All @@ -11,4 +11,6 @@ setInterval(() => {
document.querySelector("#lunarPhaseEmoji").innerHTML = Moon.lunarPhaseEmoji();
document.querySelector("#isWaxing").innerHTML = Moon.isWaxing();
document.querySelector("#isWaning").innerHTML = Moon.isWaning();
}, 33);
requestAnimationFrame(update);
};
update();

0 comments on commit 971f1a7

Please sign in to comment.