Skip to content

Commit

Permalink
Fixed various small errors in examples (#5343)
Browse files Browse the repository at this point in the history
Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
  • Loading branch information
mrxz and mrxz authored Jul 24, 2023
1 parent d54421f commit 76904ca
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 78 deletions.
2 changes: 1 addition & 1 deletion examples/animation/pivots/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<a-scene>
<a-assets>
<a-mixin id="cylinder" geometry="primitive: cylinder; height: 2; openEnded: true; radius: 2" material="side: double">
<a-mixin id="cylinder" geometry="primitive: cylinder; height: 2; openEnded: true; radius: 2" material="side: double"></a-mixin>
<a-mixin id="scaleAnimation" animation="property: object3D.scale.y; from: 1.125; to: 0.0001; dur: 2000"></a-mixin>
<img id="background" src="../../assets/img/gray-gradient.jpg">
</a-assets>
Expand Down
38 changes: 0 additions & 38 deletions examples/boilerplate/flythrough/index.html

This file was deleted.

8 changes: 5 additions & 3 deletions examples/performance/set-attribute/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@
</head>
<body>
<a-scene>
<a-mixin id="foo" dummy__1="foo: 1"></a-mixin>
<a-mixin id="bar" dummy__1="foo: 2"></a-mixin>
<a-mixin id="baz" dummy__1="foo: 3"></a-mixin>
<a-assets>
<a-mixin id="foo" dummy__1="foo: 1"></a-mixin>
<a-mixin id="bar" dummy__1="foo: 2"></a-mixin>
<a-mixin id="baz" dummy__1="foo: 3"></a-mixin>
</a-assets>

<a-entity mixin="foo bar baz" dummy__1="a: false; b: false; c: false; d: false; e: false; f: false; g: false" set-attribute-test></a-entity>
</a-scene>
Expand Down
2 changes: 1 addition & 1 deletion examples/primitives/boxes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<a-box mixin="box" position="0 -0.2 0" color="#4CC3D9"></a-box>
<a-box mixin="box" position="0.5 -0.2 0.5" color="#93648D"></a-box>
<a-box mixin="box" position="0 0 2" color="#7BC8A4"></a-box>
<a-box mixin="box" position="-0.5 -0,5 3" color="#FFC65D"></a-box>
<a-box mixin="box" position="-0.5 -0.5 3" color="#FFC65D"></a-box>
<a-box mixin="box" position="0 0 4" color="#F16745"></a-box>
<a-box mixin="box" position="-0.2 -0.4 5" color="#FFC65D"></a-box>
<a-box mixin="box" position="0 0 6" color="#4CC3D9"></a-box>
Expand Down
23 changes: 3 additions & 20 deletions examples/showcase/anime-UI/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,9 @@
<meta name="description" content="Anime UI — A-Frame">
<script src="../../../dist/aframe-master.js"></script>
<script src="https://unpkg.com/aframe-event-set-component@4.2.1/dist/aframe-event-set-component.min.js"></script>
<script>
AFRAME.registerComponent('hide-in-ar-mode', {
// Set this object invisible while in AR mode.
// TODO: could this be replaced with bind="visible: !ar-mode"
// with https://www.npmjs.com/package/aframe-state-component ?
init: function () {
this.el.sceneEl.addEventListener('enter-vr', (ev) => {
if (this.el.sceneEl.is('ar-mode')) {
this.el.setAttribute('visible', false);
}
});
this.el.sceneEl.addEventListener('exit-vr', (ev) => {
this.el.setAttribute('visible', true);
});
}
})
</script>
</head>
<body>
<a-scene renderer="colorManagement: true;">
<a-scene renderer="colorManagement: true;" vr-mode-ui="enterAREnabled: true">
<a-assets>
<a-asset-item id="engine" src="models/engine.glb"></a-asset-item>
<a-mixin id="image" geometry="height: 2; width: 2"></a-mixin>
Expand Down Expand Up @@ -53,11 +36,11 @@
<a-camera position="0 0 0" near="0.1"></a-camera>
</a-entity>

<a-entity position="0 0 -3" hide-in-ar-mode>
<a-entity position="0 0 -3" hide-on-enter-ar>
<a-gltf-model src="#engine" rotation="90 0 0" scale="18 18 18"></a-gltf-model>
</a-entity>

<a-entity id="wall-lights" position="-7.25 1.5 2.9" rotation="0 90 0" scale="1.25 1.25 1.25">
<a-entity id="wall-lights" position="-7.25 1.5 2.9" rotation="0 90 0" scale="1.25 1.25 1.25" hide-on-enter-ar>
<a-entity position="0 0 0" scale="0.05 0.05 0.05">
<a-plane mixin="delayVisible" width="1" height="4" shader="flat" color="#B4E2F8" event-set__loaded="_delay: 350"></a-plane>
<a-plane width="6" height="4" color="#586266" opacity="0.6" position="0 0 -.01"></a-plane>
Expand Down
2 changes: 1 addition & 1 deletion examples/showcase/hand-tracking/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<a-entity slider position="0 0.10 0"></a-entity>
<a-entity id="sphereButton" button="label: sphere" position="-0.15 0 0"></a-entity>
<a-entity id="boxButton" button="label: box" position="0 0 0"></a-entity>
<a-entity id="torusButton"button="label: torus" position="0.15 0 0"></a-entity>
<a-entity id="torusButton" button="label: torus" position="0.15 0 0"></a-entity>
<a-entity id="darkModeButton" button="label: Dark Mode; width: 0.20; toggable: true" position="0 -0.10 0"></a-entity>
</a-entity>
<a-entity hand-tracking-controls="hand: left"></a-entity>
Expand Down
2 changes: 1 addition & 1 deletion examples/showcase/spheres-and-fog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- Orange -->
<a-entity position="0 0 -5">
<a-sphere position="0 4.2 0" radius="4.2" color="#F16745"
roughness="0.8" width-segments="52" height-segments="52"></a-sphere>
roughness="0.8" segments-width="52" segments-height="52"></a-sphere>
<a-image src="#shadow3" rotation="-90 0 0" scale="3 3 3"></a-image>
</a-entity>

Expand Down
2 changes: 1 addition & 1 deletion examples/test/animation-color/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<body>
<a-scene pulse stats>
<a-assets>
<a-mixin id="box" geometry="primitive: box; depth: 0.5; height: 1; width: 0.5" material="color: #2D4659">
<a-mixin id="box" geometry="primitive: box; depth: 0.5; height: 1; width: 0.5" material="color: #2D4659"></a-mixin>
<a-mixin id="pulse" animation="property: components.material.material.color; type: color; from: #FDFBDA; to: #2D4659; dur: 1000; startEvents: pulse"></a-mixin>
</a-assets>

Expand Down
6 changes: 4 additions & 2 deletions examples/test/embedded-cursor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</style>
</head>
<body>
<a-scene backround="color: #FBE0D8" embedded="true">
<a-scene background="color: #FBE0D8" embedded="true">
<a-assets>
<audio id="blip1" src="../../showcase/anime-UI/audio/321103__nsstudios__blip1.wav"></audio>
<audio id="blip2" src="../../showcase/anime-UI/audio/321104__nsstudios__blip2.wav"></audio>
Expand All @@ -32,7 +32,7 @@
<a-mixin id="sphere" geometry="primitive: sphere"></a-mixin>
</a-assets>

<a-entity cursor="rayOrigin: mouse; objects: .intersectable; far: 30"></a-entity>
<a-entity cursor="rayOrigin: mouse" raycaster="objects: .intersectable; far: 30"></a-entity>

<a-camera position="0 .6 4"></a-camera>

Expand All @@ -46,6 +46,7 @@
<a-entity position="0 1 1">
<a-entity id="invisibleCube"
mixin="cube"
class="intersectable"
material="color: grey; opacity: 0.3; transparent: true"
scale="1 1 0.1"
animation="startEvents: click; property: rotation; to: 0 360 0; easing: linear; dur: 2000">
Expand All @@ -64,6 +65,7 @@

<a-entity position="1 1 0">
<a-entity mixin="yellow cube"
class="intersectable"
sound__1="on: click; src: #shot; poolSize: 6"
sound__2="src: #blip2; autoplay: true"
animation="startEvents: click; property: scale; to: 1.2 1.2 1.2; easing: linear; dur: 200">
Expand Down
8 changes: 4 additions & 4 deletions examples/test/geometry-gallery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</a-mixin>
<a-mixin id="cylinder"
geometry="primitive: cylinder; radius: 0.2; height: .5;
segmentsRadial: 50; segmentsHeight: 50:
segmentsRadial: 50; segmentsHeight: 50;
openEnded: true; thetaStart: 0; thetaLength: 360">
</a-mixin>
<a-mixin id="ring"
Expand Down Expand Up @@ -84,9 +84,9 @@
<a-entity position="-2.5 0 1">
<a-entity mixin="column">
<a-entity mixin="column-light"></a-entity>
<a-entity mixin="object-on-column color box spin" animation__spin="to: 360 360 0"></a-entity>
<a-entity mixin="object-on-column color box spin" position=".18 1.2 .1" animation__spin="to: 360 360 0"></a-entity>
<a-entity mixin="object-on-column color box spin" position="-.18 1.2 -.2" animation__spin="to: 360 360 0"></a-entity>
<a-entity mixin="object-on-column color box spin" animation__spin="to: 360"></a-entity>
<a-entity mixin="object-on-column color box spin" position=".18 1.2 .1" animation__spin="to: 360"></a-entity>
<a-entity mixin="object-on-column color box spin" position="-.18 1.2 -.2" animation__spin="to: 360"></a-entity>
</a-entity>
<a-entity mixin="column-bottom"></a-entity>
</a-entity>
Expand Down
2 changes: 1 addition & 1 deletion examples/test/layer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<a-entity id="rightHand" toggle-layer laser-controls="hand: right" raycaster="objects: [button]"></a-entity>

<a-entity page-turn="direction: forward" id="nextButton" button="label: Next" position="0.5 1.1 -1.5"></a-entity>
<a-entity page-turn="direction: backward" id="previousButton"button="label: Previous" position="-0.5 1.1 -1.5"></a-entity>
<a-entity page-turn="direction: backward" id="previousButton" button="label: Previous" position="-0.5 1.1 -1.5"></a-entity>
</a-scene>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/test/physical/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</script>
</head>
<body>
<a-scene generate background="#111">
<a-scene generate background="color: #111">
<a-assets>
<a-cubemap id="reflection">
<img src="milkyway/px.jpg">
Expand Down
2 changes: 1 addition & 1 deletion examples/test/pivot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<a-entity mixin="wing flap" animation="to: 0 120 0"></a-entity>
</a-entity>
<a-entity rotation="-45 0 90">
<a-entity mixin="wing flag" animation="to: 0 -120 0"></a-entity>
<a-entity mixin="wing flap" animation="to: 0 -120 0"></a-entity>
</a-entity>
</a-entity>
</a-entity>
Expand Down
2 changes: 1 addition & 1 deletion examples/test/raycaster/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<body>
<a-scene background="color: #ECECEC">
<a-assets>
<a-mixin id="box" geometry="primitive: box; depth: 0.1, height: 0.3; width: 0.1"
<a-mixin id="box" geometry="primitive: box; depth: 0.1; height: 0.3; width: 0.1"
material="color: #DDD; opacity: 0.4; shader: flat"
intersect-color-change></a-mixin>
<a-mixin id="sphere" geometry="primitive: sphere; radius: 0.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/test/shadows/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- Center point light. -->
<a-entity geometry="primitive: sphere; radius: 0.15"
material="color: #FAFAFA; shader: flat"
light="castShadow: true; color: #FAFAFA; intensity: 0.5; shadowBias: 0.01
light="castShadow: true; color: #FAFAFA; intensity: 0.5; shadowBias: 0.01;
shadowCameraNear: 1; type: point; shadowMapWidth: 1024; shadowMapHeight: 1024"
position="0 -1 1"
animation="property: scale; to: 2 2 2; dur: 3000; dir: alternate; loop: true"
Expand All @@ -31,7 +31,7 @@
<a-entity animation="property: rotation; to: 0 360 360; dur: 5000; easing: linear; loop: true">
<a-entity geometry="primitive: sphere; radius: 0.25"
material="color: #EF2D5E; shader: flat"
light="castShadow: true; color: #EF2D5E; intensity: 1; shadowBias: 0.01
light="castShadow: true; color: #EF2D5E; intensity: 1; shadowBias: 0.01;
shadowCameraNear: 1; type: point; shadowMapWidth: 1024; shadowMapHeight: 1024"
position="0 5 5"></a-entity>
</a-entity>
Expand Down

0 comments on commit 76904ca

Please sign in to comment.