8383 const elementsArray = Array . isArray ( elements ) ? elements : Array . from ( elements ) ;
8484 removeOverlay ( ) ;
8585 const host = document . createElement ( "div" ) ;
86- host . id = OVERLAY_HOST_ID , host . style . cssText = "\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100vw !important;\n height: 100vh !important;\n pointer-events: none !important;\n z-index: 2147483647 !important;\n margin: 0 !important;\n padding: 0 !important;\n " ,
86+ host . id = OVERLAY_HOST_ID , host . style . cssText = "\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100vw !important;\n height: 100vh !important;\n pointer-events: none !important;\n z-index: 2147483647 !important;\n margin: 0 !important;\n padding: 0 !important;\n " ,
8787 document . body . appendChild ( host ) ;
8888 const shadow = host . attachShadow ( {
8989 mode : "closed"
9595 let color ;
9696 color = isTarget ? "#FF0000" : isPrimary ? "#0066FF" : "#00FF00" ;
9797 const importanceRatio = maxImportance > 0 ? importance / maxImportance : .5 , borderOpacity = isTarget ? 1 : isPrimary ? .9 : Math . max ( .4 , .5 + .5 * importanceRatio ) , fillOpacity = .2 * borderOpacity , borderWidth = isTarget ? 2 : isPrimary ? 1.5 : Math . max ( .5 , Math . round ( 2 * importanceRatio ) ) , hexOpacity = Math . round ( 255 * fillOpacity ) . toString ( 16 ) . padStart ( 2 , "0" ) , box = document . createElement ( "div" ) ;
98- if ( box . style . cssText = `\n position: absolute;\n left: ${ bbox . x } px;\n top: ${ bbox . y } px;\n width: ${ bbox . width } px;\n height: ${ bbox . height } px;\n border: ${ borderWidth } px solid ${ color } ;\n background-color: ${ color } ${ hexOpacity } ;\n box-sizing: border-box;\n opacity: ${ borderOpacity } ;\n pointer-events: none;\n ` ,
98+ if ( box . style . cssText = `\n position: absolute;\n left: ${ bbox . x } px;\n top: ${ bbox . y } px;\n width: ${ bbox . width } px;\n height: ${ bbox . height } px;\n border: ${ borderWidth } px solid ${ color } ;\n background-color: ${ color } ${ hexOpacity } ;\n box-sizing: border-box;\n opacity: ${ borderOpacity } ;\n pointer-events: none;\n ` ,
9999 importance > 0 || isPrimary ) {
100100 const badge = document . createElement ( "span" ) ;
101- badge . textContent = isPrimary ? `⭐${ importance } ` : `${ importance } ` , badge . style . cssText = `\n position: absolute;\n top: -18px;\n left: 0;\n background: ${ color } ;\n color: white;\n font-size: 11px;\n font-weight: bold;\n padding: 2px 6px;\n font-family: Arial, sans-serif;\n border-radius: 3px;\n opacity: 0.95;\n white-space: nowrap;\n pointer-events: none;\n ` ,
101+ badge . textContent = isPrimary ? `⭐${ importance } ` : `${ importance } ` , badge . style . cssText = `\n position: absolute;\n top: -18px;\n left: 0;\n background: ${ color } ;\n color: white;\n font-size: 11px;\n font-weight: bold;\n padding: 2px 6px;\n font-family: Arial, sans-serif;\n border-radius: 3px;\n opacity: 0.95;\n white-space: nowrap;\n pointer-events: none;\n ` ,
102102 box . appendChild ( badge ) ;
103103 }
104104 if ( isTarget ) {
105105 const targetIndicator = document . createElement ( "span" ) ;
106- targetIndicator . textContent = "🎯" , targetIndicator . style . cssText = "\n position: absolute;\n top: -18px;\n right: 0;\n font-size: 16px;\n pointer-events: none;\n " ,
106+ targetIndicator . textContent = "🎯" , targetIndicator . style . cssText = "\n position: absolute;\n top: -18px;\n right: 0;\n font-size: 16px;\n pointer-events: none;\n " ,
107107 box . appendChild ( targetIndicator ) ;
108108 }
109109 shadow . appendChild ( box ) ;
123123 if ( ! grids || ! Array . isArray ( grids ) ) return ;
124124 removeOverlay ( ) ;
125125 const host = document . createElement ( "div" ) ;
126- host . id = OVERLAY_HOST_ID , host . style . cssText = "\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100vw !important;\n height: 100vh !important;\n pointer-events: none !important;\n z-index: 2147483647 !important;\n margin: 0 !important;\n padding: 0 !important;\n " ,
126+ host . id = OVERLAY_HOST_ID , host . style . cssText = "\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100vw !important;\n height: 100vh !important;\n pointer-events: none !important;\n z-index: 2147483647 !important;\n margin: 0 !important;\n padding: 0 !important;\n " ,
127127 document . body . appendChild ( host ) ;
128128 const shadow = host . attachShadow ( {
129129 mode : "closed"
139139 let labelText = grid . label ? `Grid ${ grid . grid_id } : ${ grid . label } ` : `Grid ${ grid . grid_id } ` ;
140140 grid . is_dominant && ( labelText = `⭐ ${ labelText } (dominant)` ) ;
141141 const badge = document . createElement ( "span" ) ;
142- if ( badge . textContent = labelText , badge . style . cssText = `\n position: absolute;\n top: -18px;\n left: 0;\n background: ${ color } ;\n color: white;\n font-size: 11px;\n font-weight: bold;\n padding: 2px 6px;\n font-family: Arial, sans-serif;\n border-radius: 3px;\n opacity: 0.95;\n white-space: nowrap;\n pointer-events: none;\n ` ,
142+ if ( badge . textContent = labelText , badge . style . cssText = `\n position: absolute;\n top: -18px;\n left: 0;\n background: ${ color } ;\n color: white;\n font-size: 11px;\n font-weight: bold;\n padding: 2px 6px;\n font-family: Arial, sans-serif;\n border-radius: 3px;\n opacity: 0.95;\n white-space: nowrap;\n pointer-events: none;\n ` ,
143143 box . appendChild ( badge ) , isTarget ) {
144144 const targetIndicator = document . createElement ( "span" ) ;
145- targetIndicator . textContent = "🎯" , targetIndicator . style . cssText = "\n position: absolute;\n top: -18px;\n right: 0;\n font-size: 16px;\n pointer-events: none;\n " ,
145+ targetIndicator . textContent = "🎯" , targetIndicator . style . cssText = "\n position: absolute;\n top: -18px;\n right: 0;\n font-size: 16px;\n pointer-events: none;\n " ,
146146 box . appendChild ( targetIndicator ) ;
147147 }
148148 shadow . appendChild ( box ) ;
156156 let overlayTimeout = null ;
157157 function removeOverlay ( ) {
158158 const existing = document . getElementById ( OVERLAY_HOST_ID ) ;
159- existing && existing . remove ( ) , overlayTimeout && ( clearTimeout ( overlayTimeout ) ,
159+ existing && existing . remove ( ) , overlayTimeout && ( clearTimeout ( overlayTimeout ) ,
160160 overlayTimeout = null ) ;
161161 }
162- } ( ) ;
162+ } ( ) ;
0 commit comments