File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments