Skip to content

Commit

Permalink
docs: add feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbraemer committed Nov 22, 2024
1 parent ffedb83 commit cd4e989
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions .web/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default defineConfig({
{ text: 'Introduction', link: '/guide/' },
{ text: 'Quick Start', link: '/guide/quick-start' },
{ text: 'Why', link: '/guide/why' },
{ text: 'Feedback', link: '/guide/feedback' },
],
},
{
Expand Down
9 changes: 8 additions & 1 deletion .web/docs/.vitepress/theme/components/LandingAfter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,18 @@ try:
</div>
</div>
</div>

<!-- Survey Section -->
<div class="py-24 sm:py-32">
<div class="mx-auto max-w-7xl px-6 lg:px-8">
<Survey />
</div>
</div>
</template>

<script setup>
// OS detection with reactive state for manual toggle
import { ref } from 'vue';
import Survey from './Survey.vue';
const isWindows =
typeof navigator !== 'undefined' && /Win/.test(navigator.platform);
Expand Down
49 changes: 49 additions & 0 deletions .web/docs/.vitepress/theme/components/Survey.vue
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>
5 changes: 5 additions & 0 deletions .web/docs/guide/feedback.md
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 />

0 comments on commit cd4e989

Please sign in to comment.