From bfe31e20eaddaa9435c98962c53c35f4184ed5fe Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 18 Jun 2021 14:12:50 +0300 Subject: [PATCH] better compact attachments --- src/components/attachment/attachment.js | 17 +++++++++++++---- src/components/gallery/gallery.vue | 5 ++++- src/components/status_body/status_body.scss | 6 +++--- .../status_content/status_content.vue | 5 ----- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index a80c5c2e..84656ffa 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -68,6 +68,7 @@ const Attachment = { '-nsfw-placeholder': this.hidden }, '-' + this.type, + '-' + this.size, `-${this.useContainFit ? 'contain' : 'cover'}-fit` ] }, @@ -102,10 +103,18 @@ const Attachment = { return (this.type === 'html' && !this.attachment.oembed) || this.type === 'unknown' }, useModal () { - const modalTypes = this.size === 'hide' ? ['image', 'video', 'audio'] - : this.mergedConfig.playVideosInModal - ? ['image', 'video'] - : ['image'] + let modalTypes = [] + switch (this.size) { + case 'hide': + case 'small': + modalTypes = ['image', 'video', 'audio', 'flash'] + break + default: + modalTypes = this.mergedConfig.playVideosInModal + ? ['image', 'video', 'flash'] + : ['image'] + break + } return modalTypes.includes(this.type) }, ...mapGetters(['mergedConfig']) diff --git a/src/components/gallery/gallery.vue b/src/components/gallery/gallery.vue index a1f1c26c..65175366 100644 --- a/src/components/gallery/gallery.vue +++ b/src/components/gallery/gallery.vue @@ -95,7 +95,10 @@ height: 0; width: 100%; flex-grow: 1; - margin-top: 0.5em; + + &:not(:first-child) { + margin-top: 0.5em; + } } &.-long { diff --git a/src/components/status_body/status_body.scss b/src/components/status_body/status_body.scss index 5be21171..f261108e 100644 --- a/src/components/status_body/status_body.scss +++ b/src/components/status_body/status_body.scss @@ -123,6 +123,7 @@ } &.-compact { + align-items: top; flex-direction: row; --emoji-size: 16px; @@ -140,9 +141,7 @@ mask-size: auto 3.5em, auto auto; mask-position: 0 0, 0 0; mask-repeat: repeat-x, repeat; - mask-image: - linear-gradient(to top, white 0.5em, transparent 2.5em), - linear-gradient(to top, white, white); + mask-image: linear-gradient(to bottom, white 2em, transparent 3em); /* Autoprefixed seem to ignore this one, and also syntax is different */ -webkit-mask-composite: xor; @@ -154,6 +153,7 @@ flex: 1 1 0; min-width: 5em; height: 100%; + margin-left: 0.5em; } .summary-wrapper { diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue index 90ce130d..573eadf5 100644 --- a/src/components/status_content/status_content.vue +++ b/src/components/status_content/status_content.vue @@ -51,10 +51,5 @@ $status-margin: 0.75em; .StatusContent { flex: 1; min-width: 0; - &.-compact { - flex { - display: flex; - } - } }