From 28b2062bfc9c55aab4e4555407f03f6e8f28aaaf Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 14 Nov 2022 01:52:50 -0600 Subject: [PATCH] Fix commit hex color hover breaking with glitch effect onLoad override 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. --- assets/js/custom.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/custom.js b/assets/js/custom.js index 3796740..1a3e186 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -1,5 +1,5 @@ // Easter egg feature! 🐣️ -window.onload = () => { +setupCommitHover = () => { let commit = document.querySelector("#commit-id > a"); if (commit != null) { let colorCode = commit.innerHTML.trim().substring(1, 7); @@ -10,4 +10,5 @@ window.onload = () => { commit.style.color = ''; }) } -} \ No newline at end of file +}; +window.addEventListener("load", setupCommitHover, true); \ No newline at end of file