( x, y, size = 40, containerStyle = "", loadingStyle = "" )
| 1186 | // #region utils |
| 1187 | |
| 1188 | function addLoadingAnimationAtPos( |
| 1189 | x, |
| 1190 | y, |
| 1191 | size = 40, |
| 1192 | containerStyle = "", |
| 1193 | loadingStyle = "" |
| 1194 | ) { |
| 1195 | let ele = document.createElement("div"); |
| 1196 | ele.style.cssText = ` |
| 1197 | position: fixed; |
| 1198 | left: ${x - size / 2}px; |
| 1199 | top: ${y - size / 2}px; |
| 1200 | width: ${size}px; |
| 1201 | height: ${size}px; |
| 1202 | z-index: 2147483647; |
| 1203 | pointer-events: none; |
| 1204 | user-select: none; |
| 1205 | ${containerStyle} |
| 1206 | `; |
| 1207 | addLoadingAnimation(ele, size, loadingStyle); |
| 1208 | document.body.appendChild(ele); |
| 1209 | return () => ele.remove(); |
| 1210 | } |
| 1211 | function addLoadingAnimation( |
| 1212 | element, |
| 1213 | size = Math.min(element?.clientWidth, element?.clientHeight) || 0, |
no test coverage detected