Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 12d661e

Browse files
committed
Merge branch 'main' of github.com:nafunii/gitccentify
2 parents 060808a + 17388ec commit 12d661e

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

onload.js

+24-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
chrome.storage.sync.get('a1', ({ a1 }) => {
2+
updateAccents(a1);
3+
4+
// run a second check to update missing accents due to limitations
25
setTimeout(function() {
3-
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L4-bg', a1 + "ff", "important");
4-
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L3-bg', a1 + "c5", "important");
5-
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L2-bg', a1 + "8a", "important");
6-
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L1-bg', a1 + "54", "important");
7-
document.querySelector(':root').style.setProperty('--color-accent-emphasis', a1 + "ff", "important");
8-
document.querySelector(':root').style.setProperty('--color-btn-primary-bg', a1 + "ff", "important");
9-
document.querySelector(':root').style.setProperty('--color-btn-primary-hover-bg', a1 + "c5", "important");
10-
document.querySelector(':root').style.setProperty('--color-btn-primary-active-bg', a1 + "8a", "important");
11-
document.querySelector(':root').style.setProperty('--color-btn-primary-focus-bg', a1 + "8a", "important");
12-
document.querySelector(':root').style.setProperty('--color-btn-primary-disabled-bg', a1 + "54", "important");
13-
document.querySelector('.js-highlight-blob').style.setProperty('fill', a1 + "c5", "important");
14-
document.querySelector('.js-highlight-blob').style.setProperty('stroke', a1 + "ff", "important");
15-
for (let i = 0; i < document.querySelectorAll('.Progress-item.rounded-2').length; i++) {
16-
document.querySelectorAll('.Progress-item.rounded-2')[i].style.setProperty('background-color', a1 + "ff", "important");
17-
}
6+
updateAccents(a1);
187
}, 1000);
19-
});
8+
9+
});
10+
11+
function updateAccents(a1) {
12+
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L4-bg', a1 + "ff", "important");
13+
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L3-bg', a1 + "c5", "important");
14+
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L2-bg', a1 + "8a", "important");
15+
document.querySelector(':root').style.setProperty('--color-calendar-graph-day-L1-bg', a1 + "54", "important");
16+
document.querySelector(':root').style.setProperty('--color-accent-emphasis', a1 + "ff", "important");
17+
document.querySelector(':root').style.setProperty('--color-btn-primary-bg', a1 + "ff", "important");
18+
document.querySelector(':root').style.setProperty('--color-btn-primary-hover-bg', a1 + "c5", "important");
19+
document.querySelector(':root').style.setProperty('--color-btn-primary-active-bg', a1 + "8a", "important");
20+
document.querySelector(':root').style.setProperty('--color-btn-primary-focus-bg', a1 + "8a", "important");
21+
document.querySelector(':root').style.setProperty('--color-btn-primary-disabled-bg', a1 + "54", "important");
22+
document.querySelector('.js-highlight-blob').style.setProperty('fill', a1 + "c5", "important");
23+
document.querySelector('.js-highlight-blob').style.setProperty('stroke', a1 + "ff", "important");
24+
for (let i = 0; i < document.querySelectorAll('.Progress-item.rounded-2').length; i++) {
25+
document.querySelectorAll('.Progress-item.rounded-2')[i].style.setProperty('background-color', a1 + "ff", "important");
26+
}
27+
}

0 commit comments

Comments
 (0)