Skip to content

Commit 8b38240

Browse files
committed
style widget internal div
1 parent f36d019 commit 8b38240

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

fern/custom.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ function injectVapiWidget() {
1313
return;
1414
}
1515

16+
// Add --ask-ai-panel-width CSS variable for widget positioning if it doesn't exist already
17+
if (!getComputedStyle(document.documentElement).getPropertyValue('--ask-ai-panel-width').trim()) {
18+
document.documentElement.style.setProperty('--ask-ai-panel-width', '0px');
19+
}
20+
1621
const script = document.createElement('script');
1722
script.src = WIDGET_SCRIPT_URL;
1823
script.async = true;
@@ -28,6 +33,13 @@ function injectVapiWidget() {
2833
widget.style.zIndex = '9999';
2934
document.body.appendChild(widget);
3035
console.log('[custom.js] Widget element appended to DOM');
36+
37+
const internalDiv = widget.querySelector('div');
38+
if (internalDiv) {
39+
internalDiv.style.position = 'fixed';
40+
internalDiv.style.right = 'var(--ask-ai-panel-width)';
41+
internalDiv.style.transition = 'right 0.5s ease-out';
42+
}
3143
};
3244
document.body.appendChild(script);
3345
console.log('[custom.js] Widget script appended to DOM');

0 commit comments

Comments
 (0)