Skip to content

Commit 785df95

Browse files
committed
docs: fix demo video modal
1 parent 7e1c884 commit 785df95

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/pages/pricing.vue

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ defineOgImageComponent('Docs')
1919
const evanTestimonial = computed(() => {
2020
return home.value?.testimonials.items.find(item => item.author.name === 'Evan You')
2121
})
22+
23+
const demoVideoLink = home.value?.deploy?.buttons?.find(link => link.id === 'demo-video') || {}
24+
const videoLink = ref('')
25+
const videoModalOpen = ref(false)
26+
27+
onMounted(() => {
28+
demoVideoLink.click = (e) => {
29+
if (e.ctrlKey || e.metaKey) {
30+
return
31+
}
32+
e?.preventDefault()
33+
videoLink.value = demoVideoLink.to
34+
videoModalOpen.value = true
35+
}
36+
})
2237
</script>
2338

2439
<template>
@@ -169,6 +184,18 @@ const evanTestimonial = computed(() => {
169184
</div>
170185
</li>
171186
</ul>
187+
<UModal v-model="videoModalOpen" :ui="{ width: 'sm:max-w-4xl lg:max-w-5xl aspect-[16/9]' }">
188+
<div class="p-3 h-full">
189+
<iframe
190+
width="100%"
191+
height="100%"
192+
:src="`https://www.youtube-nocookie.com/embed/${videoLink.split('=')[1]}`"
193+
frameborder="0"
194+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
195+
allowfullscreen
196+
/>
197+
</div>
198+
</UModal>
172199
</ULandingSection>
173200
<ULandingSection :title="page.faq.title" :description="page.faq.description" :ui="{ container: 'max-w-5xl' }">
174201
<ULandingFAQ :items="page?.faq.items" multiple>

0 commit comments

Comments
 (0)