@shijiu/jsview-vue 0.9.254 → 0.9.267
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/dom/bin/package.json +11 -11
- package/dom/browser-root-style.css +21 -21
- package/loader/jsview-main.js +41 -41
- package/loader/jsview.config.default.js +37 -37
- package/loader/jsview.default.config.js +37 -37
- package/package.json +1 -5
- package/samples/AdvanceMetroWidget/App.vue +122 -122
- package/samples/AdvanceMetroWidget/Frame.vue +100 -100
- package/samples/AdvanceMetroWidget/Item.vue +57 -57
- package/samples/AdvanceMetroWidget/data.js +136 -136
- package/samples/AnimPicture/App.vue +223 -223
- package/samples/Basic/App.vue +128 -128
- package/samples/Basic/components/TitleBar.vue +28 -28
- package/samples/Basic/components/anim/AnimGroup.vue +67 -67
- package/samples/Basic/components/anim/AnimKeyframeBasic.vue +101 -101
- package/samples/Basic/components/anim/AnimKeyframeComposite.vue +52 -52
- package/samples/Basic/components/anim/AnimTransition.vue +116 -116
- package/samples/Basic/components/div/DivBackground.vue +14 -14
- package/samples/Basic/components/div/DivClip.vue +80 -80
- package/samples/Basic/components/div/DivCssScoped.vue +26 -26
- package/samples/Basic/components/div/DivCssVar.vue +49 -49
- package/samples/Basic/components/div/DivGroup1.vue +32 -32
- package/samples/Basic/components/div/DivGroup2.vue +40 -40
- package/samples/Basic/components/div/DivLayout.vue +11 -11
- package/samples/Basic/components/div/DivRadius.vue +46 -46
- package/samples/Basic/components/text/TextAlign.vue +47 -47
- package/samples/Basic/components/text/TextFontStyle.vue +57 -57
- package/samples/Basic/components/text/TextGroup.vue +31 -31
- package/samples/Basic/components/text/TextOverflow.vue +77 -77
- package/samples/BasicFocusControl/App.vue +124 -124
- package/samples/BasicFocusControl/components/BaseBlock.vue +50 -50
- package/samples/BasicFocusControl/components/MainArea.vue +97 -97
- package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +20 -20
- package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +29 -29
- package/samples/BasicFocusControl/components/SideBar.vue +72 -72
- package/samples/BasicFocusControl/components/SideBarBlock.vue +29 -29
- package/samples/ClassNameDemo/App.vue +119 -119
- package/samples/ClassNameDemo/components/ContentItem.vue +252 -252
- package/samples/ClassNameDemo/components/LoadingView.vue +43 -43
- package/samples/ClassNameDemo/components/TitleView.vue +24 -24
- package/samples/ClassNameDemo/data.js +24 -24
- package/samples/ColorSpace/App.vue +134 -134
- package/samples/DemoHomepage/App.vue +31 -31
- package/samples/DemoHomepage/components/BodyFrame.vue +81 -81
- package/samples/DemoHomepage/components/Dialog.vue +93 -93
- package/samples/DemoHomepage/components/Item.vue +76 -76
- package/samples/DemoHomepage/components/TabFrame.vue +86 -86
- package/samples/DemoHomepage/router.js +132 -132
- package/samples/DemoHomepage/views/Homepage.vue +186 -186
- package/samples/FlipCard/App.vue +80 -80
- package/samples/FlipCard/FlipCard.vue +123 -123
- package/samples/FlipCard/data.js +12 -12
- package/samples/FlowMultiWidget/App.vue +90 -90
- package/samples/FlowMultiWidget/components/Block.vue +106 -106
- package/samples/FlowMultiWidget/components/FlowPage.vue +59 -59
- package/samples/FlowMultiWidget/components/Item.vue +102 -102
- package/samples/FlowMultiWidget/components/MenuItem.vue +71 -71
- package/samples/FlowMultiWidget/components/MyMenu.vue +89 -89
- package/samples/FlowMultiWidget/data.js +446 -446
- package/samples/HashHistory/App.vue +124 -124
- package/samples/HashHistory/components/HorizontalButtonList.vue +113 -113
- package/samples/HashHistory/components/Item.vue +73 -73
- package/samples/HashHistory/router.js +29 -29
- package/samples/HashHistory/views/BasePage.vue +18 -18
- package/samples/HashHistory/views/MainPage.vue +67 -67
- package/samples/HashHistory/views/SubPage.vue +78 -78
- package/samples/HashHistory/views/SubPageFirst.vue +9 -9
- package/samples/HashHistory/views/SubPageSecond.vue +9 -9
- package/samples/LongImage/App.vue +96 -96
- package/samples/LongImage/Button.vue +153 -153
- package/samples/LongImage/LongImageScroll.vue +126 -126
- package/samples/LongImage/Scroll.vue +15 -15
- package/samples/LongText/App.vue +111 -111
- package/samples/LongText/Button.vue +153 -153
- package/samples/LongText/LongTextScroll.vue +224 -224
- package/samples/LongText/Scroll.vue +15 -15
- package/samples/Preload/App.vue +145 -145
- package/samples/Preload/data.js +22 -22
- package/samples/Preload/preloadItem.vue +21 -21
- package/samples/QrcodeDemo/App.vue +72 -72
- package/samples/SimpleWidgetDemo/App.vue +203 -203
- package/samples/SimpleWidgetDemo/Item.vue +82 -82
- package/samples/SimpleWidgetDemo/components/ContentItem.vue +411 -411
- package/samples/SimpleWidgetDemo/components/MyTab.vue +116 -116
- package/samples/SimpleWidgetDemo/data.js +110 -110
- package/samples/SprayView/App.vue +269 -269
- package/samples/SpriteImage/App.vue +174 -174
- package/samples/SpriteImage/images/egg_break.json +116 -116
- package/samples/TextBox/App.vue +178 -178
- package/samples/TextBox/RenderCenter.vue +108 -108
- package/samples/TextBox/RenderLeft.vue +108 -108
- package/samples/TextBox/RenderOneLine.vue +119 -119
- package/samples/TextBox/RenderRight.vue +106 -106
- package/samples/TextShadowDemo/App.vue +97 -97
- package/samples/TextureSize/App.vue +141 -141
- package/samples/ThrowMoveDemo/AccelerateDemo.vue +117 -117
- package/samples/ThrowMoveDemo/App.vue +113 -113
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +115 -115
- package/samples/ThrowMoveDemo/TargetDemo.vue +116 -116
- package/samples/ThrowMoveDemo/UDParabolicDemo.vue +121 -121
- package/samples/TransitPage/App.vue +40 -40
- package/samples/VideoDemo/App.vue +137 -137
- package/samples/VideoDemo/components/Button.vue +68 -68
- package/samples/VideoDemo/components/Controllor.vue +195 -195
- package/samples/VideoDemo/components/VideoFrame.vue +152 -152
- package/scripts/common.js +57 -115
- package/scripts/jsview-install-local-packages.js +73 -73
- package/scripts/jsview-post-build.js +127 -127
- package/scripts/jsview-post-install.js +78 -78
- package/scripts/jsview-run-android.js +64 -64
- package/utils/JsViewEngineWidget/bin/index.js +1 -1
- package/utils/JsViewEngineWidget/bin/package.json +11 -11
- package/utils/JsViewVueTools/JsvHashHistory.js +111 -111
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +417 -417
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +80 -80
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +147 -147
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +54 -54
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/ApicDataBase.js +28 -28
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +123 -123
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/GifData.js +83 -83
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/LoopToolBase.js +25 -25
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/NormalLoopTool.js +61 -61
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/PartLoopTool.js +119 -119
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/Viewer.js +106 -106
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/WebpData.js +141 -141
- package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetLoader.js +20 -20
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +204 -204
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +63 -63
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +426 -426
- package/utils/JsViewVueWidget/JsvActorMove/index.js +12 -12
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +178 -178
- package/utils/JsViewVueWidget/JsvApic/index.js +17 -17
- package/utils/JsViewVueWidget/JsvMarquee.vue +196 -196
- package/utils/JsViewVueWidget/JsvNinePatch.vue +76 -76
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +350 -350
- package/utils/JsViewVueWidget/JsvPreload/index.js +21 -21
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +140 -140
- package/utils/JsViewVueWidget/JsvQrcode/index.js +18 -18
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +139 -139
- package/utils/JsViewVueWidget/JsvSpray/index.js +14 -14
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +447 -447
- package/utils/JsViewVueWidget/JsvSpriteAnim/SpriteController.js +56 -56
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +6 -6
- package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +34 -34
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +494 -494
- package/utils/JsViewVueWidget/JsvSwiper/index.js +9 -9
- package/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue +34 -34
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +403 -403
- package/utils/JsViewVueWidget/JsvSwiper3D/index.js +9 -9
- package/utils/JsViewVueWidget/JsvTextBox.vue +110 -110
- package/utils/JsViewVueWidget/JsvVideo.vue +35 -35
- package/patches/node_modules/@babel/preset-env/lib/available-plugins.js +0 -219
- package/patches/node_modules/@vue/cli-plugin-typescript/index.js +0 -100
- package/patches/node_modules/@vue/cli-service/lib/commands/serve.js +0 -395
- package/patches/node_modules/@vue/cli-service/lib/config/app.js +0 -272
- package/patches/node_modules/@vue/cli-service/lib/config/assets.js +0 -70
- package/patches/node_modules/@vue/cli-service/lib/config/base.js +0 -212
- package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -2566
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +0 -274
- package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1596
- package/patches/node_modules/postcss-js/objectifier.js +0 -90
- package/patches/node_modules/vue-loader/dist/resolveScript.js +0 -70
- package/scripts/deploy-fast-pack.js +0 -17
- package/scripts/deploy-fast-publish.js +0 -44
- package/scripts/deploy-git-commit-empty.js +0 -21
- package/scripts/deploy-prepare.js +0 -56
- package/scripts/make-js.sh +0 -181
- package/vetur.config.js +0 -5
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* 【界面概述】
|
|
3
|
-
* 展示精灵图的用法,包含动图和切图
|
|
4
|
-
*
|
|
5
|
-
* 【控件介绍】
|
|
6
|
-
* JsvSpriteImg:精灵图控件
|
|
7
|
-
* spriteInfo {object} (必需)精灵图配置信息{frames:[], meta:{}}
|
|
8
|
-
* viewSize {object} (必需){w:0, h:0}
|
|
9
|
-
* imageUrl {string} (必需)图片地址
|
|
10
|
-
* duration {float} (动图必需)动图的时间
|
|
11
|
-
* onAnimEnd {fucntion} 动图结束回调
|
|
12
|
-
* loop {string} 动图的循环次数 infinite/数字,默认为infinite
|
|
13
|
-
* spriteName {string} 动图的名称,默认为null
|
|
14
|
-
* autostart{boolean} 是否自动播放动图
|
|
15
|
-
* controller {SpriteController} 控制动图的对象
|
|
16
|
-
* stop(end_frame) 停止动画 end_frame: "start", "end"
|
|
17
|
-
* start() 开始动画
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* 【技巧说明】
|
|
21
|
-
* Q: 动图和切图如何实现?
|
|
22
|
-
* A: spriteInfo中的frame有多个时为动图,只有一个时为切图
|
|
23
|
-
*
|
|
24
|
-
* Q: spriteInfo中属性的含义?
|
|
25
|
-
* A: meta.size为整张切图的大小;frames中为每一帧的位置和大小信息,目前仅支持统一大小的帧
|
|
26
|
-
-->
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
import JsvSpriteAnim from "../../utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue";
|
|
30
|
-
import { SpriteController } from "../../utils/JsViewVueWidget/JsvSpriteAnim/SpriteController";
|
|
31
|
-
import spriteImage from "./images/egg_break.png";
|
|
32
|
-
import config_json from "./images/egg_break.json";
|
|
33
|
-
export default {
|
|
34
|
-
components: {
|
|
35
|
-
JsvSpriteAnim,
|
|
36
|
-
},
|
|
37
|
-
setup() {
|
|
38
|
-
return {
|
|
39
|
-
spriteImage: spriteImage,
|
|
40
|
-
config_json: config_json,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
data() {
|
|
44
|
-
console.log(
|
|
45
|
-
"test spriteImage =",
|
|
46
|
-
spriteImage,
|
|
47
|
-
"/n config_json=",
|
|
48
|
-
config_json
|
|
49
|
-
);
|
|
50
|
-
const sprite_info = this._formatInfo();
|
|
51
|
-
console.log("test sprite_into =", sprite_info);
|
|
52
|
-
const view_size = {
|
|
53
|
-
w: sprite_info.maxW,
|
|
54
|
-
h: sprite_info.maxH,
|
|
55
|
-
};
|
|
56
|
-
console.log("test view_size =", view_size);
|
|
57
|
-
return {
|
|
58
|
-
sprite_info,
|
|
59
|
-
view_size,
|
|
60
|
-
spriteController: new SpriteController(),
|
|
61
|
-
show: true,
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
methods: {
|
|
65
|
-
spriteAnimEnd() {
|
|
66
|
-
this.show = false;
|
|
67
|
-
},
|
|
68
|
-
onKeyDown(ev) {
|
|
69
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
70
|
-
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
return true;
|
|
74
|
-
},
|
|
75
|
-
_formatInfo() {
|
|
76
|
-
const info = {
|
|
77
|
-
frames: [],
|
|
78
|
-
meta: {
|
|
79
|
-
size: this.config_json.meta.size,
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
let frames_ref = info.frames;
|
|
84
|
-
let max_width = 0;
|
|
85
|
-
let max_height = 0;
|
|
86
|
-
|
|
87
|
-
for (let i = 0; i < this.config_json.frames.length; i++) {
|
|
88
|
-
const target = this.config_json.frames[i].spriteSourceSize;
|
|
89
|
-
frames_ref.push({
|
|
90
|
-
target,
|
|
91
|
-
source: this.config_json.frames[i].frame,
|
|
92
|
-
});
|
|
93
|
-
const sprite_with = target.x + target.w;
|
|
94
|
-
const sprite_height = target.y + target.h;
|
|
95
|
-
if (sprite_with > max_width) {
|
|
96
|
-
max_width = sprite_with;
|
|
97
|
-
}
|
|
98
|
-
if (sprite_height > max_height) {
|
|
99
|
-
max_height = sprite_height;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return { info, maxW: max_width, maxH: max_height };
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
</script>
|
|
107
|
-
|
|
108
|
-
<template>
|
|
109
|
-
<jsv-focus-block
|
|
110
|
-
autoFocus
|
|
111
|
-
:onAction="{
|
|
112
|
-
onKeyDown: onKeyDown,
|
|
113
|
-
}"
|
|
114
|
-
>
|
|
115
|
-
<div
|
|
116
|
-
:style="{
|
|
117
|
-
textAlign: 'center',
|
|
118
|
-
fontSize: '30px',
|
|
119
|
-
lineHeight: '50px',
|
|
120
|
-
color: '#ffffff',
|
|
121
|
-
left: 200,
|
|
122
|
-
top: 100,
|
|
123
|
-
width: 434,
|
|
124
|
-
height: 50,
|
|
125
|
-
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
126
|
-
}"
|
|
127
|
-
>
|
|
128
|
-
精灵图效果
|
|
129
|
-
</div>
|
|
130
|
-
<!--
|
|
131
|
-
通过show进行 清理精灵图,用于验证精灵图清理后,StyleSheet中cssRules的keyFrame清理工作能正常完成
|
|
132
|
-
-->
|
|
133
|
-
<div
|
|
134
|
-
v-if="this.show"
|
|
135
|
-
:style="{ left: 200, top: 150, transform: 'scale3d(2.5, 2.5, 1)' }"
|
|
136
|
-
>
|
|
137
|
-
<JsvSpriteAnim
|
|
138
|
-
:spriteInfo="sprite_info.info"
|
|
139
|
-
:loop="10"
|
|
140
|
-
:viewSize="view_size"
|
|
141
|
-
:duration="0.8"
|
|
142
|
-
:controller="this.spriteController"
|
|
143
|
-
:autostart="true"
|
|
144
|
-
:onAnimEnd="spriteAnimEnd"
|
|
145
|
-
:imageUrl="spriteImage"
|
|
146
|
-
/>
|
|
147
|
-
</div>
|
|
148
|
-
|
|
149
|
-
<div
|
|
150
|
-
:style="{
|
|
151
|
-
textAlign: 'center',
|
|
152
|
-
fontSize: '30px',
|
|
153
|
-
lineHeight: '50px',
|
|
154
|
-
color: '#ffffff',
|
|
155
|
-
left: 700,
|
|
156
|
-
top: 100,
|
|
157
|
-
width: 434,
|
|
158
|
-
height: 50,
|
|
159
|
-
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
160
|
-
}"
|
|
161
|
-
>
|
|
162
|
-
原始图片
|
|
163
|
-
</div>
|
|
164
|
-
<div
|
|
165
|
-
:style="{
|
|
166
|
-
left: 700,
|
|
167
|
-
top: 150,
|
|
168
|
-
width: 434,
|
|
169
|
-
height: 372,
|
|
170
|
-
backgroundImage: `url(${spriteImage})`,
|
|
171
|
-
}"
|
|
172
|
-
/>
|
|
173
|
-
</jsv-focus-block>
|
|
174
|
-
</template>
|
|
1
|
+
<!--
|
|
2
|
+
* 【界面概述】
|
|
3
|
+
* 展示精灵图的用法,包含动图和切图
|
|
4
|
+
*
|
|
5
|
+
* 【控件介绍】
|
|
6
|
+
* JsvSpriteImg:精灵图控件
|
|
7
|
+
* spriteInfo {object} (必需)精灵图配置信息{frames:[], meta:{}}
|
|
8
|
+
* viewSize {object} (必需){w:0, h:0}
|
|
9
|
+
* imageUrl {string} (必需)图片地址
|
|
10
|
+
* duration {float} (动图必需)动图的时间
|
|
11
|
+
* onAnimEnd {fucntion} 动图结束回调
|
|
12
|
+
* loop {string} 动图的循环次数 infinite/数字,默认为infinite
|
|
13
|
+
* spriteName {string} 动图的名称,默认为null
|
|
14
|
+
* autostart{boolean} 是否自动播放动图
|
|
15
|
+
* controller {SpriteController} 控制动图的对象
|
|
16
|
+
* stop(end_frame) 停止动画 end_frame: "start", "end"
|
|
17
|
+
* start() 开始动画
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* 【技巧说明】
|
|
21
|
+
* Q: 动图和切图如何实现?
|
|
22
|
+
* A: spriteInfo中的frame有多个时为动图,只有一个时为切图
|
|
23
|
+
*
|
|
24
|
+
* Q: spriteInfo中属性的含义?
|
|
25
|
+
* A: meta.size为整张切图的大小;frames中为每一帧的位置和大小信息,目前仅支持统一大小的帧
|
|
26
|
+
-->
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import JsvSpriteAnim from "../../utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue";
|
|
30
|
+
import { SpriteController } from "../../utils/JsViewVueWidget/JsvSpriteAnim/SpriteController";
|
|
31
|
+
import spriteImage from "./images/egg_break.png";
|
|
32
|
+
import config_json from "./images/egg_break.json";
|
|
33
|
+
export default {
|
|
34
|
+
components: {
|
|
35
|
+
JsvSpriteAnim,
|
|
36
|
+
},
|
|
37
|
+
setup() {
|
|
38
|
+
return {
|
|
39
|
+
spriteImage: spriteImage,
|
|
40
|
+
config_json: config_json,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
data() {
|
|
44
|
+
console.log(
|
|
45
|
+
"test spriteImage =",
|
|
46
|
+
spriteImage,
|
|
47
|
+
"/n config_json=",
|
|
48
|
+
config_json
|
|
49
|
+
);
|
|
50
|
+
const sprite_info = this._formatInfo();
|
|
51
|
+
console.log("test sprite_into =", sprite_info);
|
|
52
|
+
const view_size = {
|
|
53
|
+
w: sprite_info.maxW,
|
|
54
|
+
h: sprite_info.maxH,
|
|
55
|
+
};
|
|
56
|
+
console.log("test view_size =", view_size);
|
|
57
|
+
return {
|
|
58
|
+
sprite_info,
|
|
59
|
+
view_size,
|
|
60
|
+
spriteController: new SpriteController(),
|
|
61
|
+
show: true,
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
spriteAnimEnd() {
|
|
66
|
+
this.show = false;
|
|
67
|
+
},
|
|
68
|
+
onKeyDown(ev) {
|
|
69
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
70
|
+
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
},
|
|
75
|
+
_formatInfo() {
|
|
76
|
+
const info = {
|
|
77
|
+
frames: [],
|
|
78
|
+
meta: {
|
|
79
|
+
size: this.config_json.meta.size,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
let frames_ref = info.frames;
|
|
84
|
+
let max_width = 0;
|
|
85
|
+
let max_height = 0;
|
|
86
|
+
|
|
87
|
+
for (let i = 0; i < this.config_json.frames.length; i++) {
|
|
88
|
+
const target = this.config_json.frames[i].spriteSourceSize;
|
|
89
|
+
frames_ref.push({
|
|
90
|
+
target,
|
|
91
|
+
source: this.config_json.frames[i].frame,
|
|
92
|
+
});
|
|
93
|
+
const sprite_with = target.x + target.w;
|
|
94
|
+
const sprite_height = target.y + target.h;
|
|
95
|
+
if (sprite_with > max_width) {
|
|
96
|
+
max_width = sprite_with;
|
|
97
|
+
}
|
|
98
|
+
if (sprite_height > max_height) {
|
|
99
|
+
max_height = sprite_height;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return { info, maxW: max_width, maxH: max_height };
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<template>
|
|
109
|
+
<jsv-focus-block
|
|
110
|
+
autoFocus
|
|
111
|
+
:onAction="{
|
|
112
|
+
onKeyDown: onKeyDown,
|
|
113
|
+
}"
|
|
114
|
+
>
|
|
115
|
+
<div
|
|
116
|
+
:style="{
|
|
117
|
+
textAlign: 'center',
|
|
118
|
+
fontSize: '30px',
|
|
119
|
+
lineHeight: '50px',
|
|
120
|
+
color: '#ffffff',
|
|
121
|
+
left: 200,
|
|
122
|
+
top: 100,
|
|
123
|
+
width: 434,
|
|
124
|
+
height: 50,
|
|
125
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
126
|
+
}"
|
|
127
|
+
>
|
|
128
|
+
精灵图效果
|
|
129
|
+
</div>
|
|
130
|
+
<!--
|
|
131
|
+
通过show进行 清理精灵图,用于验证精灵图清理后,StyleSheet中cssRules的keyFrame清理工作能正常完成
|
|
132
|
+
-->
|
|
133
|
+
<div
|
|
134
|
+
v-if="this.show"
|
|
135
|
+
:style="{ left: 200, top: 150, transform: 'scale3d(2.5, 2.5, 1)' }"
|
|
136
|
+
>
|
|
137
|
+
<JsvSpriteAnim
|
|
138
|
+
:spriteInfo="sprite_info.info"
|
|
139
|
+
:loop="10"
|
|
140
|
+
:viewSize="view_size"
|
|
141
|
+
:duration="0.8"
|
|
142
|
+
:controller="this.spriteController"
|
|
143
|
+
:autostart="true"
|
|
144
|
+
:onAnimEnd="spriteAnimEnd"
|
|
145
|
+
:imageUrl="spriteImage"
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div
|
|
150
|
+
:style="{
|
|
151
|
+
textAlign: 'center',
|
|
152
|
+
fontSize: '30px',
|
|
153
|
+
lineHeight: '50px',
|
|
154
|
+
color: '#ffffff',
|
|
155
|
+
left: 700,
|
|
156
|
+
top: 100,
|
|
157
|
+
width: 434,
|
|
158
|
+
height: 50,
|
|
159
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
160
|
+
}"
|
|
161
|
+
>
|
|
162
|
+
原始图片
|
|
163
|
+
</div>
|
|
164
|
+
<div
|
|
165
|
+
:style="{
|
|
166
|
+
left: 700,
|
|
167
|
+
top: 150,
|
|
168
|
+
width: 434,
|
|
169
|
+
height: 372,
|
|
170
|
+
backgroundImage: `url(${spriteImage})`,
|
|
171
|
+
}"
|
|
172
|
+
/>
|
|
173
|
+
</jsv-focus-block>
|
|
174
|
+
</template>
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
{"frames": [
|
|
2
|
-
|
|
3
|
-
{
|
|
4
|
-
"filename": "image_00.png",
|
|
5
|
-
"frame": {"x":104,"y":2,"w":50,"h":64},
|
|
6
|
-
"rotated": false,
|
|
7
|
-
"trimmed": false,
|
|
8
|
-
"spriteSourceSize": {"x":53,"y":43,"w":50,"h":64},
|
|
9
|
-
"sourceSize": {"w":50,"h":64}
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"filename": "image_01.png",
|
|
13
|
-
"frame": {"x":2,"y":2,"w":48,"h":64},
|
|
14
|
-
"rotated": false,
|
|
15
|
-
"trimmed": false,
|
|
16
|
-
"spriteSourceSize": {"x":55,"y":43,"w":48,"h":64},
|
|
17
|
-
"sourceSize": {"w":48,"h":64}
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"filename": "image_02.png",
|
|
21
|
-
"frame": {"x":52,"y":2,"w":50,"h":64},
|
|
22
|
-
"rotated": false,
|
|
23
|
-
"trimmed": false,
|
|
24
|
-
"spriteSourceSize": {"x":55,"y":43,"w":50,"h":64},
|
|
25
|
-
"sourceSize": {"w":50,"h":64}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"filename": "image_03.png",
|
|
29
|
-
"frame": {"x":274,"y":2,"w":64,"h":74},
|
|
30
|
-
"rotated": false,
|
|
31
|
-
"trimmed": false,
|
|
32
|
-
"spriteSourceSize": {"x":54,"y":33,"w":64,"h":74},
|
|
33
|
-
"sourceSize": {"w":64,"h":74}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"filename": "image_04.png",
|
|
37
|
-
"frame": {"x":156,"y":2,"w":56,"h":72},
|
|
38
|
-
"rotated": false,
|
|
39
|
-
"trimmed": false,
|
|
40
|
-
"spriteSourceSize": {"x":47,"y":44,"w":56,"h":72},
|
|
41
|
-
"sourceSize": {"w":56,"h":72}
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"filename": "image_05.png",
|
|
45
|
-
"frame": {"x":214,"y":2,"w":58,"h":84},
|
|
46
|
-
"rotated": false,
|
|
47
|
-
"trimmed": false,
|
|
48
|
-
"spriteSourceSize": {"x":46,"y":44,"w":58,"h":84},
|
|
49
|
-
"sourceSize": {"w":58,"h":84}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"filename": "image_06.png",
|
|
53
|
-
"frame": {"x":2,"y":88,"w":92,"h":106},
|
|
54
|
-
"rotated": false,
|
|
55
|
-
"trimmed": false,
|
|
56
|
-
"spriteSourceSize": {"x":32,"y":32,"w":92,"h":106},
|
|
57
|
-
"sourceSize": {"w":92,"h":106}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"filename": "image_07.png",
|
|
61
|
-
"frame": {"x":2,"y":228,"w":142,"h":140},
|
|
62
|
-
"rotated": false,
|
|
63
|
-
"trimmed": false,
|
|
64
|
-
"spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
|
|
65
|
-
"sourceSize": {"w":142,"h":140}
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"filename": "image_08.png",
|
|
69
|
-
"frame": {"x":146,"y":228,"w":142,"h":140},
|
|
70
|
-
"rotated": false,
|
|
71
|
-
"trimmed": false,
|
|
72
|
-
"spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
|
|
73
|
-
"sourceSize": {"w":142,"h":140}
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"filename": "image_09.png",
|
|
77
|
-
"frame": {"x":290,"y":228,"w":142,"h":140},
|
|
78
|
-
"rotated": false,
|
|
79
|
-
"trimmed": false,
|
|
80
|
-
"spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
|
|
81
|
-
"sourceSize": {"w":142,"h":140}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"filename": "image_10.png",
|
|
85
|
-
"frame": {"x":190,"y":88,"w":136,"h":138},
|
|
86
|
-
"rotated": false,
|
|
87
|
-
"trimmed": false,
|
|
88
|
-
"spriteSourceSize": {"x":11,"y":21,"w":136,"h":138},
|
|
89
|
-
"sourceSize": {"w":136,"h":138}
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"filename": "image_11.png",
|
|
93
|
-
"frame": {"x":96,"y":88,"w":92,"h":88},
|
|
94
|
-
"rotated": false,
|
|
95
|
-
"trimmed": false,
|
|
96
|
-
"spriteSourceSize": {"x":33,"y":26,"w":92,"h":88},
|
|
97
|
-
"sourceSize": {"w":92,"h":88}
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"filename": "image_12.png",
|
|
101
|
-
"frame": {"x":340,"y":2,"w":88,"h":84},
|
|
102
|
-
"rotated": false,
|
|
103
|
-
"trimmed": false,
|
|
104
|
-
"spriteSourceSize": {"x":35,"y":26,"w":88,"h":84},
|
|
105
|
-
"sourceSize": {"w":88,"h":84}
|
|
106
|
-
}],
|
|
107
|
-
"meta": {
|
|
108
|
-
"app": "http://www.texturepacker.com",
|
|
109
|
-
"version": "1.0",
|
|
110
|
-
"image": "egg_1.png",
|
|
111
|
-
"format": "RGBA8888",
|
|
112
|
-
"size": {"w":434,"h":372},
|
|
113
|
-
"scale": "1",
|
|
114
|
-
"smartupdate": "$TexturePacker:SmartUpdate:3ca02d63806cac6ee77822c5f378c4f3$"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
1
|
+
{"frames": [
|
|
2
|
+
|
|
3
|
+
{
|
|
4
|
+
"filename": "image_00.png",
|
|
5
|
+
"frame": {"x":104,"y":2,"w":50,"h":64},
|
|
6
|
+
"rotated": false,
|
|
7
|
+
"trimmed": false,
|
|
8
|
+
"spriteSourceSize": {"x":53,"y":43,"w":50,"h":64},
|
|
9
|
+
"sourceSize": {"w":50,"h":64}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"filename": "image_01.png",
|
|
13
|
+
"frame": {"x":2,"y":2,"w":48,"h":64},
|
|
14
|
+
"rotated": false,
|
|
15
|
+
"trimmed": false,
|
|
16
|
+
"spriteSourceSize": {"x":55,"y":43,"w":48,"h":64},
|
|
17
|
+
"sourceSize": {"w":48,"h":64}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"filename": "image_02.png",
|
|
21
|
+
"frame": {"x":52,"y":2,"w":50,"h":64},
|
|
22
|
+
"rotated": false,
|
|
23
|
+
"trimmed": false,
|
|
24
|
+
"spriteSourceSize": {"x":55,"y":43,"w":50,"h":64},
|
|
25
|
+
"sourceSize": {"w":50,"h":64}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"filename": "image_03.png",
|
|
29
|
+
"frame": {"x":274,"y":2,"w":64,"h":74},
|
|
30
|
+
"rotated": false,
|
|
31
|
+
"trimmed": false,
|
|
32
|
+
"spriteSourceSize": {"x":54,"y":33,"w":64,"h":74},
|
|
33
|
+
"sourceSize": {"w":64,"h":74}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"filename": "image_04.png",
|
|
37
|
+
"frame": {"x":156,"y":2,"w":56,"h":72},
|
|
38
|
+
"rotated": false,
|
|
39
|
+
"trimmed": false,
|
|
40
|
+
"spriteSourceSize": {"x":47,"y":44,"w":56,"h":72},
|
|
41
|
+
"sourceSize": {"w":56,"h":72}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"filename": "image_05.png",
|
|
45
|
+
"frame": {"x":214,"y":2,"w":58,"h":84},
|
|
46
|
+
"rotated": false,
|
|
47
|
+
"trimmed": false,
|
|
48
|
+
"spriteSourceSize": {"x":46,"y":44,"w":58,"h":84},
|
|
49
|
+
"sourceSize": {"w":58,"h":84}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"filename": "image_06.png",
|
|
53
|
+
"frame": {"x":2,"y":88,"w":92,"h":106},
|
|
54
|
+
"rotated": false,
|
|
55
|
+
"trimmed": false,
|
|
56
|
+
"spriteSourceSize": {"x":32,"y":32,"w":92,"h":106},
|
|
57
|
+
"sourceSize": {"w":92,"h":106}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"filename": "image_07.png",
|
|
61
|
+
"frame": {"x":2,"y":228,"w":142,"h":140},
|
|
62
|
+
"rotated": false,
|
|
63
|
+
"trimmed": false,
|
|
64
|
+
"spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
|
|
65
|
+
"sourceSize": {"w":142,"h":140}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"filename": "image_08.png",
|
|
69
|
+
"frame": {"x":146,"y":228,"w":142,"h":140},
|
|
70
|
+
"rotated": false,
|
|
71
|
+
"trimmed": false,
|
|
72
|
+
"spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
|
|
73
|
+
"sourceSize": {"w":142,"h":140}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"filename": "image_09.png",
|
|
77
|
+
"frame": {"x":290,"y":228,"w":142,"h":140},
|
|
78
|
+
"rotated": false,
|
|
79
|
+
"trimmed": false,
|
|
80
|
+
"spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
|
|
81
|
+
"sourceSize": {"w":142,"h":140}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"filename": "image_10.png",
|
|
85
|
+
"frame": {"x":190,"y":88,"w":136,"h":138},
|
|
86
|
+
"rotated": false,
|
|
87
|
+
"trimmed": false,
|
|
88
|
+
"spriteSourceSize": {"x":11,"y":21,"w":136,"h":138},
|
|
89
|
+
"sourceSize": {"w":136,"h":138}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"filename": "image_11.png",
|
|
93
|
+
"frame": {"x":96,"y":88,"w":92,"h":88},
|
|
94
|
+
"rotated": false,
|
|
95
|
+
"trimmed": false,
|
|
96
|
+
"spriteSourceSize": {"x":33,"y":26,"w":92,"h":88},
|
|
97
|
+
"sourceSize": {"w":92,"h":88}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"filename": "image_12.png",
|
|
101
|
+
"frame": {"x":340,"y":2,"w":88,"h":84},
|
|
102
|
+
"rotated": false,
|
|
103
|
+
"trimmed": false,
|
|
104
|
+
"spriteSourceSize": {"x":35,"y":26,"w":88,"h":84},
|
|
105
|
+
"sourceSize": {"w":88,"h":84}
|
|
106
|
+
}],
|
|
107
|
+
"meta": {
|
|
108
|
+
"app": "http://www.texturepacker.com",
|
|
109
|
+
"version": "1.0",
|
|
110
|
+
"image": "egg_1.png",
|
|
111
|
+
"format": "RGBA8888",
|
|
112
|
+
"size": {"w":434,"h":372},
|
|
113
|
+
"scale": "1",
|
|
114
|
+
"smartupdate": "$TexturePacker:SmartUpdate:3ca02d63806cac6ee77822c5f378c4f3$"
|
|
115
|
+
}
|
|
116
|
+
}
|