Skip to content

Commit 0087cee

Browse files
committed
Update video page, add sensitive content warning
1 parent e852919 commit 0087cee

1 file changed

Lines changed: 78 additions & 2 deletions

File tree

resources/js/pages/v/index.vue

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,53 @@
6464
</div>
6565
</div>
6666

67+
<!-- Sensitive Content Warning -->
68+
<div
69+
v-else-if="
70+
currentVideo &&
71+
currentVideo.is_sensitive &&
72+
!showSensitiveContent
73+
"
74+
class="flex items-center justify-center w-full h-full bg-gray-100 dark:bg-gray-900"
75+
>
76+
<div class="text-center max-w-md px-6">
77+
<div class="mx-auto mb-6">
78+
<ExclamationTriangleIcon
79+
class="h-16 w-16 text-orange-500 mx-auto"
80+
/>
81+
</div>
82+
83+
<h2
84+
class="text-2xl font-bold text-gray-900 dark:text-white mb-4"
85+
>
86+
Sensitive Content
87+
</h2>
88+
<p class="text-gray-600 dark:text-gray-400 mb-8">
89+
This video may contain sensitive content that some viewers
90+
may find disturbing or inappropriate. Viewer discretion is
91+
advised.
92+
</p>
93+
94+
<div class="space-y-3">
95+
<button
96+
@click="handleViewSensitiveContent"
97+
class="w-full bg-[#F02C56] hover:bg-red-600 text-white font-semibold py-3 px-6 rounded-lg transition-colors duration-200 flex items-center justify-center cursor-pointer"
98+
>
99+
<EyeIcon class="h-5 w-5 mr-2" />
100+
View Content
101+
</button>
102+
103+
<button
104+
@click="goBack"
105+
class="w-full bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-900 dark:text-white font-semibold py-3 px-6 rounded-lg transition-colors duration-200 flex items-center justify-center cursor-pointer"
106+
>
107+
<ArrowLeftIcon class="h-5 w-5 mr-2" />
108+
Go Back
109+
</button>
110+
</div>
111+
</div>
112+
</div>
113+
67114
<div
68115
v-else-if="currentVideo"
69116
class="lg:w-[calc(100%-540px)] h-full relative"
@@ -114,7 +161,12 @@
114161
</div>
115162

116163
<div
117-
v-if="currentVideo && !isVideoLoading && !error"
164+
v-if="
165+
currentVideo &&
166+
!isVideoLoading &&
167+
!error &&
168+
(!currentVideo.is_sensitive || showSensitiveContent)
169+
"
118170
class="lg:max-w-[550px] relative w-full h-full bg-white dark:bg-slate-950"
119171
>
120172
<div
@@ -208,6 +260,15 @@
208260
</p>
209261
</div>
210262

263+
<!-- Sensitive Content Badge -->
264+
<div
265+
v-if="currentVideo.is_sensitive"
266+
class="mt-3 inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200"
267+
>
268+
<ExclamationTriangleIcon class="h-3 w-3 mr-1" />
269+
Sensitive Content
270+
</div>
271+
211272
<div
212273
class="mt-3 text-xs sm:text-sm font-medium dark:text-slate-500 flex items-center"
213274
>
@@ -360,6 +421,8 @@ import {
360421
BookmarkIcon,
361422
EllipsisVerticalIcon,
362423
FlagIcon,
424+
EyeIcon,
425+
ArrowLeftIcon,
363426
} from "@heroicons/vue/24/outline";
364427
import UrlCopyInput from "@/components/Form/UrlCopyInput.vue";
365428
import Comments from "@/components/Status/Comments.vue";
@@ -382,6 +445,7 @@ const isVideoLoaded = ref(false);
382445
const isVideoLoading = ref(true);
383446
const showEditModal = ref(false);
384447
const showMenu = ref(false);
448+
const showSensitiveContent = ref(false);
385449
const error = ref(null);
386450
387451
const currentVideo = computed(() => videoStore.video);
@@ -404,6 +468,14 @@ const goHome = () => {
404468
router.push("/");
405469
};
406470
471+
const handleViewSensitiveContent = () => {
472+
if (!authStore.isAuthenticated) {
473+
authStore.openAuthModal("login");
474+
return;
475+
}
476+
showSensitiveContent.value = true;
477+
};
478+
407479
const handleGuestFollow = async () => {
408480
const currentDomain = window.location.hostname;
409481
const accountHandle = `@${currentVideo.value.account.username}@${currentDomain}`;
@@ -682,7 +754,11 @@ onBeforeUnmount(() => {
682754
});
683755
684756
watch(isVideoLoaded, (newVal) => {
685-
if (newVal && videoRef.value) {
757+
if (
758+
newVal &&
759+
videoRef.value &&
760+
(!currentVideo.value?.is_sensitive || showSensitiveContent.value)
761+
) {
686762
setTimeout(() => videoRef.value.play(), 500);
687763
}
688764
});

0 commit comments

Comments
 (0)