mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Adding nsfw image blur. Fixes #438
This commit is contained in:
parent
7aa801b111
commit
21ebc8a574
7
ui/assets/css/main.css
vendored
7
ui/assets/css/main.css
vendored
@ -163,3 +163,10 @@ hr {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.img-blur {
|
||||||
|
filter: blur(10px);
|
||||||
|
-webkit-filter: blur(10px);
|
||||||
|
-moz-filter: blur(10px);
|
||||||
|
-o-filter: blur(10px);
|
||||||
|
-ms-filter: blur(10px);
|
||||||
|
}
|
||||||
|
30
ui/src/components/post-listing.tsx
vendored
30
ui/src/components/post-listing.tsx
vendored
@ -160,22 +160,20 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{post.url &&
|
{post.url && isImage(post.url) && !this.state.imageExpanded && (
|
||||||
isImage(post.url) &&
|
<span
|
||||||
!post.nsfw &&
|
title={i18n.t('expand_here')}
|
||||||
!post.community_nsfw &&
|
class="pointer"
|
||||||
!this.state.imageExpanded && (
|
onClick={linkEvent(this, this.handleImageExpandClick)}
|
||||||
<span
|
>
|
||||||
title={i18n.t('expand_here')}
|
<img
|
||||||
class="pointer"
|
className={`mx-2 mt-1 float-left img-fluid thumbnail rounded ${(post.nsfw ||
|
||||||
onClick={linkEvent(this, this.handleImageExpandClick)}
|
post.community_nsfw) &&
|
||||||
>
|
'img-blur'}`}
|
||||||
<img
|
src={imageThumbnailer(post.url)}
|
||||||
class="mx-2 mt-1 float-left img-fluid thumbnail rounded"
|
/>
|
||||||
src={imageThumbnailer(post.url)}
|
</span>
|
||||||
/>
|
)}
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{post.url && isVideo(post.url) && (
|
{post.url && isVideo(post.url) && (
|
||||||
<video
|
<video
|
||||||
playsinline
|
playsinline
|
||||||
|
Loading…
Reference in New Issue
Block a user