mesh css simplification
This commit is contained in:
parent
cbec4b2e87
commit
44933dd1b4
9 changed files with 115 additions and 141 deletions
13
app.js
13
app.js
|
|
@ -228,10 +228,10 @@ const script = {
|
||||||
"ext/three-svg",
|
"ext/three-svg",
|
||||||
"ext/jszip",
|
"ext/jszip",
|
||||||
"add/license",
|
"add/license",
|
||||||
"ext/clip2", // work.test
|
"ext/clip2",
|
||||||
"ext/tween",
|
"ext/tween",
|
||||||
"ext/fsave",
|
"ext/fsave",
|
||||||
"ext/earcut", // work.test
|
"ext/earcut",
|
||||||
"ext/base64",
|
"ext/base64",
|
||||||
"add/array",
|
"add/array",
|
||||||
"add/three",
|
"add/three",
|
||||||
|
|
@ -258,7 +258,7 @@ const script = {
|
||||||
"moto/load-url",
|
"moto/load-url",
|
||||||
"moto/load-file",
|
"moto/load-file",
|
||||||
"moto/broker",
|
"moto/broker",
|
||||||
"moto/db",
|
"moto/idb",
|
||||||
"kiri/ui",
|
"kiri/ui",
|
||||||
"kiri/do",
|
"kiri/do",
|
||||||
"kiri/lang",
|
"kiri/lang",
|
||||||
|
|
@ -421,7 +421,7 @@ const script = {
|
||||||
"moto/space",
|
"moto/space",
|
||||||
"moto/load-obj",
|
"moto/load-obj",
|
||||||
"moto/load-stl",
|
"moto/load-stl",
|
||||||
"moto/db",
|
"moto/idb",
|
||||||
"moto/ui",
|
"moto/ui",
|
||||||
"kiri/catalog",
|
"kiri/catalog",
|
||||||
"main/meta"
|
"main/meta"
|
||||||
|
|
@ -437,7 +437,6 @@ const script = {
|
||||||
"ext/fsave",
|
"ext/fsave",
|
||||||
"add/array",
|
"add/array",
|
||||||
"add/three",
|
"add/three",
|
||||||
"geo/mesh",
|
|
||||||
"moto/ctrl",
|
"moto/ctrl",
|
||||||
"moto/space",
|
"moto/space",
|
||||||
"moto/load-3mf",
|
"moto/load-3mf",
|
||||||
|
|
@ -447,7 +446,7 @@ const script = {
|
||||||
"moto/load-url",
|
"moto/load-url",
|
||||||
"moto/load-file",
|
"moto/load-file",
|
||||||
"moto/broker",
|
"moto/broker",
|
||||||
"moto/db"
|
"moto/idb"
|
||||||
],
|
],
|
||||||
mesh_work : [
|
mesh_work : [
|
||||||
"moto/worker",
|
"moto/worker",
|
||||||
|
|
@ -468,6 +467,8 @@ const script = {
|
||||||
"geo/polygon",
|
"geo/polygon",
|
||||||
"geo/polygons",
|
"geo/polygons",
|
||||||
"geo/mesh",
|
"geo/mesh",
|
||||||
|
"moto/broker",
|
||||||
|
"moto/idb"
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
let MOTO = self.moto = self.moto || {},
|
let moto = self.moto = self.moto || {},
|
||||||
time = function() { return new Date().getTime() },
|
time = function() { return new Date().getTime() },
|
||||||
restarting = false,
|
restarting = false,
|
||||||
running = {},
|
running = {},
|
||||||
|
|
@ -12,8 +12,10 @@ let MOTO = self.moto = self.moto || {},
|
||||||
worker = null,
|
worker = null,
|
||||||
seqid = 1;
|
seqid = 1;
|
||||||
|
|
||||||
|
if (moto.client) return;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Function} fn name of function in MOTO.worker
|
* @param {Function} fn name of function in moto.worker
|
||||||
* @param {Object} data to send to server
|
* @param {Object} data to send to server
|
||||||
* @param {Function} onreply function to call on reply messages
|
* @param {Function} onreply function to call on reply messages
|
||||||
* @param {Object[]} zerocopy array of objects to pass using zerocopy
|
* @param {Object[]} zerocopy array of objects to pass using zerocopy
|
||||||
|
|
@ -39,7 +41,7 @@ function send(fn, data, onreply, zerocopy) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// code is running in the browser / client context
|
// code is running in the browser / client context
|
||||||
let CLIENT = MOTO.client = {
|
let client = moto.client = {
|
||||||
send: send,
|
send: send,
|
||||||
|
|
||||||
// factory can be overridden
|
// factory can be overridden
|
||||||
|
|
@ -69,7 +71,7 @@ let CLIENT = MOTO.client = {
|
||||||
|
|
||||||
// same as restart
|
// same as restart
|
||||||
start: function(url) {
|
start: function(url) {
|
||||||
CLIENT.restart(url);
|
client.restart(url);
|
||||||
},
|
},
|
||||||
|
|
||||||
restart: function(url) {
|
restart: function(url) {
|
||||||
|
|
@ -78,7 +80,7 @@ let CLIENT = MOTO.client = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLIENT.stop();
|
client.stop();
|
||||||
|
|
||||||
restarting = true;
|
restarting = true;
|
||||||
|
|
||||||
|
|
@ -90,15 +92,20 @@ let CLIENT = MOTO.client = {
|
||||||
}
|
}
|
||||||
|
|
||||||
running = {};
|
running = {};
|
||||||
worker = CLIENT.newWorker(url);
|
worker = client.newWorker(url);
|
||||||
|
|
||||||
// bind to CLIENT to enable synth injections
|
// bind to client to enable synth injections
|
||||||
CLIENT.onmessage = worker.onmessage = function(e) {
|
client.onmessage = worker.onmessage = function(e) {
|
||||||
let now = time(),
|
let now = time(),
|
||||||
reply = e.data,
|
reply = e.data,
|
||||||
record = running[reply.seq],
|
record = running[reply.seq],
|
||||||
onreply = record ? record.fn : undefined;
|
onreply = record ? record.fn : undefined;
|
||||||
|
|
||||||
|
if (reply.register) {
|
||||||
|
// console.log({register: reply.register});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (reply.done) {
|
if (reply.done) {
|
||||||
delete running[reply.seq];
|
delete running[reply.seq];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (self.moto.Storage) return;
|
if (moto.IDB) return;
|
||||||
|
|
||||||
self.moto.Storage = Storage;
|
moto.IDB = moto.Storage = Storage;
|
||||||
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
|
// https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
|
||||||
|
|
||||||
|
|
@ -4,14 +4,9 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto = {};
|
||||||
if (self.moto.KV) return;
|
if (moto.KV) return;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {String} dbname
|
|
||||||
* @param {number} [version]
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function KV() {
|
function KV() {
|
||||||
this.__data__ = {};
|
this.__data__ = {};
|
||||||
this.__mem__ = true;
|
this.__mem__ = true;
|
||||||
|
|
@ -33,22 +28,18 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
KP.clear = function() {
|
KP.clear = function() {
|
||||||
var d = this.__data__, key;
|
this.__data__ = {};
|
||||||
for (key in d) {
|
|
||||||
if (d.hasOwnProperty(key)) {
|
|
||||||
delete d[key];
|
|
||||||
delete this[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
self.moto.KV = self.localStorage;
|
let KV = moto.KV = self.localStorage,
|
||||||
self.moto.KV.setItem('__test', 1);
|
testkey = '__test';
|
||||||
self.moto.KV.getItem('__test');
|
KV.setItem(testkey, 1);
|
||||||
|
KV.getItem(testkey);
|
||||||
|
KV.removeItem(testkey);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
self.moto.KV = new KV();
|
moto.KV = new KV();
|
||||||
let msg = "in private or restricted browsing mode. local storage blocked. application may not function.";
|
let msg = "in private or restricted browsing mode. local storage blocked. application may not function properly.";
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
alert(msg);
|
alert(msg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,29 +4,48 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
let MOTO = self.moto = self.moto || {},
|
let moto = self.moto = self.moto || {},
|
||||||
time = Date.now;
|
time = Date.now;
|
||||||
|
|
||||||
|
if (moto.worker) return;
|
||||||
|
|
||||||
// allow license to inject module
|
// allow license to inject module
|
||||||
self.gapp = self.gapp || MOTO;
|
self.gapp = self.gapp || moto;
|
||||||
|
|
||||||
|
let isinit = false;
|
||||||
|
let endpoints = {};
|
||||||
|
|
||||||
// code is running in the worker / server context
|
// code is running in the worker / server context
|
||||||
const dispatch = MOTO.worker = {
|
const dispatch = moto.worker = {
|
||||||
|
|
||||||
|
register: (name, fn) => {
|
||||||
|
endpoints[name] = fn;
|
||||||
|
sync(name);
|
||||||
|
},
|
||||||
|
|
||||||
send: (msg) => {
|
send: (msg) => {
|
||||||
self.postMessage(msg);
|
self.postMessage(msg);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sync: (name) => {
|
||||||
|
if (name) {
|
||||||
|
if (isinit) dispatch.send({register: [name]});
|
||||||
|
} else {
|
||||||
|
dispatch.send({register: Object.keys(endpoints)});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onmessage: (e) => {
|
onmessage: (e) => {
|
||||||
|
|
||||||
if (e.data === '--init--') {
|
if (e.data === '--init--') {
|
||||||
console.log('worker got init');
|
isinit = true;
|
||||||
|
dispatch.sync();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let time_recv = time(),
|
let time_recv = time(),
|
||||||
msg = e.data || {},
|
msg = e.data || {},
|
||||||
run = dispatch[msg.task],
|
run = endpoints[msg.task],
|
||||||
send = {
|
send = {
|
||||||
data : function(data,direct) {
|
data : function(data,direct) {
|
||||||
dispatch.send({
|
dispatch.send({
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Russo One';
|
font-family: 'Russo One';
|
||||||
src: url('ext/russo-one.ttf');
|
src: url('/moto/russo-one.ttf');
|
||||||
}
|
}
|
||||||
a, a:hover, a:visited {
|
a, a:hover, a:visited {
|
||||||
border: none;
|
border: none;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Russo One';
|
font-family: 'Russo One';
|
||||||
src: url('/kiri/ext/russo-one.ttf');
|
src: url('/moto/russo-one.ttf');
|
||||||
}
|
}
|
||||||
|
|
||||||
a, a:hover, a:visited {
|
a, a:hover, a:visited {
|
||||||
|
|
@ -19,7 +19,7 @@ a, a:hover, a:visited {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
body, div {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
@ -30,20 +30,24 @@ div {
|
||||||
#app {
|
#app {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-weight: normal;
|
flex-direction: column;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#app-info {
|
#app-info {
|
||||||
|
z-index: 50;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%) translateY(-50%);
|
transform: translateX(-50%) translateY(-50%);
|
||||||
z-index: 50;
|
cursor: pointer;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#app-info:hover #app-vers {
|
#app-info:hover #app-vers {
|
||||||
|
|
@ -67,24 +71,58 @@ div {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
#app-info {
|
#app-body {
|
||||||
cursor: pointer;
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app-body > div {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#curtain {
|
||||||
|
z-index: 50000;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
position: fixed;
|
||||||
|
background-color: #fff;
|
||||||
|
font-family: 'Russo One', sans-serif;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container {
|
||||||
|
z-index: 1;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container canvas {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top {
|
||||||
|
z-index: 2;
|
||||||
|
padding: 3px;
|
||||||
|
flex-direction: row;
|
||||||
|
font-family: 'Russo One', sans-serif;
|
||||||
|
background-color: rgba(255,255,255,0.75);
|
||||||
|
}
|
||||||
|
|
||||||
|
#top > div {
|
||||||
|
margin: 0 5px 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-sep {
|
#top-sep {
|
||||||
z-index: 14;
|
z-index: 2;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background-image: var(--gradbar);
|
background-image: var(--gradbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
#loading {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
padding-right: 15px;
|
|
||||||
position: fixed;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.noselect {
|
.noselect {
|
||||||
-khtml-user-select: none;
|
-khtml-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
|
|
@ -92,52 +130,6 @@ div {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hide {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
.noshow {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.grid {
|
|
||||||
display: grid;
|
|
||||||
}
|
|
||||||
.f-row {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
.f-col {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.grow {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
.a-start {
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
.a-center {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.a-end {
|
|
||||||
align-items: flex-end;
|
|
||||||
}
|
|
||||||
.a-stretch {
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
.j-start {
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
.j-center {
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.j-end {
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
.center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.russo {
|
|
||||||
font-family: 'Russo One', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
:-moz-any() {
|
:-moz-any() {
|
||||||
overflow-x: hidden !important;
|
overflow-x: hidden !important;
|
||||||
overflow-y: hidden !important;
|
overflow-y: hidden !important;
|
||||||
|
|
@ -148,38 +140,3 @@ div {
|
||||||
margin-right: -14px !important;
|
margin-right: -14px !important;
|
||||||
margin-bottom: -14px !important;
|
margin-bottom: -14px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#curtain {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
position: fixed;
|
|
||||||
background-color: #fff;
|
|
||||||
font-family: 'Russo One', sans-serif;
|
|
||||||
z-index: 50000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#container {
|
|
||||||
position: fixed;
|
|
||||||
z-index: -1;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#container canvas {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#top {
|
|
||||||
font-family: 'Russo One', sans-serif;
|
|
||||||
background-color: rgba(255,255,255,0.75);
|
|
||||||
padding: 3px;
|
|
||||||
z-index: 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
#top > div {
|
|
||||||
margin: 0 5px 0 5px;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -6,29 +6,28 @@
|
||||||
<meta name="keywords" content="3d,mesh,editor,stl,obj,3mf" />
|
<meta name="keywords" content="3d,mesh,editor,stl,obj,3mf" />
|
||||||
<meta name="copyright" content="stewart allen [sa@grid.space]">
|
<meta name="copyright" content="stewart allen [sa@grid.space]">
|
||||||
<meta name="description" content="Browser-based 3D Mesh Editor">
|
<meta name="description" content="Browser-based 3D Mesh Editor">
|
||||||
<meta property="og:description" content="Mesh:Tool is browser-based 3D Mesh Editor">
|
<meta property="og:description" content="Mesh:Tool is a browser-based 3D Mesh Editor">
|
||||||
<meta property="og:title" content="Browser-based 3D Mesh Editor">
|
<meta property="og:title" content="Browser-based Mesh Editor">
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
<meta property="og:url" content="https://grid.space/mesh/">
|
<meta property="og:url" content="https://grid.space/mesh/">
|
||||||
<meta property="og:image" content="https://static.grid.space/img/logo_km_og.png">
|
|
||||||
<title>Mesh:Tool</title>
|
<title>Mesh:Tool</title>
|
||||||
<link rel="icon" href="/kiri/favicon.ico">
|
<link rel="icon" href="/mesh/favicon.ico">
|
||||||
<link rel="apple-touch-icon" href="/kiri/favicon-mobile.png">
|
|
||||||
<link rel="stylesheet" type="text/css" href="/mesh/index.css?{{version}}">
|
<link rel="stylesheet" type="text/css" href="/mesh/index.css?{{version}}">
|
||||||
<link href="/font/css/all.min.css" rel="stylesheet">
|
<link href="/font/css/all.min.css" rel="stylesheet">
|
||||||
<script src="/font/js/all.min.js" crossorigin="anonymous"></script>
|
<script src="/font/js/all.min.js" crossorigin="anonymous"></script>
|
||||||
<script src="/code/mesh.js?{{version}}"></script>
|
<script src="/code/mesh.js?{{version}}"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app" class="f-col">
|
<div id="app">
|
||||||
<div id="curtain" class="j-center a-center"><img id="loading"/>loading...</div>
|
<div id="curtain"><img id="loading"/>loading...</div>
|
||||||
<div id="container"></div>
|
<div id="container"></div>
|
||||||
<div id="top" class="f-row">
|
<div id="top">
|
||||||
<div id="app-info" class="f-col a-center">
|
<div id="app-info">
|
||||||
<div><div id="app-name"></div><div id="app-vers">version</div></div>
|
<div id="app-name"></div><div id="app-vers">version</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="top-sep"></div>
|
<div id="top-sep"></div>
|
||||||
|
<div id="app-body"></div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue