-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffedb83
commit cd4e989
Showing
4 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<template v-if="phid && phsid"> | ||
<iframe | ||
:src="`https://formless.ai/c/PMr93Z8ztjUe?phid=${phid}&phsid=${phsid}`" | ||
class="formless-embed" | ||
width="100%" | ||
height="100%" | ||
loading="lazy" | ||
allow="microphone" | ||
style="border: 0; display: block; height: 100vh" | ||
></iframe> | ||
</template> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, onMounted } from 'vue'; | ||
const phid = ref(''); | ||
const phsid = ref(''); | ||
onMounted(() => { | ||
// Wait for PostHog to be available | ||
const getPostHogIds = () => { | ||
if ( | ||
window.posthog && | ||
typeof window.posthog.get_distinct_id === 'function' && | ||
typeof window.posthog.get_session_id === 'function' | ||
) { | ||
phid.value = window.posthog.get_distinct_id(); | ||
phsid.value = window.posthog.get_session_id(); | ||
} else { | ||
// Retry after a short delay if PostHog isn't loaded yet | ||
setTimeout(getPostHogIds, 10); | ||
} | ||
}; | ||
getPostHogIds(); | ||
}); | ||
// Load the Formless AI script dynamically | ||
const loadFormlessScript = () => { | ||
const script = document.createElement('script'); | ||
script.src = 'https://embed.formless.ai/embed.js'; | ||
script.async = true; | ||
document.body.appendChild(script); | ||
}; | ||
loadFormlessScript(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script setup> | ||
import Survey from '../.vitepress/theme/components/Survey.vue'; | ||
</script> | ||
|
||
<Survey /> |