From 8ddeca22277574b0de9c1d0ba838cd89b56a8d02 Mon Sep 17 00:00:00 2001 From: Thomas Mathews Date: Fri, 20 Jan 2023 13:42:58 -0800 Subject: [PATCH] Updated modals to be better for everyone. --- css/responsive.css | 11 ++++ css/styles.css | 86 +++++++++++++---------------- index.html | 134 +++++---------------------------------------- js/ui/render.js | 5 +- js/ui/settings.js | 1 - js/ui/state.js | 18 +++--- js/ui/util.js | 34 +++--------- 7 files changed, 78 insertions(+), 211 deletions(-) diff --git a/css/responsive.css b/css/responsive.css index c0c91e4..9064b38 100644 --- a/css/responsive.css +++ b/css/responsive.css @@ -33,4 +33,15 @@ width: 44px; height: 44px; } + + dialog:modal { + width: initial; + padding: 10px; + } + + .modal-content { + margin-top: 0; + border-radius: 0; + height: 100%; + } } diff --git a/css/styles.css b/css/styles.css index bd3797e..45833c2 100644 --- a/css/styles.css +++ b/css/styles.css @@ -370,6 +370,11 @@ button.nav > img.icon { .action-bar button.icon { transition: opacity 0.3s linear; + padding: 5px; +} +.action-bar button.icon img.icon { + width: 16px; + height: 16px; } .action-bar button.icon:hover { opacity: 1; @@ -385,51 +390,45 @@ details.cw summary { } /* Modal */ -.modal { - position: fixed; - z-index: var(--zModal); - left: 0; - top: 0; - width: 100%; - height: 100%; - background: rgba(255,255,255,0.4); - opacity: 1; - transition: opacity 0.2s linear; +dialog:modal { + width: 80%; + max-width: 700px; + padding: 20px; + border: none; + background: transparent; + color: var(--clrText); +} +dialog::backdrop { backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); } -.modal.scrollable { - overflow-y: auto; -} -.modal.closed { - opacity: 0; - pointer-events: none; -} -.modal-content { - padding: 20px; - overflow: auto; - border-radius: 15px; - background: var(--clrPanel); - max-width: 700px; - margin: 0 auto; - margin-top: 35px; -} -.modal header { +dialog header { display: flex; } -.modal header label { +dialog header label { + flex: 1; font-weight: 800; font-size: var(--fsEnlarged); - flex: 1; word-break: break-word; } -.modal header button { +dialog header button { font-size: 24px; } -.modal .modal-floating-close-btn { - position: sticky; - top: 20px; - left: 20px; +dialog > img { + /* fix for media preview */ + max-width: 100%; + max-height: 100%; +} +dialog > .container { + display: flex; + flex-direction: column; + background: var(--clrPanel); + border-radius: 15px; + padding: 20px; +} +dialog > .container .max-content { + max-height: min(100vh/2, 500px); + overflow: auto; } /* Post & Reply */ @@ -440,6 +439,7 @@ details.cw summary { textarea.post-input { display: block; width: 100%; + min-height: 25px; } .post-tools { @@ -452,6 +452,9 @@ textarea.post-input { .post-tools > button.icon.cw.active { opacity: 1.0; } +.post-tools > button[name='reply-all'] { + margin-right: 5px; +} input[type="text"].cw { border: none; border-bottom: solid 2px var(--clrWarn); @@ -490,21 +493,6 @@ label[role="profile-nip5"] { display: block; } -/* Media Preview */ - -.modal .media-container { - text-align: center; - position: absolute; - width: 100%; - height: 100%; -} -.modal .media-container > img { - object-fit: scale-down; - object-position: center; - width: 100%; - height: 100%; -} - /* Profile Editor */ #profile-editor header { diff --git a/index.html b/index.html index 7c8caa5..b8ced9a 100644 --- a/index.html +++ b/index.html @@ -51,11 +51,6 @@ Sign In with Key -
-
- @@ -211,7 +206,6 @@