Skip to content

Commit ea80c21

Browse files
committed
Examples: Clean up.
1 parent fe276f2 commit ea80c21

30 files changed

+80
-27
lines changed

docs/manual/ar/introduction/WebGL-compatibility-check.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>فحص توافق WebGL</h1>
1414
</p>
1515

1616
<p>
17-
أضف [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js] إلى جافا سكريبت الخاص بك وقم بتشغيل ما يلي قبل محاولة تقديم أي شيء.
17+
أضف [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js] إلى جافا سكريبت الخاص بك وقم بتشغيل ما يلي قبل محاولة تقديم أي شيء.
1818
</p>
1919

2020
<code>

docs/manual/en/introduction/WebGL-compatibility-check.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>[name]</h1>
1414
</p>
1515

1616
<p>
17-
Add [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]
17+
Add [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]
1818
to your javascript and run the following before attempting to render anything.
1919
</p>
2020

docs/manual/ja/introduction/WebGL-compatibility-check.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>[name]</h1>
1313
</p>
1414

1515
<p>
16-
javascriptのコードに[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]を付け加えて、何かを描画する前に以下のコードを実行してください。
16+
javascriptのコードに[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]を付け加えて、何かを描画する前に以下のコードを実行してください。
1717
</p>
1818

1919
<code>

docs/manual/ko/introduction/WebGL-compatibility-check.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>WebGL 호환성 검사([name])</h1>
1414
</p>
1515

1616
<p>
17-
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]를 스크립트에 추가하고 무언가를 렌더링하기 전에 아래 코드를 실행해보세요.
17+
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]를 스크립트에 추가하고 무언가를 렌더링하기 전에 아래 코드를 실행해보세요.
1818
</p>
1919

2020
<code>

docs/manual/zh/introduction/WebGL-compatibility-check.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>WebGL兼容性检查([name])</h1>
1313
</p>
1414

1515
<p>
16-
请将[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]引入到你的文件,并在尝试开始渲染之前先运行该文件。
16+
请将[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]引入到你的文件,并在尝试开始渲染之前先运行该文件。
1717
</p>
1818

1919
<code>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
( function () {
2+
class ImportMaps {
3+
static isAvailable() {
4+
return 'supports' in HTMLScriptElement && HTMLScriptElement.supports('importmap');
5+
}
6+
7+
static getErrorMessage() {
8+
const message = 'Your browser does not support <a href="https://wicg.github.io/import-maps/" style="color:blue">Import Maps</a>';
9+
const element = document.createElement('div');
10+
element.style.fontFamily = 'monospace';
11+
element.style.fontSize = '13px';
12+
element.style.fontWeight = 'normal';
13+
element.style.textAlign = 'center';
14+
element.style.background = '#fff';
15+
element.style.color = '#000';
16+
element.style.padding = '1.5em';
17+
element.style.width = '400px';
18+
element.style.margin = '5em auto 0';
19+
element.innerHTML = message;
20+
return element;
21+
}
22+
23+
}
24+
25+
THREE.ImportMaps as default = ImportMaps as default;
26+
} )();
File renamed without changes.

examples/js/capabilities/WebGPU.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
( function () {
2+
class WebGPU {
3+
static isAvailable() {
4+
return navigator.gpu !== undefined;
5+
}
6+
7+
static getErrorMessage() {
8+
const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:blue">WebGPU</a>';
9+
const element = document.createElement('div');
10+
element.id = 'webgpumessage';
11+
element.style.fontFamily = 'monospace';
12+
element.style.fontSize = '13px';
13+
element.style.fontWeight = 'normal';
14+
element.style.textAlign = 'center';
15+
element.style.background = '#fff';
16+
element.style.color = '#000';
17+
element.style.padding = '1.5em';
18+
element.style.width = '400px';
19+
element.style.margin = '5em auto 0';
20+
element.innerHTML = message;
21+
return element;
22+
}
23+
24+
}
25+
26+
THREE.WebGPU as default = WebGPU as default;
27+
} )();
File renamed without changes.

examples/jsm/renderers/webgpu/WebGPU.js renamed to examples/jsm/capabilities/WebGPU.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class WebGPU {
88

99
static getErrorMessage() {
1010

11-
const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:#000">WebGPU</a>.';
11+
const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:blue">WebGPU</a>';
1212

1313
const element = document.createElement( 'div' );
1414
element.id = 'webgpumessage';

0 commit comments

Comments
 (0)