move packer to kiri, mesh to own directory, normalize work/pool names

This commit is contained in:
Stewart Allen 2021-12-28 15:52:28 -05:00
commit 7176ab0822
11 changed files with 56 additions and 24 deletions

View file

@ -1,7 +0,0 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
"use strict";
(function() {
})();

View file

@ -1,10 +0,0 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
"use strict";
(function() {
// start worker pool
moto.client.start(`/code/mesh_pool?${gapp.version}`, moto.client.max());
})();

View file

@ -14,6 +14,11 @@ function $h(id, h) {
$(id).innerHTML = h;
}
function estop(evt) {
evt.stopPropagation();
evt.preventDefault();
}
(function() {
let DOC = document,
@ -27,7 +32,8 @@ function init() {
zoomrev = true,
zoomspd = 1,
space = moto.Space,
platform = space.platform;
platform = space.platform,
platcolor = 0x00ff00;
// setup default workspace
space.sky.set({
@ -49,6 +55,27 @@ function init() {
space.view.setZoom(zoomrev, zoomspd);
space.useDefaultKeys(true);
// add file drop handler
space.event.addHandlers(self, [
'drop', (evt) => {
estop(evt);
platform.setColor(platcolor);
load.File.load(evt.dataTransfer.files[0])
.then(data => {
console.log({data});
})
},
'dragover', (evt) => {
estop(evt);
evt.dataTransfer.dropEffect = 'copy';
let color = platform.setColor(0x00ff00);
if (color !== 0x00ff00) platcolor = color;
},
'dragleave', (evt) => {
platform.setColor(platcolor);
}
]);
// start worker
moto.client.start(`/code/mesh_work?${gapp.version}`);