@shijiu/jsview-vue-samples 1.9.747
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/AnimPicture/App.vue +207 -0
- package/AnimPicture/assets/animated_webp.webp +0 -0
- package/AnimPicture/assets/ball_3.webp +0 -0
- package/AnimPicture/assets/girl_run.gif +0 -0
- package/AnimPicture/assets/quan.webp +0 -0
- package/Basic/App.vue +134 -0
- package/Basic/assets/border.png +0 -0
- package/Basic/assets/border2.png +0 -0
- package/Basic/assets/icon.png +0 -0
- package/Basic/assets/test.jpg +0 -0
- package/Basic/components/ContentBlock.vue +38 -0
- package/Basic/components/FontStyle.css +16 -0
- package/Basic/components/anim/AnimGroup.vue +66 -0
- package/Basic/components/anim/AnimKeyframeBasic.vue +119 -0
- package/Basic/components/anim/AnimKeyframeComposite.vue +52 -0
- package/Basic/components/anim/AnimTransition.vue +157 -0
- package/Basic/components/div/DivBackground.vue +44 -0
- package/Basic/components/div/DivClip.vue +159 -0
- package/Basic/components/div/DivCssScoped.vue +20 -0
- package/Basic/components/div/DivCssVar.vue +53 -0
- package/Basic/components/div/DivGroup1.vue +47 -0
- package/Basic/components/div/DivGroup2.vue +65 -0
- package/Basic/components/div/DivLayout.vue +70 -0
- package/Basic/components/div/DivRadius.vue +65 -0
- package/Basic/components/div/DivTransform.vue +32 -0
- package/Basic/components/img/ImageGroup.vue +31 -0
- package/Basic/components/img/ImgLayout.vue +41 -0
- package/Basic/components/panel/Panel1.vue +55 -0
- package/Basic/components/panel/Panel2.vue +31 -0
- package/Basic/components/panel/TitleBar.vue +29 -0
- package/Basic/components/text/TextAlign.vue +66 -0
- package/Basic/components/text/TextEmoji.vue +26 -0
- package/Basic/components/text/TextFontStyle.vue +89 -0
- package/Basic/components/text/TextGroup1.vue +49 -0
- package/Basic/components/text/TextGroup2.vue +28 -0
- package/Basic/components/text/TextOverflow.vue +110 -0
- package/BasicFocusControl/App.vue +104 -0
- package/BasicFocusControl/components/BaseBlock.vue +50 -0
- package/BasicFocusControl/components/MainArea.vue +83 -0
- package/BasicFocusControl/components/MainAreaLeftBlock.vue +17 -0
- package/BasicFocusControl/components/MainAreaRightBlock.vue +27 -0
- package/BasicFocusControl/components/SideBar.vue +58 -0
- package/BasicFocusControl/components/SideBarBlock.vue +27 -0
- package/Collision/App.vue +452 -0
- package/ColorSpace/App.vue +126 -0
- package/ColorSpace/bmpDemo.bmp +0 -0
- package/ColorSpace/jpegDemo.jpeg +0 -0
- package/ColorSpace/pngDemo.png +0 -0
- package/ColorSpace/pngNoAlphaDemo.png +0 -0
- package/DemoHomepage/App.vue +27 -0
- package/DemoHomepage/components/BodyFrame.vue +95 -0
- package/DemoHomepage/components/Dialog.vue +94 -0
- package/DemoHomepage/components/Item.vue +77 -0
- package/DemoHomepage/components/TabFrame.vue +85 -0
- package/DemoHomepage/router.js +196 -0
- package/DemoHomepage/views/Homepage.vue +195 -0
- package/FilterDemo/AnimatePic.vue +58 -0
- package/FilterDemo/App.vue +159 -0
- package/FilterDemo/VideoLayer.vue +62 -0
- package/FilterDemo/jpegDemo.jpeg +0 -0
- package/FilterDemo/webpDemo.webp +0 -0
- package/FlipCard/App.vue +71 -0
- package/FlipCard/FlipCard.vue +118 -0
- package/FlipCard/assets/blue_egg.png +0 -0
- package/FlipCard/assets/red_egg.png +0 -0
- package/FlipCard/data.js +13 -0
- package/GridDemo/App.vue +215 -0
- package/GridDemo/ButtonBlock.vue +112 -0
- package/GridDemo/FocusItem.vue +37 -0
- package/GridDemo/Item.vue +93 -0
- package/HashHistory/App.vue +115 -0
- package/HashHistory/components/HorizontalButtonList.vue +91 -0
- package/HashHistory/components/Item.vue +60 -0
- package/HashHistory/router.js +41 -0
- package/HashHistory/views/MainPage.vue +57 -0
- package/HashHistory/views/SubPage.vue +66 -0
- package/ImpactStop/App.vue +435 -0
- package/Input/App.vue +164 -0
- package/Input/FullKeyboard.vue +87 -0
- package/Input/InputPanel.vue +131 -0
- package/Input/KeyboardItem.vue +58 -0
- package/LongImage/App.vue +80 -0
- package/LongImage/Button.vue +58 -0
- package/LongImage/ButtonItem.vue +44 -0
- package/LongImage/LongImageScroll.vue +92 -0
- package/LongImage/Scroll.vue +14 -0
- package/LongImage/assets/1280x7200.jpg +0 -0
- package/LongText/App.vue +96 -0
- package/LongText/Button.vue +51 -0
- package/LongText/ButtonItem.vue +44 -0
- package/LongText/LongTextScroll.vue +192 -0
- package/LongText/Scroll.vue +14 -0
- package/Marquee/App.vue +247 -0
- package/Marquee/longText.js +14 -0
- package/MaskClip/App.vue +122 -0
- package/MaskClip/images/mask-025/config.json +29 -0
- package/MaskClip/images/mask-025/res/1.png +0 -0
- package/MaskClip/images/mask-025/res/2.png +0 -0
- package/MaskClip/images/mask-025/res/3.png +0 -0
- package/MaskClip/images/mask-025/res/4.png +0 -0
- package/MaskClip/images/mask-025/res/icon.png +0 -0
- package/MaskClip/images/mask-025/res/stroke.png +0 -0
- package/MaskClip/images/php.jpg +0 -0
- package/MetroWidgetDemos/Advanced/App.vue +46 -0
- package/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- package/MetroWidgetDemos/Advanced/Buttons.vue +70 -0
- package/MetroWidgetDemos/Advanced/Mixed.vue +77 -0
- package/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
- package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
- package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +116 -0
- package/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/MetroWidgetDemos/Item.vue +85 -0
- package/MetroWidgetDemos/PerformanceTest/App.vue +210 -0
- package/MetroWidgetDemos/PerformanceTest/Item.vue +90 -0
- package/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/border.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +386 -0
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +129 -0
- package/MetroWidgetDemos/PerformanceTest/data.js +45 -0
- package/MetroWidgetDemos/PingPong/App.vue +135 -0
- package/MetroWidgetDemos/PingPong/AppPage.vue +73 -0
- package/MetroWidgetDemos/PingPong/AppTab.vue +62 -0
- package/MetroWidgetDemos/PingPong/TabItem.vue +84 -0
- package/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
- package/MetroWidgetDemos/Simple/App.vue +45 -0
- package/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -0
- package/MetroWidgetDemos/WidgetItem.vue +89 -0
- package/MetroWidgetDemos/data.js +205 -0
- package/NinePatchDemo/App.vue +145 -0
- package/NinePatchDemo/Item.vue +69 -0
- package/NinePatchDemo/assets/border.png +0 -0
- package/Preload/App.vue +135 -0
- package/Preload/Item.vue +32 -0
- package/Preload/data.js +23 -0
- package/Preload/images/awesomeface.png +0 -0
- package/Preload/images/cat.jpg +0 -0
- package/Preload/images/rank.png +0 -0
- package/Preload/images/rank_focus.png +0 -0
- package/Preload/images/rule.png +0 -0
- package/Preload/images/rule_focus.png +0 -0
- package/Preload/images/start.png +0 -0
- package/Preload/images/start_focus.png +0 -0
- package/QrcodeDemo/App.vue +68 -0
- package/ScaleDownNeon/App.vue +107 -0
- package/SoundPool/App.vue +134 -0
- package/SoundPool/bgmusic.mp3 +0 -0
- package/SoundPool/coin.mp3 +0 -0
- package/SoundPool/jump.mp3 +0 -0
- package/SoundPool/lose.mp3 +0 -0
- package/SoundPool/run.mp3 +0 -0
- package/SprayView/App.vue +272 -0
- package/SprayView/assets/snow.png +0 -0
- package/SpriteImage/App.vue +173 -0
- package/SpriteImage/images/cat_run.png +0 -0
- package/SpriteImage/images/egg_break.json +116 -0
- package/SpriteImage/images/egg_break.png +0 -0
- package/SpriteImage/images/sprite.png +0 -0
- package/TextBox/App.vue +91 -0
- package/TextBox/RenderCenter.vue +133 -0
- package/TextBox/RenderLeft.vue +138 -0
- package/TextBox/RenderOneLine.vue +101 -0
- package/TextBox/RenderRight.vue +131 -0
- package/TextShadowDemo/App.vue +91 -0
- package/TextureAnimation/App.vue +336 -0
- package/TextureAnimation/App2.vue +111 -0
- package/TextureAnimation/assets/blackWhiteGrid.png +0 -0
- package/TextureAnimation/assets/light.png +0 -0
- package/TextureAnimation/assets/light2.png +0 -0
- package/TextureAnimation/assets/mask.png +0 -0
- package/TextureAnimation/assets/php.jpg +0 -0
- package/TextureAnimation/assets/php2.png +0 -0
- package/TextureAnimation/assets/swipLight.png +0 -0
- package/TextureSize/App.vue +132 -0
- package/TextureSize/bmpDemo.bmp +0 -0
- package/TextureSize/jpegDemo.jpeg +0 -0
- package/TextureSize/jpgDemo.jpg +0 -0
- package/TextureSize/pngDemo.png +0 -0
- package/TextureSize/pngNoAlphaDemo.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +116 -0
- package/ThrowMoveDemo/App.vue +114 -0
- package/ThrowMoveDemo/LRParabolicDemo.vue +115 -0
- package/ThrowMoveDemo/TargetDemo.vue +116 -0
- package/ThrowMoveDemo/UDParabolicDemo.vue +121 -0
- package/TouchSample/App.vue +136 -0
- package/TouchSample/Item.vue +103 -0
- package/TouchSample/MetroWidgetHorizontal.vue +144 -0
- package/TouchSample/MetroWidgetVertical.vue +144 -0
- package/TouchSample/TouchContainerHorizontal.vue +160 -0
- package/TouchSample/TouchContainerVertical.vue +160 -0
- package/TouchSample/data.js +81 -0
- package/TransitPage/App.vue +29 -0
- package/VideoDemo/App.vue +121 -0
- package/VideoDemo/components/Button.vue +58 -0
- package/VideoDemo/components/Controllor.vue +197 -0
- package/VideoDemo/components/VideoFrame.vue +140 -0
- package/VisibleSensorDemo/App.vue +234 -0
- package/package.json +17 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-08-30 10:58:38
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-08-30 14:20:46
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script setup>
|
|
9
|
+
import { createImpactTracer, createImpactCallback } from "jsview";
|
|
10
|
+
import { ref, shallowRef, onMounted, onBeforeUnmount } from "vue";
|
|
11
|
+
import { useRouter } from "vue-router";
|
|
12
|
+
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
|
|
15
|
+
const transEle1 = shallowRef(null),
|
|
16
|
+
transEle2 = shallowRef(null),
|
|
17
|
+
rotateEle1 = shallowRef(null),
|
|
18
|
+
rotateEle2 = shallowRef(null),
|
|
19
|
+
rotateEle3 = shallowRef(null),
|
|
20
|
+
rotateEle4 = shallowRef(null),
|
|
21
|
+
scaleEle1 = shallowRef(null),
|
|
22
|
+
scaleEle2 = shallowRef(null),
|
|
23
|
+
skewEle1 = shallowRef(null),
|
|
24
|
+
skewEle2 = shallowRef(null);
|
|
25
|
+
|
|
26
|
+
let sensors = [];
|
|
27
|
+
|
|
28
|
+
const tLeftColor = ref("#FF0000"),
|
|
29
|
+
tRightColor = ref("#00FF00"),
|
|
30
|
+
rLeftColor = ref("#FF0000"),
|
|
31
|
+
rRightColor = ref("#00FF00"),
|
|
32
|
+
r2LeftColor = ref("#FF0000"),
|
|
33
|
+
r2RightColor = ref("#00FF00"),
|
|
34
|
+
sLeftColor = ref("#FF0000"),
|
|
35
|
+
sRightColor = ref("#00FF00"),
|
|
36
|
+
skLeftColor = ref("#FF0000"),
|
|
37
|
+
skRightColor = ref("#00FF00");
|
|
38
|
+
|
|
39
|
+
const lastItemVisibility = ref("hidden"); // 验证View先声明碰撞检测再显示的场景,是否碰撞能正常生效
|
|
40
|
+
const lastItemGone = ref(false); // 验证碰撞对象关联的View从ViewTree拿掉后是否触发Native端的自清理处理
|
|
41
|
+
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
lastItemVisibility.value = "visible";
|
|
44
|
+
}, 1000);
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
lastItemGone.value = true;
|
|
47
|
+
}, 5000);
|
|
48
|
+
|
|
49
|
+
const onKeyDown = (ev) => {
|
|
50
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
51
|
+
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
const translate_sensor = createImpactTracer(
|
|
58
|
+
transEle1.value,
|
|
59
|
+
transEle2.value,
|
|
60
|
+
createImpactCallback(
|
|
61
|
+
() => {
|
|
62
|
+
tLeftColor.value = "#00FFFF";
|
|
63
|
+
tRightColor.value = "#FFFF00";
|
|
64
|
+
},
|
|
65
|
+
() => {
|
|
66
|
+
tLeftColor.value = "#FF0000";
|
|
67
|
+
tRightColor.value = "#00FF00";
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
sensors.push(translate_sensor);
|
|
72
|
+
|
|
73
|
+
const rotate_count = { count: 0 };
|
|
74
|
+
const rotate_sensor = createImpactTracer(
|
|
75
|
+
rotateEle1.value,
|
|
76
|
+
rotateEle2.value,
|
|
77
|
+
createImpactCallback(
|
|
78
|
+
() => {
|
|
79
|
+
rLeftColor.value = "#00FFFF";
|
|
80
|
+
rRightColor.value = "#FFFF00";
|
|
81
|
+
},
|
|
82
|
+
() => {
|
|
83
|
+
rotate_count.count++;
|
|
84
|
+
if (rotate_count.count >= 2) {
|
|
85
|
+
// 旋转有头尾连续两次碰撞
|
|
86
|
+
console.log("Finish collision of rotate element");
|
|
87
|
+
}
|
|
88
|
+
rLeftColor.value = "#FF0000";
|
|
89
|
+
rRightColor.value = "#00FF00";
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
sensors.push(rotate_sensor);
|
|
94
|
+
|
|
95
|
+
const rotate2_sensor = createImpactTracer(
|
|
96
|
+
rotateEle3.value,
|
|
97
|
+
rotateEle4.value,
|
|
98
|
+
createImpactCallback(
|
|
99
|
+
() => {
|
|
100
|
+
r2LeftColor.value = "#00FFFF";
|
|
101
|
+
r2RightColor.value = "#FFFF00";
|
|
102
|
+
},
|
|
103
|
+
() => {
|
|
104
|
+
r2LeftColor.value = "#FF0000";
|
|
105
|
+
r2RightColor.value = "#00FF00";
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
sensors.push(rotate2_sensor);
|
|
110
|
+
|
|
111
|
+
const scale_sensor = createImpactTracer(
|
|
112
|
+
scaleEle1.value,
|
|
113
|
+
scaleEle2.value,
|
|
114
|
+
createImpactCallback(
|
|
115
|
+
() => {
|
|
116
|
+
sLeftColor.value = "#00FFFF";
|
|
117
|
+
sRightColor.value = "#FFFF00";
|
|
118
|
+
},
|
|
119
|
+
() => {
|
|
120
|
+
sLeftColor.value = "#FF0000";
|
|
121
|
+
sRightColor.value = "#00FF00";
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
);
|
|
125
|
+
sensors.push(scale_sensor);
|
|
126
|
+
|
|
127
|
+
const skew_sensor = createImpactTracer(
|
|
128
|
+
skewEle1.value,
|
|
129
|
+
skewEle2.value,
|
|
130
|
+
createImpactCallback(
|
|
131
|
+
() => {
|
|
132
|
+
skLeftColor.value = "#00FFFF";
|
|
133
|
+
skRightColor.value = "#FFFF00";
|
|
134
|
+
},
|
|
135
|
+
() => {
|
|
136
|
+
skLeftColor.value = "#FF0000";
|
|
137
|
+
skRightColor.value = "#00FF00";
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
sensors.push(skew_sensor);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
onBeforeUnmount(() => {
|
|
145
|
+
for (let i = 0; i < sensors.length; i++) {
|
|
146
|
+
sensors[i].Recycle();
|
|
147
|
+
}
|
|
148
|
+
sensors = [];
|
|
149
|
+
});
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<template>
|
|
153
|
+
<jsv-focus-block
|
|
154
|
+
autoFocus
|
|
155
|
+
:style="{
|
|
156
|
+
width: 1920,
|
|
157
|
+
height: 1080,
|
|
158
|
+
backgroundColor: '#007788',
|
|
159
|
+
}"
|
|
160
|
+
:onAction="{
|
|
161
|
+
onKeyDown: onKeyDown,
|
|
162
|
+
}"
|
|
163
|
+
>
|
|
164
|
+
<div
|
|
165
|
+
:style="{
|
|
166
|
+
textAlign: 'center',
|
|
167
|
+
fontSize: '30px',
|
|
168
|
+
lineHeight: '50px',
|
|
169
|
+
color: '#ffffff',
|
|
170
|
+
left: 100,
|
|
171
|
+
top: 20,
|
|
172
|
+
width: 1280 - 200,
|
|
173
|
+
height: 50,
|
|
174
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
175
|
+
}"
|
|
176
|
+
>
|
|
177
|
+
原生端辅助的高效率碰撞检测处理
|
|
178
|
+
</div>
|
|
179
|
+
<div :style="{ top: 200, left: 100 }">
|
|
180
|
+
<div
|
|
181
|
+
ref="transEle1"
|
|
182
|
+
:style="{
|
|
183
|
+
left: 0,
|
|
184
|
+
width: 100,
|
|
185
|
+
height: 100,
|
|
186
|
+
backgroundColor: tLeftColor,
|
|
187
|
+
animation: 'toRight 5s',
|
|
188
|
+
}"
|
|
189
|
+
>
|
|
190
|
+
view1
|
|
191
|
+
</div>
|
|
192
|
+
<div :style="{ left: 300 }">
|
|
193
|
+
<div
|
|
194
|
+
ref="transEle2"
|
|
195
|
+
:style="{
|
|
196
|
+
width: 100,
|
|
197
|
+
height: 100,
|
|
198
|
+
backgroundColor: tRightColor,
|
|
199
|
+
animation: 'toLeft 5s',
|
|
200
|
+
}"
|
|
201
|
+
>
|
|
202
|
+
view2
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<div :style="{ top: 500, left: 100 }">
|
|
208
|
+
<div
|
|
209
|
+
ref="rotateEle1"
|
|
210
|
+
:style="{
|
|
211
|
+
left: 0,
|
|
212
|
+
width: 20,
|
|
213
|
+
height: 150,
|
|
214
|
+
backgroundColor: rLeftColor,
|
|
215
|
+
animation: 'rotate1 5s',
|
|
216
|
+
}"
|
|
217
|
+
>
|
|
218
|
+
view1
|
|
219
|
+
</div>
|
|
220
|
+
<div
|
|
221
|
+
ref="rotateEle2"
|
|
222
|
+
:style="{
|
|
223
|
+
left: 100,
|
|
224
|
+
width: 20,
|
|
225
|
+
height: 150,
|
|
226
|
+
backgroundColor: rRightColor,
|
|
227
|
+
animation: 'rotate2 5s',
|
|
228
|
+
}"
|
|
229
|
+
>
|
|
230
|
+
view2
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<div :style="{ top: 500, left: 500 }">
|
|
235
|
+
<div
|
|
236
|
+
:style="{
|
|
237
|
+
top: 50,
|
|
238
|
+
left: 0,
|
|
239
|
+
width: 150,
|
|
240
|
+
height: 150,
|
|
241
|
+
backgroundColor: 'rgba(255,255,255,0.5)',
|
|
242
|
+
animation: 'rotate3 5s',
|
|
243
|
+
}"
|
|
244
|
+
>
|
|
245
|
+
<div
|
|
246
|
+
ref="rotateEle3"
|
|
247
|
+
:style="{
|
|
248
|
+
left: (150 - 20) / 2,
|
|
249
|
+
width: 20,
|
|
250
|
+
height: 150,
|
|
251
|
+
backgroundColor: r2LeftColor,
|
|
252
|
+
}"
|
|
253
|
+
>
|
|
254
|
+
view1
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
<div
|
|
258
|
+
:style="{
|
|
259
|
+
top: 0,
|
|
260
|
+
left: 100,
|
|
261
|
+
width: 150,
|
|
262
|
+
height: 150,
|
|
263
|
+
backgroundColor: 'rgba(255,255,255,0.5)',
|
|
264
|
+
animation: 'rotate4 5s',
|
|
265
|
+
}"
|
|
266
|
+
>
|
|
267
|
+
<div
|
|
268
|
+
ref="rotateEle4"
|
|
269
|
+
:style="{
|
|
270
|
+
left: 0,
|
|
271
|
+
top: (150 - 20) / 2,
|
|
272
|
+
width: 150,
|
|
273
|
+
height: 20,
|
|
274
|
+
backgroundColor: r2RightColor,
|
|
275
|
+
}"
|
|
276
|
+
>
|
|
277
|
+
view2
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
<div :style="{ top: 200, left: 500 }">
|
|
283
|
+
<div
|
|
284
|
+
ref="scaleEle1"
|
|
285
|
+
:style="{
|
|
286
|
+
left: 100,
|
|
287
|
+
width: 100,
|
|
288
|
+
height: 100,
|
|
289
|
+
backgroundColor: sLeftColor,
|
|
290
|
+
animation: 'scale1 5s',
|
|
291
|
+
}"
|
|
292
|
+
>
|
|
293
|
+
view1
|
|
294
|
+
</div>
|
|
295
|
+
<div
|
|
296
|
+
ref="scaleEle2"
|
|
297
|
+
:style="{
|
|
298
|
+
left: 250,
|
|
299
|
+
width: 100,
|
|
300
|
+
height: 100,
|
|
301
|
+
backgroundColor: sRightColor,
|
|
302
|
+
animation: 'scale2 5s',
|
|
303
|
+
}"
|
|
304
|
+
>
|
|
305
|
+
view2
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<div
|
|
310
|
+
v-if="!lastItemGone"
|
|
311
|
+
:style="{
|
|
312
|
+
top: 500,
|
|
313
|
+
left: 800,
|
|
314
|
+
visibility: lastItemVisibility,
|
|
315
|
+
}"
|
|
316
|
+
>
|
|
317
|
+
<div
|
|
318
|
+
ref="skewEle1"
|
|
319
|
+
:style="{
|
|
320
|
+
left: 100,
|
|
321
|
+
width: 100,
|
|
322
|
+
height: 100,
|
|
323
|
+
backgroundColor: skLeftColor,
|
|
324
|
+
animation: 'skew1 5s',
|
|
325
|
+
}"
|
|
326
|
+
>
|
|
327
|
+
viewA
|
|
328
|
+
</div>
|
|
329
|
+
<div
|
|
330
|
+
ref="skewEle2"
|
|
331
|
+
:style="{
|
|
332
|
+
left: 300,
|
|
333
|
+
width: 100,
|
|
334
|
+
height: 100,
|
|
335
|
+
backgroundColor: skRightColor,
|
|
336
|
+
animation: 'skew2 5s',
|
|
337
|
+
}"
|
|
338
|
+
>
|
|
339
|
+
viewB
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</jsv-focus-block>
|
|
343
|
+
</template>
|
|
344
|
+
|
|
345
|
+
<style scoped>
|
|
346
|
+
@keyframes toLeft {
|
|
347
|
+
from {
|
|
348
|
+
transform: translate3d(0, 0, 0) scale3d(0.5, 0.5, 1);
|
|
349
|
+
}
|
|
350
|
+
to {
|
|
351
|
+
transform: translate3d(-300px, 0, 0) scale3d(1.5, 1.5, 1);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@keyframes toRight {
|
|
356
|
+
from {
|
|
357
|
+
transform: translate3d(0, 0, 0) scale3d(0.5, 0.5, 1);
|
|
358
|
+
}
|
|
359
|
+
to {
|
|
360
|
+
transform: translate3d(300px, 0, 0) scale3d(1.5, 1.5, 1);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
@keyframes rotate1 {
|
|
365
|
+
from {
|
|
366
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
367
|
+
}
|
|
368
|
+
to {
|
|
369
|
+
transform: rotate3d(0, 0, 1, 360deg);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* webview中 旋转轴为(0,0,-1)会导致getComputeStyle中的transform为单位矩阵*/
|
|
374
|
+
@keyframes rotate2 {
|
|
375
|
+
from {
|
|
376
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
377
|
+
}
|
|
378
|
+
to {
|
|
379
|
+
transform: rotate3d(0, 0, 1, -360deg);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@keyframes scale1 {
|
|
384
|
+
0% {
|
|
385
|
+
transform: scale3d(1, 1, 1);
|
|
386
|
+
}
|
|
387
|
+
50% {
|
|
388
|
+
transform: scale3d(2, 2, 1);
|
|
389
|
+
}
|
|
390
|
+
100% {
|
|
391
|
+
transform: scale3d(1, 1, 1);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@keyframes scale2 {
|
|
396
|
+
0% {
|
|
397
|
+
transform: scale3d(1, 1, 1);
|
|
398
|
+
}
|
|
399
|
+
50% {
|
|
400
|
+
transform: scale3d(2, 2, 1);
|
|
401
|
+
}
|
|
402
|
+
100% {
|
|
403
|
+
transform: scale3d(1, 1, 1);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
@keyframes skew1 {
|
|
408
|
+
0% {
|
|
409
|
+
transform: skew(0, 0);
|
|
410
|
+
}
|
|
411
|
+
50% {
|
|
412
|
+
transform: skew(-60deg, 0);
|
|
413
|
+
}
|
|
414
|
+
100% {
|
|
415
|
+
transform: skew(0, 0);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
@keyframes skew2 {
|
|
420
|
+
0% {
|
|
421
|
+
transform: skew(0, 0);
|
|
422
|
+
}
|
|
423
|
+
50% {
|
|
424
|
+
transform: skew(60deg, 0);
|
|
425
|
+
}
|
|
426
|
+
100% {
|
|
427
|
+
transform: skew(0, 0);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
@keyframes rotate3 {
|
|
432
|
+
from {
|
|
433
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
434
|
+
transform-origin: center top;
|
|
435
|
+
}
|
|
436
|
+
to {
|
|
437
|
+
transform: rotate3d(0, 0, 1, -360deg);
|
|
438
|
+
transform-origin: center top;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
@keyframes rotate4 {
|
|
443
|
+
from {
|
|
444
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
445
|
+
transform-origin: center center;
|
|
446
|
+
}
|
|
447
|
+
to {
|
|
448
|
+
transform: rotate3d(0, 0, 1, -360deg);
|
|
449
|
+
transform-origin: center center;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
</style>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import jpegDemo from "./jpegDemo.jpeg";
|
|
3
|
+
import pngDemo from "./pngDemo.png";
|
|
4
|
+
import pngNoAlphaDemo from "./pngNoAlphaDemo.png";
|
|
5
|
+
import bmpDemo from "./bmpDemo.bmp";
|
|
6
|
+
import { useRouter } from "vue-router";
|
|
7
|
+
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
|
|
10
|
+
const onKeyDown = (ev) => {
|
|
11
|
+
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
12
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
13
|
+
window.JsView?.setGlobalConfig({
|
|
14
|
+
texCache: -1,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
router.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return false;
|
|
22
|
+
};
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<jsv-focus-block autoFocus :onKeyDown="onKeyDown">
|
|
27
|
+
<div class="allBgc">
|
|
28
|
+
<div class="block">
|
|
29
|
+
<div :style="{ left: 0, top: 0 }">
|
|
30
|
+
<div class="leftFont top0">
|
|
31
|
+
{{ `RBG_8888\n透明区域透明\n色彩不失真` }}
|
|
32
|
+
</div>
|
|
33
|
+
<div class="leftFont top250">
|
|
34
|
+
{{ `RBG_565\n透明区域为黑色\n色彩略失真` }}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div :style="{ left: 220, top: 0 }">
|
|
39
|
+
<img class="graphSize top0" :src="bmpDemo" />
|
|
40
|
+
<img
|
|
41
|
+
class="graphSize top250"
|
|
42
|
+
jsvImgColorSpace="RGB_565"
|
|
43
|
+
:src="bmpDemo"
|
|
44
|
+
/>
|
|
45
|
+
<div class="underFont">
|
|
46
|
+
{{ `bmp图片` }}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div :style="{ left: 440, top: 0 }">
|
|
51
|
+
<img class="graphSize top0" :src="jpegDemo" />
|
|
52
|
+
<img
|
|
53
|
+
class="graphSize top250"
|
|
54
|
+
jsvImgColorSpace="RGB_565"
|
|
55
|
+
:src="jpegDemo"
|
|
56
|
+
/>
|
|
57
|
+
<div class="underFont">
|
|
58
|
+
{{ "jpg/jpeg图片" }}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div :style="{ left: 660, top: 0 }">
|
|
63
|
+
<img class="graphSize top0" :src="pngDemo" />
|
|
64
|
+
<img
|
|
65
|
+
class="graphSize top250"
|
|
66
|
+
jsvImgColorSpace="RGB_565"
|
|
67
|
+
:src="pngDemo"
|
|
68
|
+
/>
|
|
69
|
+
<div class="underFont">
|
|
70
|
+
{{ `png有透明图片\nRGB_565下透明部分为黑色` }}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div :style="{ left: 880, top: 0 }">
|
|
75
|
+
<img class="graphSize top0" :src="pngNoAlphaDemo" />
|
|
76
|
+
<img
|
|
77
|
+
class="graphSize top250"
|
|
78
|
+
jsvImgColorSpace="RGB_565"
|
|
79
|
+
:src="pngNoAlphaDemo"
|
|
80
|
+
/>
|
|
81
|
+
<div class="underFont">
|
|
82
|
+
{{ `png无透明图片` }}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</jsv-focus-block>
|
|
88
|
+
</template>
|
|
89
|
+
<style scoped>
|
|
90
|
+
.allBgc {
|
|
91
|
+
width: 1920;
|
|
92
|
+
height: 1080;
|
|
93
|
+
background-color: #334c4c;
|
|
94
|
+
}
|
|
95
|
+
.block {
|
|
96
|
+
left: 20;
|
|
97
|
+
top: 50;
|
|
98
|
+
}
|
|
99
|
+
.leftFont {
|
|
100
|
+
left: 0;
|
|
101
|
+
width: 200;
|
|
102
|
+
height: 200;
|
|
103
|
+
color: #ffffff;
|
|
104
|
+
font-size: 30px;
|
|
105
|
+
}
|
|
106
|
+
.top0 {
|
|
107
|
+
top: 0;
|
|
108
|
+
}
|
|
109
|
+
.top250 {
|
|
110
|
+
top: 250;
|
|
111
|
+
}
|
|
112
|
+
.graphSize {
|
|
113
|
+
left: 0;
|
|
114
|
+
width: 200;
|
|
115
|
+
height: 200;
|
|
116
|
+
border-radius: 15px 15px 15px 15px;
|
|
117
|
+
}
|
|
118
|
+
.underFont {
|
|
119
|
+
left: 0;
|
|
120
|
+
top: 500;
|
|
121
|
+
width: 200;
|
|
122
|
+
height: 200;
|
|
123
|
+
color: #ffffff;
|
|
124
|
+
font-size: 20px;
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2021-06-02 13:31:00
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-12 13:40:15
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script>
|
|
9
|
+
import { router } from "./router";
|
|
10
|
+
import { jJsvRuntimeBridge } from "jsview";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
Router: router,
|
|
14
|
+
mounted() {
|
|
15
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div>
|
|
22
|
+
<router-view />
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style scoped>
|
|
27
|
+
</style>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { watch } from "vue";
|
|
3
|
+
import { MetroWidget, VERTICAL } from "jsview";
|
|
4
|
+
import Item from "./Item.vue";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
components: {
|
|
8
|
+
Item,
|
|
9
|
+
MetroWidget,
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
data: Array,
|
|
13
|
+
name: String,
|
|
14
|
+
onEdge: Function,
|
|
15
|
+
tabId: Number,
|
|
16
|
+
},
|
|
17
|
+
setup() {
|
|
18
|
+
return {
|
|
19
|
+
direction: VERTICAL,
|
|
20
|
+
width: 1280,
|
|
21
|
+
height: 600,
|
|
22
|
+
initFocusId: 0,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
measures(item) {
|
|
27
|
+
return {
|
|
28
|
+
width: item.width,
|
|
29
|
+
height: item.height,
|
|
30
|
+
focusable: item.focusable,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
itemClick(index, data) {
|
|
34
|
+
if (!data.path) {
|
|
35
|
+
console.error("Route path is not defined.");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.$router.push(data.path);
|
|
39
|
+
localStorage.curFocusId = index;
|
|
40
|
+
localStorage.curTab = this.tabId;
|
|
41
|
+
},
|
|
42
|
+
_provideData() {
|
|
43
|
+
return this.data;
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
beforeCreate() {
|
|
47
|
+
if (typeof localStorage.curFocusId !== "undefined") {
|
|
48
|
+
this.initFocusId = parseInt(localStorage.curFocusId);
|
|
49
|
+
}
|
|
50
|
+
localStorage.curFocusId = 0;
|
|
51
|
+
watch(
|
|
52
|
+
() => {
|
|
53
|
+
return this.data;
|
|
54
|
+
},
|
|
55
|
+
() => {
|
|
56
|
+
this.$refs.mw?.refreshData(true);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<metro-widget
|
|
65
|
+
ref="mw"
|
|
66
|
+
:name="name"
|
|
67
|
+
:width="width"
|
|
68
|
+
:height="height"
|
|
69
|
+
:direction="direction"
|
|
70
|
+
:provideData="_provideData"
|
|
71
|
+
:enableTouch="true"
|
|
72
|
+
:measures="measures"
|
|
73
|
+
:padding="{ left: 10, top: 10, right: 10, bottom: 10 }"
|
|
74
|
+
:onEdge="onEdge"
|
|
75
|
+
:initFocusId="initFocusId"
|
|
76
|
+
>
|
|
77
|
+
<template #renderItem="{ data, query, onEdge, onAction }">
|
|
78
|
+
<Item
|
|
79
|
+
:style="{
|
|
80
|
+
width: data.width,
|
|
81
|
+
height: data.height,
|
|
82
|
+
backgroundColor: data.backgroundColor,
|
|
83
|
+
color: '#000000',
|
|
84
|
+
}"
|
|
85
|
+
:data="data"
|
|
86
|
+
:query="query"
|
|
87
|
+
:onEdge="onEdge"
|
|
88
|
+
:onAction="onAction"
|
|
89
|
+
:itemClick="itemClick"
|
|
90
|
+
>
|
|
91
|
+
{{ data.name }}
|
|
92
|
+
</Item>
|
|
93
|
+
</template>
|
|
94
|
+
</metro-widget>
|
|
95
|
+
</template>
|