From c62603901660e686269db1210c49cbdcc8254659 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Mon, 13 May 2024 04:07:32 +0900 Subject: [PATCH] fix fail message --- examples/2d-array.html | 1 + examples/2d-array.js | 8 ++++---- examples/background.html | 1 + examples/background.js | 8 ++++---- examples/bind-group-layouts.html | 1 + examples/bind-group-layouts.js | 8 ++++---- examples/cube-map.html | 1 + examples/cube-map.js | 8 ++++---- examples/cube.html | 1 + examples/cube.js | 8 ++++---- examples/examples.css | 12 ++++++++++++ examples/instancing-size-only.html | 1 + examples/instancing-size-only.js | 8 ++++---- examples/instancing.html | 1 + examples/instancing.js | 7 +++---- examples/primitives.html | 1 + examples/primitives.js | 7 +++---- test/tests/umd-min-test.html | 9 +++++---- test/tests/umd-test.html | 9 +++++---- 19 files changed, 60 insertions(+), 40 deletions(-) diff --git a/examples/2d-array.html b/examples/2d-array.html index ba09d39..edac047 100644 --- a/examples/2d-array.html +++ b/examples/2d-array.html @@ -8,6 +8,7 @@
webgpu-utils - 2d-array texture
+ \ No newline at end of file diff --git a/examples/2d-array.js b/examples/2d-array.js index 99a7bd4..9d7cc40 100644 --- a/examples/2d-array.js +++ b/examples/2d-array.js @@ -257,10 +257,10 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } + main(); diff --git a/examples/background.html b/examples/background.html index 432301c..4c85988 100644 --- a/examples/background.html +++ b/examples/background.html @@ -7,6 +7,7 @@ + \ No newline at end of file diff --git a/examples/background.js b/examples/background.js index 774f9e5..e840a18 100644 --- a/examples/background.js +++ b/examples/background.js @@ -404,10 +404,10 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } + main(); diff --git a/examples/bind-group-layouts.html b/examples/bind-group-layouts.html index d805a6e..57746bd 100644 --- a/examples/bind-group-layouts.html +++ b/examples/bind-group-layouts.html @@ -8,6 +8,7 @@
webgpu-utils - 2d-array texture
+ \ No newline at end of file diff --git a/examples/bind-group-layouts.js b/examples/bind-group-layouts.js index 92279ac..81a5b4d 100644 --- a/examples/bind-group-layouts.js +++ b/examples/bind-group-layouts.js @@ -241,10 +241,10 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } + main(); diff --git a/examples/cube-map.html b/examples/cube-map.html index ad1fdbb..08a9feb 100644 --- a/examples/cube-map.html +++ b/examples/cube-map.html @@ -8,6 +8,7 @@
webgpu-utils - cube-map
+ \ No newline at end of file diff --git a/examples/cube-map.js b/examples/cube-map.js index 1dbca81..bcaf0e3 100644 --- a/examples/cube-map.js +++ b/examples/cube-map.js @@ -190,10 +190,10 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } + main(); diff --git a/examples/cube.html b/examples/cube.html index 04985d8..5d7e5b3 100644 --- a/examples/cube.html +++ b/examples/cube.html @@ -8,6 +8,7 @@
webgpu-utils - cube
+ \ No newline at end of file diff --git a/examples/cube.js b/examples/cube.js index 98ccee4..82d812e 100644 --- a/examples/cube.js +++ b/examples/cube.js @@ -225,10 +225,10 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } + main(); diff --git a/examples/examples.css b/examples/examples.css index 87b52cc..2cc1acb 100644 --- a/examples/examples.css +++ b/examples/examples.css @@ -20,4 +20,16 @@ canvas { width: 100%; top: 1em; left: 0; +} + +#fail { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + color: red; } \ No newline at end of file diff --git a/examples/instancing-size-only.html b/examples/instancing-size-only.html index 4655fee..3dc9132 100644 --- a/examples/instancing-size-only.html +++ b/examples/instancing-size-only.html @@ -8,6 +8,7 @@
webgpu-utils - instancing (size only)
+ \ No newline at end of file diff --git a/examples/instancing-size-only.js b/examples/instancing-size-only.js index 26e2fd8..576fcd7 100644 --- a/examples/instancing-size-only.js +++ b/examples/instancing-size-only.js @@ -253,10 +253,10 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } + main(); diff --git a/examples/instancing.html b/examples/instancing.html index d6bd709..00783bd 100644 --- a/examples/instancing.html +++ b/examples/instancing.html @@ -8,6 +8,7 @@
webgpu-utils - instancing
+ \ No newline at end of file diff --git a/examples/instancing.js b/examples/instancing.js index 290d042..f408de7 100644 --- a/examples/instancing.js +++ b/examples/instancing.js @@ -251,10 +251,9 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } main(); diff --git a/examples/primitives.html b/examples/primitives.html index 5ae854c..d1de102 100644 --- a/examples/primitives.html +++ b/examples/primitives.html @@ -8,6 +8,7 @@
webgpu-utils - primitives
+ \ No newline at end of file diff --git a/examples/primitives.js b/examples/primitives.js index ecacfda..dff57de 100644 --- a/examples/primitives.js +++ b/examples/primitives.js @@ -271,10 +271,9 @@ async function main() { } function fail(msg) { - const elem = document.createElement('p'); - elem.textContent = msg; - elem.style.color = 'red'; - document.body.appendChild(elem); + const elem = document.querySelector('#fail'); + elem.style.display = ''; + elem.children[0].textContent = msg; } main(); diff --git a/test/tests/umd-min-test.html b/test/tests/umd-min-test.html index b605ac3..e12b6a1 100644 --- a/test/tests/umd-min-test.html +++ b/test/tests/umd-min-test.html @@ -5,6 +5,7 @@ + diff --git a/test/tests/umd-test.html b/test/tests/umd-test.html index 2b2274a..aaa19b9 100644 --- a/test/tests/umd-test.html +++ b/test/tests/umd-test.html @@ -5,6 +5,7 @@ +