@shijiu/jsview-vue-samples 2.2.128 → 2.2.373
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/BakeViewDemo/App.vue +6 -1
- package/Basic/components/anim/AnimEasingCubicBezier.vue +56 -0
- package/Basic/components/anim/AnimGroup2.vue +33 -0
- package/Basic/components/panel/Panel2.vue +8 -3
- package/CoupletsTest/widget/Banger/Maroon.vue +4 -7
- package/CoupletsTest/widget/Fireworks/Fireworks.vue +52 -44
- package/CustomShader/App.vue +174 -0
- package/CustomShader/gaussianBlur.glsl +27 -0
- package/CustomShader/pageFlip.glsl +41 -0
- package/CustomShader/sdf.glsl +22 -0
- package/CustomShader/test.glsl +8 -0
- package/CustomShader/vortex.glsl +38 -0
- package/DemoHomepage/App.vue +50 -32
- package/DemoHomepage/components/Item.vue +23 -12
- package/DemoHomepage/index.d.ts +5 -2
- package/DemoHomepage/router.js +105 -72
- package/DispersedFocusControl/App.vue +67 -0
- package/DispersedFocusControl/Button.vue +76 -0
- package/DispersedFocusControl/data.js +44 -0
- package/DragBox/App.vue +148 -0
- package/DriftScopeTest/App.vue +128 -0
- package/FlexCellDemo/App.vue +47 -223
- package/FlexCellDemo/TestFrame1.vue +88 -0
- package/FlexCellDemo/TestFrame2.vue +100 -0
- package/FlexCellDemo/TestFrame3.vue +97 -0
- package/FlexCellDemo/TestFrame4.vue +60 -0
- package/FlexCellDemo/TestFrame5.vue +60 -0
- package/FlexCellDemo/images/6.jpg +0 -0
- package/FocusMoveStyle/App.vue +1 -0
- package/FocusMoveStyle/CreepFocus.vue +11 -1
- package/FocusMoveStyle/FoldableItem.vue +1 -1
- package/FreeMove/App.vue +62 -64
- package/FreeMoveLink/App.vue +2 -2
- package/FullScreenFlex/App.vue +42 -0
- package/FullScreenFlex/TestFrame2.vue +107 -0
- package/FullScreenFlex/images/1.png +0 -0
- package/HashHistory/App.vue +8 -4
- package/ImpactStop/App.vue +45 -45
- package/Input/App.vue +184 -97
- package/Input/InputPanel.vue +98 -82
- package/LatexFormula/App.vue +97 -10
- package/LongImage/App.vue +1 -2
- package/LongText/App.vue +2 -2
- package/LongText/LongTextScroll.vue +22 -22
- package/LongText/Scroll.vue +28 -9
- package/MetroWidgetDemos/RefreshDemo/App.vue +172 -56
- package/MetroWidgetDemos/RefreshDemo/ControlItem.vue +45 -0
- package/MetroWidgetDemos/RefreshDemo/Item.vue +20 -4
- package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +1 -1
- package/MetroWidgetDemos/routeList.js +17 -17
- package/MindMap/App.vue +10 -1
- package/MindMap/data.js +34 -8
- package/Parkour/appConfig/jsview.config.mjs +0 -4
- package/PosterPacker/App.vue +207 -0
- package/PosterPacker/images/bg.jpg +0 -0
- package/PosterPacker/images/blue.png +0 -0
- package/PosterPacker/images/darkGreen.png +0 -0
- package/PosterPacker/images/left.png +0 -0
- package/PosterPacker/images/orange.png +0 -0
- package/PosterPacker/images/pink.png +0 -0
- package/PosterPacker/images/purple.png +0 -0
- package/PosterPacker/images/red.png +0 -0
- package/PosterPacker/images/right.png +0 -0
- package/PosterPacker/images/yellowGreen.png +0 -0
- package/PosterPacker/tools/geniePakcer/Genie.vue +686 -0
- package/PosterPacker/tools/geniePakcer/genieBottom.glsl +49 -0
- package/PosterPacker/tools/geniePakcer/genieLeft.glsl +50 -0
- package/PosterPacker/tools/geniePakcer/genieRight.glsl +57 -0
- package/PosterPacker/tools/geniePakcer/genieTop.glsl +50 -0
- package/PosterPacker/tools/particlePacker/Particle.vue +71 -0
- package/PosterPacker/tools/vortexPacker/Vortex.vue +135 -0
- package/PosterPacker/tools/vortexPacker/vortex.glsl +37 -0
- package/Preload/App.vue +1 -1
- package/SceneTransition/JsvSceneTransition.vue +30 -42
- package/ScrollBoxTest/App.vue +35 -86
- package/ScrollBoxTest/ClipBar.vue +154 -0
- package/ScrollBoxTest/DrawCircle.ts +25 -0
- package/ScrollBoxTest/NinePatchBar.vue +188 -0
- package/ScrollBoxTest/NoBackgroundBar.vue +125 -0
- package/ScrollBoxTest/SizeDivBar.vue +139 -0
- package/SprayMove/App.vue +75 -0
- package/SprayMove/SprayMove.vue +173 -0
- package/SprayView/App.vue +8 -9
- package/TestNativeSharedView/App.vue +6 -4
- package/TextShadowDemo/App.vue +3 -3
- package/TextureAnimation/App.vue +244 -148
- package/TextureAnimation/App2.vue +66 -14
- package/TextureAnimation/assets/blackWhiteTurntable.png +0 -0
- package/TextureAnimation/assets/circleHaloMask.png +0 -0
- package/TombSweepingDayTest/Raining/Rain.vue +8 -8
- package/TouchWidget/App.vue +79 -40
- package/TouchWidget/Item.vue +15 -3
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/MetroWidgetDemos/RefreshDemo/data.js +0 -16
- package/TextureAnimation/assets/mask.png +0 -0
- package/TextureAnimation/assets/php.jpg +0 -0
- package/TouchSample/App.vue +0 -136
- package/TouchSample/Item.vue +0 -102
- package/TouchSample/MetroWidgetHorizontal.vue +0 -144
- package/TouchSample/MetroWidgetVertical.vue +0 -144
- package/TouchSample/TouchContainerHorizontal.vue +0 -160
- package/TouchSample/TouchContainerVertical.vue +0 -160
- package/TouchSample/data.js +0 -81
- /package/TextureAnimation/assets/{php2.png → borderOpacity.png} +0 -0
package/TextureAnimation/App.vue
CHANGED
|
@@ -3,12 +3,13 @@ import {
|
|
|
3
3
|
jJsvRuntimeBridge,
|
|
4
4
|
getKeyFramesGroup,
|
|
5
5
|
JsvTextureAnim,
|
|
6
|
+
DefaultKeyCodeMap,
|
|
6
7
|
} from "jsview";
|
|
7
|
-
import img from "./assets/
|
|
8
|
+
import img from "./assets/borderOpacity.png";
|
|
8
9
|
import swipLight from "./assets/swipLight.png";
|
|
9
|
-
import { onMounted, onBeforeUnmount } from "vue";
|
|
10
|
+
import { onMounted, onBeforeUnmount, shallowRef } from "vue";
|
|
10
11
|
import { useRouter } from "vue-router";
|
|
11
|
-
const router = useRouter()
|
|
12
|
+
const router = useRouter();
|
|
12
13
|
const styleShell = getKeyFramesGroup();
|
|
13
14
|
const translateTransform = "translate3d(50%, 50%, 0)";
|
|
14
15
|
const rotateTransform = "rotate3d(1,1,1, 30deg)";
|
|
@@ -17,6 +18,9 @@ const borderRadius = 40;
|
|
|
17
18
|
const repeat = -1;
|
|
18
19
|
const duration = 3000;
|
|
19
20
|
|
|
21
|
+
let sTranslateTextureRef = shallowRef(null);
|
|
22
|
+
let sTranslateTextureTrigger = shallowRef(1);
|
|
23
|
+
|
|
20
24
|
const translateAnim =
|
|
21
25
|
"{from {transform: translate3d(-100%, -50%, 0);} to {transform: translate3d(100%, 50%, 0);}}";
|
|
22
26
|
const rotateAnim =
|
|
@@ -26,183 +30,275 @@ const scaleAnim =
|
|
|
26
30
|
const swipAnim =
|
|
27
31
|
"{from {transform: translate3d(-100%, 0, 0);} to {transform: translate3d(100%, 0, 0);}}";
|
|
28
32
|
|
|
29
|
-
styleShell.insertRule(
|
|
30
|
-
|
|
31
|
-
);
|
|
32
|
-
styleShell.insertRule(
|
|
33
|
-
"@keyframes texture-anim-rotate " + rotateAnim
|
|
34
|
-
);
|
|
35
|
-
styleShell.insertRule(
|
|
36
|
-
"@keyframes texture-anim-scale " + scaleAnim
|
|
37
|
-
);
|
|
33
|
+
styleShell.insertRule("@keyframes texture-anim-translate " + translateAnim);
|
|
34
|
+
styleShell.insertRule("@keyframes texture-anim-rotate " + rotateAnim);
|
|
35
|
+
styleShell.insertRule("@keyframes texture-anim-scale " + scaleAnim);
|
|
38
36
|
|
|
39
37
|
const onKeyDown = (ev) => {
|
|
40
38
|
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
41
39
|
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
42
40
|
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
41
|
+
} else if (ev.keyCode == DefaultKeyCodeMap.Ok) {
|
|
42
|
+
sTranslateTextureRef.value.start();
|
|
43
|
+
sTranslateTextureTrigger.value = sTranslateTextureTrigger.value + 1;
|
|
43
44
|
}
|
|
44
45
|
return true;
|
|
45
|
-
}
|
|
46
|
+
};
|
|
46
47
|
|
|
47
48
|
onMounted(() => {
|
|
48
49
|
jJsvRuntimeBridge.notifyPageLoaded();
|
|
49
|
-
})
|
|
50
|
+
});
|
|
50
51
|
|
|
51
52
|
onBeforeUnmount(() => {
|
|
52
53
|
styleShell.removeRule("texture-anim-translate");
|
|
53
54
|
styleShell.removeRule("texture-anim-rotate");
|
|
54
55
|
styleShell.removeRule("texture-anim-scale");
|
|
55
|
-
})
|
|
56
|
-
|
|
56
|
+
});
|
|
57
57
|
</script>
|
|
58
58
|
<template>
|
|
59
|
-
<jsv-focus-block
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
59
|
+
<jsv-focus-block
|
|
60
|
+
autoFocus
|
|
61
|
+
:onKeyDown="onKeyDown"
|
|
62
|
+
:style="{
|
|
63
|
+
width: 1920,
|
|
64
|
+
height: 1080,
|
|
65
|
+
backgroundColor: '#007788',
|
|
66
|
+
}"
|
|
67
|
+
>
|
|
68
|
+
<div
|
|
69
|
+
:style="{
|
|
70
|
+
left: 100,
|
|
71
|
+
top: 20,
|
|
72
|
+
}"
|
|
73
|
+
>
|
|
74
|
+
<div
|
|
75
|
+
:style="{
|
|
76
|
+
width: 300,
|
|
77
|
+
height: 150,
|
|
78
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
79
|
+
}"
|
|
80
|
+
/>
|
|
81
|
+
<jsv-texture-anim
|
|
82
|
+
ref="sTranslateTextureRef"
|
|
83
|
+
:src="img"
|
|
84
|
+
:width="300"
|
|
85
|
+
:height="150"
|
|
86
|
+
:animation="translateAnim"
|
|
87
|
+
:duration="duration"
|
|
88
|
+
:transform="null"
|
|
89
|
+
:borderRadius="borderRadius"
|
|
90
|
+
:autoStart="true"
|
|
91
|
+
></jsv-texture-anim>
|
|
92
|
+
<div
|
|
93
|
+
:key="sTranslateTextureTrigger"
|
|
94
|
+
:style="{
|
|
95
|
+
width: 300,
|
|
96
|
+
height: 150,
|
|
97
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
98
|
+
transform: null,
|
|
99
|
+
animation: `texture-anim-translate ${duration / 1000}s linear 1`,
|
|
100
|
+
}"
|
|
101
|
+
/>
|
|
83
102
|
</div>
|
|
84
103
|
|
|
85
|
-
<div
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
<div
|
|
105
|
+
:style="{
|
|
106
|
+
left: 100,
|
|
107
|
+
top: 230,
|
|
108
|
+
}"
|
|
109
|
+
>
|
|
110
|
+
<div
|
|
111
|
+
:style="{
|
|
112
|
+
width: 300,
|
|
113
|
+
height: 150,
|
|
114
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
115
|
+
}"
|
|
116
|
+
/>
|
|
117
|
+
<jsv-texture-anim
|
|
118
|
+
:src="img"
|
|
119
|
+
:width="300"
|
|
120
|
+
:height="150"
|
|
121
|
+
:animation="rotateAnim"
|
|
122
|
+
:duration="duration"
|
|
123
|
+
:transform="null"
|
|
124
|
+
:borderRadius="borderRadius"
|
|
125
|
+
:repeat="repeat"
|
|
126
|
+
:autoStart="true"
|
|
127
|
+
></jsv-texture-anim>
|
|
128
|
+
<div
|
|
129
|
+
:style="{
|
|
130
|
+
width: 300,
|
|
131
|
+
height: 150,
|
|
132
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
133
|
+
transform: null,
|
|
134
|
+
animation: `texture-anim-rotate ${duration / 1000}s linear infinite`,
|
|
135
|
+
}"
|
|
136
|
+
/>
|
|
103
137
|
</div>
|
|
104
138
|
|
|
105
|
-
<div
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
139
|
+
<div
|
|
140
|
+
:style="{
|
|
141
|
+
left: 100,
|
|
142
|
+
top: 460,
|
|
143
|
+
}"
|
|
144
|
+
>
|
|
145
|
+
<div
|
|
146
|
+
:style="{
|
|
147
|
+
width: 300,
|
|
148
|
+
height: 150,
|
|
149
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
150
|
+
}"
|
|
151
|
+
/>
|
|
152
|
+
<jsv-texture-anim
|
|
153
|
+
:src="img"
|
|
154
|
+
:width="300"
|
|
155
|
+
:height="150"
|
|
156
|
+
:animation="scaleAnim"
|
|
157
|
+
:duration="duration"
|
|
158
|
+
:transform="null"
|
|
159
|
+
:borderRadius="borderRadius"
|
|
160
|
+
:repeat="repeat"
|
|
161
|
+
:autoStart="true"
|
|
162
|
+
></jsv-texture-anim>
|
|
163
|
+
<div
|
|
164
|
+
:style="{
|
|
165
|
+
width: 300,
|
|
166
|
+
height: 150,
|
|
167
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
168
|
+
transform: null,
|
|
169
|
+
animation: `texture-anim-scale ${duration / 1000}s linear infinite`,
|
|
170
|
+
}"
|
|
171
|
+
/>
|
|
123
172
|
</div>
|
|
124
173
|
<!-- transform sample -->
|
|
125
|
-
<div
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
174
|
+
<div
|
|
175
|
+
:style="{
|
|
176
|
+
left: 500,
|
|
177
|
+
top: 20,
|
|
178
|
+
}"
|
|
179
|
+
>
|
|
180
|
+
<div
|
|
181
|
+
:style="{
|
|
182
|
+
width: 300,
|
|
183
|
+
height: 150,
|
|
184
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
185
|
+
}"
|
|
186
|
+
/>
|
|
187
|
+
<jsv-texture-anim
|
|
188
|
+
:src="img"
|
|
189
|
+
:width="300"
|
|
190
|
+
:height="150"
|
|
191
|
+
:transform="translateTransform"
|
|
192
|
+
:borderRadius="borderRadius"
|
|
193
|
+
></jsv-texture-anim>
|
|
194
|
+
<div
|
|
195
|
+
:style="{
|
|
196
|
+
width: 300,
|
|
197
|
+
height: 150,
|
|
198
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
199
|
+
transform: translateTransform,
|
|
200
|
+
}"
|
|
201
|
+
/>
|
|
142
202
|
</div>
|
|
143
203
|
|
|
144
|
-
<div
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
204
|
+
<div
|
|
205
|
+
:style="{
|
|
206
|
+
left: 500,
|
|
207
|
+
top: 230,
|
|
208
|
+
}"
|
|
209
|
+
>
|
|
210
|
+
<div
|
|
211
|
+
:style="{
|
|
212
|
+
width: 300,
|
|
213
|
+
height: 150,
|
|
214
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
215
|
+
}"
|
|
216
|
+
/>
|
|
217
|
+
<jsv-texture-anim
|
|
218
|
+
:src="img"
|
|
219
|
+
:width="300"
|
|
220
|
+
:height="150"
|
|
221
|
+
:transform="rotateTransform"
|
|
222
|
+
:borderRadius="borderRadius"
|
|
223
|
+
></jsv-texture-anim>
|
|
224
|
+
<div
|
|
225
|
+
:style="{
|
|
226
|
+
width: 300,
|
|
227
|
+
height: 150,
|
|
228
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
229
|
+
transform: rotateTransform,
|
|
230
|
+
}"
|
|
231
|
+
/>
|
|
161
232
|
</div>
|
|
162
233
|
|
|
163
|
-
<div
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
234
|
+
<div
|
|
235
|
+
:style="{
|
|
236
|
+
left: 500,
|
|
237
|
+
top: 460,
|
|
238
|
+
}"
|
|
239
|
+
>
|
|
240
|
+
<div
|
|
241
|
+
:style="{
|
|
242
|
+
width: 300,
|
|
243
|
+
height: 150,
|
|
244
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
245
|
+
}"
|
|
246
|
+
/>
|
|
247
|
+
<jsv-texture-anim
|
|
248
|
+
:src="img"
|
|
249
|
+
:width="300"
|
|
250
|
+
:height="150"
|
|
251
|
+
:transform="scaleTransform"
|
|
252
|
+
:borderRadius="borderRadius"
|
|
253
|
+
></jsv-texture-anim>
|
|
254
|
+
<div
|
|
255
|
+
:style="{
|
|
256
|
+
width: 300,
|
|
257
|
+
height: 150,
|
|
258
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
259
|
+
transform: scaleTransform,
|
|
260
|
+
}"
|
|
261
|
+
/>
|
|
180
262
|
</div>
|
|
181
263
|
<!-- swip light -->
|
|
182
|
-
<div
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
264
|
+
<div
|
|
265
|
+
:style="{
|
|
266
|
+
left: 850,
|
|
267
|
+
top: 460,
|
|
268
|
+
}"
|
|
269
|
+
>
|
|
270
|
+
<div
|
|
271
|
+
:style="{
|
|
272
|
+
width: 300,
|
|
273
|
+
height: 150,
|
|
274
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
275
|
+
}"
|
|
276
|
+
/>
|
|
277
|
+
<jsv-texture-anim
|
|
278
|
+
:src="swipLight"
|
|
279
|
+
:animation="swipAnim"
|
|
280
|
+
:width="300"
|
|
281
|
+
:height="150"
|
|
282
|
+
:duration="duration"
|
|
283
|
+
transform="scale3d(0.5, 1, 1) rotate3d(0,0,1, 30deg)"
|
|
284
|
+
:borderRadius="borderRadius"
|
|
285
|
+
:repeat="repeat"
|
|
286
|
+
:autoStart="true"
|
|
287
|
+
></jsv-texture-anim>
|
|
194
288
|
</div>
|
|
195
289
|
|
|
196
290
|
<!-- 说明文字 -->
|
|
197
|
-
<div
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
291
|
+
<div
|
|
292
|
+
:style="{
|
|
293
|
+
left: 100,
|
|
294
|
+
top: 620,
|
|
295
|
+
width: 1920,
|
|
296
|
+
height: 200,
|
|
297
|
+
fontSize: 30,
|
|
298
|
+
color: '#000000',
|
|
299
|
+
}"
|
|
300
|
+
>
|
|
205
301
|
{{ "1. 注意圆角\n2. 红色半透明的view为标准, 图片的动画需要与其一致" }}
|
|
206
302
|
</div>
|
|
207
303
|
</jsv-focus-block>
|
|
208
|
-
</template>
|
|
304
|
+
</template>
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
DECORATE_NINEPATCH_ALPHA_MIX,
|
|
7
7
|
JsvTextureStoreApi,
|
|
8
8
|
} from "jsview";
|
|
9
|
-
import img from "./assets/
|
|
10
|
-
import img2 from "./assets/
|
|
11
|
-
import mask from "./assets/
|
|
9
|
+
import img from "./assets/blackWhiteTurntable.png";
|
|
10
|
+
import img2 from "./assets/light.png";
|
|
11
|
+
import mask from "./assets/circleHaloMask.png";
|
|
12
12
|
import { getDataUrl } from "../CommonUtils/ResourceData";
|
|
13
13
|
//无网络环境下使用
|
|
14
14
|
const DemoResourceBase = getDataUrl();
|
|
@@ -25,17 +25,20 @@ const top = ref(80);
|
|
|
25
25
|
const rotateAnimation =
|
|
26
26
|
"{from {transform: rotate3d(0,0,1,0);} to {transform: rotate3d(0,0,1,360deg);}}";
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* 创建右图的边缘遮罩,可调节边框的粗细:circleLineWidth
|
|
30
|
+
*/
|
|
28
31
|
// 设置设定模拟绘制.9图
|
|
29
32
|
let canvasRef;
|
|
30
33
|
let sourceId = shallowRef("");
|
|
31
|
-
let sampleImageWidth =
|
|
34
|
+
let sampleImageWidth = 150;
|
|
32
35
|
canvasRef = JsvTextureStoreApi.canvasTexture(
|
|
33
36
|
sampleImageWidth,
|
|
34
37
|
sampleImageWidth
|
|
35
38
|
); // 创建画布
|
|
36
39
|
|
|
37
40
|
let circleInnerDiameter = 70; // 环形内直径, 为所要包括图形的borderRadius的一倍
|
|
38
|
-
let circleLineWidth =
|
|
41
|
+
let circleLineWidth = 2; // 线宽
|
|
39
42
|
let circleRadius = Math.floor(circleInnerDiameter / 2 + circleLineWidth / 2); // 绘制线是圆圈的轨迹中线
|
|
40
43
|
let customPath = canvasRef.circlePath(
|
|
41
44
|
Math.floor(sampleImageWidth / 2),
|
|
@@ -43,9 +46,10 @@ let customPath = canvasRef.circlePath(
|
|
|
43
46
|
circleRadius
|
|
44
47
|
); // 创建圆环绘制路径,圆形在画布的中心点位置
|
|
45
48
|
canvasRef.drawColor("rgba(0,0,0,0)"); // 画布绘制半透明底色
|
|
46
|
-
customPath.stroke(circleLineWidth, "#
|
|
49
|
+
customPath.stroke(circleLineWidth, "#000000FF"); // 以给定线宽绘制圆环
|
|
47
50
|
sourceId = canvasRef.commit(); // texture和div的textureStore绑定
|
|
48
51
|
|
|
52
|
+
// 通过canvas创建出来的 texture 创建NinePatch方式的蒙版
|
|
49
53
|
const ninePatchDecorator1 = {
|
|
50
54
|
type: DECORATE_NINEPATCH_ALPHA_MIX,
|
|
51
55
|
url: `jsvtexturestore://${sourceId}`,
|
|
@@ -55,20 +59,39 @@ const ninePatchDecorator1 = {
|
|
|
55
59
|
animTime: 0.5,
|
|
56
60
|
};
|
|
57
61
|
|
|
62
|
+
/**
|
|
63
|
+
* 导入右图的边缘光晕部分的遮罩
|
|
64
|
+
*/
|
|
65
|
+
// 外发光的圈的图片信息
|
|
66
|
+
const originPngInfo = {
|
|
67
|
+
size: 160, // 图片尺寸
|
|
68
|
+
radius: 56, // 图片中的圆的圆内半径
|
|
69
|
+
};
|
|
70
|
+
const rectRadius = Math.floor(circleInnerDiameter / 2 + circleLineWidth / 2); // 光环在描边之外,留出描边的宽度
|
|
58
71
|
const ninePatchDecorator2 = {
|
|
59
72
|
type: DECORATE_NINEPATCH_ALPHA_MIX,
|
|
60
73
|
url: `url(${mask})`,
|
|
61
|
-
imageWidth:
|
|
74
|
+
imageWidth: originPngInfo.size,
|
|
75
|
+
imageDspWidth: Math.floor(
|
|
76
|
+
(rectRadius / originPngInfo.radius) * originPngInfo.size
|
|
77
|
+
),
|
|
62
78
|
centerWidth: 2,
|
|
63
|
-
borderOutset:
|
|
79
|
+
borderOutset: Math.floor(originPngInfo.size / 2 - originPngInfo.radius),
|
|
64
80
|
animTime: 0.5,
|
|
65
81
|
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 设置敏感转盘的绘制覆盖区域
|
|
85
|
+
*/
|
|
66
86
|
//注意texture的尺寸需要兼顾最大的view
|
|
67
87
|
const texCoord = {
|
|
68
|
-
width:
|
|
69
|
-
height:
|
|
88
|
+
width: 400,
|
|
89
|
+
height: 400,
|
|
70
90
|
};
|
|
71
91
|
|
|
92
|
+
/**
|
|
93
|
+
* 其他回调处理
|
|
94
|
+
*/
|
|
72
95
|
const onKeyDown = (ev) => {
|
|
73
96
|
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
74
97
|
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
@@ -93,6 +116,7 @@ onBeforeUnmount(() => {
|
|
|
93
116
|
:style="{
|
|
94
117
|
width: 1280,
|
|
95
118
|
height: 720,
|
|
119
|
+
backgroundColor: 'rgba(0,0,0,0.7)',
|
|
96
120
|
}"
|
|
97
121
|
>
|
|
98
122
|
<div
|
|
@@ -119,8 +143,26 @@ onBeforeUnmount(() => {
|
|
|
119
143
|
height: height,
|
|
120
144
|
backgroundColor: 'rgba(0, 255, 0, 0.7)',
|
|
121
145
|
borderRadius: Math.floor(circleInnerDiameter / 2),
|
|
146
|
+
fontSize: 30,
|
|
147
|
+
lineHeight: height,
|
|
148
|
+
textAlign: 'center',
|
|
122
149
|
}"
|
|
123
|
-
|
|
150
|
+
>
|
|
151
|
+
{{ "带光晕的焦点框" }}
|
|
152
|
+
</div>
|
|
153
|
+
<jsv-texture-anim
|
|
154
|
+
:src="img"
|
|
155
|
+
:left="left"
|
|
156
|
+
:top="top"
|
|
157
|
+
:width="width"
|
|
158
|
+
:height="height"
|
|
159
|
+
:texCoord="texCoord"
|
|
160
|
+
:animation="rotateAnimation"
|
|
161
|
+
:duration="5000"
|
|
162
|
+
:repeat="-1"
|
|
163
|
+
:autoStart="true"
|
|
164
|
+
:decorate="ninePatchDecorator2"
|
|
165
|
+
></jsv-texture-anim>
|
|
124
166
|
<jsv-texture-anim
|
|
125
167
|
:src="img"
|
|
126
168
|
:left="left"
|
|
@@ -129,13 +171,23 @@ onBeforeUnmount(() => {
|
|
|
129
171
|
:height="height"
|
|
130
172
|
:texCoord="texCoord"
|
|
131
173
|
:animation="rotateAnimation"
|
|
132
|
-
:duration="
|
|
174
|
+
:duration="5000"
|
|
133
175
|
:repeat="-1"
|
|
134
176
|
:autoStart="true"
|
|
135
177
|
:decorate="ninePatchDecorator1"
|
|
136
178
|
></jsv-texture-anim>
|
|
137
179
|
</div>
|
|
138
180
|
<div>
|
|
181
|
+
<!-- <div
|
|
182
|
+
:style="{
|
|
183
|
+
left: left + 500,
|
|
184
|
+
top: top,
|
|
185
|
+
width: width,
|
|
186
|
+
height: height,
|
|
187
|
+
backgroundColor: 'rgba(0, 255, 0, 0.7)',
|
|
188
|
+
borderRadius: rectRadius,
|
|
189
|
+
}"
|
|
190
|
+
/> -->
|
|
139
191
|
<jsv-texture-anim
|
|
140
192
|
:src="img2"
|
|
141
193
|
:left="left + 500"
|
|
@@ -144,10 +196,10 @@ onBeforeUnmount(() => {
|
|
|
144
196
|
:height="height"
|
|
145
197
|
:texCoord="texCoord"
|
|
146
198
|
:animation="rotateAnimation"
|
|
147
|
-
:duration="
|
|
199
|
+
:duration="3000"
|
|
148
200
|
:repeat="-1"
|
|
149
201
|
:autoStart="true"
|
|
150
|
-
:decorate="
|
|
202
|
+
:decorate="ninePatchDecorator1"
|
|
151
203
|
></jsv-texture-anim>
|
|
152
204
|
</div>
|
|
153
205
|
</jsv-focus-block>
|
|
Binary file
|
|
Binary file
|
|
@@ -43,21 +43,21 @@ let randomInteger = Math.floor(Math.random() * 200) + 1;
|
|
|
43
43
|
|
|
44
44
|
onMounted(() => {
|
|
45
45
|
myControl = myRef.value.control;
|
|
46
|
-
myControl.run([
|
|
47
|
-
|
|
46
|
+
myControl.run((cmds) => [
|
|
47
|
+
cmds
|
|
48
48
|
.condition()
|
|
49
49
|
.onNextTick(randomInteger)
|
|
50
50
|
.then([
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
cmds.action().setSpeed(undefined, 9),
|
|
52
|
+
cmds.action(3).setAccel(undefined, 0.13),
|
|
53
53
|
]),
|
|
54
|
-
|
|
54
|
+
cmds
|
|
55
55
|
.condition(undefined, true)
|
|
56
56
|
.reachPosition(undefined, 620)
|
|
57
57
|
.then([
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
cmds.action().teleportTo(undefined, -580 - myHeight),
|
|
59
|
+
cmds.action().setSpeed(undefined, 9),
|
|
60
|
+
cmds.action(3).setAccel(undefined, 0.13),
|
|
61
61
|
]),
|
|
62
62
|
]);
|
|
63
63
|
});
|