mirror of
https://github.com/Xevion/v2.xevion.dev.git
synced 2025-12-05 23:16:47 -06:00
The new glitch effect session storage management was overriding window.onload, breaking the commit color hover's onload override. I should probably use addEventListener for both of them, but I'm busy, I just want it fixed now so I can sleep.
14 lines
513 B
JavaScript
14 lines
513 B
JavaScript
// Easter egg feature! 🐣️
|
|
setupCommitHover = () => {
|
|
let commit = document.querySelector("#commit-id > a");
|
|
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 = '';
|
|
})
|
|
}
|
|
};
|
|
window.addEventListener("load", setupCommitHover, true); |