fixed tests + included git tag version

This commit is contained in:
Leon van Kammen 2023-12-06 21:39:04 +01:00
parent 28f349775d
commit a12a142f24
7 changed files with 41 additions and 173291 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*
* generated at $(date)
* v0.5.1 generated at Wed Dec 6 09:38:34 PM CET 2023
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
@ -2929,31 +2929,26 @@ AFRAME.registerComponent('xrf-gaze',{
material="color: #BBBBBB; shader: flat">
</a-entity>`
}else{
//if( document.querySelector('[cursor]') )
// document.querySelector('[cursor]').setAttribute("visible",false)
if( document.querySelector('[cursor]') ) {
document.querySelector('[cursor]').setAttribute("visible",false)
}
}
},
init:function(data){
this.immersive = false;
this.log = ""
let enabled = () => AFRAME.utils.device.isMobile()
let setVisible = () => {
let cursor = document.querySelector('[cursor]')
if( cursor ) cursor.setAttribute('visible', enabled() )
let setVisible = (state) => {
this.log += state ? ">true" :">false"
alert(this.log)
if( enabled() ) setGazer(state)
}
this.setGazer(enabled())
setVisible();
setVisible(false);
document.querySelector("a-scene").addEventListener('exit-vr', () => {
this.immersive = false;
setVisible()
})
document.querySelector("a-scene").addEventListener('enter-vr', () => {
this.immersive = true;
setVisible()
if( !document.querySelector("#cursor") ) return
})
document.querySelector("a-scene").addEventListener('exit-vr', () => setVisible(false) )
document.querySelector("a-scene").addEventListener('enter-vr', () => setVisible(true) )
document.querySelector("a-scene").addEventListener('exit-ar', () => setVisible(false) )
document.querySelector("a-scene").addEventListener('enter-ar', () => setVisible(true) )
let highlightMesh = (state) => (e) => {
if( !e.target.object3D ) return

105
dist/xrfragment.all.js vendored
View File

@ -1,105 +0,0 @@
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
/*
* generated at $(date)
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/

172825
dist/xrfragment.module.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* generated at $(date)
* v0.5.1 generated at Wed Dec 6 09:38:34 PM CET 2023
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/

View File

@ -1,5 +1,5 @@
/*
* generated at $(date)
* v0.5.1 generated at Wed Dec 6 09:38:34 PM CET 2023
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/

12
make
View File

@ -1,6 +1,5 @@
#!/bin/sh
set -e
try(){ set +e; "$@" 2>/dev/null; set -e; }
trace(){ set -x; "$@"; set +x; }
@ -81,13 +80,14 @@ build(){
cat dist/xrfragment.three.js > dist/xrfragment.three.module.js
echo "export default xrf;" >> dist/xrfragment.three.module.js
# convert ESM to normal browser js
sed 's/export //g' example/assets/js/utils.js > dist/utils.js
# add AFRAME
cat dist/xrfragment.three.js \
dist/utils.js \
src/3rd/js/aframe/*.js \
example/assets/js/qr.js > dist/xrfragment.aframe.js
# convert ESM to normal browser js
sed 's/export //g' example/assets/js/utils.js > dist/utils.js
# fat all-in-one standalone xrf release
test -f /tmp/xrf-aframe.js || {
@ -95,13 +95,13 @@ build(){
wget "https://cdn.jsdelivr.net/npm/aframe-blink-controls/dist/aframe-blink-controls.min.js" -O /tmp/xrf-blink.js
for i in /tmp/xrf-*.js; do echo -e "\n" >> $i; done # add extra linebreak to prevent bundle issues
}
cat /tmp/xrf-*.js dist/xrfragment.aframe.js dist/utils.js > dist/xrfragment.aframe.all.js
cat /tmp/xrf-*.js dist/xrfragment.aframe.js > dist/xrfragment.aframe.all.js
# add license headers
for file in dist/xrfragment.{aframe,module,three,three.module,all}.js; do
for file in dist/xrfragment.{aframe,module,three,three.module,aframe.all}.js; do
awk 'BEGIN{
print "/*"
print " * generated at $(date)"
print " * '"$(git tag)"' generated at '"$(date)"'"
print " * https://xrfragment.org"
print " * SPDX-License-Identifier: MPL-2.0"
print " */"