update documentation
This commit is contained in:
parent
8ee196fe14
commit
b713a79bb8
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
10
index.html
10
index.html
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue