opnform-host-nginx/client/components/pages/welcome/Testimonials.vue

64 lines
1.2 KiB
Vue
Raw Normal View History

2023-12-09 15:47:03 +01:00
<template>
<iframe
:id="iframeId"
title="NoteForms testimonial"
loading="lazy"
height="500px"
:src="'https://embed-v2.testimonial.to/w/notionforms?theme=light&card=base&loadMore=on&initialCount=8&tag=all'"
frameBorder="0"
scrolling="no"
width="100%"
2023-12-09 15:47:03 +01:00
/>
</template>
<script>
import { useDarkMode } from '~/lib/forms/public-page.js'
2023-12-09 17:02:23 +01:00
2023-12-09 15:47:03 +01:00
export default {
props: {
featuresOnly: {
type: Boolean,
default: false
}
},
data: () => ({
iframeId: 'testimonialto-carousel-all-notionforms'
}),
computed: {},
2023-12-09 15:47:03 +01:00
mounted () {
window.addEventListener('load', () => {
this.loadScript()
})
2023-12-09 15:47:03 +01:00
},
methods: {
loadScript () {
if (import.meta.server)
return
2023-12-09 15:47:03 +01:00
const script = document.createElement('script')
script.setAttribute(
'src',
'https://testimonial.to/js/iframeResizer.min.js'
)
script.setAttribute('defer', 'defer')
2023-12-09 15:47:03 +01:00
document.head.appendChild(script)
script.addEventListener('load', () => {
console.log('resizeing')
window.iFrameResize(
{
log: false,
checkOrigin: false
},
'#' + this.iframeId
)
2023-12-09 15:47:03 +01:00
})
}
}
}
</script>