Browse Source

Update docs

customisations
alemart 8 months ago
parent
commit
52cb01a062

+ 3
- 3
README.md View File

@@ -1,12 +1,12 @@
1 1
 # encantar.js WebAR engine
2 2
 
3
-[![GitHub release (latest by date)](https://img.shields.io/github/v/release/alemart/encantar-js)](https://github.com/alemart/encantar-js/releases/) ![GitHub file size in bytes on a specified ref (branch/commit/tag)](https://img.shields.io/github/size/alemart/encantar-js/dist/encantar.min.js?branch=master&label=minified%20js) [![GitHub Repo stars](https://img.shields.io/github/stars/alemart/encantar-js?logo=github)](https://github.com/alemart/encantar-js/stargazers) [![GitHub Sponsors](https://img.shields.io/github/sponsors/alemart?logo=github)](https://github.com/sponsors/alemart/)
3
+![GitHub release](https://img.shields.io/github/v/release/alemart/encantar-js) ![GitHub file size](https://img.shields.io/github/size/alemart/encantar-js/dist/encantar.min.js?branch=master&label=minified%20js) [![GitHub Repo stars](https://img.shields.io/github/stars/alemart/encantar-js?logo=github)](https://github.com/alemart/encantar-js/stargazers) [![GitHub Sponsors](https://img.shields.io/github/sponsors/alemart?logo=github)](https://github.com/sponsors/alemart/) [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/alemart)
4 4
 
5 5
 The Augmented Reality engine that will enchant you!
6 6
 
7
-:magic_wand: **[Demos](https://alemart.github.io/encantar-js/demos/)** | :eyes: **[Try it!](https://alemart.github.io/encantar-js/demos/hello-three/poster.html)** | :books: **[Learn](https://alemart.github.io/encantar-js/)** | :heart: **[Support](https://alemart.github.io/encantar-js/support-my-work)**
7
+:star2: **[Try it!](https://alemart.github.io/encantar-js/demos/hello-three/poster.html)** | :video_game: **[Play a game!](https://alemart.github.io/encantar-js/demos/basketball/poster.html)** | :magic_wand: **[Demos](https://alemart.github.io/encantar-js/demos/)** | :books: **[Learn](https://alemart.github.io/encantar-js/)**
8 8
 
9
-[![Demo](docs/img/mage.gif)](https://alemart.github.io/encantar-js/demos/hello-three/poster.html)
9
+[![Demo](docs/img/mage.gif)](https://alemart.github.io/encantar-js/demos/hello-three/poster.html) [![Game](docs/img/basketball.gif)](https://alemart.github.io/encantar-js/demos/basketball/poster.html)
10 10
 
11 11
 ## Features
12 12
 

+ 1
- 1
docs/api/camera-source.md View File

@@ -39,4 +39,4 @@ const webcam = AR.Source.Camera({
39 39
 
40 40
 `source.resolution: Resolution, read-only`
41 41
 
42
-The [resolution](resolution.md) of this source of data.
42
+The [resolution](resolution.md) of this source of data. Set it when [instantiating](#instantiation) the object.

+ 5
- 5
docs/api/image-tracker.md View File

@@ -15,7 +15,7 @@ Instantiate an image tracker with the specified `options`.
15 15
 **Arguments**
16 16
 
17 17
 * `options: object, optional`. An object with the following keys (all are optional):
18
-    * `resolution: Resolution`. The [resolution](resolution.md) of the tracker. Make sure that the [resolution of the video](camera-source.md) is at least as high as this. Suggested values: `"sm"`, `"sm+"`, `"md"`, `"md+"`.
18
+    * `resolution: Resolution`. The [resolution](resolution.md) of the tracker. Make sure that the [resolution of the video](camera-source.md#resolution) is at least as high as this. Suggested values: `"sm"`, `"sm+"`, `"md"`, `"md+"`.
19 19
 
20 20
 **Returns**
21 21
 
@@ -29,11 +29,11 @@ const imageTracker = AR.Tracker.Image({
29 29
 });
30 30
 ```
31 31
 
32
-### ~~AR.Tracker.ImageTracker~~
32
+### AR.Tracker.ImageTracker
33 33
 
34
-~~`AR.Tracker.ImageTracker(): ImageTracker`~~
34
+<span style="text-decoration: line-through">`AR.Tracker.ImageTracker(): ImageTracker`</span>
35 35
 
36
-Instantiate an image tracker with default settings.
36
+Instantiate an image tracker with the default settings.
37 37
 
38 38
 *Deprecated since:* 0.4.0. Use `AR.Tracker.Image()` instead.
39 39
 
@@ -67,7 +67,7 @@ A [database](reference-image-database.md) of [reference images](reference-image.
67 67
 
68 68
 The [resolution](resolution.md) adopted by the computer vision algorithms implemented in the tracker. Higher resolutions improve the tracking quality, but are computationally more expensive. Note that this resolution is different from, and should not be larger than, the [resolution of the camera](camera-source.md#resolution)!
69 69
 
70
-*Note:* this property is read-only since 0.4.0. Set the resolution when instantiating the tracker.
70
+*Note:* this property is read-only since 0.4.0. Set the resolution when [instantiating](#instantiation) the tracker.
71 71
 
72 72
 ## Events
73 73
 

+ 1
- 1
docs/api/resolution.md View File

@@ -1,6 +1,6 @@
1 1
 # Resolution
2 2
 
3
-A `Resolution` is a setting defined by a string. It is mapped to a size measured in pixels according to special rules. You may use it, for example, to change the resolution of a video captured by a webcam, to adjust the resolution of a video when it is processed by a tracker, or to set the rendering resolution of a virtual scene.
3
+A `Resolution` is a setting defined by a string. It is mapped to a size measured in pixels according to special rules. You may use it, for example, to set the [resolution of the camera](camera-source.md#resolution), to adjust the [resolution of the tracker](image-tracker.md#resolution), or to set the [rendering resolution](viewport.md#resolution) of the virtual scene.
4 4
 
5 5
 The table below shows examples of how resolution strings are converted to pixels:
6 6
 

+ 1
- 1
docs/api/viewport.md View File

@@ -51,7 +51,7 @@ The [HUD](hud.md).
51 51
 
52 52
 `viewport.resolution: Resolution, read-only`
53 53
 
54
-The [resolution](resolution.md) of the virtual scene.
54
+The [resolution](resolution.md) of the virtual scene. You may set it when [instantiating](#instantiation) the viewport.
55 55
 
56 56
 ### aspectRatio
57 57
 

BIN
docs/img/basketball.gif View File


BIN
docs/img/mage.gif View File


+ 4
- 4
docs/index.md View File

@@ -1,12 +1,12 @@
1 1
 # Welcome to encantar.js!
2 2
 
3
-[![GitHub release (latest by date)](https://img.shields.io/github/v/release/alemart/encantar-js)](https://github.com/alemart/encantar-js/releases/) ![GitHub file size in bytes on a specified ref (branch/commit/tag)](https://img.shields.io/github/size/alemart/encantar-js/dist/encantar.min.js?branch=master&label=minified%20js) [![GitHub Repo stars](https://img.shields.io/github/stars/alemart/encantar-js?logo=github)](https://github.com/alemart/encantar-js/stargazers) [![GitHub Sponsors](https://img.shields.io/github/sponsors/alemart?logo=github)](https://github.com/sponsors/alemart/)
3
+![GitHub release](https://img.shields.io/github/v/release/alemart/encantar-js) ![GitHub file size](https://img.shields.io/github/size/alemart/encantar-js/dist/encantar.min.js?branch=master&label=minified%20js) [![GitHub Repo stars](https://img.shields.io/github/stars/alemart/encantar-js?logo=github)](https://github.com/alemart/encantar-js/stargazers) [![GitHub Sponsors](https://img.shields.io/github/sponsors/alemart?logo=github)](https://github.com/sponsors/alemart/) [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/alemart)
4 4
 
5 5
 The Augmented Reality engine that will enchant you!
6 6
 
7
-[:sparkles: Demos](./demos.md){ .md-button ._blank }
8
-[:eyes: Try it!](https://alemart.github.io/encantar-js/demos/hello-three/poster.html){ .md-button ._blank }
9
-[:books: Learn](./tutorial/introduction.md){ .md-button } [:heart:{ .heart } Support](./support-my-work.md){ .md-button }
7
+[:star2: Try it!](./demos/hello-three/poster.html){ .md-button ._blank } [:video_game: Play a game!](./demos/basketball/poster.html){ .md-button ._blank } [:sparkles: Demos](./demos.md){ .md-button ._blank } [:books: Learn](./tutorial/introduction.md){ .md-button }
8
+
9
+[![Demo](./img/mage.gif)](./demos/hello-three/poster.html){ ._blank } [![Game](./img/basketball.gif)](./demos/basketball/poster.html){ ._blank }
10 10
 
11 11
 ## Features
12 12
 

+ 5
- 5
docs_overrides/js/extra.js View File

@@ -17,11 +17,11 @@ document.addEventListener('DOMContentLoaded', () => {
17 17
 
18 18
     const support = document.createElement('a');
19 19
     const heart = document.createElement('img');
20
-    const text = document.createTextNode('Support me');
20
+    const text = document.createTextNode('Support');
21 21
 
22 22
     heart.src = 'https://github.githubassets.com/images/icons/emoji/unicode/2764.png';
23 23
     heart.style.width = '24px';
24
-    heart.style.paddingRight = '8px';
24
+    //heart.style.paddingRight = '8px';
25 25
     heart.classList.add('gemoji', 'heart');
26 26
 
27 27
     support.href = 'https://alemart.github.io/encantar-js/support-my-work';
@@ -32,8 +32,8 @@ document.addEventListener('DOMContentLoaded', () => {
32 32
     support.style.position = 'fixed';
33 33
     support.style.right = '16px';
34 34
     support.style.bottom = '16px';
35
-    support.style.padding = '0 20px';
36
-    support.style.height = '48px';
35
+    support.style.padding = '12px';// '0 20px';
36
+    //support.style.height = '48px';
37 37
     support.style.color = 'var(--md-primary-fg-color)';
38 38
     support.style.backgroundColor = 'var(--md-primary-bg-color)';
39 39
     support.style.fontWeight = 'bold';
@@ -59,7 +59,7 @@ document.addEventListener('DOMContentLoaded', () => {
59 59
     });
60 60
 
61 61
     support.appendChild(heart);
62
-    support.appendChild(text);
62
+    //support.appendChild(text);
63 63
     document.body.appendChild(support);
64 64
 
65 65
 });

+ 2
- 2
docs_overrides/support-my-work.html View File

@@ -2,10 +2,10 @@
2 2
 <html>
3 3
     <head>
4 4
         <meta charset="utf-8">
5
-        <meta http-equiv="refresh" content="0; url='https://alemart.github.io/demos/assets/promo.html'">
5
+        <meta http-equiv="refresh" content="0; url='https://alemart.github.io/encantar-js/demos/assets/promo.html'">
6 6
         <title>encantar.js - Support my work</title>
7 7
     </head>
8 8
     <body>
9
-        <p>Redirecting...</p>
9
+        <p><a href="https://alemart.github.io/encantar-js/demos/assets/promo.html">Redirecting...</a></p>
10 10
     </body>
11 11
 </html>

Loading…
Cancel
Save