up
This commit is contained in:
parent
a17fd9c232
commit
8bce5fe21c
14 changed files with 628 additions and 634 deletions
26
assets/utils.js
Normal file
26
assets/utils.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue