From 4cb8bd5b8ae9bfd66c26c11bb438230b313ae0f4 Mon Sep 17 00:00:00 2001 From: 08draven Date: Mon, 4 Nov 2024 20:41:35 -0500 Subject: [PATCH] don't display scores if not hovered --- static/index.css | 8 ++++++++ static/js/index.js | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/static/index.css b/static/index.css index e8cb3c1..2609711 100644 --- a/static/index.css +++ b/static/index.css @@ -84,4 +84,12 @@ section#main { pre { white-space: pre-wrap; +} + +.score-content { + display:none; +} + +.score:hover .score-content { + display: inline; } \ No newline at end of file diff --git a/static/js/index.js b/static/js/index.js index 71e72a8..bff97e5 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -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,'[$1]'); + + document.querySelector('.lb').innerHTML = sant; } }