mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 05:57:32 -07:00
Option to hide revealed sensitive media (#6209)
* Option to hide revealed sensitive media This PR commit adds a button on sensitive images and videos to to hide them without refreshing the page. * fix position with multiple images * Fixing some lint problems Not related to this PR, but "Node.js CI / lint" failed on it.
This commit is contained in:
parent
82330cb4fa
commit
86a394dc50
2 changed files with 91 additions and 45 deletions
|
@ -5,7 +5,9 @@
|
|||
<span>{{ $t('clickToShow') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<a class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else
|
||||
<div class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else>
|
||||
<i><fa :icon="faEyeSlash" @click="hide = true"></fa></i>
|
||||
<a
|
||||
:href="image.url"
|
||||
:style="style"
|
||||
:title="image.name"
|
||||
|
@ -13,11 +15,12 @@
|
|||
>
|
||||
<div v-if="image.type === 'image/gif'">GIF</div>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faExclamationTriangle, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
|
||||
import i18n from '../i18n';
|
||||
import { getStaticImageUrl } from '../scripts/get-static-image-url';
|
||||
import ImageViewer from './image-viewer.vue';
|
||||
|
@ -36,7 +39,8 @@ export default Vue.extend({
|
|||
data() {
|
||||
return {
|
||||
hide: true,
|
||||
faExclamationTriangle
|
||||
faExclamationTriangle,
|
||||
faEyeSlash
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -78,6 +82,24 @@ export default Vue.extend({
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.gqnyydlzavusgskkfvwvjiattxdzsqlf {
|
||||
position: relative;
|
||||
|
||||
> i {
|
||||
display: block;
|
||||
position: absolute;
|
||||
border-radius: 6px;
|
||||
background-color: var(--fg);
|
||||
color: var(--accentLighten);
|
||||
font-size: 14px;
|
||||
opacity: .5;
|
||||
padding: 3px 6px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
}
|
||||
|
||||
> a {
|
||||
display: block;
|
||||
cursor: zoom-in;
|
||||
overflow: hidden;
|
||||
|
@ -102,6 +124,7 @@ export default Vue.extend({
|
|||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.qjewsnkgzzxlxtzncydssfbgjibiehcy {
|
||||
display: flex;
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
<span>{{ $t('clickToShow') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<a class="kkjnbbplepmiyuadieoenjgutgcmtsvu" v-else
|
||||
<div class="kkjnbbplepmiyuadieoenjgutgcmtsvu" v-else>
|
||||
<i><fa :icon="faEyeSlash" @click="hide = true"></fa></i>
|
||||
<a
|
||||
:href="video.url"
|
||||
rel="nofollow noopener"
|
||||
target="_blank"
|
||||
|
@ -14,11 +16,12 @@
|
|||
>
|
||||
<fa :icon="faPlayCircle"/>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import { faPlayCircle } from '@fortawesome/free-regular-svg-icons';
|
||||
import { faPlayCircle, faEyeSlash } from '@fortawesome/free-regular-svg-icons';
|
||||
import i18n from '../i18n';
|
||||
|
||||
export default Vue.extend({
|
||||
|
@ -32,7 +35,8 @@ export default Vue.extend({
|
|||
data() {
|
||||
return {
|
||||
hide: true,
|
||||
faPlayCircle
|
||||
faPlayCircle,
|
||||
faEyeSlash
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -47,6 +51,24 @@ export default Vue.extend({
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.kkjnbbplepmiyuadieoenjgutgcmtsvu {
|
||||
position: relative;
|
||||
|
||||
> i {
|
||||
display: block;
|
||||
position: absolute;
|
||||
border-radius: 6px;
|
||||
background-color: var(--fg);
|
||||
color: var(--accentLighten);
|
||||
font-size: 14px;
|
||||
opacity: .5;
|
||||
padding: 3px 6px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
}
|
||||
|
||||
> a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
@ -58,6 +80,7 @@ export default Vue.extend({
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.icozogqfvdetwohsdglrbswgrejoxbdj {
|
||||
display: flex;
|
||||
|
|
Loading…
Reference in a new issue