Un-rollback commit coloring code

This commit is contained in:
Xevion
2022-04-10 22:16:57 -05:00
parent d47d72ebcd
commit df7cf3cf8a
2 changed files with 11 additions and 9 deletions
+9 -7
View File
@@ -58,13 +58,15 @@ layout: compress
<script>
window.onload = () => {
let commit = document.querySelector("#commit-id > a");
let colorCode = commit.innerHTML.trim().substring(1, 7);
commit.addEventListener('mouseover', function handler() {
commit.style.color = `#${colorCode}`;
})
commit.addEventListener('mouseout', function handler() {
commit.style.color = '';
})
if (commit != null) {
let colorCode = commit.innerHTML.trim().substring(1, 7);
commit.addEventListener('mouseover', function handler() {
commit.style.color = `#${colorCode}`;
})
commit.addEventListener('mouseout', function handler() {
commit.style.color = '';
})
}
}
</script>
{% endif %}