mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
26 lines
No EOL
709 B
JavaScript
26 lines
No EOL
709 B
JavaScript
|
|
function colorHeadingTable() {
|
|
|
|
const headers = document.querySelectorAll('th');
|
|
headers.forEach(header => {
|
|
const text = header.textContent;
|
|
const match = text.match(/\((\d+)\s*\/\s*(\d+)\)/);
|
|
if (match) {
|
|
const [_, completed, total] = match;
|
|
const ratio = completed / total;
|
|
const alpha = ratio.toFixed(2);
|
|
header.style.backgroundColor = `rgba(154, 205, 50, ${alpha})`;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function updateMapHeightForLargeScreens() {
|
|
|
|
const mapFound = document.querySelector('#map');
|
|
if (mapFound && window.innerHeight > 800 && window.innerWidth > 800) {
|
|
mapFound.style.height = '80vh';
|
|
} else {
|
|
console.log('window.innerHeight', window.innerHeight);
|
|
}
|
|
} |