From 99e7a11c25e704851cfbbaed64594acbbd752038 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 10 May 2022 12:28:58 -0700 Subject: web: ui improvements, mainly for mobile Using a `100vh' height results in the bottom bit of the UI being cropped until scrolling down, while using `100%' results in the address bar always wasting space. By combining these with a fixed-position element, we're able to have the UI grow and shrink as the address bar visibility changes. --- web/static/dartboat.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/static/dartboat.js') diff --git a/web/static/dartboat.js b/web/static/dartboat.js index e664a8d..aacb1bc 100644 --- a/web/static/dartboat.js +++ b/web/static/dartboat.js @@ -158,8 +158,9 @@ document.addEventListener('DOMContentLoaded', () => { f = e => $(`#${e.target.dataset.modal}`).style.display = 'block'; $$('[data-modal]').forEach(x => x.addEventListener('click', f)); f = e => { - if (e.target === e.currentTarget) - e.target.style.display = 'none'; + if (e.target === e.currentTarget || + e.target.classList.contains("modal-close")) + e.currentTarget.style.display = 'none'; }; $$('.modal').forEach(x => x.addEventListener('click', f)); }); -- cgit v1.2.3-70-g09d2