don't display scores if not hovered
This commit is contained in:
parent
e795165cc4
commit
4cb8bd5b8a
2 changed files with 14 additions and 0 deletions
|
@ -84,4 +84,12 @@ section#main {
|
|||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.score-content {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.score:hover .score-content {
|
||||
display: inline;
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue