forked from nutomic/lemmy
Adding nsfw image blur. Fixes #438
This commit is contained in:
parent
7145dde79f
commit
572b3b876f
2 changed files with 21 additions and 16 deletions
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);
|
||||||
|
}
|
||||||
|
|
10
ui/src/components/post-listing.tsx
vendored
10
ui/src/components/post-listing.tsx
vendored
|
@ -160,18 +160,16 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{post.url &&
|
{post.url && isImage(post.url) && !this.state.imageExpanded && (
|
||||||
isImage(post.url) &&
|
|
||||||
!post.nsfw &&
|
|
||||||
!post.community_nsfw &&
|
|
||||||
!this.state.imageExpanded && (
|
|
||||||
<span
|
<span
|
||||||
title={i18n.t('expand_here')}
|
title={i18n.t('expand_here')}
|
||||||
class="pointer"
|
class="pointer"
|
||||||
onClick={linkEvent(this, this.handleImageExpandClick)}
|
onClick={linkEvent(this, this.handleImageExpandClick)}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
class="mx-2 mt-1 float-left img-fluid thumbnail rounded"
|
className={`mx-2 mt-1 float-left img-fluid thumbnail rounded ${(post.nsfw ||
|
||||||
|
post.community_nsfw) &&
|
||||||
|
'img-blur'}`}
|
||||||
src={imageThumbnailer(post.url)}
|
src={imageThumbnailer(post.url)}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue