@shijiu/jsview-vue-samples 2.0.1073 → 2.0.1106
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/Basic/components/div/DivBackground.vue +13 -25
- package/Basic/components/img/ImageGroup.vue +14 -20
- package/Basic/components/img/ImgLayout.vue +59 -68
- package/BasicFocusControl/components/BaseBlock.vue +11 -17
- package/BasicFocusControl/components/MainAreaLeftBlock.vue +2 -2
- package/BasicFocusControl/components/MainAreaRightBlock.vue +2 -2
- package/BasicFocusControl/components/SideBarBlock.vue +2 -2
- package/CssPreprocessor/App.vue +40 -51
- package/CssPreprocessor/Less/App.vue +6 -14
- package/CssPreprocessor/Scss/App.vue +6 -14
- package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +0 -1
- package/CssPreprocessor/Stylus/App.vue +6 -14
- package/CssPreprocessor/utils/ContentBlock.vue +30 -12
- package/CssPreprocessor/utils/ContentList.vue +23 -14
- package/CssPreprocessor/utils/Panel.vue +34 -23
- package/CssPreprocessor/utils/TitleBar.vue +7 -9
- package/DemoHomepage/components/BodyFrame.vue +54 -78
- package/DemoHomepage/components/Dialog.vue +38 -43
- package/DemoHomepage/components/Item.vue +52 -55
- package/DemoHomepage/components/TabFrame.vue +43 -72
- package/DemoHomepage/router.js +1 -1
- package/GiftRain/App.vue +10 -4
- package/GridDemo/App.vue +5 -5
- package/GridDemo/FocusItem.vue +3 -5
- package/GridDemo/Item.vue +4 -24
- package/HashHistory/App.vue +0 -10
- package/HashHistory/views/MainPage.vue +0 -1
- package/ImpactStop/App.vue +0 -1
- package/Input/App.vue +106 -150
- package/Input/FullKeyboard.vue +18 -28
- package/Input/InputPanel.vue +87 -109
- package/Input/KeyboardItem.vue +35 -45
- package/JsvRadarChart/App.vue +16 -19
- package/LongImage/Button.vue +2 -3
- package/LongText/App.vue +0 -3
- package/LongText/Button.vue +0 -1
- package/LongText/LongTextScroll.vue +0 -4
- package/Marquee/App.vue +1 -0
- package/MetroWidgetDemos/PerformanceTest/App.vue +2 -3
- package/MetroWidgetDemos/PerformanceTest/Item.vue +52 -55
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +86 -95
- package/MetroWidgetDemos/PingPong/App.vue +56 -89
- package/MetroWidgetDemos/PingPong/AppPage.vue +3 -3
- package/MetroWidgetDemos/PingPong/Item.vue +1 -1
- package/MetroWidgetDemos/PingPong/TabItem.vue +3 -3
- package/MetroWidgetDemos/PingPong/WidgetItem.vue +1 -1
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +2 -4
- package/MetroWidgetDemos/basic/Item.vue +1 -1
- package/MetroWidgetDemos/direction/App.vue +0 -2
- package/MetroWidgetDemos/direction/Item.vue +1 -1
- package/MetroWidgetDemos/focusableItemBasic/App.vue +1 -1
- package/MetroWidgetDemos/focusableItemBasic/ButtonItem.vue +1 -1
- package/MetroWidgetDemos/focusableItemMetroWidget/App.vue +1 -1
- package/MetroWidgetDemos/focusableItemMetroWidget/Item.vue +1 -1
- package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +1 -1
- package/MetroWidgetDemos/focusableItemMix/App.vue +1 -1
- package/MetroWidgetDemos/focusableItemMix/ButtonItem.vue +1 -1
- package/MetroWidgetDemos/focusableItemMix/Item.vue +1 -1
- package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +23 -25
- package/MetroWidgetDemos/layoutType/App.vue +0 -2
- package/MetroWidgetDemos/layoutType/Item.vue +1 -1
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +0 -1
- package/MetroWidgetDemos/ninePatchFocusPage/PageRow.vue +1 -1
- package/MetroWidgetDemos/padding/App.vue +0 -2
- package/MetroWidgetDemos/padding/Item.vue +1 -1
- package/MetroWidgetDemos/slideSetting/Item.vue +1 -1
- package/MockjsDemo/App.vue +26 -11
- package/MockjsDemo/mock/index.js +9 -1
- package/QrcodeDemo/App.vue +0 -1
- package/SoundPool/App.vue +1 -2
- package/SpriteImage/App.vue +89 -125
- package/Swiper/App.vue +1 -3
- package/TestNativeSharedView/App.vue +104 -48
- package/TextBox/RenderCenter.vue +89 -113
- package/TextBox/RenderLeft.vue +89 -113
- package/TextBox/RenderOneLine.vue +7 -10
- package/TextBox/RenderRight.vue +8 -11
- package/TextShadowDemo/App.vue +54 -75
- package/TextureAnimation/App.vue +175 -287
- package/TextureAnimation/App2.vue +1 -5
- package/ThrowMoveDemo/AccelerateDemo.vue +40 -71
- package/ThrowMoveDemo/App.vue +13 -23
- package/ThrowMoveDemo/TargetDemo.vue +24 -53
- package/ThrowMoveDemo/UDParabolicDemo.vue +31 -60
- package/VideoDemo/App.vue +71 -116
- package/package.json +1 -1
- package/VideoDemo/components/Button.vue +0 -58
- package/VideoDemo/components/Controllor.vue +0 -197
- package/VideoDemo/components/VideoFrame.vue +0 -140
package/TextureAnimation/App.vue
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script setup>
|
|
2
2
|
import {
|
|
3
3
|
jJsvRuntimeBridge,
|
|
4
4
|
getKeyFramesGroup,
|
|
@@ -6,314 +6,202 @@ import {
|
|
|
6
6
|
} from "jsview";
|
|
7
7
|
import img from "./assets/php2.png";
|
|
8
8
|
import swipLight from "./assets/swipLight.png";
|
|
9
|
+
import { onMounted, onBeforeUnmount } from "vue";
|
|
10
|
+
import { useRouter } from "vue-router";
|
|
11
|
+
const router = useRouter()
|
|
12
|
+
const styleShell = getKeyFramesGroup();
|
|
13
|
+
const translateTransform = "translate3d(50%, 50%, 0)";
|
|
14
|
+
const rotateTransform = "rotate3d(1,1,1, 30deg)";
|
|
15
|
+
const scaleTransform = "scale3d(0.5, 1.5, 1.0)";
|
|
16
|
+
const borderRadius = 40;
|
|
17
|
+
const repeat = -1;
|
|
18
|
+
const duration = 3000;
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
const translateAnim =
|
|
21
|
+
"{from {transform: translate3d(-100%, -50%, 0);} to {transform: translate3d(100%, 50%, 0);}}";
|
|
22
|
+
const rotateAnim =
|
|
23
|
+
"{from {transform: rotate3d(1,-1,1,0);} to {transform: rotate3d(1,-1,1,360deg);}}";
|
|
24
|
+
const scaleAnim =
|
|
25
|
+
"{from {transform: scale3d(0.5, 0.5, 1);} to {transform: scale3d(1.5, 1.5, 1);}}";
|
|
26
|
+
const swipAnim =
|
|
27
|
+
"{from {transform: translate3d(-100%, 0, 0);} to {transform: translate3d(100%, 0, 0);}}";
|
|
16
28
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
styleShell.insertRule(
|
|
30
|
+
"@keyframes texture-anim-translate " + translateAnim
|
|
31
|
+
);
|
|
32
|
+
styleShell.insertRule(
|
|
33
|
+
"@keyframes texture-anim-rotate " + rotateAnim
|
|
34
|
+
);
|
|
35
|
+
styleShell.insertRule(
|
|
36
|
+
"@keyframes texture-anim-scale " + scaleAnim
|
|
37
|
+
);
|
|
23
38
|
|
|
24
|
-
|
|
25
|
-
|
|
39
|
+
const onKeyDown = (ev) => {
|
|
40
|
+
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
41
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
42
|
+
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
onMounted(() => {
|
|
48
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
onBeforeUnmount(() => {
|
|
52
|
+
styleShell.removeRule("texture-anim-translate");
|
|
53
|
+
styleShell.removeRule("texture-anim-rotate");
|
|
54
|
+
styleShell.removeRule("texture-anim-scale");
|
|
55
|
+
})
|
|
26
56
|
|
|
27
|
-
return {
|
|
28
|
-
styleShell,
|
|
29
|
-
img,
|
|
30
|
-
borderRadius: 40,
|
|
31
|
-
repeat: -1,
|
|
32
|
-
duration: 3000,
|
|
33
|
-
translateAnim,
|
|
34
|
-
rotateAnim,
|
|
35
|
-
scaleAnim,
|
|
36
|
-
swipAnim,
|
|
37
|
-
translateTransform: "translate3d(50%, 50%, 0)",
|
|
38
|
-
rotateTransform: "rotate3d(1,1,1, 30deg)",
|
|
39
|
-
scaleTransform: "scale3d(0.5, 1.5, 1.0)",
|
|
40
|
-
swipLight,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
methods: {
|
|
44
|
-
onKeyDown(ev) {
|
|
45
|
-
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
46
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
47
|
-
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
created() {
|
|
53
|
-
this.styleShell.insertRule(
|
|
54
|
-
"@keyframes texture-anim-translate " + this.translateAnim
|
|
55
|
-
);
|
|
56
|
-
this.styleShell.insertRule(
|
|
57
|
-
"@keyframes texture-anim-rotate " + this.rotateAnim
|
|
58
|
-
);
|
|
59
|
-
this.styleShell.insertRule(
|
|
60
|
-
"@keyframes texture-anim-scale " + this.scaleAnim
|
|
61
|
-
);
|
|
62
|
-
},
|
|
63
|
-
mounted() {
|
|
64
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
65
|
-
},
|
|
66
|
-
beforeUnmount() {
|
|
67
|
-
this.styleShell.removeRule("texture-anim-translate");
|
|
68
|
-
this.styleShell.removeRule("texture-anim-rotate");
|
|
69
|
-
this.styleShell.removeRule("texture-anim-scale");
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
57
|
</script>
|
|
73
58
|
<template>
|
|
74
|
-
<jsv-focus-block
|
|
75
|
-
|
|
76
|
-
:
|
|
77
|
-
:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<jsv-texture-anim
|
|
97
|
-
:src="img"
|
|
98
|
-
:width="300"
|
|
99
|
-
:height="150"
|
|
100
|
-
:animation="translateAnim"
|
|
101
|
-
:duration="duration"
|
|
102
|
-
:transform="null"
|
|
103
|
-
:borderRadius="borderRadius"
|
|
104
|
-
:repeat="repeat"
|
|
105
|
-
:autoStart="true"
|
|
106
|
-
></jsv-texture-anim>
|
|
107
|
-
<div
|
|
108
|
-
:style="{
|
|
109
|
-
width: 300,
|
|
110
|
-
height: 150,
|
|
111
|
-
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
112
|
-
transform: null,
|
|
113
|
-
animation: `texture-anim-translate ${
|
|
114
|
-
duration / 1000
|
|
59
|
+
<jsv-focus-block autoFocus :onKeyDown="onKeyDown" :style="{
|
|
60
|
+
width: 1920,
|
|
61
|
+
height: 1080,
|
|
62
|
+
backgroundColor: '#007788',
|
|
63
|
+
}">
|
|
64
|
+
<div :style="{
|
|
65
|
+
left: 100,
|
|
66
|
+
top: 20,
|
|
67
|
+
}">
|
|
68
|
+
<div :style="{
|
|
69
|
+
width: 300,
|
|
70
|
+
height: 150,
|
|
71
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
72
|
+
}" />
|
|
73
|
+
<jsv-texture-anim :src="img" :width="300" :height="150" :animation="translateAnim" :duration="duration"
|
|
74
|
+
:transform="null" :borderRadius="borderRadius" :repeat="repeat" :autoStart="true"></jsv-texture-anim>
|
|
75
|
+
<div :style="{
|
|
76
|
+
width: 300,
|
|
77
|
+
height: 150,
|
|
78
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
79
|
+
transform: null,
|
|
80
|
+
animation: `texture-anim-translate ${duration / 1000
|
|
115
81
|
}s linear infinite`,
|
|
116
|
-
|
|
117
|
-
/>
|
|
82
|
+
}" />
|
|
118
83
|
</div>
|
|
119
84
|
|
|
120
|
-
<div
|
|
121
|
-
:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
:
|
|
135
|
-
:
|
|
136
|
-
:
|
|
137
|
-
|
|
138
|
-
:duration="duration"
|
|
139
|
-
:transform="null"
|
|
140
|
-
:borderRadius="borderRadius"
|
|
141
|
-
:repeat="repeat"
|
|
142
|
-
:autoStart="true"
|
|
143
|
-
></jsv-texture-anim>
|
|
144
|
-
<div
|
|
145
|
-
:style="{
|
|
146
|
-
width: 300,
|
|
147
|
-
height: 150,
|
|
148
|
-
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
149
|
-
transform: null,
|
|
150
|
-
animation: `texture-anim-rotate ${duration / 1000}s linear infinite`,
|
|
151
|
-
}"
|
|
152
|
-
/>
|
|
85
|
+
<div :style="{
|
|
86
|
+
left: 100,
|
|
87
|
+
top: 230,
|
|
88
|
+
}">
|
|
89
|
+
<div :style="{
|
|
90
|
+
width: 300,
|
|
91
|
+
height: 150,
|
|
92
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
93
|
+
}" />
|
|
94
|
+
<jsv-texture-anim :src="img" :width="300" :height="150" :animation="rotateAnim" :duration="duration"
|
|
95
|
+
:transform="null" :borderRadius="borderRadius" :repeat="repeat" :autoStart="true"></jsv-texture-anim>
|
|
96
|
+
<div :style="{
|
|
97
|
+
width: 300,
|
|
98
|
+
height: 150,
|
|
99
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
100
|
+
transform: null,
|
|
101
|
+
animation: `texture-anim-rotate ${duration / 1000}s linear infinite`,
|
|
102
|
+
}" />
|
|
153
103
|
</div>
|
|
154
104
|
|
|
155
|
-
<div
|
|
156
|
-
:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
:
|
|
170
|
-
:
|
|
171
|
-
:
|
|
172
|
-
|
|
173
|
-
:duration="duration"
|
|
174
|
-
:transform="null"
|
|
175
|
-
:borderRadius="borderRadius"
|
|
176
|
-
:repeat="repeat"
|
|
177
|
-
:autoStart="true"
|
|
178
|
-
></jsv-texture-anim>
|
|
179
|
-
<div
|
|
180
|
-
:style="{
|
|
181
|
-
width: 300,
|
|
182
|
-
height: 150,
|
|
183
|
-
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
184
|
-
transform: null,
|
|
185
|
-
animation: `texture-anim-scale ${duration / 1000}s linear infinite`,
|
|
186
|
-
}"
|
|
187
|
-
/>
|
|
105
|
+
<div :style="{
|
|
106
|
+
left: 100,
|
|
107
|
+
top: 460,
|
|
108
|
+
}">
|
|
109
|
+
<div :style="{
|
|
110
|
+
width: 300,
|
|
111
|
+
height: 150,
|
|
112
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
113
|
+
}" />
|
|
114
|
+
<jsv-texture-anim :src="img" :width="300" :height="150" :animation="scaleAnim" :duration="duration"
|
|
115
|
+
:transform="null" :borderRadius="borderRadius" :repeat="repeat" :autoStart="true"></jsv-texture-anim>
|
|
116
|
+
<div :style="{
|
|
117
|
+
width: 300,
|
|
118
|
+
height: 150,
|
|
119
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
120
|
+
transform: null,
|
|
121
|
+
animation: `texture-anim-scale ${duration / 1000}s linear infinite`,
|
|
122
|
+
}" />
|
|
188
123
|
</div>
|
|
189
124
|
<!-- transform sample -->
|
|
190
|
-
<div
|
|
191
|
-
:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
:
|
|
205
|
-
:
|
|
206
|
-
|
|
207
|
-
:transform="translateTransform"
|
|
208
|
-
:borderRadius="borderRadius"
|
|
209
|
-
></jsv-texture-anim>
|
|
210
|
-
<div
|
|
211
|
-
:style="{
|
|
212
|
-
width: 300,
|
|
213
|
-
height: 150,
|
|
214
|
-
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
215
|
-
transform: translateTransform,
|
|
216
|
-
}"
|
|
217
|
-
/>
|
|
125
|
+
<div :style="{
|
|
126
|
+
left: 500,
|
|
127
|
+
top: 20,
|
|
128
|
+
}">
|
|
129
|
+
<div :style="{
|
|
130
|
+
width: 300,
|
|
131
|
+
height: 150,
|
|
132
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
133
|
+
}" />
|
|
134
|
+
<jsv-texture-anim :src="img" :width="300" :height="150" :transform="translateTransform"
|
|
135
|
+
:borderRadius="borderRadius"></jsv-texture-anim>
|
|
136
|
+
<div :style="{
|
|
137
|
+
width: 300,
|
|
138
|
+
height: 150,
|
|
139
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
140
|
+
transform: translateTransform,
|
|
141
|
+
}" />
|
|
218
142
|
</div>
|
|
219
143
|
|
|
220
|
-
<div
|
|
221
|
-
:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
:
|
|
235
|
-
:
|
|
236
|
-
|
|
237
|
-
:transform="rotateTransform"
|
|
238
|
-
:borderRadius="borderRadius"
|
|
239
|
-
></jsv-texture-anim>
|
|
240
|
-
<div
|
|
241
|
-
:style="{
|
|
242
|
-
width: 300,
|
|
243
|
-
height: 150,
|
|
244
|
-
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
245
|
-
transform: rotateTransform,
|
|
246
|
-
}"
|
|
247
|
-
/>
|
|
144
|
+
<div :style="{
|
|
145
|
+
left: 500,
|
|
146
|
+
top: 230,
|
|
147
|
+
}">
|
|
148
|
+
<div :style="{
|
|
149
|
+
width: 300,
|
|
150
|
+
height: 150,
|
|
151
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
152
|
+
}" />
|
|
153
|
+
<jsv-texture-anim :src="img" :width="300" :height="150" :transform="rotateTransform"
|
|
154
|
+
:borderRadius="borderRadius"></jsv-texture-anim>
|
|
155
|
+
<div :style="{
|
|
156
|
+
width: 300,
|
|
157
|
+
height: 150,
|
|
158
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
159
|
+
transform: rotateTransform,
|
|
160
|
+
}" />
|
|
248
161
|
</div>
|
|
249
162
|
|
|
250
|
-
<div
|
|
251
|
-
:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
:
|
|
265
|
-
:
|
|
266
|
-
|
|
267
|
-
:transform="scaleTransform"
|
|
268
|
-
:borderRadius="borderRadius"
|
|
269
|
-
></jsv-texture-anim>
|
|
270
|
-
<div
|
|
271
|
-
:style="{
|
|
272
|
-
width: 300,
|
|
273
|
-
height: 150,
|
|
274
|
-
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
275
|
-
transform: scaleTransform,
|
|
276
|
-
}"
|
|
277
|
-
/>
|
|
163
|
+
<div :style="{
|
|
164
|
+
left: 500,
|
|
165
|
+
top: 460,
|
|
166
|
+
}">
|
|
167
|
+
<div :style="{
|
|
168
|
+
width: 300,
|
|
169
|
+
height: 150,
|
|
170
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
171
|
+
}" />
|
|
172
|
+
<jsv-texture-anim :src="img" :width="300" :height="150" :transform="scaleTransform"
|
|
173
|
+
:borderRadius="borderRadius"></jsv-texture-anim>
|
|
174
|
+
<div :style="{
|
|
175
|
+
width: 300,
|
|
176
|
+
height: 150,
|
|
177
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
178
|
+
transform: scaleTransform,
|
|
179
|
+
}" />
|
|
278
180
|
</div>
|
|
279
181
|
<!-- swip light -->
|
|
280
|
-
<div
|
|
281
|
-
:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
/>
|
|
293
|
-
<jsv-texture-anim
|
|
294
|
-
:src="swipLight"
|
|
295
|
-
:animation="swipAnim"
|
|
296
|
-
:width="300"
|
|
297
|
-
:height="150"
|
|
298
|
-
:duration="duration"
|
|
299
|
-
transform="scale3d(0.5, 1, 1) rotate3d(0,0,1, 30deg)"
|
|
300
|
-
:borderRadius="borderRadius"
|
|
301
|
-
:repeat="repeat"
|
|
302
|
-
:autoStart="true"
|
|
303
|
-
></jsv-texture-anim>
|
|
182
|
+
<div :style="{
|
|
183
|
+
left: 850,
|
|
184
|
+
top: 460,
|
|
185
|
+
}">
|
|
186
|
+
<div :style="{
|
|
187
|
+
width: 300,
|
|
188
|
+
height: 150,
|
|
189
|
+
backgroundColor: 'rgba(0,255,0,0.5)',
|
|
190
|
+
}" />
|
|
191
|
+
<jsv-texture-anim :src="swipLight" :animation="swipAnim" :width="300" :height="150" :duration="duration"
|
|
192
|
+
transform="scale3d(0.5, 1, 1) rotate3d(0,0,1, 30deg)" :borderRadius="borderRadius" :repeat="repeat"
|
|
193
|
+
:autoStart="true"></jsv-texture-anim>
|
|
304
194
|
</div>
|
|
305
195
|
|
|
306
196
|
<!-- 说明文字 -->
|
|
307
|
-
<div
|
|
308
|
-
:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}"
|
|
316
|
-
>
|
|
197
|
+
<div :style="{
|
|
198
|
+
left: 100,
|
|
199
|
+
top: 620,
|
|
200
|
+
width: 1920,
|
|
201
|
+
height: 200,
|
|
202
|
+
fontSize: 30,
|
|
203
|
+
color: '#000000',
|
|
204
|
+
}">
|
|
317
205
|
{{ "1. 注意圆角\n2. 红色半透明的view为标准, 图片的动画需要与其一致" }}
|
|
318
206
|
</div>
|
|
319
207
|
</jsv-focus-block>
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref
|
|
2
|
+
import { ref } from "vue";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import {
|
|
5
|
-
jJsvRuntimeBridge,
|
|
6
|
-
getKeyFramesGroup,
|
|
7
5
|
JsvTextureAnim,
|
|
8
|
-
TexAlignAnchor,
|
|
9
6
|
DECORATE_NINEPATCH_ALPHA_MIX,
|
|
10
|
-
DECORATE_BORDER_RADIUS,
|
|
11
7
|
} from "jsview";
|
|
12
8
|
import img from "./assets/light.png";
|
|
13
9
|
import img2 from "./assets/light2.png";
|
|
@@ -1,92 +1,61 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-10-20 18:27:25
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: ZhengYi
|
|
5
|
+
* @LastEditTime: 2023-05-05
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
|
-
<script>
|
|
8
|
+
<script setup>
|
|
9
9
|
import { JsvActorMoveControl, JsvActorMove } from "jsview";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
direction: 1,
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
computed: {
|
|
23
|
-
directionDetail() {
|
|
24
|
-
return this.direction > 0 ? "上" : "下";
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
setup() {
|
|
28
|
-
let throwControl = new JsvActorMoveControl(); // 抛物运动体控制器
|
|
29
|
-
let moveControl = new JsvActorMoveControl(); // 平移运动体控制器
|
|
10
|
+
import { shallowRef, computed } from "vue"
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
name: String,
|
|
13
|
+
})
|
|
14
|
+
let direction = shallowRef(1)
|
|
15
|
+
let throwControl = new JsvActorMoveControl(); // 抛物运动体控制器
|
|
16
|
+
let moveControl = new JsvActorMoveControl(); // 平移运动体控制器
|
|
17
|
+
let focusNode = shallowRef(null)
|
|
30
18
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(x, y) => {
|
|
50
|
-
console.log(`Throw end with x=${x} y=${y}`);
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
return true;
|
|
19
|
+
const directionDetail = computed(() => {
|
|
20
|
+
return direction.value > 0 ? "上" : "下";
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const onKeyDown = (ev) => {
|
|
24
|
+
if (ev.keyCode === 13) {
|
|
25
|
+
let preDirection = direction.value;
|
|
26
|
+
direction.value = -direction.value;
|
|
27
|
+
throwControl.throwAlongY(
|
|
28
|
+
0,
|
|
29
|
+
750 * preDirection,
|
|
30
|
+
{
|
|
31
|
+
type: "catch",
|
|
32
|
+
position: 200 * preDirection,
|
|
33
|
+
direction: preDirection,
|
|
34
|
+
},
|
|
35
|
+
(x, y) => {
|
|
36
|
+
console.log(`Throw end with x=${x} y=${y}`);
|
|
54
37
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
38
|
+
);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
59
43
|
</script>
|
|
60
44
|
|
|
61
45
|
<template>
|
|
62
|
-
<jsv-focus-block
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
:onAction="{
|
|
67
|
-
onKeyDown: onKeyDown,
|
|
68
|
-
}"
|
|
69
|
-
>
|
|
70
|
-
<div
|
|
71
|
-
key="sample1"
|
|
72
|
-
class="detail-font"
|
|
73
|
-
:style="{ top: 150, left: 425, width: 430, height: 40 }"
|
|
74
|
-
>
|
|
46
|
+
<jsv-focus-block ref="focusNode" :name="props.name" autoFocus :onAction="{
|
|
47
|
+
onKeyDown: onKeyDown,
|
|
48
|
+
}">
|
|
49
|
+
<div key="sample1" class="detail-font" :style="{ top: 150, left: 425, width: 430, height: 40 }">
|
|
75
50
|
{{ `向${directionDetail}加速` }}
|
|
76
51
|
</div>
|
|
77
|
-
<div
|
|
78
|
-
key="DirectText"
|
|
79
|
-
class="font"
|
|
80
|
-
:style="{ top: 250, left: 425, width: 430, height: 40 }"
|
|
81
|
-
>
|
|
52
|
+
<div key="DirectText" class="font" :style="{ top: 250, left: 425, width: 430, height: 40 }">
|
|
82
53
|
{{ `当前方向:${directionDetail}` }}
|
|
83
54
|
</div>
|
|
84
55
|
<div :style="{ top: 590, left: 625 }">
|
|
85
56
|
<jsv-actor-move key="move" :control="moveControl">
|
|
86
57
|
<jsv-actor-move key="throw" :control="throwControl">
|
|
87
|
-
<div
|
|
88
|
-
:style="{ backgroundColor: '#FF0000', width: 30, height: 30 }"
|
|
89
|
-
></div>
|
|
58
|
+
<div :style="{ backgroundColor: '#FF0000', width: 30, height: 30 }"></div>
|
|
90
59
|
</jsv-actor-move>
|
|
91
60
|
</jsv-actor-move>
|
|
92
61
|
</div>
|