This commit is contained in:
Leon van Kammen 2023-06-02 09:42:52 +02:00
parent 29b6a69576
commit c5d12868d6
2 changed files with 21 additions and 2 deletions

View File

@ -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 )

View File

@ -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;