don't display scores if not hovered
This commit is contained in:
parent
df2ed789f7
commit
0502848861
2 changed files with 14 additions and 0 deletions
|
@ -85,3 +85,11 @@ section#main {
|
||||||
pre {
|
pre {
|
||||||
white-space: pre-wrap;
|
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()))
|
let jason = await (fetch('/leaderboard').then(x => x.text()))
|
||||||
|
|
||||||
document.querySelector('.lb').textContent = jason;
|
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