From 17f84bdeafa984bb63b393b4ff9b89e5edab8add Mon Sep 17 00:00:00 2001 From: Geoffrey Wu Date: Wed, 14 Sep 2022 14:21:08 -0400 Subject: [PATCH] close #68 --- client/multiplayer/room.html | 2 ++ client/quizbowl.js | 12 ++++++++++++ client/singleplayer/bonuses.html | 5 ++++- client/singleplayer/tossups.html | 2 ++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/client/multiplayer/room.html b/client/multiplayer/room.html index 25cd6fc60..921193147 100644 --- a/client/multiplayer/room.html +++ b/client/multiplayer/room.html @@ -99,6 +99,8 @@ + +
diff --git a/client/quizbowl.js b/client/quizbowl.js index 607052a74..7dec0f551 100644 --- a/client/quizbowl.js +++ b/client/quizbowl.js @@ -261,6 +261,12 @@ document.getElementById('set-name').addEventListener('change', async function (e } }); +document.getElementById('font-size').addEventListener('input', function () { + localStorage.setItem('font-size', this.value); + document.getElementById('font-size-display').innerHTML = this.value; + document.getElementById('question').style.setProperty('font-size', `${this.value}px`); +}); + document.getElementById('toggle-high-contrast-question-text').addEventListener('click', function () { this.blur(); if (this.checked) { @@ -277,6 +283,12 @@ document.getElementById('toggle-options').addEventListener('click', function () document.getElementById('options').classList.toggle('d-none'); }); +if (localStorage.getItem('font-size')) { + document.getElementById('font-size').value = localStorage.getItem('font-size'); + document.getElementById('font-size-display').innerHTML = localStorage.getItem('font-size'); + document.getElementById('question').style.setProperty('font-size', `${localStorage.getItem('font-size')}px`); +} + if (localStorage.getItem('high-contrast-question-text') === 'true') { document.getElementById('toggle-high-contrast-question-text').checked = true; document.getElementById('question').classList.add('high-contrast-question-text'); diff --git a/client/singleplayer/bonuses.html b/client/singleplayer/bonuses.html index ce46bbbe7..1f3f2f69f 100644 --- a/client/singleplayer/bonuses.html +++ b/client/singleplayer/bonuses.html @@ -74,7 +74,10 @@ -
+
+ + +
diff --git a/client/singleplayer/tossups.html b/client/singleplayer/tossups.html index 9bfb2bc41..077b727b8 100644 --- a/client/singleplayer/tossups.html +++ b/client/singleplayer/tossups.html @@ -77,6 +77,8 @@
+ +