@shijiu/jsview-vue 2.1.200 → 2.1.339-test.0
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/bin/browser/BrowserApic.vue.mjs +124 -0
- package/bin/browser/BrowserApic2.vue.mjs +118 -0
- package/bin/browser/BrowserApicLib.mjs +424 -0
- package/bin/browser/BrowserAudio.vue.mjs +263 -0
- package/bin/browser/BrowserJsvLatex.vue.mjs +110 -0
- package/bin/browser/BrowserJsvPlayer.vue.mjs +573 -0
- package/bin/browser/BrowserPreload.vue.mjs +154 -0
- package/bin/browser/BrowserQrcode.vue.mjs +178 -0
- package/bin/browser/BrowserSpray.vue.mjs +66 -0
- package/bin/browser/BrowserTextureAnim.vue.mjs +324 -0
- package/bin/export-sfc.mjs +12 -0
- package/bin/jsview-common.mjs +39 -0
- package/bin/jsview-vue.mjs +21106 -0
- package/index.js +3 -4
- package/package.json +1 -2
- package/tools/config/rollup.config.mjs +52 -0
- package/tools/config/tsconfig.json +18 -0
- package/tools/config/vite.config.ts +60 -0
- package/tools/jsview-vue-build.mjs +125 -0
- package/utils/JsViewEngineWidget/{JsvFocusBlock.vue → JsvFocus/JsvFocusBlock.vue} +11 -11
- package/utils/JsViewEngineWidget/{JsvFocusHub.ts → JsvFocus/JsvFocusHub.ts} +9 -3
- package/utils/JsViewEngineWidget/{JsvFocusManager.js → JsvFocus/JsvFocusManager.js} +6 -5
- package/utils/JsViewEngineWidget/MetroWidget/AnimationManager.ts +33 -10
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +89 -57
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +118 -62
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +504 -60
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +11 -1
- package/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue +13 -0
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +34 -1
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +52 -11
- package/utils/JsViewEngineWidget/index.js +3 -3
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +9 -0
- package/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue +11 -3
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +1 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +8 -0
- package/utils/JsViewPlugin/JsvAudio/ScreenLockManager.js +16 -0
- package/utils/JsViewPlugin/JsvAudio/version.js +3 -3
- package/utils/JsViewPlugin/JsvAudio/version.mjs +3 -3
- package/utils/JsViewPlugin/JsvLatex/index.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +1 -1
- package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +3 -3
- package/utils/JsViewPlugin/JsvPlayer/index.js +2 -2
- package/utils/JsViewVueTools/DebugTool.js +2 -2
- package/utils/JsViewVueTools/DefaultKeyMap.js +1 -1
- package/utils/JsViewVueTools/JsvDynamicCssStyle.js +1 -1
- package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +2 -2
- package/utils/JsViewVueTools/JsvImpactTracer.js +7 -7
- package/utils/JsViewVueTools/JsvPreDownloader.ts +1 -1
- package/utils/JsViewVueTools/JsvRefTaker.js +2 -1
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +29 -29
- package/utils/JsViewVueTools/JsvStyleClass.js +3 -3
- package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +1 -1
- package/utils/JsViewVueTools/JsvTextTools.js +4 -4
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.ts +29 -1
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +6 -5
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +60 -2
- package/utils/JsViewVueTools/NinePatchHelper.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
- package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvApic}/BrowserApic.vue +20 -23
- package/utils/JsViewVueWidget/JsvApic/{JsvApic.vue → JsvApic/JsvApic.vue} +3 -14
- package/utils/JsViewVueWidget/JsvApic/{index.js → JsvApic/index.js} +2 -4
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +116 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +137 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/index.js +17 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.js +4 -0
- package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/NormalLoopTool.js +16 -18
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.js +90 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.js +17 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.js +111 -0
- package/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.js +48 -0
- package/utils/JsViewVueWidget/JsvConnectLine/ArcLineManager.js +71 -0
- package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +354 -0
- package/utils/JsViewVueWidget/JsvConnectLine/index.js +2 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +37 -18
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts +7 -3
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +28 -2
- package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +12 -5
- package/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.ts +21 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +47 -59
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +129 -12
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +45 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +10 -2
- package/utils/JsViewVueWidget/JsvGrid.vue +1 -1
- package/utils/JsViewVueWidget/JsvHole.js +1 -1
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +1 -1
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -2
- package/utils/JsViewVueWidget/JsvLine/LineManager.js +6 -4
- package/utils/JsViewVueWidget/JsvMarquee.vue +7 -4
- package/utils/JsViewVueWidget/JsvPieChart.vue +1 -1
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +1 -1
- package/utils/JsViewVueWidget/JsvPreload/index.js +1 -1
- package/utils/JsViewVueWidget/JsvProgressBar.vue +172 -0
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +0 -1
- package/utils/JsViewVueWidget/JsvQrcode/index.js +1 -1
- package/utils/JsViewVueWidget/JsvRadarChart.vue +1 -1
- package/utils/JsViewVueWidget/JsvScaleTextBox.vue +0 -2
- package/utils/JsViewVueWidget/JsvSector.vue +1 -1
- package/utils/JsViewVueWidget/JsvSoundPool.js +1 -1
- package/utils/JsViewVueWidget/JsvSpray/index.js +1 -1
- package/utils/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.ts +235 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +433 -401
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +120 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +5 -5
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +425 -422
- package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +1 -1
- package/utils/JsViewVueWidget/index.js +7 -3
- package/utils/index.js +4 -0
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/LoopToolBase.js +0 -25
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/PartLoopTool.js +0 -119
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/Viewer.js +0 -106
- /package/utils/JsViewPlugin/JsvLatex/{JsvLatexBrowser.vue → BrowserJsvLatex.vue} +0 -0
- /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser-0.9.vue → BrowserJsvPlayer-0.9.vue} +0 -0
- /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser.vue → BrowserJsvPlayer.vue} +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/ApicDataBase.js +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/GifData.js +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/WebpData.js +0 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { openBlock, createElementBlock } from 'vue';
|
|
2
|
+
import { _ as _export_sfc } from '../export-sfc.mjs';
|
|
3
|
+
|
|
4
|
+
//!
|
|
5
|
+
//! utils/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue;
|
|
6
|
+
//!
|
|
7
|
+
/*! <!--
|
|
8
|
+
* @Author: ChenChanghua
|
|
9
|
+
* @Date: 2022-02-08 09:29:17
|
|
10
|
+
* @LastEditTime: 2023-02-21 10:51:22
|
|
11
|
+
* @Description: file content
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
const DECORATE_BORDER_RADIUS = "BroderRaidus";
|
|
17
|
+
const DECORATE_NINEPATCH_ALPHA_MIX = "NinePatchAlphaMix";
|
|
18
|
+
const TexAlignAnchor = {
|
|
19
|
+
LEFT_TOP: 1,
|
|
20
|
+
CENTER_TOP: 2,
|
|
21
|
+
RIGHT_TOP: 3,
|
|
22
|
+
LEFT_MIDDLE: 4,
|
|
23
|
+
CENTER: 5,
|
|
24
|
+
RIGHT_MIDDLE: 6,
|
|
25
|
+
LEFT_BOTTOM: 7,
|
|
26
|
+
CENTER_BOTTOM: 8,
|
|
27
|
+
RIGHT_BOTTOM: 9
|
|
28
|
+
};
|
|
29
|
+
const getOffset = (type, viewW, viewH, texLeft, texTop) => {
|
|
30
|
+
let extraLeft, extraTop;
|
|
31
|
+
switch (type) {
|
|
32
|
+
case TexAlignAnchor.LEFT_TOP:
|
|
33
|
+
extraLeft = 0;
|
|
34
|
+
extraTop = 0;
|
|
35
|
+
break;
|
|
36
|
+
case TexAlignAnchor.CENTER_TOP:
|
|
37
|
+
extraLeft = viewW / 2;
|
|
38
|
+
extraTop = 0;
|
|
39
|
+
break;
|
|
40
|
+
case TexAlignAnchor.RIGHT_TOP:
|
|
41
|
+
extraLeft = viewW;
|
|
42
|
+
extraTop = 0;
|
|
43
|
+
break;
|
|
44
|
+
case TexAlignAnchor.LEFT_MIDDLE:
|
|
45
|
+
extraLeft = 0;
|
|
46
|
+
extraTop = viewH / 2;
|
|
47
|
+
break;
|
|
48
|
+
case TexAlignAnchor.RIGHT_MIDDLE:
|
|
49
|
+
extraLeft = viewW;
|
|
50
|
+
extraTop = viewH / 2;
|
|
51
|
+
break;
|
|
52
|
+
case TexAlignAnchor.LEFT_BOTTOM:
|
|
53
|
+
extraLeft = 0;
|
|
54
|
+
extraTop = viewH;
|
|
55
|
+
break;
|
|
56
|
+
case TexAlignAnchor.CENTER_BOTTOM:
|
|
57
|
+
extraLeft = viewW / 2;
|
|
58
|
+
extraTop = viewH;
|
|
59
|
+
break;
|
|
60
|
+
case TexAlignAnchor.RIGHT_BOTTOM:
|
|
61
|
+
extraLeft = viewW;
|
|
62
|
+
extraTop = viewH;
|
|
63
|
+
break;
|
|
64
|
+
case TexAlignAnchor.CENTER:
|
|
65
|
+
default:
|
|
66
|
+
extraLeft = viewW / 2;
|
|
67
|
+
extraTop = viewH / 2;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return [texLeft + extraLeft, texTop + extraTop];
|
|
71
|
+
};
|
|
72
|
+
let TOKEN = 0;
|
|
73
|
+
const _sfc_main = {
|
|
74
|
+
props: {
|
|
75
|
+
src: String,
|
|
76
|
+
top: Number,
|
|
77
|
+
left: Number,
|
|
78
|
+
width: Number,
|
|
79
|
+
height: Number,
|
|
80
|
+
borderRadius: [String, Number],
|
|
81
|
+
decorate: Object,
|
|
82
|
+
animation: String,
|
|
83
|
+
duration: Number,
|
|
84
|
+
transform: String,
|
|
85
|
+
transformOrigin: String,
|
|
86
|
+
repeat: {
|
|
87
|
+
type: Number,
|
|
88
|
+
default: 1
|
|
89
|
+
},
|
|
90
|
+
delay: {
|
|
91
|
+
type: Number,
|
|
92
|
+
default: 0
|
|
93
|
+
},
|
|
94
|
+
easing: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "linear"
|
|
97
|
+
},
|
|
98
|
+
onAnimationEnd: Function,
|
|
99
|
+
autoStart: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: false
|
|
102
|
+
},
|
|
103
|
+
texCoord: {
|
|
104
|
+
type: Object
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
setup(props) {
|
|
108
|
+
return {
|
|
109
|
+
animName: "browser-texture-anim-" + TOKEN++,
|
|
110
|
+
animDiv: null,
|
|
111
|
+
clipDiv: null,
|
|
112
|
+
imgDiv: null,
|
|
113
|
+
watcherHandlerList: []
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
computed: {
|
|
117
|
+
animSet() {
|
|
118
|
+
return `${this.animName} ${this.duration / 1e3}s ${this.easing} ${this.delay / 1e3}s ${this.repeat === -1 ? "infinite" : this.repeat}`;
|
|
119
|
+
},
|
|
120
|
+
textureLayout() {
|
|
121
|
+
if (!isNaN(this.texCoord?.width) && !isNaN(this.texCoord?.height)) {
|
|
122
|
+
const texLeft = !isNaN(this.texCoord.left) ? this.texCoord.left : -this.texCoord.width / 2;
|
|
123
|
+
const texTop = !isNaN(this.texCoord.top) ? this.texCoord.top : -this.texCoord.height / 2;
|
|
124
|
+
const type = !isNaN(this.texCoord.alignAnchor) ? this.texCoord.alignAnchor : 5;
|
|
125
|
+
const offset = getOffset(
|
|
126
|
+
type,
|
|
127
|
+
this.width,
|
|
128
|
+
this.height,
|
|
129
|
+
texLeft,
|
|
130
|
+
texTop
|
|
131
|
+
);
|
|
132
|
+
const transition = this.decorate?.animTime ? `left ${this.decorate.animTime}s, top ${this.decorate.animTime}s` : "";
|
|
133
|
+
return {
|
|
134
|
+
position: "absolute",
|
|
135
|
+
left: offset[0] + "px",
|
|
136
|
+
top: offset[1] + "px",
|
|
137
|
+
transition,
|
|
138
|
+
width: this.texCoord.width + "px",
|
|
139
|
+
height: this.texCoord.height + "px"
|
|
140
|
+
};
|
|
141
|
+
} else {
|
|
142
|
+
return {
|
|
143
|
+
position: "absolute",
|
|
144
|
+
left: "0px",
|
|
145
|
+
top: "0px",
|
|
146
|
+
width: this.width + "px",
|
|
147
|
+
height: this.height + "px"
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
maskStyle() {
|
|
152
|
+
if (this.borderRadius) {
|
|
153
|
+
const radiusObj = this._readRadius(this.borderRadius);
|
|
154
|
+
return {
|
|
155
|
+
left: this.left + "px",
|
|
156
|
+
top: this.top + "px",
|
|
157
|
+
borderRadius: `${radiusObj.topLeft}px ${radiusObj.topRight}px ${radiusObj.bottomLeft}px ${radiusObj.bottomRight}px`,
|
|
158
|
+
width: this.width + "px",
|
|
159
|
+
height: this.height + "px",
|
|
160
|
+
overflow: "hidden"
|
|
161
|
+
};
|
|
162
|
+
} else if (this.decorate) {
|
|
163
|
+
if (this.decorate.type == DECORATE_NINEPATCH_ALPHA_MIX) {
|
|
164
|
+
const imageDspWidth = this.decorate.imageDspWidth > 0 ? this.decorate.imageDspWidth : this.decorate.imageWidth;
|
|
165
|
+
const slideWidth = (this.decorate.imageWidth - this.decorate.centerWidth) / 2;
|
|
166
|
+
const outset = Math.ceil(
|
|
167
|
+
this.decorate.borderOutset * imageDspWidth / this.decorate.imageWidth
|
|
168
|
+
);
|
|
169
|
+
console.log("get mask style");
|
|
170
|
+
const transitionTime = this.decorate.animTime;
|
|
171
|
+
return {
|
|
172
|
+
left: this.left + "px",
|
|
173
|
+
top: this.top + "px",
|
|
174
|
+
width: this.width + "px",
|
|
175
|
+
height: this.height + "px",
|
|
176
|
+
transition: `left ${transitionTime}s, top ${transitionTime}s, width ${transitionTime}s, height ${transitionTime}s`,
|
|
177
|
+
webkitMaskBoxImageSource: this.decorate.url,
|
|
178
|
+
webkitMaskBoxImageSlice: slideWidth,
|
|
179
|
+
webkitMaskBoxImageWidth: Math.ceil(
|
|
180
|
+
slideWidth * imageDspWidth / this.decorate.imageWidth
|
|
181
|
+
) + "px",
|
|
182
|
+
webkitMaskBoxImageOutset: outset + "px",
|
|
183
|
+
position: "absolute"
|
|
184
|
+
};
|
|
185
|
+
} else if (this.decorate.type == DECORATE_BORDER_RADIUS) {
|
|
186
|
+
return {
|
|
187
|
+
left: this.left + "px",
|
|
188
|
+
top: this.top + "px",
|
|
189
|
+
borderRadius: `${this.decorate.topLeft}px ${this.decorate.topRight}px ${this.decorate.bottomRight}px ${this.decorate.bottomLeft}`,
|
|
190
|
+
width: this.width + "px",
|
|
191
|
+
height: this.height + "px",
|
|
192
|
+
overflow: "hidden"
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
} else {
|
|
196
|
+
return {
|
|
197
|
+
left: this.left + "px",
|
|
198
|
+
top: this.top + "px",
|
|
199
|
+
width: this.width + "px",
|
|
200
|
+
height: this.height + "px",
|
|
201
|
+
overflow: "hidden"
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
methods: {
|
|
207
|
+
_readRadius(setting) {
|
|
208
|
+
if (typeof setting == "number") {
|
|
209
|
+
return {
|
|
210
|
+
type: DECORATE_BORDER_RADIUS,
|
|
211
|
+
topLeft: setting,
|
|
212
|
+
topRight: setting,
|
|
213
|
+
bottomRight: setting,
|
|
214
|
+
bottomLeft: setting
|
|
215
|
+
};
|
|
216
|
+
} else if (typeof setting == "string" && setting.length > 0) {
|
|
217
|
+
const pattern = /\d+/g;
|
|
218
|
+
let match = setting.match(pattern);
|
|
219
|
+
if (match.length > 0) {
|
|
220
|
+
let top_left = match[0];
|
|
221
|
+
let top_right = match.length > 1 ? match[1] : top_left;
|
|
222
|
+
return {
|
|
223
|
+
type: DECORATE_BORDER_RADIUS,
|
|
224
|
+
topLeft: top_left,
|
|
225
|
+
topRight: top_right,
|
|
226
|
+
bottomRight: match.length > 2 ? match[2] : top_left,
|
|
227
|
+
bottomLeft: match.length > 3 ? match[3] : top_right
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return null;
|
|
232
|
+
},
|
|
233
|
+
start() {
|
|
234
|
+
if (this.animDiv && this.animation) {
|
|
235
|
+
this.animDiv.style.animation = this.animSet;
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
insertKeyframe(animDefine) {
|
|
239
|
+
const index = document.styleSheets[0].cssRules.length;
|
|
240
|
+
document.styleSheets[0].insertRule(animDefine, index);
|
|
241
|
+
},
|
|
242
|
+
removeKeyframe(animName) {
|
|
243
|
+
const styleSheetRef = document.styleSheets[0];
|
|
244
|
+
const cssRulesRef = styleSheetRef.cssRules;
|
|
245
|
+
for (let i = cssRulesRef.length - 1; i >= 0; i--) {
|
|
246
|
+
if (cssRulesRef[i].name === animName) {
|
|
247
|
+
styleSheetRef.deleteRule(i);
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
mounted() {
|
|
254
|
+
if (this.animation) {
|
|
255
|
+
this.insertKeyframe("@keyframes " + this.animName + " " + this.animation);
|
|
256
|
+
}
|
|
257
|
+
this.$refs.root.jsvGetProxyView().RegisterOnProxyReady(() => {
|
|
258
|
+
const root = this.$refs.root.jsvGetProxyView().HtmlGetElement();
|
|
259
|
+
this.clipDiv = window.originDocument.createElement("div");
|
|
260
|
+
Object.assign(this.clipDiv.style, this.maskStyle);
|
|
261
|
+
const textureLayout = this.textureLayout;
|
|
262
|
+
this.animDiv = window.originDocument.createElement("div");
|
|
263
|
+
Object.assign(this.animDiv.style, textureLayout);
|
|
264
|
+
this.animDiv.onanimationend = () => {
|
|
265
|
+
this.animDiv.style.animation = null;
|
|
266
|
+
this.onAnimationEnd?.();
|
|
267
|
+
};
|
|
268
|
+
this.imgDiv = window.originDocument.createElement("div");
|
|
269
|
+
this.imgDiv.style.width = textureLayout.width;
|
|
270
|
+
this.imgDiv.style.height = textureLayout.height;
|
|
271
|
+
this.imgDiv.style.backgroundImage = `url(${this.src})`;
|
|
272
|
+
this.imgDiv.style.transform = this.transform;
|
|
273
|
+
this.imgDiv.style.transformOrigin = this.transformOrigin;
|
|
274
|
+
this.animDiv.appendChild(this.imgDiv);
|
|
275
|
+
this.clipDiv.appendChild(this.animDiv);
|
|
276
|
+
root.appendChild(this.clipDiv);
|
|
277
|
+
});
|
|
278
|
+
this.watcherHandlerList.push(
|
|
279
|
+
this.$watch("left", (newValue) => {
|
|
280
|
+
this.clipDiv.style.left = newValue + "px";
|
|
281
|
+
})
|
|
282
|
+
);
|
|
283
|
+
this.watcherHandlerList.push(
|
|
284
|
+
this.$watch("top", (newValue) => {
|
|
285
|
+
this.clipDiv.style.top = newValue + "px";
|
|
286
|
+
})
|
|
287
|
+
);
|
|
288
|
+
this.watcherHandlerList.push(
|
|
289
|
+
this.$watch("width", (newValue) => {
|
|
290
|
+
this.clipDiv.style.width = newValue + "px";
|
|
291
|
+
})
|
|
292
|
+
);
|
|
293
|
+
this.watcherHandlerList.push(
|
|
294
|
+
this.$watch("height", (newValue) => {
|
|
295
|
+
this.clipDiv.style.height = newValue + "px";
|
|
296
|
+
})
|
|
297
|
+
);
|
|
298
|
+
this.watcherHandlerList.push(
|
|
299
|
+
this.$watch("textureLayout", (newValue) => {
|
|
300
|
+
Object.assign(this.animDiv.style, newValue);
|
|
301
|
+
this.imgDiv.style.width = newValue.width;
|
|
302
|
+
this.imgDiv.style.height = newValue.height;
|
|
303
|
+
})
|
|
304
|
+
);
|
|
305
|
+
if (this.autoStart) {
|
|
306
|
+
setTimeout(() => {
|
|
307
|
+
this.start();
|
|
308
|
+
}, 0);
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
beforeUnmount() {
|
|
312
|
+
this.removeKeyframe(this.animName);
|
|
313
|
+
for (let handler of this.watcherHandlerList) {
|
|
314
|
+
handler?.();
|
|
315
|
+
}
|
|
316
|
+
this.watcherHandlerList = [];
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
320
|
+
return openBlock(), createElementBlock("div", { ref: "root" }, null, 512);
|
|
321
|
+
}
|
|
322
|
+
const BrowserTextureAnim = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
323
|
+
|
|
324
|
+
export { BrowserTextureAnim as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//!
|
|
2
|
+
//! utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.js;
|
|
3
|
+
//!
|
|
4
|
+
class LoopToolBase {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.mFrameIndex = -1;
|
|
7
|
+
this.mTotalFrameNum = -1;
|
|
8
|
+
this.mNextFrameIndex = -1;
|
|
9
|
+
this.mValide = false;
|
|
10
|
+
}
|
|
11
|
+
getNextIndex(curIndex) {
|
|
12
|
+
return -1;
|
|
13
|
+
}
|
|
14
|
+
hasNext() {
|
|
15
|
+
return this.mNextFrameIndex != -1;
|
|
16
|
+
}
|
|
17
|
+
next() {
|
|
18
|
+
this.mFrameIndex = this.mNextFrameIndex;
|
|
19
|
+
this.mNextFrameIndex = this.getNextIndex(this.mFrameIndex);
|
|
20
|
+
return this.mFrameIndex;
|
|
21
|
+
}
|
|
22
|
+
setApicInfo(frameNum, loopNum) {
|
|
23
|
+
this.mTotalFrameNum = frameNum;
|
|
24
|
+
this.mLoopNum = loopNum;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const LoopType = {
|
|
28
|
+
LOOP_DEFAULT: 0,
|
|
29
|
+
LOOP_INFINITE: 1,
|
|
30
|
+
LOOP_FINITE: 2,
|
|
31
|
+
LOOP_PART: 3,
|
|
32
|
+
LOOP_SINGLE: 4
|
|
33
|
+
};
|
|
34
|
+
const ApicEndState = {
|
|
35
|
+
HIDE: 1,
|
|
36
|
+
LAST_FRAME: 2
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { ApicEndState as A, LoopType as L, LoopToolBase as a };
|