Skip to content

Commit

Permalink
docs: fix demo video modal
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Sep 19, 2024
1 parent 7e1c884 commit 785df95
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/pages/pricing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ defineOgImageComponent('Docs')
const evanTestimonial = computed(() => {
return home.value?.testimonials.items.find(item => item.author.name === 'Evan You')
})
const demoVideoLink = home.value?.deploy?.buttons?.find(link => link.id === 'demo-video') || {}
const videoLink = ref('')
const videoModalOpen = ref(false)
onMounted(() => {
demoVideoLink.click = (e) => {
if (e.ctrlKey || e.metaKey) {
return
}
e?.preventDefault()
videoLink.value = demoVideoLink.to
videoModalOpen.value = true
}
})
</script>

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

0 comments on commit 785df95

Please sign in to comment.