don't display scores if not hovered

This commit is contained in:
biglyderv 2024-11-04 20:41:35 -05:00
parent e795165cc4
commit 4cb8bd5b8a
2 changed files with 14 additions and 0 deletions

View file

@ -84,4 +84,12 @@ section#main {
pre {
white-space: pre-wrap;
}
.score-content {
display:none;
}
.score:hover .score-content {
display: inline;
}

View file

@ -295,6 +295,12 @@ class Game extends GameBasic {
let jason = await (fetch('/leaderboard').then(x => x.text()))
document.querySelector('.lb').textContent = jason;
let sant = document.querySelector('.lb').innerHTML;
sant = sant.replaceAll(/\[([^\[]+)\]/g,'<span class="score">[<span class="score-content">$1</span>]</span>');
document.querySelector('.lb').innerHTML = sant;
}
}