diff options
| author | Henry Jameson <me@hjkos.com> | 2021-06-18 02:09:50 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-06-18 02:09:50 +0300 |
| commit | c1293c3afa9b9a057008026a9d988c6a5b9f516c (patch) | |
| tree | 9b75f29db56579f5160590a8a34a4b0789dab04e /src | |
| parent | f15599e6e57477131ba5592e2874916ed1da06e2 (diff) | |
| parent | a3c703bd37fc55c2377cb0bf099af6a21ea07e8e (diff) | |
Merge branch 'compact-notifs' into proper-attachments
* compact-notifs:
compact notifs
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/notification/notification.vue | 3 | ||||
| -rw-r--r-- | src/components/status_body/status_body.js | 1 | ||||
| -rw-r--r-- | src/components/status_body/status_body.scss | 56 | ||||
| -rw-r--r-- | src/components/status_content/status_content.js | 1 | ||||
| -rw-r--r-- | src/components/status_content/status_content.vue | 13 |
5 files changed, 71 insertions, 3 deletions
diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 0081dee4..396ae0e1 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -181,8 +181,9 @@ </router-link> </div> <template v-else> - <status-content + <StatusContent class="faint" + :compact="true" :status="notification.action" /> </template> diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 601c963b..94366c6c 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -21,6 +21,7 @@ library.add( const StatusContent = { name: 'StatusContent', props: [ + 'compact', 'status', 'focused', 'noHeading', diff --git a/src/components/status_body/status_body.scss b/src/components/status_body/status_body.scss index c7732bfe..516ced9d 100644 --- a/src/components/status_body/status_body.scss +++ b/src/components/status_body/status_body.scss @@ -1,11 +1,17 @@ @import '../../_variables.scss'; .StatusBody { + display: flex; + flex-direction: column; .emoji { --_still_image-label-scale: 0.5; } + .attachments { + margin-top: 0.5em; + } + & .text, & .summary { font-family: var(--postFont, sans-serif); @@ -115,4 +121,54 @@ .cyantext { color: var(--postCyantext, $fallback--cBlue); } + + &.-compact { + flex-direction: row; + + --emoji-size: 16px; + + & .body, + & .attachments { + max-height: 3.25em; + } + + .body { + overflow: hidden; + white-space: normal; + min-width: 5em; + flex: 5 1 auto; + 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); + + /* Autoprefixed seem to ignore this one, and also syntax is different */ + -webkit-mask-composite: xor; + mask-composite: exclude; + } + + .attachments { + margin-top: 0; + flex: 1 1 auto; + min-width: 5em; + height: 100%; + } + + .summary-wrapper { + .summary::after { + content: ': '; + } + + line-height: inherit; + margin: 0; + border: none; + display: inline-block; + } + + .text-wrapper { + display: inline-block; + } + } } diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js index c085c992..55f701d0 100644 --- a/src/components/status_content/status_content.js +++ b/src/components/status_content/status_content.js @@ -28,6 +28,7 @@ const StatusContent = { name: 'StatusContent', props: [ 'status', + 'compact', 'focused', 'noHeading', 'fullContent', diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue index a9511fbe..c1533b19 100644 --- a/src/components/status_content/status_content.vue +++ b/src/components/status_content/status_content.vue @@ -1,8 +1,12 @@ <template> - <div class="StatusContent"> +<div + class="StatusContent" + :class="{ '-compact': compact }" +> <slot name="header" /> <StatusBody :status="status" + :compact="compact" :single-line="singleLine" :hide-mentions="hideMentions" @parseReady="$emit('parseReady', $event)" @@ -23,7 +27,7 @@ /> <div - v-if="status.card && !noHeading" + v-if="status.card && !noHeading && !compact" class="link-preview media-body" > <link-preview @@ -46,5 +50,10 @@ $status-margin: 0.75em; .StatusContent { flex: 1; min-width: 0; + &.-compact { + flex { + display: flex; + } + } } </style> |
