update documentation

This commit is contained in:
Leon van Kammen 2023-10-12 17:58:02 +02:00
parent 8ee196fe14
commit b713a79bb8
4 changed files with 8 additions and 13 deletions

View File

@ -47,6 +47,7 @@
window.$ = (s) => document.querySelector(s)
window.notify = notify(window)
window.embed = embed
console.log = ( (log) => function(str){
if( String(str).match(/:.*#/) ) window.notify(str)
log(str)

View File

@ -54,18 +54,12 @@ export function setupConsole(el){
}
export function setupUrlBar(el,XRF){
var isIframe = document.location.hash.match(/embed=1/)
let ids = ['#overlay','a#embed','a#source','a#model']
let showButtons = () => {
ids.map( (i) => $(i).style.display = 'block' )
$('a#more').style.display = 'none'
}
if( isIframe ){
// show internal URL bar & backbuttons to test XR fragments interactively
showButtons()
}else{
$('a#more').addEventListener('click', () => showButtons() )
}
$('a#more').addEventListener('click', () => showButtons() )
XRF.addEventListener('updateHash', () => reflectUrl() )
const reflectUrl = (url) => el.value = url || document.location.search.substr(1) + document.location.hash

View File

@ -18,7 +18,7 @@
<a class="btn-foot" id="source" target="_blank" href="https://github.com/coderofsalvation/xrfragment-helloworld"> clone project</a>
<a class="btn-foot" id="embed" target="_blank" onclick="embed()">📺 embed</a>
<a class="btn-foot" id="model" target="_blank" href="index.gltf">⬇️ model</a>
<a class="btn-foot" id="more" target="_blank" href="index.gltf">XRF</a>
<a class="btn-foot" id="more" target="_blank" >XRF</a>
<textarea style="display:none"></textarea>
<script async src="./../../assets/js/alpine.min.js"></script>

File diff suppressed because one or more lines are too long