Skip to content

Commit

Permalink
Fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
jgbarah committed Feb 19, 2024
1 parent 3d4e25e commit b6db2c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions seminar-03/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ First, let's create an A-Frame component that writes a message in the browser co
Then, let's move the JavaScript code for creating a component to a separate JavaScript file.

* [Scene source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/scene_component2.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component2.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component2.js)
* [View online](scene_component2.html)

Now, let's add a parameter to the component, so that we can select which message it prints in the console.

* [Scene source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/scene_component3.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component3.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component3.js)
* [View online](scene_component3.html)

Now, let's make the component write a message when it receives an event. We will do this by adding an event handler, which will be installed by the component. In the HTML scene, it will write a message when it is clicked.

* [Scene source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/scene_component4.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component4.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component4.js)
* [View online](scene_component4.html)

Finally, let's make the component create a new entity every time it receives an event. For this, the handler will create a new element in the DOM. In our case, it will create a new `a-box` as a children of the element where the component is.

* [Scene source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/scene_component5.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component5.html)
* [JavaScript source code](https://github.com/jgbarah/aframe-playground/tree/master/seminar-03/component5.js)
* [View online](scene_component5.html)

0 comments on commit b6db2c2

Please sign in to comment.