Skip to content

Commit

Permalink
fix fail message
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed May 12, 2024
1 parent cdafa33 commit c626039
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 40 deletions.
1 change: 1 addition & 0 deletions examples/2d-array.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<canvas></canvas>
<div id="b"><a href="https://github.com/greggman/webgpu-utils.org">webgpu-utils</a> - 2d-array texture</div>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="2d-array.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/2d-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
1 change: 1 addition & 0 deletions examples/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</head>
<body>
<canvas></canvas>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="background.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
1 change: 1 addition & 0 deletions examples/bind-group-layouts.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<canvas></canvas>
<div id="b"><a href="https://github.com/greggman/webgpu-utils.org">webgpu-utils</a> - 2d-array texture</div>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="bind-group-layouts.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/bind-group-layouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
1 change: 1 addition & 0 deletions examples/cube-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<canvas></canvas>
<div id="b"><a href="https://github.com/greggman/webgpu-utils.org">webgpu-utils</a> - cube-map</div>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="cube-map.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/cube-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
1 change: 1 addition & 0 deletions examples/cube.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<canvas></canvas>
<div id="b"><a href="https://github.com/greggman/webgpu-utils.org">webgpu-utils</a> - cube</div>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="cube.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/cube.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
12 changes: 12 additions & 0 deletions examples/examples.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions examples/instancing-size-only.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<canvas></canvas>
<div id="b"><a href="https://github.com/greggman/webgpu-utils.org">webgpu-utils</a> - instancing (size only)</div>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="instancing-size-only.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/instancing-size-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
1 change: 1 addition & 0 deletions examples/instancing.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<canvas></canvas>
<div id="b"><a href="https://github.com/greggman/webgpu-utils.org">webgpu-utils</a> - instancing</div>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="instancing.js"></script>
</body>
</html>
7 changes: 3 additions & 4 deletions examples/instancing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
1 change: 1 addition & 0 deletions examples/primitives.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<canvas></canvas>
<div id="b"><a href="https://github.com/greggman/webgpu-utils.org">webgpu-utils</a> - primitives</div>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script type="module" src="primitives.js"></script>
</body>
</html>
7 changes: 3 additions & 4 deletions examples/primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
9 changes: 5 additions & 4 deletions test/tests/umd-min-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</head>
<body>
<canvas></canvas>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script src="https://wgpu-matrix.org/dist/1.x/wgpu-matrix.js"></script>
<script src="../../dist/1.x/webgpu-utils.min.js"></script>
<script>
Expand Down Expand Up @@ -291,12 +292,12 @@
}

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();

</script>
Expand Down
9 changes: 5 additions & 4 deletions test/tests/umd-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</head>
<body>
<canvas></canvas>
<div id="fail" style="display: none;"><div id="fail-msg"></div></div>
<script src="https://wgpu-matrix.org/dist/1.x/wgpu-matrix.js"></script>
<script src="../../dist/1.x/webgpu-utils.js"></script>
<script>
Expand Down Expand Up @@ -291,12 +292,12 @@
}

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();

</script>
Expand Down

0 comments on commit c626039

Please sign in to comment.