@@ -1284,10 +1284,48 @@ class UI extends EventListener {
1284
1284
1285
1285
showWorking ( ) {
1286
1286
if ( this . #overlayActive) return ;
1287
-
1287
+
1288
+ // Create and add stylesheet for spinner if it doesn't exist
1289
+ if ( ! document . getElementById ( 'puter-spinner-styles' ) ) {
1290
+ const styleSheet = document . createElement ( 'style' ) ;
1291
+ styleSheet . id = 'puter-spinner-styles' ;
1292
+ styleSheet . textContent = `
1293
+ .puter-loading-spinner {
1294
+ width: 50px;
1295
+ height: 50px;
1296
+ border: 5px solid #f3f3f3;
1297
+ border-top: 5px solid #3498db;
1298
+ border-radius: 50%;
1299
+ animation: spin 1s linear infinite;
1300
+ margin-bottom: 10px;
1301
+ }
1302
+
1303
+ .puter-loading-text {
1304
+ color: white;
1305
+ font-family: Arial, sans-serif;
1306
+ font-size: 16px;
1307
+ margin-top: 10px;
1308
+ text-align: center;
1309
+ }
1310
+
1311
+ @keyframes spin {
1312
+ 0% { transform: rotate(0deg); }
1313
+ 100% { transform: rotate(360deg); }
1314
+ }
1315
+
1316
+ .puter-loading-container {
1317
+ display: flex;
1318
+ flex-direction: column;
1319
+ align-items: center;
1320
+ justify-content: center;
1321
+ }
1322
+ ` ;
1323
+ document . head . appendChild ( styleSheet ) ;
1324
+ }
1325
+
1288
1326
const overlay = document . createElement ( 'div' ) ;
1289
1327
overlay . classList . add ( 'puter-loading-overlay' ) ;
1290
-
1328
+
1291
1329
const styles = {
1292
1330
position : 'fixed' ,
1293
1331
top : '0' ,
@@ -1301,11 +1339,22 @@ class UI extends EventListener {
1301
1339
alignItems : 'center' ,
1302
1340
pointerEvents : 'all'
1303
1341
} ;
1304
-
1342
+
1305
1343
Object . assign ( overlay . style , styles ) ;
1306
- overlay . innerHTML = '<div class="puter-loading-spinner">Working...</div>' ;
1344
+
1345
+ // Create container for spinner and text
1346
+ const container = document . createElement ( 'div' ) ;
1347
+ container . classList . add ( 'puter-loading-container' ) ;
1348
+
1349
+ // Add spinner and text
1350
+ container . innerHTML = `
1351
+ <div class="puter-loading-spinner"></div>
1352
+ <div class="puter-loading-text">Working...</div>
1353
+ ` ;
1354
+
1355
+ overlay . appendChild ( container ) ;
1307
1356
document . body . appendChild ( overlay ) ;
1308
-
1357
+
1309
1358
this . #overlayActive = true ;
1310
1359
this . #overlayTimer = setTimeout ( ( ) => {
1311
1360
this . #overlayTimer = null ;
0 commit comments