File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed
src/BlazorWorker.Demo/Net9/BLazorWorker.Demo.Client/wwwroot Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ a, .btn-link {
6969.loading-progress {
7070 position : relative;
7171 display : block;
72- width : 8 rem ;
73- height : 8 rem ;
72+ width : 16 rem ;
73+ height : 16 rem ;
7474 margin : 20vh auto 1rem auto;
7575}
7676
Original file line number Diff line number Diff line change 1414
1515< body >
1616 < div id ="app ">
17- < div style ="margin: 100px auto; width: 500px; height: 120px; text-align: center; ">
18- < img src ="loading-icon.svg " width ="97 " height ="88 " />
19- </ div >
2017 < svg class ="loading-progress ">
2118 < circle r ="40% " cx ="50% " cy ="50% " />
2219 < circle r ="40% " cx ="50% " cy ="50% " />
3128 </ div >
3229 < script src ="_framework/blazor.webassembly.js "> </ script >
3330 < script src ="_content/TG.Blazor.IndexedDB/indexedDb.Blazor.js "> </ script >
31+ < script >
32+ window . addEventListener ( 'DOMContentLoaded' , ( ) => {
33+ const app = document . getElementById ( 'app' ) ;
34+ const svg = app . querySelector ( '.loading-progress' ) ;
35+
36+ if ( ! svg ) return ;
37+
38+ // Get position and size of SVG
39+ const rect = svg . getBoundingClientRect ( ) ;
40+
41+ // Create the image element
42+ const img = document . createElement ( 'img' ) ;
43+ img . src = 'loading-icon.svg' ;
44+ img . width = 97 ;
45+ img . height = 88 ;
46+ img . style . position = 'absolute' ;
47+ img . style . left = rect . left + window . scrollX + rect . width / 2 - 97 / 2 + 'px' ;
48+ img . style . top = rect . top + window . scrollY + rect . height / 2 - 88 / 2 + 'px' ;
49+ img . style . pointerEvents = 'none' ;
50+ img . style . zIndex = '9999' ;
51+
52+ // Add it to the body
53+ document . getElementById ( "app" ) . appendChild ( img ) ;
54+ } ) ;
55+ </ script >
3456</ body >
3557
3658</ html >
You can’t perform that action at this time.
0 commit comments