From 6978d27a8c3ff94a912f53c5cfd98250cfdc2f98 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 4 Feb 2018 15:59:42 -0800 Subject: [PATCH] click on images to show them in a modal --- routes/_components/ModalDialog.html | 12 +- routes/_components/status/ImageDialog.html | 44 +++++++ routes/_components/status/Media.html | 117 +++++++++++------- .../status/StatusMediaAttachments.html | 56 +++++---- routes/_components/status/VideoDialog.html | 9 +- routes/_utils/showImageDialog.js | 17 +++ routes/_utils/showVideoDialog.js | 10 +- 7 files changed, 187 insertions(+), 78 deletions(-) create mode 100644 routes/_components/status/ImageDialog.html create mode 100644 routes/_utils/showImageDialog.js diff --git a/routes/_components/ModalDialog.html b/routes/_components/ModalDialog.html index de22ba7..84b9280 100644 --- a/routes/_components/ModalDialog.html +++ b/routes/_components/ModalDialog.html @@ -11,7 +11,6 @@ position: fixed; top: 50%; transform: translate(0, -50%); - background: #000; padding: 0; border: 3px solid var(--main-border); } @@ -28,8 +27,7 @@ background: var(--nav-bg) } .close-dialog-button { - margin: 0 0 2px; - padding: 0; + padding: 0 0 7px; background: none; border: none; } @@ -41,6 +39,13 @@ :global(dialog::backdrop, .backdrop) { background: rgba(51, 51, 51, 0.9) !important; /* TODO: hack for Safari */ } + + @media (max-width: 767px) { + .close-dialog-button span { + padding: 0 10px 4px; + font-size: 32px; + } + } \ No newline at end of file diff --git a/routes/_components/status/Media.html b/routes/_components/status/Media.html index 2828cf7..3e88eae 100644 --- a/routes/_components/status/Media.html +++ b/routes/_components/status/Media.html @@ -2,53 +2,60 @@ style="grid-template-columns: repeat(auto-fit, minmax({{maxMediaWidth}}px, 1fr));" > {{#each mediaAttachments as media}} {{#if media.type === 'video'}} - - {{elseif media.type === 'gifv' && $autoplayGifs}} -