diff --git a/index.html b/index.html index e2c6df7..3578a26 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - +
@@ -221,17 +221,29 @@ AFRAME.registerComponent('onemptypinch', { // changed from ondrop to be coherent function onHoveredChangeColor(){ console.log( "onHoveredChangeOpacity" ) - let target = document.getElementById('testboxpinch') - // could iterate over targets, see https://aframe.io/docs/1.5.0/components/cursor.html#configuring-the-cursor-through-the-raycaster-component - console.log ( "cursor-hovered?", target.states.includes( "cursor-hovered" ) ) - if ( target.states.includes( "cursor-hovered" ) ){ - console.log ( "yes, cursor-hovered" ) - target.setAttribute("material", "color", "green") - //target.setAttribute("color", "red") - document.getElementById('rig').setAttribute('position', "4 0 -3") - // bug on hand pinch, even while checking on world position, might have to see older commit - } + // iterate over targets + // see instead of teleportable https://aframe.io/docs/1.5.0/components/cursor.html#configuring-the-cursor-through-the-raycaster-component + Array.from( document.querySelectorAll(".teleportable") ).map( target => { + if ( target.states.includes( "cursor-hovered" ) ){ + target.setAttribute("material", "color", "magenta") // visited + document.getElementById('rig').setAttribute('position', target.getAttribute("position") ) + } + }) +} + +AFRAME.registerComponent('highlight-on-gaze', { + init: function(){ + this.el.setAttribute("opacity", .5) + }, + events: { + mouseenter: function (e) { + this.el.setAttribute("opacity", .8) + }, + mouseleave: function (e) { + this.el.setAttribute("opacity", .5) + } } +}); let page = "Wiki.VirtualRealityInterface"; // should do then only once graph loaded instead, should emit event @@ -258,8 +270,8 @@ setTimeout( _ => {