Add nsfw mask for status media

This commit is contained in:
r 2019-12-22 04:25:56 +00:00
parent 4a83c22261
commit 2506615f42
2 changed files with 36 additions and 4 deletions

View File

@ -97,6 +97,7 @@
max-height: 180px; max-height: 180px;
max-width: 220px; max-width: 220px;
width: auto; width: auto;
vertical-align: bottom;
} }
.page-title { .page-title {
@ -280,4 +281,27 @@
.img-link { .img-link {
display: inline-block; display: inline-block;
position: relative;
}
.status-nsfw-overlay {
height: 100%;
width: 100%;
background: black;
position: absolute;
top: 0;
left: 0;
}
.img-link:hover .status-nsfw-overlay {
display: none;
}
.status-video-container {
display: inline-block;
position: relative;
}
.status-video-container:hover .status-nsfw-overlay {
display: none;
} }

View File

@ -61,6 +61,9 @@
{{if eq .Type "image"}} {{if eq .Type "image"}}
<a class="img-link" href="{{.URL}}" target="_blank"> <a class="img-link" href="{{.URL}}" target="_blank">
<img class="status-image" src="{{.URL}}" alt="status-image" /> <img class="status-image" src="{{.URL}}" alt="status-image" />
{{if $.Sensitive}}
<div class="status-nsfw-overlay"></div>
{{end}}
</a> </a>
{{else if eq .Type "audio"}} {{else if eq .Type "audio"}}
<audio class="status-audio" controls preload="none"> <audio class="status-audio" controls preload="none">
@ -68,10 +71,15 @@
<p> Your browser doesn't support HTML5 audio </p> <p> Your browser doesn't support HTML5 audio </p>
</audio> </audio>
{{else if eq .Type "video"}} {{else if eq .Type "video"}}
<div class="status-video-container">
<video class="status-video" controls preload="none"> <video class="status-video" controls preload="none">
<source src="{{.URL}}"> <source src="{{.URL}}">
<p> Your browser doesn't support HTML5 video </p> <p> Your browser doesn't support HTML5 video </p>
</video> </video>
{{if $.Sensitive}}
<div class="status-nsfw-overlay"></div>
{{end}}
</div>
{{else}} {{else}}
<a href="{{.URL}}" target="_blank"> attachment </a> <a href="{{.URL}}" target="_blank"> attachment </a>
{{end}} {{end}}