diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js new file mode 100644 index 00000000..36fe6510 --- /dev/null +++ b/extensions/LazyTong/Cube.js @@ -0,0 +1,1810 @@ +const t = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDgwIDgwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjxzdHlsZT4uYXtmaWxsOiNlNjJ9LmJ7ZmlsbDojNmMwfS5je2ZpbGw6IzYzNn0uZHtmaWxsOiNlZDB9LmV7ZmlsbDojMzkwfTwvc3R5bGU+PHBhdGggY2xhc3M9ImEiIGQ9Im0xMS43IDIyLjNsMjguNi0xMy40djM1LjJsLTI4LjYgMTMuM3oiLz48cGF0aCBjbGFzcz0iYiIgZD0ibTY4LjMgMjIuNmwtMjgtMTMuN3YzNS4ybDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+'; +void (window.tempExt = { + Extension: class { + constructor(e) { + console.log("%cLazyTong's Cube\n----------\n    ▃▆█▇▄▖\n      ▟◤▖   ◥█▎\n   ◢◤  ▐     ▐▉\n  ▗◤   ▂ ▗▖  ▕█▎\n ◤ ▗▅▖◥▄ ▀◣  █▊\n▐ ▕▎◥▖◣◤    ◢██\n█◣ ◥▅█▀    ▐██◤\n▐█▙▂    ◢██◤\n◥██◣    ◢▄◤\n   ▀██▅▇▀\n----------\nVer 1.2\nhttps://lt.js.org ", 'color:green;font-weight:bolder'); + this.instances = {}, this.runtime = e, this.canvas = () => { + try { + const { + canvas: e + } = this.runtime.renderer; + if (e instanceof HTMLCanvasElement) return e + } catch (e) { + return null + } + return null + }, this.parentElement = () => { + try { + const { + canvas: e + } = this.runtime.renderer; + if (e instanceof HTMLCanvasElement) return e.parentElement + } catch (e) { + console.log(e); + return null + } + return null + }, this.renderer = function () { + let tau = 2 * Math.PI, + extend = function (e, t) { + for (let a in t) e[a] = t[a]; + return e + }, + lerp = function (e, t, a) { + return (t - e) * a + e + }, + modulo = function (a, e) { + return (a % e + e) % e + }, + s = function () { + }, + canvasRenderer = {}; + canvasRenderer.begin = function (e) { + e.beginPath() + }, canvasRenderer.move = function (e, t, a) { + e.moveTo(a.x, a.y) + }, canvasRenderer.line = function (e, t, a) { + e.lineTo(a.x, a.y) + }, canvasRenderer.bezier = function (a, r, o, d, e) { + a.bezierCurveTo(o.x, o.y, d.x, d.y, e.x, e.y) + }, canvasRenderer.closePath = function (e) { + e.closePath() + }, canvasRenderer.setPath = function () { + }, canvasRenderer.renderPath = function (d, a, t, r) { + this.begin(d, a), t.forEach(function (e) { + e.render(d, a, canvasRenderer) + }), r && this.closePath(d, a) + }, canvasRenderer.stroke = function (a, r, o, d, e) { + o && (a.strokeStyle = d, a.lineWidth = e, a.stroke()) + }, canvasRenderer.fill = function (t, a, r, o) { + r && (t.fillStyle = o, t.fill()) + }, canvasRenderer.end = function () { + }; + let vector = function (e) { + this.set(e) + }; + vector.prototype.set = function (e) { + return this.x = e && e.x || 0, this.y = e && e.y || 0, this.z = e && e.z || 0, this + }, vector.prototype.write = function (e) { + return e ? (this.x = null == e.x ? this.x : e.x, this.y = null == e.y ? this.y : e.y, this.z = null == e.z ? this.z : e.z, this) : this + }, vector.prototype.rotate = function (e) { + if (e) return this.rotateZ(e.z), this.rotateY(e.y), this.rotateX(e.x), this + }, vector.prototype.rotateZ = function (e) { + R(this, e, 'x', 'y') + }, vector.prototype.rotateX = function (e) { + R(this, e, 'y', 'z') + }, vector.prototype.rotateY = function (e) { + R(this, e, 'x', 'z') + }; + let R = function (T, l, a, e) { + if (l && 0 !== l % tau) { + let t = Math.cos(l), + r = Math.sin(l), + o = T[a], + d = T[e]; + T[a] = o * t - d * r, T[e] = d * t + o * r + } + }; + vector.prototype.isSame = function (e) { + return !!e && this.x === e.x && this.y === e.y && this.z === e.z + }, vector.prototype.add = function (e) { + return e ? (this.x += e.x || 0, this.y += e.y || 0, this.z += e.z || 0, this) : this + }, vector.prototype.subtract = function (e) { + return e ? (this.x -= e.x || 0, this.y -= e.y || 0, this.z -= e.z || 0, this) : this + }, vector.prototype.multiply = function (e) { + return null == e ? this : ('number' == typeof e ? (this.x *= e, this.y *= e, this.z *= e) : (this.x *= null == e.x ? 1 : e.x, this.y *= null == e.y ? 1 : e.y, this.z *= null == e.z ? 1 : e.z), this) + }, vector.prototype.transform = function (e, t, a) { + return this.multiply(a), this.rotate(t), this.add(e), this + }, vector.prototype.lerp = function (a, e) { + return this.x = lerp(this.x, a.x || 0, e), this.y = lerp(this.y, a.y || 0, e), this.z = lerp(this.z, a.z || 0, e), this + }, vector.prototype.magnitude = function () { + let e = this.x * this.x + this.y * this.y + this.z * this.z; + return u(e) + }; + let u = function (e) { + return 1e-8 > Math.abs(e - 1) ? 1 : Math.sqrt(e) + }; + vector.prototype.magnitude2d = function () { + let e = this.x * this.x + this.y * this.y; + return u(e) + }, vector.prototype.copy = function () { + return new vector(this) + }; + let onePoint = { + x: 1, + y: 1, + z: 1 + }, + anchor = function (e) { + this.create(e || {}) + }; + anchor.prototype.create = function (e) { + this.children = [], extend(this, this.constructor.defaults), this.setOptions(e), this.translate = new vector(e.translate), this.rotate = new vector(e.rotate), this.scale = new vector(onePoint).multiply(this.scale), this.origin = new vector, this.renderOrigin = new vector, this.addTo && this.addTo.addChild(this) + }, anchor.defaults = {}, anchor.optionKeys = Object.keys(anchor.defaults).concat(['rotate', 'translate', 'scale', 'addTo']), anchor.prototype.setOptions = function (e) { + let t = this.constructor.optionKeys; + for (let a in e) -1 !== t.indexOf(a) && (this[a] = e[a]) + }, anchor.prototype.addChild = function (e) { + -1 !== this.children.indexOf(e) || (e.remove(), e.addTo = this, this.children.push(e)) + }, anchor.prototype.removeChild = function (a) { + let e = this.children.indexOf(a); + -1 !== e && this.children.splice(e, 1) + }, anchor.prototype.remove = function () { + this.addTo && this.addTo.removeChild(this) + }, anchor.prototype.update = function () { + this.reset(), this.children.forEach(function (e) { + e.update() + }), this.transform(this.translate, this.rotate, this.scale) + }, anchor.prototype.reset = function () { + this.renderOrigin.set(this.origin) + }, anchor.prototype.transform = function (t, a, r) { + this.renderOrigin.transform(t, a, r), this.children.forEach(function (o) { + o.transform(t, a, r) + }) + }, anchor.prototype.updateGraph = function () { + this.update(), this.updateFlatGraph(), this.flatGraph.forEach(function (e) { + e.updateSortValue() + }), this.flatGraph.sort(anchor.shapeSorter) + }, anchor.shapeSorter = function (a, e) { + return a.sortValue - e.sortValue + }, Object.defineProperty(anchor.prototype, 'flatGraph', { + get: function () { + return this._flatGraph || this.updateFlatGraph(), this._flatGraph + }, + set: function (e) { + this._flatGraph = e + } + }), anchor.prototype.updateFlatGraph = function () { + this.flatGraph = this.getFlatGraph() + }, anchor.prototype.getFlatGraph = function () { + let e = [this]; + return this.addChildFlatGraph(e) + }, anchor.prototype.addChildFlatGraph = function (e) { + return this.children.forEach(function (t) { + let a = t.getFlatGraph(); + Array.prototype.push.apply(e, a) + }), e + }, anchor.prototype.updateSortValue = function () { + this.sortValue = this.renderOrigin.z + }, anchor.prototype.render = function () { + }, anchor.prototype.renderGraphCanvas = function (a) { + if (!a) console.error('Cube: 未提供渲染上下文'); + this.flatGraph.forEach(function (e) { + e.render(a, canvasRenderer) + }) + }, anchor.prototype.copy = function (e) { + let a = {}, + r = this.constructor.optionKeys; + r.forEach(function (e) { + a[e] = this[e] + }, this), extend(a, e); + let o = this.constructor; + return new o(a) + }, anchor.prototype.copyGraph = function (e) { + let a = this.copy(e); + return this.children.forEach(function (e) { + e.copyGraph({ + addTo: a + }) + }), a + }, anchor.prototype.normalizeRotate = function () { + this.rotate.x = modulo(this.rotate.x, tau), this.rotate.y = modulo(this.rotate.y, tau), this.rotate.z = modulo(this.rotate.z, tau) + }; + let d = function (e) { + return function (a) { + let r = function (e) { + this.create(e || {}) + }; + return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.defaults = extend({}, e.defaults), extend(r.defaults, a), r.optionKeys = e.optionKeys.slice(0), Object.keys(r.defaults).forEach(function (t) { + 1 !== !r.optionKeys.indexOf(t) && r.optionKeys.push(t) + }), r.subclass = d(r), r + } + }; + anchor.subclass = d(anchor); + let T = 'undefined' != typeof window, + e = 'mousedown', + k = 'mousemove', + S = 'mouseup'; + T && (window.PointerEvent ? (e = 'pointerdown', k = 'pointermove', S = 'pointerup') : 'ontouchstart' in window && (e = 'touchstart', k = 'touchmove', S = 'touchend')); + let dragger = function (e) { + this.create(e || {}) + }; + dragger.prototype.create = function (t) { + this.onDragStart = t.onDragStart || s, this.onDragMove = t.onDragMove || s, this.onDragEnd = t.onDragEnd || s, this.bindDrag(t.startElement) + }, dragger.prototype.bindDrag = function (t) { + t = this.getQueryElement(t), t && (t.style.touchAction = 'none', t.addEventListener(e, this)) + }, dragger.prototype.getQueryElement = function (e) { + return 'string' == typeof e && (e = document.querySelector(e)), e + }, dragger.prototype.handleEvent = function (a) { + let e = this['on' + a.type]; + e && e.call(this, a) + }, dragger.prototype.onmousedown = dragger.prototype.onpointerdown = function (e) { + this.dragStart(e, e) + }, dragger.prototype.ontouchstart = function (e) { + this.dragStart(e, e.changedTouches[0]) + }, dragger.prototype.dragStart = function (e, t) { + e.preventDefault(), this.dragStartX = t.pageX, this.dragStartY = t.pageY, T && (window.addEventListener(k, this), window.addEventListener(S, this)), this.onDragStart(t) + }, dragger.prototype.ontouchmove = function (e) { + this.dragMove(e, e.changedTouches[0]) + }, dragger.prototype.onmousemove = dragger.prototype.onpointermove = function (e) { + this.dragMove(e, e) + }, dragger.prototype.dragMove = function (t, a) { + t.preventDefault(); + let r = a.pageX - this.dragStartX, + o = a.pageY - this.dragStartY; + this.onDragMove(a, r, o) + }, dragger.prototype.onmouseup = dragger.prototype.onpointerup = dragger.prototype.ontouchend = dragger.prototype.dragEnd = function () { + window.removeEventListener(k, this), window.removeEventListener(S, this), this.onDragEnd() + }; + let init = anchor.subclass({ + element: void 0, + centered: true, + zoom: 1, + dragRotate: false, + resize: false, + onPrerender: s, + onDragStart: s, + onDragMove: s, + onDragEnd: s, + onResize: s + }); + extend(init.prototype, dragger.prototype), init.prototype.create = function (e) { + anchor.prototype.create.call(this, e), dragger.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) + }, init.prototype.setElement = function (e) { + if (!this.element) console.error('Cube: 未指定元素'); + this.setCanvas(e) + }, init.prototype.setSize = function (e, t) { + e = Math.round(e), t = Math.round(t), this.setSizeCanvas(e, t) + }, init.prototype.setResize = function (e) { + this.resize = e, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), e ? (window.addEventListener('resize', this.resizeListener), this.onWindowResize()) : window.removeEventListener('resize', this.resizeListener) + }, init.prototype.onWindowResize = function () { + this.setMeasuredSize(), this.onResize(this.width, this.height) + }, init.prototype.setMeasuredSize = function () { + let t, a, e = 'fullscreen' === this.resize; + if (e) t = window.innerWidth, a = window.innerHeight; + else { + let r = this.element.getBoundingClientRect(); + t = r.width, a = r.height + } + this.setSize(t, a) + }, init.prototype.renderGraph = function (e) { + this.renderGraphCanvas(e) + }, init.prototype.updateRenderGraph = function (e) { + this.updateGraph(), this.renderGraph(e) + }, init.prototype.setCanvas = function (e) { + this.element = e, this.ctx = this.element.getContext('2d'), this.setSizeCanvas(e.width, e.height) + }, init.prototype.setSizeCanvas = function (t, a) { + this.width = t, this.height = a; + let r = this.pixelRatio = window.devicePixelRatio || 1; + this.element.width = this.canvasWidth = t * r, this.element.height = this.canvasHeight = a * r; + let o = 1 < r && !this.resize; + o && (this.element.style.width = t + 'px', this.element.style.height = a + 'px') + }, init.prototype.renderGraphCanvas = function (e) { + e = e || this, this.prerenderCanvas(), anchor.prototype.renderGraphCanvas.call(e, this.ctx), this.postrenderCanvas() + }, init.prototype.prerenderCanvas = function () { + let r = this.ctx; + if (r.lineCap = 'round', r.lineJoin = 'round', r.clearRect(0, 0, this.canvasWidth, this.canvasHeight), r.save(), this.centered) { + let e = this.width / 2 * this.pixelRatio, + t = this.height / 2 * this.pixelRatio; + r.translate(e, t) + } + let t = this.pixelRatio * this.zoom; + r.scale(t, t), this.onPrerender(r) + }, init.prototype.postrenderCanvas = function () { + this.ctx.restore() + }, init.prototype.setDragRotate = function (e) { + e && (true === e && (e = this), this.dragRotate = e, this.bindDrag(this.element)) + }, init.prototype.dragStart = function () { + this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, dragger.prototype.dragStart.apply(this, arguments) + }, init.prototype.dragMove = function (r, o) { + let d = o.pageX - this.dragStartX, + e = o.pageY - this.dragStartY, + t = Math.min(this.width, this.height); + this.dragRotate.rotate.x = this.dragStartRX - e / t * tau, this.dragRotate.rotate.y = this.dragStartRY - d / t * tau, dragger.prototype.dragMove.apply(this, arguments) + }; + let D = function (e) { + return e instanceof vector ? e : new vector(e) + }, M = function (e) { + return new vector(e) + }, w = function (e, t) { + this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], 'arc' === e && (this.controlPoints = [new vector, new vector]) + }; + w.prototype.reset = function () { + let t = this.points; + this.renderPoints.forEach(function (a, r) { + let o = t[r]; + a.set(o) + }) + }, w.prototype.transform = function (t, a, r) { + this.renderPoints.forEach(function (o) { + o.transform(t, a, r) + }) + }, w.prototype.render = function (e, t, a) { + return this[this.method](e, t, a) + }, w.prototype.move = function (e, t, a) { + return a.move(e, t, this.renderPoints[0]) + }, w.prototype.line = function (e, t, a) { + return a.line(e, t, this.renderPoints[0]) + }, w.prototype.bezier = function (r, o, d) { + let l = this.renderPoints[0], + e = this.renderPoints[1], + t = this.renderPoints[2]; + return d.bezier(r, o, l, e, t) + }; + let V = 9 / 16; + w.prototype.arc = function (d, p, T) { + let l = this.previousPoint, + e = this.renderPoints[0], + t = this.renderPoints[1], + a = this.controlPoints[0], + r = this.controlPoints[1]; + return a.set(l).lerp(e, V), r.set(t).lerp(e, V), T.bezier(d, p, a, r, t) + }; + let custom = anchor.subclass({ + stroke: 1, + fill: false, + color: '#333', + closed: true, + visible: true, + path: [{}], + front: { + z: 1 + }, + backface: true + }); + custom.prototype.create = function (e) { + this.path = e.path; + anchor.prototype.create.call(this, e); + this.updatePath(); + this.front = new vector(e.front || this.front); + this.renderFront = new vector(this.front); + this.renderNormal = new vector + }; + let m = ['move', 'line', 'bezier', 'arc']; + custom.prototype.updatePath = function () { + this.setPath(), this.updatePathCommands() + }, custom.prototype.setPath = function () { + }, custom.prototype.updatePathCommands = function () { + this.pathCommands = this.path.map(function (r, o) { + let d = Object.keys(r), + e = d[0], + T = r[e], + n = 1 === d.length && -1 !== m.indexOf(e); + n || (e = 'line', T = r); + let c = 'line' === e || 'move' === e, + i = Array.isArray(T); + c && !i && (T = [T]), e = 0 === o ? 'move' : e; + return new w(e, T) + }) + }, custom.prototype.reset = function () { + this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function (e) { + e.reset() + }) + }, custom.prototype.transform = function (t, a, r) { + this.renderOrigin.transform(t, a, r), this.renderFront.transform(t, a, r), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function (o) { + o.transform(t, a, r) + }), this.children.forEach(function (o) { + o.transform(t, a, r) + }) + }, custom.prototype.updateSortValue = function () { + let t = this.pathCommands.length, + a = this.pathCommands[0].endRenderPoint, + o = this.pathCommands[t - 1].endRenderPoint, + e = 2 < t && a.isSame(o); + e && (t -= 1); + let d = 0; + for (let a = 0; a < t; a++) d += this.pathCommands[a].endRenderPoint.z; + this.sortValue = d / t + }, custom.prototype.render = function (e, t) { + let a = this.pathCommands.length; + if (this.visible && a && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { + if (!t) console.error('Cube: 未提供渲染器'); + 1 === a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) + } + }, custom.prototype.renderCanvasDot = function (t) { + let a = this.getLineWidth(); + if (a) { + t.fillStyle = this.getRenderColor(); + let r = this.pathCommands[0].endRenderPoint; + t.beginPath(), t.arc(r.x, r.y, a / 2, 0, tau), t.fill() + } + }, custom.prototype.getLineWidth = function () { + return this.stroke ? true === this.stroke ? 1 : this.stroke : 0 + }, custom.prototype.getRenderColor = function () { + let a = 'string' == typeof this.backface && this.isFacingBack; + return a ? this.backface : this.color + }, custom.prototype.renderPath = function (r, o) { + let d, l = 2 === this.pathCommands.length && 'line' === this.pathCommands[1].method, + e = !l && this.closed, + t = this.getRenderColor(); + o.renderPath(r, d, this.pathCommands, e), o.stroke(r, d, this.stroke, t, this.getLineWidth()), o.fill(r, d, this.fill, t), o.end(r, d) + }; + let y = anchor.subclass({ + updateSort: false, + visible: true + }); + y.prototype.updateSortValue = function () { + let r = 0; + this.flatGraph.forEach(function (e) { + e.updateSortValue(), r += e.sortValue + }), this.sortValue = r / this.flatGraph.length, this.updateSort && this.flatGraph.sort(anchor.shapeSorter) + }, y.prototype.render = function (e, t) { + this.visible && this.flatGraph.forEach(function (a) { + a.render(e, t) + }) + }, y.prototype.updateFlatGraph = function () { + this.flatGraph = this.addChildFlatGraph([]) + }, y.prototype.getFlatGraph = function () { + return [this] + }; + let rect = custom.subclass({ + width: 1, + height: 1 + }); + rect.prototype.setPath = function () { + let a = this.width / 2, + e = this.height / 2; + this.path = [{ + x: -a, + y: -e + }, { + x: a, + y: -e + }, { + x: a, + y: e + }, { + x: -a, + y: e + }] + }; + let roundedRect = custom.subclass({ + width: 1, + height: 1, + cornerRadius: .25, + closed: false + }); + roundedRect.prototype.setPath = function () { + let o = this.width / 2, + d = this.height / 2, + l = Math.min(o, d), + p = Math.min(this.cornerRadius, l), + e = o - p, + t = d - p, + a = [{ + x: e, + y: -d + }, { + arc: [{ + x: o, + y: -d + }, { + x: o, + y: -t + }] + }]; + t && a.push({ + x: o, + y: t + }), a.push({ + arc: [{ + x: o, + y: d + }, { + x: e, + y: d + }] + }), e && a.push({ + x: -e, + y: d + }), a.push({ + arc: [{ + x: -o, + y: d + }, { + x: -o, + y: t + }] + }), t && a.push({ + x: -o, + y: -t + }), a.push({ + arc: [{ + x: -o, + y: -d + }, { + x: -e, + y: -d + }] + }), e && a.push({ + x: e, + y: -d + }), this.path = a + }; + let ellipse = custom.subclass({ + diameter: 1, + width: void 0, + height: void 0, + quarters: 4, + closed: false + }); + ellipse.prototype.setPath = function () { + let t = null == this.width ? this.diameter : this.width, + a = null == this.height ? this.diameter : this.height, + r = t / 2, + o = a / 2; + this.path = [{ + x: 0, + y: -o + }, { + arc: [{ + x: r, + y: -o + }, { + x: r, + y: 0 + }] + }], 1 < this.quarters && this.path.push({ + arc: [{ + x: r, + y: o + }, { + x: 0, + y: o + }] + }), 2 < this.quarters && this.path.push({ + arc: [{ + x: -r, + y: o + }, { + x: -r, + y: 0 + }] + }), 3 < this.quarters && this.path.push({ + arc: [{ + x: -r, + y: -o + }, { + x: 0, + y: -o + }] + }) + }; + let polygon = custom.subclass({ + sides: 3, + radius: .5 + }); + polygon.prototype.setPath = function () { + this.path = []; + for (let a = 0; a < this.sides; a++) { + let r = a / this.sides * tau - tau / 4, + o = Math.cos(r) * this.radius, + e = Math.sin(r) * this.radius; + this.path.push({ + x: o, + y: e + }) + } + }; + let hemisphere = ellipse.subclass({ + fill: true + }); + hemisphere.prototype.create = function () { + ellipse.prototype.create.apply(this, arguments), this.apex = new anchor({ + addTo: this, + translate: { + z: this.diameter / 2 + } + }), this.renderCentroid = new vector + }, hemisphere.prototype.updateSortValue = function () { + this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 3 / 8), this.sortValue = this.renderCentroid.z + }, hemisphere.prototype.render = function (a, e) { + this.renderDome(a, e), ellipse.prototype.render.apply(this, arguments) + }, hemisphere.prototype.renderDome = function (o, d) { + if (this.visible) { + let l = this.getDomeRenderElement(o, d), + p = Math.atan2(this.renderNormal.y, this.renderNormal.x), + e = this.diameter / 2 * this.renderNormal.magnitude(), + t = this.renderOrigin.x, + a = this.renderOrigin.y; + d.stroke(o, l, this.stroke, this.color, this.getLineWidth()), d.fill(o, l, this.fill, this.color), d.end(o, l) + } + }; + let g = y.subclass({ + color: '#333', + updateSort: true + }); + g.prototype.create = function () { + y.prototype.create.apply(this, arguments), this.pathCommands = [new w('move', [{}]), new w('line', [{}])] + }, g.prototype.render = function (a, e) { + this.renderCylinderSurface(a, e), y.prototype.render.apply(this, arguments) + }, g.prototype.renderCylinderSurface = function (o, d) { + if (this.visible) { + let l, p = this.frontBase, + e = this.rearBase, + t = p.renderNormal.magnitude(), + a = p.diameter * t + p.getLineWidth(); + this.pathCommands[0].renderPoints[0].set(p.renderOrigin), this.pathCommands[1].renderPoints[0].set(e.renderOrigin), d.renderPath(o, l, this.pathCommands), d.stroke(o, l, true, this.color, a), d.end(o, l) + } + }, g.prototype.copyGraph = s; + let f = ellipse.subclass(); + f.prototype.copyGraph = s; + let cylinder = custom.subclass({ + diameter: 1, + length: 1, + frontFace: void 0, + fill: true + }); + cylinder.prototype.create = function () { + custom.prototype.create.apply(this, arguments), this.group = new g({ + addTo: this, + color: this.color, + visible: this.visible + }); + let e = this.length / 2, + t = this.backface || true; + this.frontBase = this.group.frontBase = new ellipse({ + addTo: this.group, + diameter: this.diameter, + translate: { + z: e + }, + rotate: { + y: tau / 2 + }, + color: this.color, + stroke: this.stroke, + fill: this.fill, + backface: this.frontFace || t, + visible: this.visible + }), this.rearBase = this.group.rearBase = this.frontBase.copy({ + translate: { + z: -e + }, + rotate: { + y: 0 + }, + backface: t + }) + }, cylinder.prototype.render = function () { + }, ['stroke', 'fill', 'color', 'visible'].forEach(function (e) { + let t = '_' + e; + Object.defineProperty(cylinder.prototype, e, { + get: function () { + return this[t] + }, + set: function (a) { + this[t] = a, this.frontBase && (this.frontBase[e] = a, this.rearBase[e] = a, this.group[e] = a) + } + }) + }); + let cone = ellipse.subclass({ + length: 1, + fill: true + }); + cone.prototype.create = function () { + ellipse.prototype.create.apply(this, arguments), this.apex = new anchor({ + addTo: this, + translate: { + z: this.length + } + }), this.renderApex = new vector, this.renderCentroid = new vector, this.tangentA = new vector, this.tangentB = new vector, this.surfacePathCommands = [new w('move', [{}]), new w('line', [{}]), new w('line', [{}])] + }, cone.prototype.updateSortValue = function () { + this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 1 / 3), this.sortValue = this.renderCentroid.z + }, cone.prototype.render = function (a, e) { + this.renderConeSurface(a, e), ellipse.prototype.render.apply(this, arguments) + }, cone.prototype.renderConeSurface = function (d, l) { + if (this.visible) { + this.renderApex.set(this.apex.renderOrigin).subtract(this.renderOrigin); + let r = this.renderNormal.magnitude(), + T = this.renderApex.magnitude2d(), + e = this.renderNormal.magnitude2d(), + t = Math.acos(e / r), + n = Math.sin(t), + i = this.diameter / 2 * r; + if (i * n < T) { + let c = Math.atan2(this.renderNormal.y, this.renderNormal.x) + tau / 2, + e = Math.acos(i / (T / n)), + t = this.tangentA, + a = this.tangentB; + t.x = Math.cos(e) * i * n, t.y = Math.sin(e) * i, a.set(this.tangentA), a.y *= -1, t.rotateZ(c), a.rotateZ(c), t.add(this.renderOrigin), a.add(this.renderOrigin), this.setSurfaceRenderPoint(0, t), this.setSurfaceRenderPoint(1, this.apex.renderOrigin), this.setSurfaceRenderPoint(2, a); + let r = this.getSurfaceRenderElement(d, l); + l.renderPath(d, r, this.surfacePathCommands), l.stroke(d, r, this.stroke, this.color, this.getLineWidth()), l.fill(d, r, this.fill, this.color), l.end(d, r) + } + } + }, cone.prototype.setSurfaceRenderPoint = function (e, t) { + let a = this.surfacePathCommands[e].renderPoints[0]; + a.set(t) + }; + let O = rect.subclass(); + O.prototype.copyGraph = function () { + }; + let W = ['frontFace', 'rearFace', 'leftFace', 'rightFace', 'topFace', 'bottomFace'], + Z = extend({}, custom.defaults); + delete Z.path, W.forEach(function (e) { + Z[e] = true + }), extend(Z, { + width: 1, + height: 1, + depth: 1, + fill: true + }); + let box = anchor.subclass(Z); + return box.prototype.create = function (e) { + anchor.prototype.create.call(this, e), this.updatePath(), this.fill = this.fill + }, box.prototype.updatePath = function () { + W.forEach(function (e) { + this[e] = this[e] + }, this) + }, W.forEach(function (e) { + let t = '_' + e; + Object.defineProperty(box.prototype, e, { + get: function () { + return this[t] + }, + set: function (a) { + this[t] = a, this.setFace(e, a) + } + }) + }), box.prototype.setFace = function (t, a) { + let r = t + 'Rect', + o = this[r]; + if (!a) return void this.removeChild(o); + let d = this.getFaceOptions(t); + d.color = 'string' == typeof a ? a : this.color, o ? o.setOptions(d) : o = this[r] = new O(d), o.updatePath(), this.addChild(o) + }, box.prototype.getFaceOptions = function (t) { + return { + frontFace: { + width: this.width, + height: this.height, + translate: { + z: this.depth / 2 + } + }, + rearFace: { + width: this.width, + height: this.height, + translate: { + z: -this.depth / 2 + }, + rotate: { + y: tau / 2 + } + }, + leftFace: { + width: this.depth, + height: this.height, + translate: { + x: -this.width / 2 + }, + rotate: { + y: -tau / 4 + } + }, + rightFace: { + width: this.depth, + height: this.height, + translate: { + x: this.width / 2 + }, + rotate: { + y: tau / 4 + } + }, + topFace: { + width: this.width, + height: this.depth, + translate: { + y: -this.height / 2 + }, + rotate: { + x: -tau / 4 + } + }, + bottomFace: { + width: this.width, + height: this.depth, + translate: { + y: this.height / 2 + }, + rotate: { + x: tau / 4 + } + } + } [t] + }, ['color', 'stroke', 'fill', 'backface', 'front', 'visible'].forEach(function (t) { + let a = '_' + t; + Object.defineProperty(box.prototype, t, { + get: function () { + return this[a] + }, + set: function (l) { + this[a] = l, W.forEach(function (a) { + let r = this[a + 'Rect'], + o = 'string' == typeof this[a]; + r && !('color' === t && o) && (r[t] = l) + }, this) + } + }) + }), { + init: args => new init(args), + createCustom: args => new custom(args), + createRect: args => new rect(args), + createRoundedRect: args => new roundedRect(args), + createEllipse: args => new ellipse(args), + createPolygon: args => new polygon(args), + createHemisphere: args => new hemisphere(args), + createCylinder: args => new cylinder(args), + createCone: args => new cone(args), + createBox: args => new box(args) + } + }(), (null === this.canvas()) && console.error('Cube: 无法定位到舞台'), (() => { + if (null !== this.canvas() && null !== this.parentElement()) { + let id = 'cube_' + Math.floor(16777215 * Math.random()).toString(16); + let t = document.createElement('canvas'); + t.setAttribute('id', id), t.setAttribute('width', this.canvas().style.width), t.setAttribute('height', this.canvas().style.height); + let a = t.style; + a.position = 'absolute', a.left = '0%', a.top = '0%', a.pointerEvents = 'none', this.parentElement().appendChild(t), this.stage = this.renderer.init({ + element: document.getElementById(id) + }), new MutationObserver(() => { + if (document.getElementById(id) == null) this.parentElement().appendChild(t) + }).observe(document.body, { + childList: true, + subtree: true + }), new MutationObserver(() => { + for (let a in t.setAttribute('width', this.canvas().style.width), t.setAttribute('height', this.canvas().style.height), this.cubeScene = this.renderer.init({ + element: document.getElementById(id) + }), this.instances) this.stage.addChild(this.instances[a]); + this.stage.updateRenderGraph() + }).observe(this.canvas(), { + attributes: true + }) + } + })(); + this._formatMessage = e.getFormatMessage({ + 'zh-cn': { + 'Cube.name': 'LazyTong的立方体', + 'Cube.createRect': '创建或修改一个矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%', + 'Cube.createRoundedRect': '创建或修改一个圆角矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%', + 'Cube.createCircle': '创建或修改一个圆形并命名为[id],X[x]Y[y]Z[z]颜色[color]半径[diameter]完整性[quarters]', + 'Cube.createEllipse': '创建或修改一个椭圆形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%', + 'Cube.createPolygon': '创建或修改一个[sides]边形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%', + 'Cube.createHemisphere': '创建或修改一个半圆并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]半径[diameter]大小[stroke]%', + 'Cube.createCone': '创建或修改一个圆锥体并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]长度[length]半径[diameter]大小[stroke]%', + 'Cube.createCylinder': '创建或修改一个圆柱体并命名为[id],X[x]Y[y]Z[z]颜色[color]顶部颜色[frontface]地面颜色[backface]长度[length]大小[stroke]%', + 'Cube.createBox': '创建或修改一个立方体并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]尺寸[depth]颜色[color]左侧颜色[leftface]右侧颜色[rightface]顶部颜色[topface]地面颜色[bottomface]大小[stroke]%', + 'Cube.createCustom': '创建或修改一个[closed]自定义模型并命名为[id],X[x]Y[y]Z[z]颜色[color]节点位置[path]节点大小[stroke]%', + 'Cube.deleteObject': '删除物体[id]', + 'Cube.getAttrib': '物体[id]的[type]', + 'Cube.deleteAllObject': '删除所有物体', + 'Cube.getObjectNumbers': '物体总数', + 'Cube.getObjectList': '物体ID列表', + 'Cube.x': 'X', + 'Cube.y': 'Y', + 'Cube.z': 'Z', + 'Cube.rotateX': '在X上旋转的角度', + 'Cube.rotateY': '在Y上旋转的角度', + 'Cube.rotateZ': '在Z上旋转的角度', + 'Cube.width': '宽度', + 'Cube.height': '高度', + 'Cube.color': '颜色', + 'Cube.stroke': '大小', + 'Cube.quarters': '完整性', + 'Cube.cornerRadius': '边角弧度', + 'Cube.radius': '弧度', + 'Cube.setRotate': '设置物体[id]在[type]上旋转[rotate]度', + 'Cube.updateRender': '渲染当前设置的物体', + 'Cube.docs': '拓展教程', + 'Cube.refreshBlocks': '刷新积木', + 'Cube.create': '创建物体', + 'Cube.modify': '修改物体', + 'Cube.info': '信息', + 'Cube.fileListEmpty': '无文件', + 'Cube.open': '开放的', + 'Cube.closed': '闭合的' + }, + en: { + 'Cube.name': "LazyTong's Cube", + 'Cube.createRect': 'Create or Modify a Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%', + 'Cube.createRoundedRect': 'Create or Modify a Rounded Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%', + 'Cube.createCircle': 'Create or Modify a Circle named[id], X[x]Y[y]Z[z]Color[color]Diameter[diameter]Quarters[quarters]', + 'Cube.createEllipse': 'Create or Modify an Ellipse named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%', + 'Cube.createPolygon': 'Create or Modify a[sides]Polygon named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%', + 'Cube.createHemisphere': 'Create or Modify a Hemisphere named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Diameter[diameter]Stroke[stroke]%', + 'Cube.createCone': 'Create or Modify a Cone named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Length[length]Diameter[diameter]Stroke[stroke]%', + 'Cube.createCylinder': 'Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color]Frontface Color[frontface]Backface Color[backface]Length[length]Stroke[stroke]%', + 'Cube.createBox': 'Create or Modify a Box named[id], X[x]Y[y]Z[z] Width[width] Height[height] Depth[depth] Color[color] Leftface Color[leftface] Rightface Color[rightface] Topface Color[topface] Bottomface Color[bottomface] Stroke[stroke]%', + 'Cube.createCustom': 'Create or Modify a[closed]Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%', + 'Cube.deleteObject': 'Delete Object[id]', + 'Cube.getAttrib': 'Get[type]of Object[id]', + 'Cube.deleteAllObject': 'Delete All Objects', + 'Cube.getObjectNumbers': 'Number of Objects', + 'Cube.getObjectList': 'List of Object IDs', + 'Cube.x': 'X', + 'Cube.y': 'Y', + 'Cube.z': 'Z', + 'Cube.rotateX': 'the angle of rotation on X', + 'Cube.rotateY': 'the angle of rotation on Y', + 'Cube.rotateZ': 'the angle of rotation on Z', + 'Cube.width': 'width', + 'Cube.height': 'height', + 'Cube.color': 'color', + 'Cube.stroke': 'stroke', + 'Cube.quarters': 'quarters', + 'Cube.cornerRadius': 'corner radius', + 'Cube.radius': 'radius', + 'Cube.setRotate': 'Set the object[id]to rotate[rotate]degrees on[type]', + 'Cube.updateRender': 'Update Render with Current Object Settings', + 'Cube.docs': 'Extended Tutorial', + 'Cube.refreshBlocks': 'Refresh blocks', + 'Cube.create': 'Creating objects', + 'Cube.modify': 'Modifying objects', + 'Cube.info': 'Information', + 'Cube.fileListEmpty': 'no file', + 'Cube.open': 'open', + 'Cube.closed': 'closed' + } + }) + } + + formatMessage(args) { + return this._formatMessage({ + id: args, + default: args, + description: args + }) + } + + getInfo() { + let id = 'cube_' + Math.floor(16777215 * Math.random()).toString(16); + return { + id: 'LazyTong.Cube', + name: this.formatMessage('Cube.name'), + blockIconURI: t, + menuIconURI: t, + color1: '#33cc33', + color2: '#669900', + blocks: [{ + blockType: 'button', + text: this.formatMessage('Cube.docs'), + onClick: this.docs + }, { + blockType: 'button', + text: this.formatMessage('Cube.refreshBlocks'), + onClick: () => { + this.runtime.extensionManager.refreshBlocks() + } + }, `---${this.formatMessage('Cube.create')}`, { + opcode: 'createRect', + blockType: 'command', + text: this.formatMessage('Cube.createRect'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + width: { + type: 'number', + defaultValue: '100' + }, + height: { + type: 'number', + defaultValue: '20' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createRoundedRect', + blockType: 'command', + text: this.formatMessage('Cube.createRoundedRect'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + width: { + type: 'number', + defaultValue: '100' + }, + height: { + type: 'number', + defaultValue: '20' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + radius: { + type: 'number', + defaultValue: '1' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createCircle', + blockType: 'command', + text: this.formatMessage('Cube.createCircle'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + diameter: { + type: 'number', + defaultValue: '50' + }, + quarters: { + type: 'number', + defaultValue: '4' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createEllipse', + blockType: 'command', + text: this.formatMessage('Cube.createEllipse'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + width: { + type: 'number', + defaultValue: '100' + }, + height: { + type: 'number', + defaultValue: '20' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createPolygon', + blockType: 'command', + text: this.formatMessage('Cube.createPolygon'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + width: { + type: 'number', + defaultValue: '100' + }, + height: { + type: 'number', + defaultValue: '20' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + sides: { + type: 'number', + defaultValue: '3' + }, + radius: { + type: 'number', + defaultValue: '1' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createHemisphere', + blockType: 'command', + text: this.formatMessage('Cube.createHemisphere'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + diameter: { + type: 'number', + defaultValue: '50' + }, + backface: { + type: 'color', + defaultValue: '#33cc33' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createCone', + blockType: 'command', + text: this.formatMessage('Cube.createCone'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + length: { + type: 'number', + defaultValue: '50' + }, + diameter: { + type: 'number', + defaultValue: '50' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + backface: { + type: 'color', + defaultValue: '#33cc33' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createCylinder', + blockType: 'command', + text: this.formatMessage('Cube.createCylinder'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + length: { + type: 'number', + defaultValue: '50' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + frontface: { + type: 'color', + defaultValue: '#33cc33' + }, + backface: { + type: 'color', + defaultValue: '#33cc33' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createBox', + blockType: 'command', + text: this.formatMessage('Cube.createBox'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + width: { + type: 'number', + defaultValue: '100' + }, + height: { + type: 'number', + defaultValue: '20' + }, + depth: { + type: 'number', + defaultValue: '50' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + leftface: { + type: 'color', + defaultValue: '#33cc33' + }, + rightface: { + type: 'color', + defaultValue: '#33cc33' + }, + topface: { + type: 'color', + defaultValue: '#33cc33' + }, + bottomface: { + type: 'color', + defaultValue: '#33cc33' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, { + opcode: 'createCustom', + blockType: 'command', + text: this.formatMessage('Cube.createCustom'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + closed: { + type: 'boolean', + menu: 'closed' + }, + x: { + type: 'number', + defaultValue: '0' + }, + y: { + type: 'number', + defaultValue: '0' + }, + z: { + type: 'number', + defaultValue: '0' + }, + color: { + type: 'color', + defaultValue: '#33cc33' + }, + path: { + type: 'string', + menu: 'files' + }, + stroke: { + type: 'number', + defaultValue: '100' + } + } + }, `---${this.formatMessage('Cube.modify')}`, { + opcode: 'deleteObject', + blockType: 'command', + text: this.formatMessage('Cube.deleteObject'), + arguments: { + id: { + type: 'string', + defaultValue: id + } + } + }, { + opcode: 'deleteAllObject', + blockType: 'command', + text: this.formatMessage('Cube.deleteAllObject'), + arguments: {} + }, { + opcode: 'setRotate', + blockType: 'command', + text: this.formatMessage('Cube.setRotate'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + type: { + type: 'string', + menu: 'rotate' + }, + rotate: { + type: 'angle', + defaultValue: '10' + } + } + }, { + opcode: 'updateRender', + blockType: 'command', + text: this.formatMessage('Cube.updateRender'), + arguments: {} + }, `---${this.formatMessage('Cube.info')}`, { + opcode: 'getAttrib', + blockType: 'reporter', + text: this.formatMessage('Cube.getAttrib'), + arguments: { + id: { + type: 'string', + defaultValue: id + }, + type: { + type: 'string', + menu: 'attrib' + } + } + }, { + opcode: 'getObjectList', + blockType: 'reporter', + text: this.formatMessage('Cube.getObjectList'), + arguments: {} + }, { + opcode: 'getObjectNumbers', + blockType: 'reporter', + text: this.formatMessage('Cube.getObjectNumbers'), + arguments: {} + }], + menus: { + attrib: [{ + text: this.formatMessage('Cube.x'), + value: 'x' + }, { + text: this.formatMessage('Cube.y'), + value: 'y' + }, { + text: this.formatMessage('Cube.z'), + value: 'z' + }, { + text: this.formatMessage('Cube.rotateX'), + value: 'rotateX' + }, { + text: this.formatMessage('Cube.rotateY'), + value: 'rotateY' + }, { + text: this.formatMessage('Cube.rotateZ'), + value: 'rotateZ' + }, { + text: this.formatMessage('Cube.width'), + value: 'width' + }, { + text: this.formatMessage('Cube.height'), + value: 'height' + }, { + text: this.formatMessage('Cube.stroke'), + value: 'stroke' + }, { + text: this.formatMessage('Cube.color'), + value: 'color' + }, { + text: this.formatMessage('Cube.quarters'), + value: 'quarters' + }, { + text: this.formatMessage('Cube.cornerRadius'), + value: 'cornerRadius' + }, { + text: this.formatMessage('Cube.radius'), + value: 'radius' + }], + closed: [{ + text: this.formatMessage('Cube.open'), + value: false + }, { + text: this.formatMessage('Cube.closed'), + value: true + }], + files: { + acceptReporters: true, + items: (() => { + try { + const e = this.runtime.getGandiAssetsFileList('json').map(e => ({ + text: e.fullName, + value: e.id + })); + return 1 > e.length ? [{ + text: this.formatMessage('Cube.fileListEmpty'), + value: 'fileListEmpty' + }] : e + } catch (e) { + return [{ + text: this.formatMessage('Cube.fileListEmpty'), + value: 'fileListEmpty' + }] + } + })() + }, + rotate: [{ + text: this.formatMessage('Cube.x'), + value: 'x' + }, { + text: this.formatMessage('Cube.y'), + value: 'y' + }, { + text: this.formatMessage('Cube.z'), + value: 'z' + }] + } + } + } + + docs() { + let e = document.createElement('a'); + e.href = 'https://lt.js.org/posts/3ad4f6', e.rel = 'noopener noreferrer', e.target = '_blank', e.click() + } + + createRect(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createRect({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + createRoundedRect(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createRoundedRect({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + cornerRadius: +args.radius, + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + createCircle(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createEllipse({ + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + diameter: +args.diameter, + translate: { + x: +args.x, + y: +args.y, + z: +args.z + }, + quarters: +args.quarters + }), this.stage.addChild(this.instances[args.id])) + } + + createEllipse(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createEllipse({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + }, + quarters: +args.quarters + }), this.stage.addChild(this.instances[args.id])) + } + + createPolygon(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createPolygon({ + sides: +args.sides, + radius: +args.sides, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + createHemisphere(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createHemisphere({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + createCone(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createCone({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + createCylinder(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createCylinder({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + frontFace: (() => /^#([0-9a-f]{6})$/i.test(args.frontface) ? args.frontface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + createBox(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createBox({ + width: +args.width, + height: +args.height, + depth: +args.depth, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + leftFace: (() => /^#([0-9a-f]{6})$/i.test(args.leftface) ? args.leftface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + rightFace: (() => /^#([0-9a-f]{6})$/i.test(args.rightface) ? args.rightface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + topFace: (() => /^#([0-9a-f]{6})$/i.test(args.topface) ? args.topface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + bottomFace: (() => /^#([0-9a-f]{6})$/i.test(args.bottomface) ? args.bottomface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + createCustom(args) { + null !== this.canvas() && args.path !== 'fileListEmpty' && null !== this.parentElement() && '{}' !== args.path && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createCustom({ + stroke: +args.stroke / 100, + closed: (() => { + switch (args.closed) { + case true: + return true + case false: + return false + default: + return false + } + })(), + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + path: JSON.parse(String.fromCharCode.apply(null, this.runtime.getGandiAssetById(args.path).asset.data)), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.stage.addChild(this.instances[args.id])) + } + + deleteObject(args) { + null !== this.parentElement() && void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0) + } + + deleteAllObject() { + if (null !== this.parentElement()) { + for (let e in this.instances) this.stage.removeChild(this.instances[e]); + this.instances = {} + } + } + + getAttrib(args) { + try { + if (void 0 !== typeof this.instances[args.id]) switch (args.type) { + case 'x': + return 'undefined' == typeof this.instances[args.id].translate.x ? 'NaN' : this.instances[args.id].translate.x; + case 'y': + return 'undefined' == typeof this.instances[args.id].translate.y ? 'NaN' : this.instances[args.id].translate.y; + case 'z': + return 'undefined' == typeof this.instances[args.id].translate.z ? 'NaN' : this.instances[args.id].translate.z; + case 'rotateX': + return 'undefined' == typeof this.instances[args.id].rotate.x ? 'NaN' : this.instances[args.id].rotate.x * (180 / Math.PI); + case 'rotateY': + return 'undefined' == typeof this.instances[args.id].rotate.y ? 'NaN' : this.instances[args.id].rotate.y * (180 / Math.PI); + case 'rotateZ': + return 'undefined' == typeof this.instances[args.id].rotate.z ? 'NaN' : this.instances[args.id].rotate.z * (180 / Math.PI); + case 'width': + return 'undefined' == typeof this.instances[args.id].width ? 'NaN' : this.instances[args.id].width; + case 'height': + return 'undefined' == typeof this.instances[args.id].height ? 'NaN' : this.instances[args.id].height; + case 'color': + return 'undefined' == typeof this.instances[args.id].color ? 'NaN' : this.instances[args.id].color; + case 'stroke': + return 'undefined' == typeof this.instances[args.id].stroke ? 'NaN' : this.instances[args.id].stroke; + case 'quarters': + return 'undefined' == typeof this.instances[args.id].quarters ? 'NaN' : this.instances[args.id].quarters; + case 'cornerRadius': + return 'undefined' == typeof this.instances[args.id].cornerRadius ? 'NaN' : this.instances[args.id].cornerRadius; + case 'radius': + return 'undefined' == typeof this.instances[args.id].radius ? 'NaN' : this.instances[args.id].radius; + default: + return 'NaN'; + } + } catch (e) { + return 'NaN' + } + } + + getObjectNumbers() { + return Object.keys(this.instances).length + } + + setRotate(args) { + if (void 0 !== typeof this.instances[args.id]) switch (args.type) { + case 'x': + this.instances[args.id].rotate.x = +args.rotate * (Math.PI / 180); + break; + case 'y': + this.instances[args.id].rotate.y = +args.rotate * (Math.PI / 180); + break; + case 'z': + this.instances[args.id].rotate.z = +args.rotate * (Math.PI / 180); + break; + default: + break; + } + } + + getObjectList() { + return Object.keys(this.instances) + } + + updateRender() { + try { + this.stage.updateRenderGraph() + } catch (e) { + console.error('Cube: 渲染时发生错误') + } + } + }, + info: { + name: 'Cube.name', + description: 'Cube.description', + extensionId: 'LazyTong.Cube', + iconURL: 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDYwMCAzNzIiIHdpZHRoPSI2MDAiIGhlaWdodD0iMzcyIiBmaWxsPSJ3aGl0ZSI+PGltYWdlIHdpZHRoPSIyNDAwIiBoZWlnaHQ9IjgwMCIgdHJhbnNmb3JtPSJtYXRyaXgoLjM2MiwwLDAsLjM2MiwtMTM1LDgyKSIgaHJlZj0iZGF0YTppbWFnZS9zdmcreG1sO2Jhc2U2NCxQSE4yWnlCNGJXeHVjejBpYUhSMGNEb3ZMM2QzZHk1M015NXZjbWN2TWpBd01DOXpkbWNpSUhabGNuTnBiMjQ5SWpFdU1TSWdlRzFzYm5NNmVHeHBibXM5SW1oMGRIQTZMeTkzZDNjdWR6TXViM0puTHpFNU9Ua3ZlR3hwYm1zaUlIaHRiRzV6T25OMloycHpQU0pvZEhSd09pOHZjM1puYW5NdVpHVjJMM04yWjJweklpQjJhV1YzUW05NFBTSXdJREFnTWpRd01DQTRNREFpSUc5d1lXTnBkSGs5SWpFaVBqeGtaV1p6UGp4c2FXNWxZWEpIY21Ga2FXVnVkQ0I0TVQwaU5UQWxJaUI1TVQwaU1DVWlJSGd5UFNJMU1DVWlJSGt5UFNJeE1EQWxJaUJwWkQwaWMzTnpkWEptTFdkeVlXUWlQanh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TFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDFNREFzT1RBd0lpQjBjbUZ1YzJadmNtMDlJbTFoZEhKcGVDZ3hMREFzTUN3eExEQXNNVEl3S1NJZ2IzQmhZMmwwZVQwaU1DNHdOU0krUEM5d1lYUm9Qanh3WVhSb0lHUTlJazB0TVRBc01UQkRNVGt1T0RZeE1URXhNVEV4TVRFeE1URXNNalF1TnpreE5qWTJOalkyTmpZMk5qWTRMRGMxTGpZNU5EUTBORFEwTkRRME5EUTJMRGszTGpnM05Td3hNek11TXpNek16TXpNek16TXpNek16UXNPREZETVRrd0xqazNNakl5TWpJeU1qSXlNakl6TERZMExqRXlOU3d5TVRFdU1URXhNVEV4TVRFeE1URXhNVFFzTFRVM0xqZzNOU3d5TmpZdU5qWTJOalkyTmpZMk5qWTJOeXd0TnpGRE16SXlMakl5TWpJeU1qSXlNakl5TWpJekxDMDROQzR4TWpVc016UTBMalEwTkRRME5EUTBORFEwTkRRMkxEVXVOekE0TXpNek16TXpNek16TXpNeUxEUXdNQ3d4T0VNME5UVXVOVFUxTlRVMU5UVTFOVFUxTlRRc016QXVNamt4TmpZMk5qWTJOalkyTmpZNExEUTNOeTQzTnpjM056YzNOemMzTnpjNExDMHhOaTR6TnpVc05UTXpMak16TXpNek16TXpNek16TXpRc0xURXlRelU0T0M0NE9EZzRPRGc0T0RnNE9EZzVMQzAzTGpZeU5TdzJNVEV1TVRFeE1URXhNVEV4TVRFeE1pdzBNUzR3T0RNek16TXpNek16TXpNek16WXNOalkyTGpZMk5qWTJOalkyTmpZMk5qY3NNemxETnpJeUxqSXlNakl5TWpJeU1qSXlNak1zTXpZdU9URTJOalkyTmpZMk5qWTJOalkwTERjME5DNDBORFEwTkRRME5EUTBORFExTEMweU55dzRNREFzTFRJeVF6ZzFOUzQxTlRVMU5UVTFOVFUxTlRVMUxDMHhOeXc0TnpjdU56YzNOemMzTnpjM056YzNPQ3cyTkM0ME5UZ3pNek16TXpNek16TXpNeXc1TXpNdU16TXpNek16TXpNek16T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BMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJdU1qSXlNakl5TWpJeU1qSXlOQ3c0TGpNek16TXpNek16TXpNek16TXpNaXd4T1RRMExqUTBORFEwTkRRME5EUTBORFlzTnpZdU1UWTJOalkyTmpZMk5qWTJOamNzTWpBd01DNHdNREF3TURBd01EQXdNREF5TERjM1F6SXdOVFV1TlRVMU5UVTFOVFUxTlRVMU55dzNOeTQ0TXpNek16TXpNek16TXpNek15d3lNRGMzTGpjM056YzNOemMzTnpjM09Dd3hMalVzTWpFek15NHpNek16TXpNek16TXpNek0xTERsRE1qRTRPQzQ0T0RnNE9EZzRPRGc0T0Rrc01UWXVOU3d5TWpFeExqRXhNVEV4TVRFeE1URXhNVE1zTVRFekxqZ3pNek16TXpNek16TXpNek16TERJeU5qWXVOalkyTmpZMk5qWTJOalkzTERFeE0wTXlNekl5T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Fd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNN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conURL: t, + featured: true, + disabled: false, + collaboratorList: [{ + collaborator: 'LazyTong @ Github', + collaboratorURL: 'https://lt.js.org' + }], + doc: 'https://lt.js.org/posts/3ad4f6' + }, + l10n: { + 'zh-cn': { + 'Cube.name': 'LazyTong的立方体 V1.2', + 'Cube.description': '升维打击!' + }, + en: { + 'Cube.name': "LazyTong's Cube V1.2", + 'Cube.description': 'Dimensionality expansion strike!' + } + } +}); diff --git a/extensions/LazyTong/README.md b/extensions/LazyTong/README.md new file mode 100644 index 00000000..3a21bb77 --- /dev/null +++ b/extensions/LazyTong/README.md @@ -0,0 +1,3 @@ +这里是LazyTong的扩展仓库。存放了这些扩展: +- Cube.js:LazyTong的立方体 +- 等待更新…