Colour tweaks and fixes

This commit is contained in:
Ian Renton
2026-03-30 19:01:25 +01:00
parent 7de3cdc49c
commit 02f564b515
16 changed files with 60 additions and 77 deletions

View File

@@ -193,25 +193,18 @@ tr.new td {
}
}
/* Fudge apply our own "dark primary" and "dark danger" backgrounds as Bootstrap doesn't do this itself */
[data-bs-theme=dark] tr.table-primary {
--bs-table-bg: #053680;
--bs-table-border-color: #021b42;
--bs-table-color: white;
}
[data-bs-theme=dark] tr.table-danger {
--bs-table-bg: #74272e;
--bs-table-border-color: #530208;
--bs-table-color: white;
}
/* TABLE */
#table-container {
border-radius: 3px;
border-radius: 5px;
border: 1px solid var(--bs-primary-border-subtle);
overflow: hidden;
}
#table-container table{
margin-bottom: 0;
}
/* MAP */
div#map {

View File

@@ -54,25 +54,25 @@ function updateTable() {
let table = $("#table");
table.find('thead tr').empty();
if (showStartTime) {
table.find('thead tr').append(`<th>${useLocalTime ? "Start&nbsp;(Local)" : "Start&nbsp;UTC"}</th>`);
table.find('thead tr').append(`<th class="bg-primary-subtle">${useLocalTime ? "Start&nbsp;(Local)" : "Start&nbsp;UTC"}</th>`);
}
if (showEndTime) {
table.find('thead tr').append(`<th>${useLocalTime ? "End&nbsp;(Local)" : "End&nbsp;UTC"}</th>`);
table.find('thead tr').append(`<th class="bg-primary-subtle">${useLocalTime ? "End&nbsp;(Local)" : "End&nbsp;UTC"}</th>`);
}
if (showDX) {
table.find('thead tr').append(`<th>DX</th>`);
table.find('thead tr').append(`<th class="bg-primary-subtle">DX</th>`);
}
if (showFreqsModes) {
table.find('thead tr').append(`<th class='hideonmobile'>Freq<span class='hideonmobile'>uencie</span>s & Modes</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Freq<span class='hideonmobile'>uencie</span>s & Modes</th>`);
}
if (showComment) {
table.find('thead tr').append(`<th class='hideonmobile'>Comment</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Comment</th>`);
}
if (showSource) {
table.find('thead tr').append(`<th class='hideonmobile'>Source</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Source</th>`);
}
if (showRef) {
table.find('thead tr').append(`<th class='hideonmobile'>Ref.</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Ref.</th>`);
}
table.find('tbody').empty();
@@ -86,22 +86,22 @@ function updateTable() {
later = alerts.filter(a => moment.unix(a["start_time"]).utc().subtract(24, 'hours').isSameOrAfter());
if (onNow.length > 0) {
table.find('tbody').append('<tr class="table-primary"><td colspan="100" style="text-align:center;">On Now</td></tr>');
table.find('tbody').append('<tr><td colspan="100" class="bg-primary-subtle" style="text-align:center;">On Now</td></tr>');
addAlertRowsToTable(table.find('tbody'), onNow);
}
if (next24h.length > 0) {
table.find('tbody').append('<tr class="table-primary"><td colspan="100" style="text-align:center;">Starting within 24 hours</td></tr>');
table.find('tbody').append('<tr><td colspan="100" class="bg-primary-subtle" style="text-align:center;">Starting within 24 hours</td></tr>');
addAlertRowsToTable(table.find('tbody'), next24h);
}
if (later.length > 0) {
table.find('tbody').append('<tr class="table-primary"><td colspan="100" style="text-align:center;">Starting later </td></tr>');
table.find('tbody').append('<tr><td colspan="100" class="bg-primary-subtle" style="text-align:center;">Starting later </td></tr>');
addAlertRowsToTable(table.find('tbody'), later);
}
if (onNow.length == 0 && next24h.length == 0 && later.length == 0) {
table.find('tbody').append('<tr class="table-danger"><td colspan="100" style="text-align:center;">No alerts match your filters.</td></tr>');
table.find('tbody').append('<tr class="bg-danger-subtle"><td colspan="100" style="text-align:center;">No alerts match your filters.</td></tr>');
}
}

View File

@@ -8,7 +8,7 @@ function loadSolarConditions() {
// HF
const hfConditionClass = { 'Good': 'table-success', 'Fair': 'table-warning', 'Poor': 'table-danger' };
const hfConditionClass = { 'Good': 'bg-success-subtle', 'Fair': 'bg-warning-subtle', 'Poor': 'bg-danger-subtle' };
if (jsonData.hf_conditions) {
Object.entries(jsonData.hf_conditions).forEach(function([key, condition]) {
@@ -26,11 +26,11 @@ function loadSolarConditions() {
cell.text(condition);
let vhfClass;
if (condition === 'Band Closed') {
vhfClass = 'table-danger';
vhfClass = 'bg-danger-subtle';
} else if (condition.includes('High')) {
vhfClass = 'table-warning';
vhfClass = 'bg-warning-subtle';
} else {
vhfClass = 'table-success';
vhfClass = 'bg-success-subtle';
}
cell.addClass(vhfClass);
});
@@ -130,8 +130,8 @@ function renderDxStats() {
const range = max - min;
cells.forEach(function({ cell, count }) {
const t = range > 0 ? (count - min) / range : 0;
const cls = t === 0 ? 'table-danger' : t < 0.05 ? 'table-warning' : 'table-success';
cell.removeClass('table-danger table-warning table-success').addClass(cls);
const cls = t === 0 ? 'bg-danger-subtle' : t < 0.05 ? 'bg-warning-subtle' : 'bg-success-subtle';
cell.removeClass('bg-danger-subtle bg-warning-subtle bg-success-subtle').addClass(cls);
});
}

View File

@@ -111,39 +111,39 @@ function updateTable() {
let table = $("#table");
table.find('thead tr').empty();
if (showTime) {
table.find('thead tr').append(`<th>${useLocalTime ? "Local" : "UTC"}</th>`);
table.find('thead tr').append(`<th class="bg-primary-subtle">${useLocalTime ? "Local" : "UTC"}</th>`);
}
if (showDX) {
table.find('thead tr').append(`<th>DX</th>`);
table.find('thead tr').append(`<th class="bg-primary-subtle">DX</th>`);
}
if (showFreq) {
table.find('thead tr').append(`<th>Freq<span class='hideonmobile'>uency</span></th>`);
table.find('thead tr').append(`<th class="bg-primary-subtle">Freq<span class='bg-primary-subtle hideonmobile'>uency</span></th>`);
}
if (showMode) {
table.find('thead tr').append(`<th>Mode</th>`);
table.find('thead tr').append(`<th class="bg-primary-subtle">Mode</th>`);
}
if (showComment) {
table.find('thead tr').append(`<th class='hideonmobile'>Comment</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Comment</th>`);
}
if (showBearing) {
table.find('thead tr').append(`<th class='hideonmobile'>Bearing</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Bearing</th>`);
}
if (showType) {
table.find('thead tr').append(`<th class='hideonmobile'>Type</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Type</th>`);
}
if (showRef) {
table.find('thead tr').append(`<th class='hideonmobile'>Ref.</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Ref.</th>`);
}
if (showDE) {
table.find('thead tr').append(`<th class='hideonmobile'>DE</th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>DE</th>`);
}
if (showWorkedCheckbox) {
table.find('thead tr').append(`<th class='hideonmobile'></th>`);
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'></th>`);
}
table.find('tbody').empty();
if (spots.length == 0) {
table.find('tbody').append('<tr class="table-danger"><td colspan="100" style="text-align:center;">No spots match your filters.</td></tr>');
table.find('tbody').append('<tr class="bg-danger-subtle"><td colspan="100" style="text-align:center;">No spots match your filters.</td></tr>');
}
// We are regenerating the entire table not just adding a new row, so reset the row counter