Skip to content

Commit dcb68f6

Browse files
committed
Starter Layout update
1 parent 3b76812 commit dcb68f6

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

src/BlazorWorker.Demo/Net9/BLazorWorker.Demo.Client/wwwroot/css/app.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ a, .btn-link {
6969
.loading-progress {
7070
position: relative;
7171
display: block;
72-
width: 8rem;
73-
height: 8rem;
72+
width: 16rem;
73+
height: 16rem;
7474
margin: 20vh auto 1rem auto;
7575
}
7676

src/BlazorWorker.Demo/Net9/BLazorWorker.Demo.Client/wwwroot/index.html

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
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%" />
@@ -31,6 +28,31 @@
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>

0 commit comments

Comments
 (0)