diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-08-27 14:45:03 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-08-27 14:45:03 +0000 |
| commit | e768ec1fca2f7580d111b0878a9695b0c8b9dbb1 (patch) | |
| tree | 668ebbcd6818b3c7ad70a372c9f77fa9cffb6a3f /src/components/still-image/still-image.vue | |
| parent | 5d49edc823ba2ea3e34d4fd6c5efcc84ef9712f7 (diff) | |
| parent | d09f43ba7a179cdca9a2d808631f8ba213dd7710 (diff) | |
Merge branch '2.1.0-rc0' into 'master'
2.1.0 into master
See merge request pleroma/pleroma-fe!1217
Diffstat (limited to 'src/components/still-image/still-image.vue')
| -rw-r--r-- | src/components/still-image/still-image.vue | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 4137bd59..ad82210d 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -11,6 +11,8 @@ <img ref="src" :key="src" + :alt="alt" + :title="alt" :src="src" :referrerpolicy="referrerpolicy" @load="onLoad" @@ -23,33 +25,33 @@ <style lang="scss"> @import '../../_variables.scss'; + .still-image { position: relative; line-height: 0; overflow: hidden; - width: 100%; - height: 100%; + display: flex; + align-items: center; - &:hover canvas { - display: none; + canvas { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 100%; + object-fit: contain; + visibility: var(--still-image-canvas, visible); } img { width: 100%; - height: 100%; + min-height: 100%; object-fit: contain; } &.animated { - &:hover::before, - img { - visibility: hidden; - } - - &:hover img { - visibility: visible - } - &::before { content: 'gif'; position: absolute; @@ -57,25 +59,28 @@ font-size: 10px; top: 5px; left: 5px; - background: rgba(127,127,127,.5); - color: #FFF; + background: rgba(127, 127, 127, 0.5); + color: #fff; display: block; padding: 2px 4px; border-radius: $fallback--tooltipRadius; border-radius: var(--tooltipRadius, $fallback--tooltipRadius); z-index: 2; + visibility: var(--still-image-label-visibility, visible); } - } - canvas { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - width: 100%; - height: 100%; - object-fit: contain; + &:hover canvas { + display: none; + } + + &:hover::before, + img { + visibility: var(--still-image-img, hidden); + } + + &:hover img { + visibility: visible; + } } } </style> |
