fuzzyworld

north-star / commit

added url and debug info

de4dbd8a6dc733f2b5d7cbfb56986b6f9b56cb9a · Pavel Safronov · 2026-03-14 11:00:04 -0700 · parents 2c1002f36367

added url and debug info
 src/app.js     | 7 +++++++
 src/index.html | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/src/app.js b/src/app.js
index 9da9cde..539a384 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1,3 +1,7 @@
+const debugParagraph = document.getElementById('debug');
+const logDebug = (message) => {
+    debugParagraph.innerText = message;
+}
 const arrow = document.getElementById('arrow');
 let currentArrowAngle = null;
 const getShortestDelta = (fromAngle, toAngle) => ((toAngle - fromAngle + 540) % 360) - 180;
@@ -138,6 +142,9 @@ const render = () => {
 
     // set the background color to self color
     document.body.style.backgroundColor = self.color;
+
+    // output debug info
+    logDebug(`Self: ${self.position.lat.toFixed(5)}, ${self.position.lon.toFixed(5)} | Target: ${target.position.lat.toFixed(5)}, ${target.position.lon.toFixed(5)} | Heading: ${selfHeading.toFixed(2)}° | Arrow Angle: ${currentArrowAngle.toFixed(2)}°`);
 };
 
 // move the test participant in a circle around the self participant, updating every 1 seconds
diff --git a/src/index.html b/src/index.html
index b951e52..ebc8a80 100644
--- a/src/index.html
+++ b/src/index.html
@@ -10,7 +10,12 @@
 </head>
 
 <body>
+    <p><a href="https://pavelsafronov.gitlab.io/north-star/">North Star</a></p>
     <div id="arrow">⇡</div>
+    <!-- Footer that says the current site (https://pavelsafronov.gitlab.io/north-star/), and debug info -->
+    <div>
+        <p id="debug"></p>
+    </div>
     <script src="app.js"></script>
 </body>