diff --git a/templates/about.html b/templates/about.html index e8be2f7..e2eec27 100644 --- a/templates/about.html +++ b/templates/about.html @@ -67,7 +67,7 @@

This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.

- + {% end %} \ No newline at end of file diff --git a/templates/add_spot.html b/templates/add_spot.html index d058546..2a4872e 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -69,8 +69,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/alerts.html b/templates/alerts.html index c413b8d..f45cd27 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -56,8 +56,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/bands.html b/templates/bands.html index 3f05427..f549a54 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -62,9 +62,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index b0b413d..e86c057 100644 --- a/templates/base.html +++ b/templates/base.html @@ -47,10 +47,10 @@ - - - - + + + + diff --git a/templates/conditions.html b/templates/conditions.html index fc7efa6..6b9d211 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -223,8 +223,8 @@ - - + + diff --git a/templates/map.html b/templates/map.html index 68a722b..6d12600 100644 --- a/templates/map.html +++ b/templates/map.html @@ -70,9 +70,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/spots.html b/templates/spots.html index a5845cf..f8a37e8 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -87,9 +87,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/status.html b/templates/status.html index fe1cc1a..89a1337 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,8 +59,8 @@ - - + + diff --git a/webassets/js/conditions.js b/webassets/js/conditions.js index 6113208..7638ac5 100644 --- a/webassets/js/conditions.js +++ b/webassets/js/conditions.js @@ -150,6 +150,25 @@ function renderKIndexForecast(data) { if (kpChart) { kpChart.destroy(); } + const isMobile = window.innerWidth < 768; + const kpAxisTicks = { + stepSize: 1, + color: textColor, + // Include geomagnetic storm levels (Gx) alongside the Kp index + callback: v => v > 4 ? `(G${v - 4}) ${v}` : String(v), + }; + const kpAxis = { + min: 0, + max: 9, + title: { display: true, text: 'Kp', color: textColor }, + ticks: kpAxisTicks, + grid: { color: gridColor }, + }; + const timeAxis = { + ticks: { color: textColor, maxRotation: 45, minRotation: 0 }, + grid: { color: gridColor }, + }; + kpChart = new Chart(document.getElementById('forecast-kp-chart'), { type: 'bar', data: { @@ -162,7 +181,8 @@ function renderKIndexForecast(data) { }, options: { responsive: true, - aspectRatio: 3, + aspectRatio: isMobile ? 0.4 : 3, + indexAxis: isMobile ? 'y' : 'x', plugins: { legend: { display: false @@ -172,22 +192,8 @@ function renderKIndexForecast(data) { } }, scales: { - x: { - ticks: { color: textColor, maxRotation: 45, minRotation: 0 }, - grid: { color: gridColor }, - }, - y: { - min: 0, - max: 9, - title: { display: true, text: 'Kp', color: textColor }, - // Include geomagnetic storm levels (Gx) on the y-axis as well as the Kp index - ticks: { - stepSize: 1, - color: textColor, - callback: v => v > 4 ? `(G${v - 4}) ${v}` : String(v), - }, - grid: { color: gridColor }, - } + x: isMobile ? kpAxis : timeAxis, + y: isMobile ? timeAxis : kpAxis, } } });