From 085b3151b00253cd3ac03974938a5adc8c079ce0 Mon Sep 17 00:00:00 2001 From: Rich Boakes Date: Wed, 27 Sep 2023 10:19:27 +0100 Subject: [PATCH] tweak 1) dialog was visible before first opening on scroll. tweak 2) dialog was removed, not just closed. --- script.js | 2 +- styles.css | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script.js b/script.js index b3ec521..82e6f50 100644 --- a/script.js +++ b/script.js @@ -134,7 +134,7 @@ function openUsageDialog() { const dialog = document.querySelector('#usage'); dialog.showModal(); dialog.addEventListener('click', () => { - dialog.remove(); + dialog.close(); }); } diff --git a/styles.css b/styles.css index 7ae2486..e93c1e7 100644 --- a/styles.css +++ b/styles.css @@ -157,7 +157,7 @@ h2 img { box-shadow: inset 0 0 1em #F0F7; } -dialog { +dialog:modal { margin: auto; padding: 2em; display: flex; @@ -203,4 +203,4 @@ dialog button { border: thin dashed #000; border-radius: 0.2em; font-weight: bold; -} \ No newline at end of file +}