Merge branch 'main' of github.com:nafunii/gitccentify

This commit is contained in:
nafunii 2022-01-11 07:48:32 +08:00
commit 12d661e77d
No known key found for this signature in database
GPG key ID: 0A82862EF6000AE3

View file

@ -1,5 +1,14 @@
chrome.storage.sync.get('a1', ({ a1 }) => { chrome.storage.sync.get('a1', ({ a1 }) => {
updateAccents(a1);
// run a second check to update missing accents due to limitations
setTimeout(function() { setTimeout(function() {
updateAccents(a1);
}, 1000);
});
function updateAccents(a1) {
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L4-bg', a1 + "ff", "important"); document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L4-bg', a1 + "ff", "important");
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L3-bg', a1 + "c5", "important"); document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L3-bg', a1 + "c5", "important");
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L2-bg', a1 + "8a", "important"); document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L2-bg', a1 + "8a", "important");
@ -15,5 +24,4 @@ chrome.storage.sync.get('a1', ({ a1 }) => {
for (let i = 0; i < document.querySelectorAll('.Progress-item.rounded-2').length; i++) { for (let i = 0; i < document.querySelectorAll('.Progress-item.rounded-2').length; i++) {
document.querySelectorAll('.Progress-item.rounded-2')[i].style.setProperty('background-color', a1 + "ff", "important"); document.querySelectorAll('.Progress-item.rounded-2')[i].style.setProperty('background-color', a1 + "ff", "important");
} }
}, 1000); }
});