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

View File

@@ -58,13 +58,15 @@ layout: compress
<script> <script>
window.onload = () => { window.onload = () => {
let commit = document.querySelector("#commit-id > a"); let commit = document.querySelector("#commit-id > a");
let colorCode = commit.innerHTML.trim().substring(1, 7); if (commit != null) {
commit.addEventListener('mouseover', function handler() { let colorCode = commit.innerHTML.trim().substring(1, 7);
commit.style.color = `#${colorCode}`; commit.addEventListener('mouseover', function handler() {
}) commit.style.color = `#${colorCode}`;
commit.addEventListener('mouseout', function handler() { })
commit.style.color = ''; commit.addEventListener('mouseout', function handler() {
}) commit.style.color = '';
})
}
} }
</script> </script>
{% endif %} {% endif %}

View File

@@ -38,7 +38,7 @@ layout: default
<p style="text-align: center;"> <p style="text-align: center;">
<a href="/feed.xml">Atom</a> | <a href="/feed.xml">Atom</a> |
<em class="build-revision"><a href="{{ site.github.repository_url }}/commit/{{ site.github.build_revision }}"> <span id="commit-id" class="build-revision"><a href="{{ site.github.repository_url }}/commit/{{ site.github.build_revision }}">
#{{ site.github.build_revision | truncate: 7, "" }} #{{ site.github.build_revision | truncate: 7, "" }}
</a></em> </a></span>
</p> </p>