From c5d12868d600900f3ff20379146be37deedcb7f9 Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Fri, 2 Jun 2023 09:42:52 +0200 Subject: [PATCH] wip --- example/aframe/sandbox/index.html | 21 ++++++++++++++++++++- example/assets/css/style.css | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/example/aframe/sandbox/index.html b/example/aframe/sandbox/index.html index 6a36c2c..692b1ff 100644 --- a/example/aframe/sandbox/index.html +++ b/example/aframe/sandbox/index.html @@ -51,10 +51,29 @@ $('#home').setAttribute('xrf', document.location.search.substr(1)+document.location.hash ) $('a-scene').addEventListener('loaded', () => { + setupConsole( $('textarea') ) setupUrlBar( $('input#uri'), window.AFRAME.XRF ) - // add screenshot component with camera to capture proper equirects + // optional hook to prompt surfing to external asset + window.AFRAME.XRF.href = (xrf,v,opts) => { + let { mesh, model, camera, scene, renderer, THREE} = opts +alert("1") + let isExtern = v.string[0] != '#' + let notIsHome = v.string != $('#home').getAttribute("xrf") +// xrf(v,opts) // original init +// const exec = mesh.userData.XRF.href.exec +//console.dir(exec) +// mesh.userData.XRF.href.exec = (e) => { +// if( !renderer.xr.isPresenting && isExtern && notIsHome ){ +// if( !confirm("teleport to "+v.string+" ?") ) return +// } +// exec(e) +// } + } + + + // add screenshot component with camera to capture bigger size equirects $('a-scene').setAttribute("screenshot",{camera: "[camera]",width: 4096*2, height:2048*2}) if( window.outerWidth > 800 ) diff --git a/example/assets/css/style.css b/example/assets/css/style.css index 48f5750..95d80b3 100644 --- a/example/assets/css/style.css +++ b/example/assets/css/style.css @@ -75,7 +75,7 @@ input[type="submit"] { #overlay > #uri { display:none; height: 29px; - font-size: 14px; + font-size: 21px; position: absolute; left: 200px; top: 9px;