Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
arcs.js
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Yves Didier
2021-12-11 18:31:14 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0cd1496ae924ba9a645d787f9aae8d90ef46f4f2
0cd1496a
1 parent
68283968
added dependencies and qr detector
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
3 deletions
build/arcs.js
components/qrcodedetector.js
deps/jsqr/worker.js
package.json
tests/loop/webpack.config.js
webpack.config.js
build/arcs.js
View file @
0cd1496
/******/
"use strict"
;
/******/
var
__webpack_modules__
=
([
/* 0 */
/***/
((
__unused_webpack_module
,
__webpack_exports__
,
__webpack_require__
)
=>
{
...
...
components/qrcodedetector.js
0 → 100644
View file @
0cd1496
import
ARCS
from
'../build/arcs.js'
;
let
QRCodeDetector
;
QRCodeDetector
=
ARCS
.
Componenent
.
create
(
function
()
{
let
busy
=
false
;
let
dataCache
=
null
;
const
worker
=
new
Worker
(
"../deps/jsqr/worker.js"
);
worker
.
addEventListener
(
"message"
,
({
data
}
=>
{
busy
=
false
;
dataCache
=
data
;
});
this
.
detect
(
imageData
)
{
if
(
!
busy
)
{
busy
=
true
;
worker
.
postMessage
(
imageData
);
}
if
(
dataCache
!==
null
)
{
this
.
emit
(
'onQRCode'
,
dataCache
);
}
};
},
[
'detect'
],
[
'onQRCode'
]
);
export
default
{
QRCodeDetector
:
QRCodeDetector
};
deps/jsqr/worker.js
0 → 100644
View file @
0cd1496
import
jsQR
from
'./jsQR.js'
;
self
.
addEventListener
(
"message"
,
e
=>
{
const
obj
=
e
.
data
;
const
qrData
=
jsQR
(
obj
.
data
,
obj
.
width
,
obj
.
height
);
self
.
postMessage
(
qrData
);
});
package.json
View file @
0cd1496
...
...
@@ -35,7 +35,9 @@
"js-aruco"
:
">=0.1"
,
"three"
:
">=0.131"
,
"tracking"
:
">=1.1.3"
,
"webpack"
:
"^5.51.1"
"webpack"
:
"^5.51.1"
,
"jsqr"
:
"^1.4.0"
,
"html2canvas"
:
"^1.3.3"
},
"devDependencies"
:
{
"copy-webpack-plugin"
:
"^9.0.1"
,
...
...
tests/loop/webpack.config.js
View file @
0cd1496
...
...
@@ -3,7 +3,7 @@ const path=require('path');
module
.
exports
=
{
entry
:
'./arcsapp.json'
,
mode
:
"
none
"
,
mode
:
"
production
"
,
output
:
{
path
:
path
.
resolve
(
__dirname
,
''
),
...
...
webpack.config.js
View file @
0cd1496
...
...
@@ -89,8 +89,10 @@ module.exports = [
plugins
:
[
new
copy
({
patterns
:
[
{
from
:
'node_modules/html2canvas/dist/html2canvas.min.js'
,
to
:
'../deps/html2canvas/html2canvas.min.js'
},
{
from
:
'node_modules/jsqr/dist/jsQR.js'
,
to
:
'../deps/jsqr/jsQR.js'
},
{
from
:
'node_modules/tracking/build/tracking.js'
,
to
:
'../deps/tracking/tracking.js'
},
{
from
:
'node_modules/three/build/three.module.js'
,
to
:
'../deps/three.js/index.js'
},
{
from
:
'node_modules/three/build/three.module.js'
,
to
:
'../deps/three.js/index.js'
},
{
from
:
'node_modules/three/examples/jsm/loaders/OBJLoader.js'
,
to
:
'../deps/objloader/index.js'
,
...
...
@@ -122,6 +124,16 @@ module.exports = [
}
},
{
from
:
'node_modules/three/examples/jsm/webxr/ARButton.js'
,
to
:
'../deps/three.js/ARButton.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
().
replace
(
'../../../build/three.module.js'
,
'./index.js'
));
}
},
{
from
:
'node_modules/js-aruco/src/aruco.js'
,
to
:
'../deps/aruco/index.js'
,
transform
:
function
(
content
,
path
)
{
...
...
Please
register
or
login
to post a comment