Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fern/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ function injectVapiWidget() {
return;
}

// Add --ask-ai-panel-width CSS variable for widget positioning if it doesn't exist already
if (!getComputedStyle(document.documentElement).getPropertyValue('--ask-ai-panel-width').trim()) {
document.documentElement.style.setProperty('--ask-ai-panel-width', '0px');
}

const script = document.createElement('script');
script.src = WIDGET_SCRIPT_URL;
script.async = true;
Expand All @@ -28,6 +33,13 @@ function injectVapiWidget() {
widget.style.zIndex = '9999';
document.body.appendChild(widget);
console.log('[custom.js] Widget element appended to DOM');

const internalDiv = widget.querySelector('div');
if (internalDiv) {
internalDiv.style.position = 'fixed !important';
internalDiv.style.right = 'var(--ask-ai-panel-width) !important';
internalDiv.style.transition = 'right 0.5s ease-out !important';
}
};
document.body.appendChild(script);
console.log('[custom.js] Widget script appended to DOM');
Expand Down
Loading