@anov/3d-ability 0.0.4-alpha1 → 0.0.4-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/camera/index.d.ts +69 -0
- package/dist/camera/index.js +257 -0
- package/dist/camera/index.js.map +1 -0
- package/dist/city/flyinglead.js +2 -0
- package/dist/city/flyinglead.js.map +1 -0
- package/dist/city/radar.js +2 -0
- package/dist/city/radar.js.map +1 -0
- package/dist/city/scanning.js +2 -0
- package/dist/city/scanning.js.map +1 -0
- package/dist/city/surroundLine.js +2 -0
- package/dist/city/surroundLine.js.map +1 -0
- package/dist/environment/rain.js +2 -1
- package/dist/environment/rain.js.map +1 -0
- package/dist/environment/{rainShder → rainShader}/index.js +2 -1
- package/dist/environment/rainShader/index.js.map +1 -0
- package/dist/environment/{rainShder → rainShader}/shader.js +2 -1
- package/dist/environment/rainShader/shader.js.map +1 -0
- package/dist/environment/shaderCloud/cloudMaterial.js +2 -1
- package/dist/environment/shaderCloud/cloudMaterial.js.map +1 -0
- package/dist/environment/shaderCloud/index.js +2 -1
- package/dist/environment/shaderCloud/index.js.map +1 -0
- package/dist/environment/shaderCloud/shader.js +2 -1
- package/dist/environment/shaderCloud/shader.js.map +1 -0
- package/dist/environment/{showShder → showShader}/index.js +2 -1
- package/dist/environment/showShader/index.js.map +1 -0
- package/dist/environment/{showShder → showShader}/shader.js +3 -2
- package/dist/environment/showShader/shader.js.map +1 -0
- package/dist/environment/sky/index.js +11 -10
- package/dist/environment/sky/index.js.map +1 -0
- package/dist/environment/skyBox/index.d.ts +41 -0
- package/dist/environment/skyBox/index.js +150 -0
- package/dist/environment/skyBox/index.js.map +1 -0
- package/dist/environment/snow.js +4 -1
- package/dist/environment/snow.js.map +1 -0
- package/dist/environment/sun/index.js +2 -1
- package/dist/environment/sun/index.js.map +1 -0
- package/dist/environment/utils/points.js +4 -3
- package/dist/environment/utils/points.js.map +1 -0
- package/dist/environment/volumetricCloud/cloudMaterial.js +2 -1
- package/dist/environment/volumetricCloud/cloudMaterial.js.map +1 -0
- package/dist/environment/volumetricCloud/inex.js +2 -1
- package/dist/environment/volumetricCloud/inex.js.map +1 -0
- package/dist/heatmap/index.d.ts +9 -0
- package/dist/heatmap/index.js +138 -0
- package/dist/heatmap/index.js.map +1 -0
- package/dist/helper/view/index.js +2 -1
- package/dist/helper/view/index.js.map +1 -0
- package/dist/helper/view/utils.js +2 -1
- package/dist/helper/view/utils.js.map +1 -0
- package/dist/index.d.ts +11 -6
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -0
- package/dist/line/curve.d.ts +33 -0
- package/dist/line/curve.js +71 -0
- package/dist/line/curve.js.map +1 -0
- package/dist/line/index.d.ts +0 -0
- package/dist/line/index.js +2 -0
- package/dist/line/index.js.map +1 -0
- package/dist/line/round-curve.d.ts +19 -0
- package/dist/line/round-curve.js +212 -0
- package/dist/line/round-curve.js.map +1 -0
- package/dist/material/finirMaterialMaterial/index.d.ts +9 -0
- package/dist/material/finirMaterialMaterial/index.js +47 -0
- package/dist/material/finirMaterialMaterial/index.js.map +1 -0
- package/dist/material/pristineGridMaterial/index.js +2 -1
- package/dist/material/pristineGridMaterial/index.js.map +1 -0
- package/dist/material/pristineGridMaterial/shader/fragment.js +2 -1
- package/dist/material/pristineGridMaterial/shader/fragment.js.map +1 -0
- package/dist/material/pristineGridMaterial/shader/vertex.js +2 -1
- package/dist/material/pristineGridMaterial/shader/vertex.js.map +1 -0
- package/dist/poi/core/Base.d.ts +7 -0
- package/dist/poi/core/Base.js +24 -0
- package/dist/poi/core/Base.js.map +1 -0
- package/dist/poi/core/Css2D.js +181 -0
- package/dist/poi/core/Css2D.js.map +1 -0
- package/dist/poi/core/Css3D.d.ts +1 -0
- package/dist/poi/core/Css3D.js +24 -0
- package/dist/poi/core/Css3D.js.map +1 -0
- package/dist/poi/core/Sprite.d.ts +12 -0
- package/dist/poi/core/Sprite.js +145 -0
- package/dist/poi/core/Sprite.js.map +1 -0
- package/dist/poi/core/SpriteBase.d.ts +11 -0
- package/dist/poi/core/SpriteBase.js +58 -0
- package/dist/poi/core/SpriteBase.js.map +1 -0
- package/dist/poi/index.d.ts +12 -0
- package/dist/poi/index.js +29 -0
- package/dist/poi/index.js.map +1 -0
- package/dist/poi/utils/base64.d.ts +3 -0
- package/dist/poi/utils/base64.js +4 -0
- package/dist/poi/utils/base64.js.map +1 -0
- package/dist/poi/utils/canvas.d.ts +3 -0
- package/dist/poi/utils/canvas.js +68 -0
- package/dist/poi/utils/canvas.js.map +1 -0
- package/dist/poi/utils/css.d.ts +35 -0
- package/dist/poi/utils/css.js +41 -0
- package/dist/poi/utils/css.js.map +1 -0
- package/dist/poi/utils/type.d.ts +35 -0
- package/dist/poi/utils/type.js +39 -0
- package/dist/poi/utils/type.js.map +1 -0
- package/dist/poiBack/assets.d.ts +2 -0
- package/dist/poiBack/assets.js +3 -0
- package/dist/poiBack/assets.js.map +1 -0
- package/dist/poiBack/dom.d.ts +2 -0
- package/dist/poiBack/dom.js +36 -0
- package/dist/poiBack/dom.js.map +1 -0
- package/dist/poiBack/index.d.ts +19 -0
- package/dist/poiBack/index.js +145 -0
- package/dist/poiBack/index.js.map +1 -0
- package/dist/poiBack/type.d.ts +20 -0
- package/dist/poiBack/type.js +6 -0
- package/dist/poiBack/type.js.map +1 -0
- package/dist/postEffects/bloomPass.js +2 -1
- package/dist/postEffects/bloomPass.js.map +1 -0
- package/dist/postEffects/index.js +2 -1
- package/dist/postEffects/index.js.map +1 -0
- package/dist/postEffects/outlinePass.js +9 -2
- package/dist/postEffects/outlinePass.js.map +1 -0
- package/dist/scene/grow/grow.d.ts +10 -0
- package/dist/scene/grow/grow.js +128 -0
- package/dist/scene/grow/grow.js.map +1 -0
- package/dist/scene/grow/growStyle.d.ts +2 -0
- package/dist/scene/grow/growStyle.js +3 -0
- package/dist/scene/grow/growStyle.js.map +1 -0
- package/dist/scene/grow/index.d.ts +2 -0
- package/dist/scene/grow/index.js +3 -0
- package/dist/scene/grow/index.js.map +1 -0
- package/dist/scene/grow/style_down.d.ts +13 -0
- package/dist/scene/grow/style_down.js +92 -0
- package/dist/scene/grow/style_down.js.map +1 -0
- package/dist/scene/grow/style_up.d.ts +13 -0
- package/dist/scene/grow/style_up.js +96 -0
- package/dist/scene/grow/style_up.js.map +1 -0
- package/dist/scene/grow/type.d.ts +46 -0
- package/dist/scene/grow/type.js +42 -0
- package/dist/scene/grow/type.js.map +1 -0
- package/dist/scene/index.d.ts +1 -0
- package/dist/scene/index.js +2 -0
- package/dist/scene/index.js.map +1 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -0
- package/dist/weather/fog2DMesh.d.ts +14 -0
- package/dist/weather/fog2DMesh.js +77 -0
- package/dist/weather/fog2DMesh.js.map +1 -0
- package/dist/weather/glsl/fog.d.ts +2 -0
- package/dist/weather/glsl/fog.js +3 -0
- package/dist/weather/glsl/fog.js.map +1 -0
- package/dist/weather/index.d.ts +4 -0
- package/dist/weather/index.js +12 -0
- package/dist/weather/index.js.map +1 -0
- package/package.json +10 -3
- package/dist/core/mouseDrawe.d.ts +0 -2
- package/dist/core/mouseDrawe.js +0 -1
- package/dist/environment/cloud/cloud.d.ts +0 -1
- package/dist/environment/cloud/cloud.js +0 -1
- package/dist/environment/cloud/index.d.ts +0 -7
- package/dist/environment/cloud/index.js +0 -60
- /package/dist/environment/{rainShder → rainShader}/index.d.ts +0 -0
- /package/dist/environment/{rainShder → rainShader}/shader.d.ts +0 -0
- /package/dist/environment/{showShder → showShader}/index.d.ts +0 -0
- /package/dist/environment/{showShder → showShader}/shader.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/material/pristineGridMaterial/shader/fragment.ts"],"sourcesContent":["export default /* glsl */ `\nprecision highp float;\n\n// Varyings from the vertex shader\nin vec2 v_uv;\nin vec2 v_worldPos;\n\n// Uniforms\nuniform float u_majorLineWidth, u_minorLineWidth, u_axisLineWidth;\nuniform vec3 u_majorLineColor, u_minorLineColor, u_baseColor;\nuniform vec3 u_xAxisColor, u_zAxisColor;\nuniform float u_majorGridDiv, u_baseAlpha;\nuniform vec2 u_resolution;\n\n// Output color\nout vec4 gColor;\n\nfloat saturate(float value) {\nreturn clamp(value, 0.0, 1.0);\n}\n\nvoid main() {\n // Calculate derivatives for anti-aliasing\nvec4 uvDDXY = vec4(dFdx(v_uv), dFdy(v_uv));\nvec2 uvDeriv = vec2(length(uvDDXY.xz), length(uvDDXY.yw));\n\nvec4 worldPosDDXY = vec4(dFdx(v_worldPos), dFdy(v_worldPos));\nvec2 worldPosDeriv = vec2(length(worldPosDDXY.xz), length(worldPosDDXY.yw));\n\n // Axis lines calculation\nfloat axisLineWidth = max(u_majorLineWidth, u_axisLineWidth);\n\nvec2 axisDrawWidth = vec2(axisLineWidth) + worldPosDeriv * 0.5; // Adjust for AA\nvec2 axisLineAA = worldPosDeriv * 1.5;\nvec2 axisLines2 = smoothstep(axisDrawWidth + axisLineAA, axisDrawWidth - axisLineAA, abs(v_worldPos.xy * 2.0));\naxisLines2 *= (axisLineWidth / axisDrawWidth);\n\n // Major grid lines\nfloat div = max(2.0, round(u_majorGridDiv));\nvec2 majorUVDeriv = worldPosDeriv / div;\nfloat majorLineWidth = u_majorLineWidth / div;\nvec2 majorDrawWidth = clamp(vec2(majorLineWidth), majorUVDeriv, vec2(0.5));\nvec2 majorLineAA = majorUVDeriv * 1.5;\nvec2 majorGridUV = 1.0 - abs(fract(v_worldPos.xy / div) * 2.0 - 1.0);\nvec2 majorGrid2 = smoothstep(majorDrawWidth + majorLineAA, majorDrawWidth - majorLineAA, majorGridUV);\nmajorGrid2 *= (majorLineWidth / majorDrawWidth);\n\n // Minor grid lines\nfloat minorLineWidth = u_minorLineWidth;\nbool minorInvertLine = minorLineWidth > 0.5;\nfloat minorTargetWidth = minorInvertLine ? 1.0 - minorLineWidth : minorLineWidth;\nvec2 minorDrawWidth = clamp(vec2(minorTargetWidth), uvDeriv, vec2(0.5));\nvec2 minorLineAA = uvDeriv * 1.5;\nvec2 minorGridUV = abs(fract(v_uv) * 2.0 - 1.0);\nminorGridUV = minorInvertLine ? minorGridUV : 1.0 - minorGridUV;\nvec2 minorGrid2 = smoothstep(minorDrawWidth + minorLineAA, minorDrawWidth - minorLineAA, minorGridUV);\nminorGrid2 *= (minorTargetWidth / minorDrawWidth);\n\nif(max(axisLines2.x, axisLines2.y) > 0.) {\n // If we're drawing axis lines, don't draw grid lines on axis\nmajorGrid2 = vec2(0.);\nminorGrid2 = vec2(0.);\n}\n\n // Combine minor and major grid lines\nfloat minorGrid = mix(minorGrid2.x, 1.0, minorGrid2.y);\nfloat majorGrid = mix(majorGrid2.x, 1.0, majorGrid2.y);\n\n // Final color calculations for grid\nvec3 gridColor = mix(u_baseColor, u_minorLineColor, minorGrid);\ngridColor = mix(gridColor, u_majorLineColor, majorGrid);\nfloat gridAlpha = u_baseAlpha;\n\n // Apply base alpha to the grid lines\nif(minorGrid > 0.0) {\ngridAlpha = saturate(mix(gridAlpha, 1.0, minorGrid));\n}\nif(majorGrid > 0.0) {\ngridAlpha = saturate(mix(gridAlpha, 1.0, majorGrid));\n}\n\n // Apply axis color to the axis lines\nvec3 axisColor = mix(vec3(1.), u_xAxisColor, step(0.5, abs(v_worldPos.x)));\naxisColor = mix(axisColor, u_zAxisColor, step(0.5, abs(v_worldPos.y)));\n\nvec3 finalColor = mix(gridColor, axisColor, max(axisLines2.x, axisLines2.y));\n\nif(max(axisLines2.x, axisLines2.y) > 0.) {\ngridAlpha = saturate(mix(gridAlpha, 1.0, max(axisLines2.x, axisLines2.y)));\n}\n\n // Set the final fragment color\ngColor = vec4(finalColor, gridAlpha);\n}\n`"],"mappings":"AAAA,eAAe"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export default /* glsl */"\n\nprecision highp float;\n\n// Uniforms\nuniform float u_majorGridDiv;\nuniform float u_gridDiv;\n\nout vec2 v_uv; // Passed to the fragment shader\nout vec2 v_worldPos;\nvoid main() {\n vec4 transformed = vec4(position, 1.0);\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * transformed;\n\n vec3 worldPosition = (modelMatrix * transformed).xyz;\n\n v_worldPos = worldPosition.xz * u_gridDiv;\n\n // Use local position for grid calculations\n vec3 localPos = transformed.xyz;\n vec3 cameraCenteringOffset = floor(cameraPosition);\n vec3 cameraSnappedWorldPos = worldPosition.xyz - cameraCenteringOffset;\n v_uv = cameraSnappedWorldPos.xz * u_gridDiv;\n\n}\n";
|
|
1
|
+
export default /* glsl */"\n\nprecision highp float;\n\n// Uniforms\nuniform float u_majorGridDiv;\nuniform float u_gridDiv;\n\nout vec2 v_uv; // Passed to the fragment shader\nout vec2 v_worldPos;\nvoid main() {\n vec4 transformed = vec4(position, 1.0);\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * transformed;\n\n vec3 worldPosition = (modelMatrix * transformed).xyz;\n\n v_worldPos = worldPosition.xz * u_gridDiv;\n\n // Use local position for grid calculations\n vec3 localPos = transformed.xyz;\n vec3 cameraCenteringOffset = floor(cameraPosition);\n vec3 cameraSnappedWorldPos = worldPosition.xyz - cameraCenteringOffset;\n v_uv = cameraSnappedWorldPos.xz * u_gridDiv;\n\n}\n";
|
|
2
|
+
//# sourceMappingURL=vertex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/material/pristineGridMaterial/shader/vertex.ts"],"sourcesContent":["export default /* glsl */ `\n\nprecision highp float;\n\n// Uniforms\nuniform float u_majorGridDiv;\nuniform float u_gridDiv;\n\nout vec2 v_uv; // Passed to the fragment shader\nout vec2 v_worldPos;\nvoid main() {\n vec4 transformed = vec4(position, 1.0);\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * transformed;\n\n vec3 worldPosition = (modelMatrix * transformed).xyz;\n\n v_worldPos = worldPosition.xz * u_gridDiv;\n\n // Use local position for grid calculations\n vec3 localPos = transformed.xyz;\n vec3 cameraCenteringOffset = floor(cameraPosition);\n vec3 cameraSnappedWorldPos = worldPosition.xyz - cameraCenteringOffset;\n v_uv = cameraSnappedWorldPos.xz * u_gridDiv;\n\n}\n`"],"mappings":"AAAA,eAAe"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
var Base = /*#__PURE__*/function () {
|
|
8
|
+
function Base() {
|
|
9
|
+
_classCallCheck(this, Base);
|
|
10
|
+
}
|
|
11
|
+
_createClass(Base, [{
|
|
12
|
+
key: "remove",
|
|
13
|
+
value: function remove() {}
|
|
14
|
+
}, {
|
|
15
|
+
key: "clone",
|
|
16
|
+
value: function clone() {}
|
|
17
|
+
}, {
|
|
18
|
+
key: "copy",
|
|
19
|
+
value: function copy() {}
|
|
20
|
+
}]);
|
|
21
|
+
return Base;
|
|
22
|
+
}();
|
|
23
|
+
export default Base;
|
|
24
|
+
//# sourceMappingURL=Base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Base"],"sources":["../../../src/poi/core/Base.ts"],"sourcesContent":["class Base {\n constructor() {\n\n }\n\n remove() {\n\n }\n\n clone() {\n }\n\n copy() {\n }\n}\n\nexport default Base"],"mappings":";;;;;;IAAMA,IAAI;EACR,gBAAc;IAAA;EAEd;EAAC;IAAA;IAAA,OAED,kBAAS,CAET;EAAC;IAAA;IAAA,OAED,iBAAQ,CACR;EAAC;IAAA;IAAA,OAED,gBAAO,CACP;EAAC;EAAA;AAAA;AAGH,eAAeA,IAAI"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
|
+
import { Object3D, Vector2 } from '@anov/3d-core';
|
|
18
|
+
import { EAnimationType, EPoiType, EventType } from "../utils/type";
|
|
19
|
+
import { getBasePoiStyle, getPanelStyle } from "../utils/css";
|
|
20
|
+
var DafultOption = {
|
|
21
|
+
animation: {
|
|
22
|
+
type: EAnimationType.fadeIn,
|
|
23
|
+
duration: 0.3
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var Css2D = /*#__PURE__*/function (_Object3D) {
|
|
27
|
+
_inherits(Css2D, _Object3D);
|
|
28
|
+
var _super = _createSuper(Css2D);
|
|
29
|
+
function Css2D(type, data, option) {
|
|
30
|
+
var _this;
|
|
31
|
+
_classCallCheck(this, Css2D);
|
|
32
|
+
_this = _super.call(this);
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "element", void 0);
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "contentDom", void 0);
|
|
35
|
+
_defineProperty(_assertThisInitialized(_this), "isCSS2DObject", void 0);
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "center", void 0);
|
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "poiType", void 0);
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "data", void 0);
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "option", void 0);
|
|
40
|
+
_this.poiType = type;
|
|
41
|
+
_this.data = data;
|
|
42
|
+
_this.option = _objectSpread(_objectSpread({}, DafultOption), option);
|
|
43
|
+
_this.element = _this.createElement();
|
|
44
|
+
if (!_this.element) throw new Error('Cannot generate HTMLElement element');
|
|
45
|
+
_this.isCSS2DObject = true;
|
|
46
|
+
_this.element.style.position = 'absolute';
|
|
47
|
+
_this.element.style.userSelect = 'none';
|
|
48
|
+
_this.element.setAttribute('draggable', 'false');
|
|
49
|
+
_this.center = new Vector2(0.5, 0.5); // ( 0, 0 ) is the lower left; ( 1, 1 ) is the top right
|
|
50
|
+
|
|
51
|
+
_this.addEventListener('removed', function () {
|
|
52
|
+
_this.traverse(function (object) {
|
|
53
|
+
if (object.element instanceof Element && object.element.parentNode !== null) object.element.parentNode.removeChild(object.element);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
_this.setAttribute();
|
|
57
|
+
return _this;
|
|
58
|
+
}
|
|
59
|
+
_createClass(Css2D, [{
|
|
60
|
+
key: "createElement",
|
|
61
|
+
value: function createElement() {
|
|
62
|
+
var _this2 = this;
|
|
63
|
+
var element;
|
|
64
|
+
// 直接传递DOM元素
|
|
65
|
+
if (this.data instanceof HTMLElement) {
|
|
66
|
+
element = this.data;
|
|
67
|
+
} else {
|
|
68
|
+
switch (this.poiType) {
|
|
69
|
+
case EPoiType.Base:
|
|
70
|
+
// 基础POI点
|
|
71
|
+
element = this.titlePanel(this.data);
|
|
72
|
+
break;
|
|
73
|
+
case EPoiType.Panel:
|
|
74
|
+
// 面板
|
|
75
|
+
element = this.contentPanel(this.data);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
EventType.forEach(function (type) {
|
|
80
|
+
element.addEventListener(type.name, function (event) {
|
|
81
|
+
(_this2._listeners[type.name] || []).forEach(function (cb) {
|
|
82
|
+
cb(event);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
return element;
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "setAttribute",
|
|
90
|
+
value: function setAttribute() {
|
|
91
|
+
var _this3 = this;
|
|
92
|
+
var hasExecuted = false;
|
|
93
|
+
// 执行渐显、打印内容等操作
|
|
94
|
+
this.onAfterRender = function () {
|
|
95
|
+
if (hasExecuted) return;
|
|
96
|
+
setTimeout(function () {
|
|
97
|
+
_this3.element.style.opacity = '1';
|
|
98
|
+
var print = _this3.option.print;
|
|
99
|
+
if (_this3.poiType === EPoiType.Panel && print) _this3.print(_this3.contentDom, _this3.data.content);
|
|
100
|
+
});
|
|
101
|
+
hasExecuted = true;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "titlePanel",
|
|
106
|
+
value: function titlePanel(data) {
|
|
107
|
+
var defaultStyle = getBasePoiStyle();
|
|
108
|
+
this.assignStyle(defaultStyle);
|
|
109
|
+
var containerDom = document.createElement('div');
|
|
110
|
+
Object.keys(defaultStyle).forEach(function (key) {
|
|
111
|
+
containerDom.style[key] = defaultStyle[key];
|
|
112
|
+
});
|
|
113
|
+
containerDom.innerText = data;
|
|
114
|
+
return containerDom;
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "contentPanel",
|
|
118
|
+
value: function contentPanel(data) {
|
|
119
|
+
var _this4 = this;
|
|
120
|
+
var defaultStyle = getPanelStyle();
|
|
121
|
+
this.assignStyle(defaultStyle.container);
|
|
122
|
+
var containerDom = document.createElement('div');
|
|
123
|
+
Object.keys(defaultStyle.container).forEach(function (key) {
|
|
124
|
+
containerDom.style[key] = defaultStyle.container[key];
|
|
125
|
+
});
|
|
126
|
+
var titleDom = document.createElement('div');
|
|
127
|
+
titleDom.innerText = data.title;
|
|
128
|
+
Object.keys(defaultStyle.title).forEach(function (key) {
|
|
129
|
+
titleDom.style[key] = defaultStyle.title[key];
|
|
130
|
+
});
|
|
131
|
+
containerDom.appendChild(titleDom);
|
|
132
|
+
this.contentDom = document.createElement('div');
|
|
133
|
+
if (!this.option.print) this.contentDom.innerText = data.content;
|
|
134
|
+
Object.keys(defaultStyle.content).forEach(function (key) {
|
|
135
|
+
_this4.contentDom.style[key] = defaultStyle.content[key];
|
|
136
|
+
});
|
|
137
|
+
containerDom.appendChild(this.contentDom);
|
|
138
|
+
return containerDom;
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "assignStyle",
|
|
142
|
+
value: function assignStyle(style) {
|
|
143
|
+
var _this$option = this.option,
|
|
144
|
+
width = _this$option.width,
|
|
145
|
+
height = _this$option.height,
|
|
146
|
+
img = _this$option.img,
|
|
147
|
+
animation = _this$option.animation;
|
|
148
|
+
if (animation) {
|
|
149
|
+
switch (animation.type) {
|
|
150
|
+
case EAnimationType.appear:
|
|
151
|
+
case EAnimationType.fadeIn:
|
|
152
|
+
style.opacity = 0;
|
|
153
|
+
style.transition = "opacity ".concat(animation.duration, "s ease");
|
|
154
|
+
break;
|
|
155
|
+
case EAnimationType.grow:
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (width) style.width = "".concat(width, "px");
|
|
160
|
+
if (height) style.height = "".concat(height, "px");
|
|
161
|
+
if (img) style.backgroundImage = "url(".concat(img, ")");
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "print",
|
|
165
|
+
value: function print(container, text) {
|
|
166
|
+
var index = 0;
|
|
167
|
+
var p = function p() {
|
|
168
|
+
if (index < text.length) {
|
|
169
|
+
container.textContent += text.charAt(index);
|
|
170
|
+
index++;
|
|
171
|
+
setTimeout(p, 20); // 调整打印速度,这里是每个字符间隔30毫秒
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
p();
|
|
176
|
+
}
|
|
177
|
+
}]);
|
|
178
|
+
return Css2D;
|
|
179
|
+
}(Object3D);
|
|
180
|
+
export default Css2D;
|
|
181
|
+
//# sourceMappingURL=Css2D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Object3D","Vector2","EAnimationType","EPoiType","EventType","getBasePoiStyle","getPanelStyle","DafultOption","animation","type","fadeIn","duration","Css2D","data","option","poiType","element","createElement","Error","isCSS2DObject","style","position","userSelect","setAttribute","center","addEventListener","traverse","object","Element","parentNode","removeChild","HTMLElement","Base","titlePanel","Panel","contentPanel","forEach","name","event","_listeners","cb","hasExecuted","onAfterRender","setTimeout","opacity","print","contentDom","content","defaultStyle","assignStyle","containerDom","document","Object","keys","key","innerText","container","titleDom","title","appendChild","width","height","img","appear","transition","grow","backgroundImage","text","index","p","length","textContent","charAt"],"sources":["../../../src/poi/core/Css2D.ts"],"sourcesContent":["import { Object3D, Vector2, use } from '@anov/3d-core'\nimport { EAnimationType, EPoiType, EventType } from '../utils/type'\nimport type { IEventType, IOption } from '../utils/type'\nimport { getBasePoiStyle, getPanelStyle } from '../utils/css'\n\nconst DafultOption = {\n animation: {\n type: EAnimationType.fadeIn,\n duration: 0.3,\n },\n}\n\nclass Css2D extends Object3D {\n element!: HTMLElement\n contentDom!: HTMLElement\n isCSS2DObject: boolean\n center: Vector2\n\n poiType: EPoiType\n data!: any\n option!: IOption\n\n constructor(type: EPoiType, data: any, option: IOption) {\n super()\n\n this.poiType = type\n this.data = data\n this.option = { ...DafultOption, ...option }\n this.element = this.createElement()\n\n if (!this.element)\n throw new Error('Cannot generate HTMLElement element')\n\n this.isCSS2DObject = true\n\n this.element.style.position = 'absolute'\n this.element.style.userSelect = 'none'\n this.element.setAttribute('draggable', 'false')\n\n this.center = new Vector2(0.5, 0.5) // ( 0, 0 ) is the lower left; ( 1, 1 ) is the top right\n\n this.addEventListener('removed', () => {\n this.traverse((object) => {\n if (object.element instanceof Element && object.element.parentNode !== null)\n object.element.parentNode.removeChild(object.element)\n })\n })\n this.setAttribute()\n }\n\n private createElement() {\n let element!: HTMLElement\n // 直接传递DOM元素\n if (this.data instanceof HTMLElement) {\n element = this.data\n }\n else {\n switch (this.poiType) {\n case EPoiType.Base: // 基础POI点\n element = this.titlePanel(this.data)\n break\n case EPoiType.Panel: // 面板\n element = this.contentPanel(this.data)\n break\n }\n }\n\n EventType.forEach((type: IEventType) => {\n element.addEventListener(type.name, (event) => {\n (this._listeners[type.name] || []).forEach((cb: Function) => {\n cb(event)\n })\n })\n })\n return element\n }\n\n setAttribute() {\n let hasExecuted = false\n // 执行渐显、打印内容等操作\n this.onAfterRender = () => {\n if (hasExecuted)\n return\n setTimeout(() => {\n this.element.style.opacity = '1'\n const { print } = this.option\n if (this.poiType === EPoiType.Panel && print)\n this.print(this.contentDom, this.data.content)\n })\n hasExecuted = true\n }\n }\n\n private titlePanel(data: string) {\n const defaultStyle = getBasePoiStyle()\n this.assignStyle(defaultStyle)\n const containerDom = document.createElement('div')\n Object.keys(defaultStyle).forEach((key) => {\n containerDom.style[key as any] = defaultStyle[key]\n })\n containerDom.innerText = data as string\n return containerDom\n }\n\n private contentPanel(data: any) {\n const defaultStyle = getPanelStyle()\n this.assignStyle(defaultStyle.container)\n const containerDom = document.createElement('div')\n Object.keys(defaultStyle.container).forEach((key) => {\n containerDom.style[key as any] = defaultStyle.container[key]\n })\n\n const titleDom = document.createElement('div')\n titleDom.innerText = data.title\n Object.keys(defaultStyle.title).forEach((key) => {\n titleDom.style[key as any] = defaultStyle.title[key]\n })\n containerDom.appendChild(titleDom)\n\n this.contentDom = document.createElement('div')\n if (!this.option.print)\n this.contentDom.innerText = data.content\n Object.keys(defaultStyle.content).forEach((key) => {\n this.contentDom.style[key as any] = defaultStyle.content[key]\n })\n containerDom.appendChild(this.contentDom)\n return containerDom\n }\n\n private assignStyle(style: any) {\n const { width, height, img, animation } = this.option\n if (animation) {\n switch (animation.type) {\n case EAnimationType.appear:\n case EAnimationType.fadeIn:\n style.opacity = 0\n style.transition = `opacity ${animation.duration}s ease`\n break\n case EAnimationType.grow:\n break\n }\n }\n if (width)\n style.width = `${width}px`\n if (height)\n style.height = `${height}px`\n if (img)\n style.backgroundImage = `url(${img})`\n }\n\n private print(container: HTMLElement, text: string) {\n let index = 0\n const p = () => {\n if (index < text.length) {\n container.textContent += text.charAt(index)\n index++\n setTimeout(p, 20) // 调整打印速度,这里是每个字符间隔30毫秒\n }\n }\n p()\n }\n}\n\nexport default Css2D"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,EAAEC,OAAO,QAAa,eAAe;AACtD,SAASC,cAAc,EAAEC,QAAQ,EAAEC,SAAS;AAE5C,SAASC,eAAe,EAAEC,aAAa;AAEvC,IAAMC,YAAY,GAAG;EACnBC,SAAS,EAAE;IACTC,IAAI,EAAEP,cAAc,CAACQ,MAAM;IAC3BC,QAAQ,EAAE;EACZ;AACF,CAAC;AAAA,IAEKC,KAAK;EAAA;EAAA;EAUT,eAAYH,IAAc,EAAEI,IAAS,EAAEC,MAAe,EAAE;IAAA;IAAA;IACtD;IAAO;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAEP,MAAKC,OAAO,GAAGN,IAAI;IACnB,MAAKI,IAAI,GAAGA,IAAI;IAChB,MAAKC,MAAM,mCAAQP,YAAY,GAAKO,MAAM,CAAE;IAC5C,MAAKE,OAAO,GAAG,MAAKC,aAAa,EAAE;IAEnC,IAAI,CAAC,MAAKD,OAAO,EACf,MAAM,IAAIE,KAAK,CAAC,qCAAqC,CAAC;IAExD,MAAKC,aAAa,GAAG,IAAI;IAEzB,MAAKH,OAAO,CAACI,KAAK,CAACC,QAAQ,GAAG,UAAU;IACxC,MAAKL,OAAO,CAACI,KAAK,CAACE,UAAU,GAAG,MAAM;IACtC,MAAKN,OAAO,CAACO,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC;IAE/C,MAAKC,MAAM,GAAG,I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,MAAM;UAC1B,KAAK7D,cAAc,CAACQ,MAAM;YACxBU,KAAK,CAACwB,OAAO,GAAG,CAAC;YACjBxB,KAAK,CAAC4C,UAAU,qBAAcxD,SAAS,CAACG,QAAQ,WAAQ;YACxD;UACF,KAAKT,cAAc,CAAC+D,IAAI;YACtB;QAAK;MAEX;MACA,IAAIL,KAAK,EACPxC,KAAK,CAACwC,KAAK,aAAMA,KAAK,OAAI;MAC5B,IAAIC,MAAM,EACRzC,KAAK,CAACyC,MAAM,aAAMA,MAAM,OAAI;MAC9B,IAAIC,GAAG,EACL1C,KAAK,CAAC8C,eAAe,iBAAUJ,GAAG,MAAG;IACzC;EAAC;IAAA;IAAA,OAED,eAAcN,SAAsB,EAAEW,IAAY,EAAE;MAClD,IAAIC,KAAK,GAAG,CAAC;MACb,IAAMC,CAAC,GAAG,SAAJA,CAAC,GAAS;QACd,IAAID,KAAK,GAAGD,IAAI,CAACG,MAAM,EAAE;UACvBd,SAAS,CAACe,WAAW,IAAIJ,IAAI,CAACK,MAAM,CAACJ,KAAK,CAAC;UAC3CA,KAAK,EAAE;UACPzB,UAAU,CAAC0B,CAAC,EAAE,EAAE,CAAC,EAAC;QACpB;MACF,CAAC;;MACDA,CAAC,EAAE;IACL;EAAC;EAAA;AAAA,EApJiBrE,QAAQ;AAuJ5B,eAAeY,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
import Base from "./Base";
|
|
15
|
+
var Css3D = /*#__PURE__*/function (_Base) {
|
|
16
|
+
_inherits(Css3D, _Base);
|
|
17
|
+
var _super = _createSuper(Css3D);
|
|
18
|
+
function Css3D() {
|
|
19
|
+
_classCallCheck(this, Css3D);
|
|
20
|
+
return _super.call(this);
|
|
21
|
+
}
|
|
22
|
+
return _createClass(Css3D);
|
|
23
|
+
}(Base);
|
|
24
|
+
//# sourceMappingURL=Css3D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Base","Css3D"],"sources":["../../../src/poi/core/Css3D.ts"],"sourcesContent":["import Base from './Base'\n\nclass Css3D extends Base {\n constructor() {\n super()\n }\n}"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,IAAI;AAAc,IAEnBC,KAAK;EAAA;EAAA;EACT,iBAAc;IAAA;IAAA;EAEd;EAAC;AAAA,EAHiBD,IAAI"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Sprite } from '@anov/3d-core';
|
|
2
|
+
import type { EPoiType, IOption } from '../utils/type';
|
|
3
|
+
declare class AnovSprite extends Sprite {
|
|
4
|
+
poiType: EPoiType;
|
|
5
|
+
data: any;
|
|
6
|
+
option: IOption;
|
|
7
|
+
constructor(type: EPoiType, data: string, option: IOption);
|
|
8
|
+
private create;
|
|
9
|
+
private setAttribute;
|
|
10
|
+
addEventListener(type: string, cb: any): () => void;
|
|
11
|
+
}
|
|
12
|
+
export default AnovSprite;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
11
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
12
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
|
+
import { Sprite, SpriteMaterial, Texture, Vector2 } from '@anov/3d-core';
|
|
23
|
+
import gsap from 'gsap';
|
|
24
|
+
import { getCanvas } from "../utils/canvas";
|
|
25
|
+
import { EAnimationType } from "../utils/type";
|
|
26
|
+
import { POI_IMG } from "../utils/base64";
|
|
27
|
+
var DafultOption = {
|
|
28
|
+
width: 200,
|
|
29
|
+
height: 260,
|
|
30
|
+
img: POI_IMG,
|
|
31
|
+
scale: 60,
|
|
32
|
+
animation: {
|
|
33
|
+
type: EAnimationType.appear,
|
|
34
|
+
duration: 0.3
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var AnovSprite = /*#__PURE__*/function (_Sprite) {
|
|
38
|
+
_inherits(AnovSprite, _Sprite);
|
|
39
|
+
var _super = _createSuper(AnovSprite);
|
|
40
|
+
function AnovSprite(type, data, option) {
|
|
41
|
+
var _this;
|
|
42
|
+
_classCallCheck(this, AnovSprite);
|
|
43
|
+
_this = _super.call(this, new SpriteMaterial({
|
|
44
|
+
map: null
|
|
45
|
+
}));
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "poiType", void 0);
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "data", void 0);
|
|
48
|
+
_defineProperty(_assertThisInitialized(_this), "option", void 0);
|
|
49
|
+
_this.poiType = type;
|
|
50
|
+
_this.data = data;
|
|
51
|
+
_this.option = _objectSpread(_objectSpread({}, DafultOption), option);
|
|
52
|
+
_this.create();
|
|
53
|
+
return _this;
|
|
54
|
+
}
|
|
55
|
+
_createClass(AnovSprite, [{
|
|
56
|
+
key: "create",
|
|
57
|
+
value: function create() {
|
|
58
|
+
var _this2 = this;
|
|
59
|
+
var _this$option = this.option,
|
|
60
|
+
_this$option$scale = _this$option.scale,
|
|
61
|
+
scale = _this$option$scale === void 0 ? 1 : _this$option$scale,
|
|
62
|
+
animation = _this$option.animation;
|
|
63
|
+
// 精灵的锚点
|
|
64
|
+
this.center = new Vector2(0.5, 0);
|
|
65
|
+
this.scale.setX(scale);
|
|
66
|
+
this.scale.setZ(scale);
|
|
67
|
+
this.visible = false;
|
|
68
|
+
// 异步生成材质
|
|
69
|
+
var setMaterial = /*#__PURE__*/function () {
|
|
70
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
71
|
+
var canvas, isFadeOrAppearAnimation, opacity, texture;
|
|
72
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
73
|
+
while (1) switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
_context.next = 2;
|
|
76
|
+
return getCanvas(_this2.data, _this2.option);
|
|
77
|
+
case 2:
|
|
78
|
+
canvas = _context.sent;
|
|
79
|
+
// 判断条件
|
|
80
|
+
isFadeOrAppearAnimation = (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.fadeIn || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear; // 根据条件设置 opacity 的值
|
|
81
|
+
opacity = isFadeOrAppearAnimation ? 0 : 1; // 生成精灵模型
|
|
82
|
+
texture = new Texture(canvas);
|
|
83
|
+
texture.needsUpdate = true;
|
|
84
|
+
_this2.material = new SpriteMaterial({
|
|
85
|
+
map: texture,
|
|
86
|
+
opacity: opacity
|
|
87
|
+
});
|
|
88
|
+
_this2.visible = true;
|
|
89
|
+
case 9:
|
|
90
|
+
case "end":
|
|
91
|
+
return _context.stop();
|
|
92
|
+
}
|
|
93
|
+
}, _callee);
|
|
94
|
+
}));
|
|
95
|
+
return function setMaterial() {
|
|
96
|
+
return _ref.apply(this, arguments);
|
|
97
|
+
};
|
|
98
|
+
}();
|
|
99
|
+
setMaterial();
|
|
100
|
+
this.setAttribute();
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "setAttribute",
|
|
104
|
+
value: function setAttribute() {
|
|
105
|
+
var _this3 = this;
|
|
106
|
+
var hasExecuted = false;
|
|
107
|
+
// 执行渐显、打印内容等操作
|
|
108
|
+
this.onAfterRender = function () {
|
|
109
|
+
if (hasExecuted) return;
|
|
110
|
+
setTimeout(function () {
|
|
111
|
+
var animation = _this3.option.animation;
|
|
112
|
+
if ((animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.fadeIn || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear) {
|
|
113
|
+
gsap.to(_this3.material, _objectSpread(_objectSpread({
|
|
114
|
+
opacity: 1
|
|
115
|
+
}, animation), {}, {
|
|
116
|
+
repeat: 0,
|
|
117
|
+
ease: 'none'
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
if ((animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.grow || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear) {
|
|
121
|
+
gsap.to(_this3.scale, _objectSpread(_objectSpread({
|
|
122
|
+
y: _this3.option.scale
|
|
123
|
+
}, animation), {}, {
|
|
124
|
+
repeat: 0,
|
|
125
|
+
ease: 'power2.out'
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
hasExecuted = true;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
key: "addEventListener",
|
|
134
|
+
value: function addEventListener(type, cb) {
|
|
135
|
+
var _this4 = this;
|
|
136
|
+
_get(_getPrototypeOf(AnovSprite.prototype), "addEventListener", this).call(this, type, cb);
|
|
137
|
+
return function () {
|
|
138
|
+
return _get(_getPrototypeOf(AnovSprite.prototype), "removeEventListener", _this4).call(_this4, type, cb);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}]);
|
|
142
|
+
return AnovSprite;
|
|
143
|
+
}(Sprite);
|
|
144
|
+
export default AnovSprite;
|
|
145
|
+
//# sourceMappingURL=Sprite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Sprite","SpriteMaterial","Texture","Vector2","gsap","getCanvas","EAnimationType","POI_IMG","DafultOption","width","height","img","scale","animation","type","appear","duration","AnovSprite","data","option","map","poiType","create","center","setX","setZ","visible","setMaterial","canvas","isFadeOrAppearAnimation","fadeIn","opacity","texture","needsUpdate","material","setAttribute","hasExecuted","onAfterRender","setTimeout","to","repeat","ease","grow","y","cb"],"sources":["../../../src/poi/core/Sprite.ts"],"sourcesContent":["import { Sprite, SpriteMaterial, Texture, Vector2 } from '@anov/3d-core'\nimport gsap from 'gsap'\nimport { getCanvas } from '../utils/canvas'\nimport { EAnimationType } from '../utils/type'\nimport type { EPoiType, IOption } from '../utils/type'\nimport { POI_IMG } from '../utils/base64'\n\nconst DafultOption = {\n width: 200,\n height: 260,\n img: POI_IMG,\n scale: 60,\n animation: {\n type: EAnimationType.appear,\n duration: 0.3,\n },\n}\n\nclass AnovSprite extends Sprite {\n poiType: EPoiType\n data!: any\n option!: IOption\n constructor(type: EPoiType, data: string, option: IOption) {\n super(new SpriteMaterial({ map: null }))\n this.poiType = type\n this.data = data\n this.option = { ...DafultOption, ...option }\n this.create()\n }\n\n private create() {\n const { scale = 1, animation } = this.option\n // 精灵的锚点\n this.center = new Vector2(0.5, 0)\n this.scale.setX(scale)\n this.scale.setZ(scale)\n this.visible = false\n // 异步生成材质\n const setMaterial = async () => {\n const canvas = await getCanvas(this.data, this.option)\n // 判断条件\n const isFadeOrAppearAnimation = animation?.type === EAnimationType.fadeIn || animation?.type === EAnimationType.appear\n // 根据条件设置 opacity 的值\n const opacity = isFadeOrAppearAnimation ? 0 : 1\n // 生成精灵模型\n const texture = new Texture(canvas)\n texture.needsUpdate = true\n this.material = new SpriteMaterial({ map: texture, opacity })\n this.visible = true\n }\n setMaterial()\n this.setAttribute()\n }\n\n private setAttribute() {\n let hasExecuted = false\n // 执行渐显、打印内容等操作\n this.onAfterRender = () => {\n if (hasExecuted)\n return\n setTimeout(() => {\n const { animation } = this.option\n if (animation?.type === EAnimationType.fadeIn || animation?.type === EAnimationType.appear) {\n gsap.to(this.material, {\n opacity: 1,\n ...animation,\n repeat: 0,\n ease: 'none',\n })\n }\n if (animation?.type === EAnimationType.grow || animation?.type === EAnimationType.appear) {\n gsap.to(this.scale, {\n y: this.option.scale,\n ...animation,\n repeat: 0,\n ease: 'power2.out',\n })\n }\n })\n hasExecuted = true\n }\n }\n\n public addEventListener(type: string, cb: any) {\n super.addEventListener(type, cb)\n return () => super.removeEventListener(type, cb)\n }\n}\n\nexport default AnovSprite"],"mappings":";+CACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADA,SAASA,MAAM,EAAEC,cAAc,EAAEC,OAAO,EAAEC,OAAO,QAAQ,eAAe;AACxE,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,SAAS;AAClB,SAASC,cAAc;AAEvB,SAASC,OAAO;AAEhB,IAAMC,YAAY,GAAG;EACnBC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;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CAAC,EAAE,MAAI,CAACxB,MAAM,CAACP;YAAK,GACjBC,SAAS;cACZ2B,MAAM,EAAE,CAAC;cACTC,IAAI,EAAE;YAAY,GAClB;UACJ;QACF,CAAC,CAAC;QACFL,WAAW,GAAG,IAAI;MACpB,CAAC;IACH;EAAC;IAAA;IAAA,OAED,0BAAwBtB,IAAY,EAAE8B,EAAO,EAAE;MAAA;MAC7C,iFAAuB9B,IAAI,EAAE8B,EAAE;MAC/B,OAAO;QAAA,+FAAgC9B,IAAI,EAAE8B,EAAE;MAAA,CAAC;IAClD;EAAC;EAAA;AAAA,EApEsB5C,MAAM;AAuE/B,eAAeiB,UAAU"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sprite } from '@anov/3d-core';
|
|
2
|
+
import type { EPoiType, IOption } from '../utils/type';
|
|
3
|
+
declare class AnovSprite extends Sprite {
|
|
4
|
+
poiType: EPoiType;
|
|
5
|
+
data: HTMLElement;
|
|
6
|
+
option: IOption;
|
|
7
|
+
constructor(type: EPoiType, data: HTMLElement, option: IOption);
|
|
8
|
+
private create;
|
|
9
|
+
private dom2Canvas;
|
|
10
|
+
}
|
|
11
|
+
export default AnovSprite;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
6
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
9
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
+
import { Sprite, SpriteMaterial, Vector2 } from '@anov/3d-core';
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
import { Curtains } from 'curtainsjs';
|
|
18
|
+
var AnovSprite = /*#__PURE__*/function (_Sprite) {
|
|
19
|
+
_inherits(AnovSprite, _Sprite);
|
|
20
|
+
var _super = _createSuper(AnovSprite);
|
|
21
|
+
function AnovSprite(type, data, option) {
|
|
22
|
+
var _this;
|
|
23
|
+
_classCallCheck(this, AnovSprite);
|
|
24
|
+
_this = _super.call(this, new SpriteMaterial());
|
|
25
|
+
_defineProperty(_assertThisInitialized(_this), "poiType", void 0);
|
|
26
|
+
_defineProperty(_assertThisInitialized(_this), "data", void 0);
|
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "option", void 0);
|
|
28
|
+
_this.poiType = type;
|
|
29
|
+
_this.data = data;
|
|
30
|
+
_this.create();
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
_createClass(AnovSprite, [{
|
|
34
|
+
key: "create",
|
|
35
|
+
value: function create() {
|
|
36
|
+
var _this$option = this.option,
|
|
37
|
+
_this$option$scale = _this$option.scale,
|
|
38
|
+
scale = _this$option$scale === void 0 ? 1 : _this$option$scale,
|
|
39
|
+
animation = _this$option.animation;
|
|
40
|
+
// 精灵的锚点
|
|
41
|
+
this.center = new Vector2(0.5, 0);
|
|
42
|
+
this.scale.setX(scale);
|
|
43
|
+
this.scale.setZ(scale);
|
|
44
|
+
this.visible = false;
|
|
45
|
+
this.dom2Canvas();
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "dom2Canvas",
|
|
49
|
+
value: function dom2Canvas() {
|
|
50
|
+
var curtains = new Curtains({
|
|
51
|
+
container: 'canvas'
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
return AnovSprite;
|
|
56
|
+
}(Sprite);
|
|
57
|
+
export default AnovSprite;
|
|
58
|
+
//# sourceMappingURL=SpriteBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Sprite","SpriteMaterial","Vector2","Curtains","AnovSprite","type","data","option","poiType","create","scale","animation","center","setX","setZ","visible","dom2Canvas","curtains","container"],"sources":["../../../src/poi/core/SpriteBase.ts"],"sourcesContent":["import { Sprite, SpriteMaterial, Texture, Vector2 } from '@anov/3d-core'\nimport gsap from 'gsap'\n\n// @ts-ignore\nimport { Curtains } from 'curtainsjs'\nimport { getCanvas } from '../utils/canvas'\nimport { EAnimationType } from '../utils/type'\nimport type { EPoiType, IOption } from '../utils/type'\n\nclass AnovSprite extends Sprite {\n poiType: EPoiType\n data: HTMLElement\n option!: IOption\n constructor(type: EPoiType, data: HTMLElement, option: IOption) {\n super(new SpriteMaterial())\n this.poiType = type\n this.data = data\n this.create()\n }\n\n private create() {\n const { scale = 1, animation } = this.option\n // 精灵的锚点\n this.center = new Vector2(0.5, 0)\n this.scale.setX(scale)\n this.scale.setZ(scale)\n this.visible = false\n this.dom2Canvas()\n }\n\n private dom2Canvas() {\n const curtains = new Curtains({\n container: 'canvas',\n })\n }\n}\n\nexport default AnovSprite"],"mappings":";;;;;;;;;;;;;;AAAA,SAASA,MAAM,EAAEC,cAAc,EAAWC,OAAO,QAAQ,eAAe;AAGxE;AACA,SAASC,QAAQ,QAAQ,YAAY;AAAA,IAK/BC,UAAU;EAAA;EAAA;EAId,oBAAYC,IAAc,EAAEC,IAAiB,EAAEC,MAAe,EAAE;IAAA;IAAA;IAC9D,0BAAM,IAAIN,cAAc,EAAE;IAAC;IAAA;IAAA;IAC3B,MAAKO,OAAO,GAAGH,IAAI;IACnB,MAAKC,IAAI,GAAGA,IAAI;IAChB,MAAKG,MAAM,EAAE;IAAA;EACf;EAAC;IAAA;IAAA,OAED,kBAAiB;MACf,mBAAiC,IAAI,CAACF,MAAM;QAAA,kCAApCG,KAAK;QAALA,KAAK,mCAAG,CAAC;QAAEC,SAAS,gBAATA,SAAS;MAC5B;MACA,IAAI,CAACC,MAAM,GAAG,IAAIV,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;MACjC,IAAI,CAACQ,KAAK,CAACG,IAAI,CAACH,KAAK,CAAC;MACtB,IAAI,CAACA,KAAK,CAACI,IAAI,CAACJ,KAAK,CAAC;MACtB,IAAI,CAACK,OAAO,GAAG,KAAK;MACpB,IAAI,CAACC,UAAU,EAAE;IACnB;EAAC;IAAA;IAAA,OAED,sBAAqB;MACnB,IAAMC,QAAQ,GAAG,IAAId,QAAQ,CAAC;QAC5Be,SAAS,EAAE;MACb,CAAC,CAAC;IACJ;EAAC;EAAA;AAAA,EAzBsBlB,MAAM;AA4B/B,eAAeI,UAAU"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import AnovSprite from './core/Sprite';
|
|
2
|
+
import Css2D from './core/Css2d';
|
|
3
|
+
import type { IOption } from './utils/type';
|
|
4
|
+
import { EPoiType } from './utils/type';
|
|
5
|
+
declare class Poi {
|
|
6
|
+
type: EPoiType;
|
|
7
|
+
currentObject: AnovSprite | Css2D;
|
|
8
|
+
constructor(type: EPoiType);
|
|
9
|
+
create(data: any, option?: IOption): AnovSprite | Css2D;
|
|
10
|
+
}
|
|
11
|
+
export default Poi;
|
|
12
|
+
export { EPoiType };
|