summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkDriveFileThumbnail.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/components/MkDriveFileThumbnail.vue')
-rw-r--r--packages/frontend/src/components/MkDriveFileThumbnail.vue21
1 files changed, 20 insertions, 1 deletions
diff --git a/packages/frontend/src/components/MkDriveFileThumbnail.vue b/packages/frontend/src/components/MkDriveFileThumbnail.vue
index 9a6d272113..543cf24022 100644
--- a/packages/frontend/src/components/MkDriveFileThumbnail.vue
+++ b/packages/frontend/src/components/MkDriveFileThumbnail.vue
@@ -4,7 +4,13 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
-<div ref="thumbnail" :class="$style.root">
+<div
+ ref="thumbnail"
+ :class="[
+ $style.root,
+ { [$style.sensitiveHighlight]: highlightWhenSensitive && file.isSensitive },
+ ]"
+>
<ImgWithBlurhash v-if="isThumbnailAvailable" :hash="file.blurhash" :src="file.thumbnailUrl" :alt="file.name" :title="file.name" :cover="fit !== 'contain'"/>
<i v-else-if="is === 'image'" class="ti ti-photo" :class="$style.icon"></i>
<i v-else-if="is === 'video'" class="ti ti-video" :class="$style.icon"></i>
@@ -27,6 +33,7 @@ import ImgWithBlurhash from '@/components/MkImgWithBlurhash.vue';
const props = defineProps<{
file: Misskey.entities.DriveFile;
fit: 'cover' | 'contain';
+ highlightWhenSensitive?: boolean;
}>();
const is = computed(() => {
@@ -67,6 +74,18 @@ const isThumbnailAvailable = computed(() => {
overflow: clip;
}
+.sensitiveHighlight::after {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+ border-radius: inherit;
+ box-shadow: inset 0 0 0 4px var(--warn);
+}
+
.iconSub {
position: absolute;
width: 30%;