@shijiu/jsview-vue 1.9.731 → 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/index.d.ts +4 -1
- package/index.js +4 -1
- package/package.json +5 -16
- package/samples/AnimPicture/App.vue +0 -207
- package/samples/AnimPicture/assets/animated_webp.webp +0 -0
- package/samples/AnimPicture/assets/ball_3.webp +0 -0
- package/samples/AnimPicture/assets/girl_run.gif +0 -0
- package/samples/AnimPicture/assets/quan.webp +0 -0
- package/samples/Basic/App.vue +0 -134
- package/samples/Basic/assets/border.png +0 -0
- package/samples/Basic/assets/border2.png +0 -0
- package/samples/Basic/assets/icon.png +0 -0
- package/samples/Basic/assets/test.jpg +0 -0
- package/samples/Basic/components/ContentBlock.vue +0 -38
- package/samples/Basic/components/FontStyle.css +0 -16
- package/samples/Basic/components/anim/AnimGroup.vue +0 -66
- package/samples/Basic/components/anim/AnimKeyframeBasic.vue +0 -119
- package/samples/Basic/components/anim/AnimKeyframeComposite.vue +0 -52
- package/samples/Basic/components/anim/AnimTransition.vue +0 -157
- package/samples/Basic/components/div/DivBackground.vue +0 -44
- package/samples/Basic/components/div/DivClip.vue +0 -159
- package/samples/Basic/components/div/DivCssScoped.vue +0 -20
- package/samples/Basic/components/div/DivCssVar.vue +0 -53
- package/samples/Basic/components/div/DivGroup1.vue +0 -47
- package/samples/Basic/components/div/DivGroup2.vue +0 -65
- package/samples/Basic/components/div/DivLayout.vue +0 -70
- package/samples/Basic/components/div/DivRadius.vue +0 -65
- package/samples/Basic/components/div/DivTransform.vue +0 -32
- package/samples/Basic/components/img/ImageGroup.vue +0 -31
- package/samples/Basic/components/img/ImgLayout.vue +0 -41
- package/samples/Basic/components/panel/Panel1.vue +0 -55
- package/samples/Basic/components/panel/Panel2.vue +0 -31
- package/samples/Basic/components/panel/TitleBar.vue +0 -29
- package/samples/Basic/components/text/TextAlign.vue +0 -66
- package/samples/Basic/components/text/TextEmoji.vue +0 -26
- package/samples/Basic/components/text/TextFontStyle.vue +0 -89
- package/samples/Basic/components/text/TextGroup1.vue +0 -49
- package/samples/Basic/components/text/TextGroup2.vue +0 -28
- package/samples/Basic/components/text/TextOverflow.vue +0 -110
- package/samples/BasicFocusControl/App.vue +0 -104
- package/samples/BasicFocusControl/components/BaseBlock.vue +0 -50
- package/samples/BasicFocusControl/components/MainArea.vue +0 -83
- package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +0 -17
- package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +0 -27
- package/samples/BasicFocusControl/components/SideBar.vue +0 -58
- package/samples/BasicFocusControl/components/SideBarBlock.vue +0 -27
- package/samples/Collision/App.vue +0 -452
- package/samples/ColorSpace/App.vue +0 -126
- package/samples/DemoHomepage/App.vue +0 -27
- package/samples/DemoHomepage/components/BodyFrame.vue +0 -95
- package/samples/DemoHomepage/components/Dialog.vue +0 -94
- package/samples/DemoHomepage/components/Item.vue +0 -77
- package/samples/DemoHomepage/components/TabFrame.vue +0 -85
- package/samples/DemoHomepage/router.js +0 -196
- package/samples/DemoHomepage/views/Homepage.vue +0 -195
- package/samples/FilterDemo/AnimatePic.vue +0 -58
- package/samples/FilterDemo/App.vue +0 -159
- package/samples/FilterDemo/VideoLayer.vue +0 -62
- package/samples/FlipCard/App.vue +0 -71
- package/samples/FlipCard/FlipCard.vue +0 -118
- package/samples/FlipCard/assets/blue_egg.png +0 -0
- package/samples/FlipCard/assets/red_egg.png +0 -0
- package/samples/FlipCard/data.js +0 -13
- package/samples/GridDemo/App.vue +0 -215
- package/samples/GridDemo/ButtonBlock.vue +0 -112
- package/samples/GridDemo/FocusItem.vue +0 -37
- package/samples/GridDemo/Item.vue +0 -93
- package/samples/HashHistory/App.vue +0 -115
- package/samples/HashHistory/components/HorizontalButtonList.vue +0 -91
- package/samples/HashHistory/components/Item.vue +0 -60
- package/samples/HashHistory/router.js +0 -41
- package/samples/HashHistory/views/MainPage.vue +0 -57
- package/samples/HashHistory/views/SubPage.vue +0 -66
- package/samples/ImpactStop/App.vue +0 -435
- package/samples/Input/App.vue +0 -164
- package/samples/Input/FullKeyboard.vue +0 -87
- package/samples/Input/InputPanel.vue +0 -131
- package/samples/Input/KeyboardItem.vue +0 -58
- package/samples/LongImage/App.vue +0 -80
- package/samples/LongImage/Button.vue +0 -58
- package/samples/LongImage/ButtonItem.vue +0 -44
- package/samples/LongImage/LongImageScroll.vue +0 -92
- package/samples/LongImage/Scroll.vue +0 -14
- package/samples/LongImage/assets/1280x7200.jpg +0 -0
- package/samples/LongText/App.vue +0 -96
- package/samples/LongText/Button.vue +0 -51
- package/samples/LongText/ButtonItem.vue +0 -44
- package/samples/LongText/LongTextScroll.vue +0 -192
- package/samples/LongText/Scroll.vue +0 -14
- package/samples/Marquee/App.vue +0 -247
- package/samples/Marquee/longText.js +0 -14
- package/samples/MaskClip/App.vue +0 -122
- package/samples/MaskClip/images/mask-025/config.json +0 -29
- package/samples/MaskClip/images/mask-025/res/1.png +0 -0
- package/samples/MaskClip/images/mask-025/res/2.png +0 -0
- package/samples/MaskClip/images/mask-025/res/3.png +0 -0
- package/samples/MaskClip/images/mask-025/res/4.png +0 -0
- package/samples/MaskClip/images/mask-025/res/icon.png +0 -0
- package/samples/MaskClip/images/mask-025/res/stroke.png +0 -0
- package/samples/MaskClip/images/php.jpg +0 -0
- package/samples/MetroWidgetDemos/Advanced/App.vue +0 -46
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +0 -90
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +0 -70
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +0 -77
- package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +0 -83
- package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +0 -89
- package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +0 -116
- package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/samples/MetroWidgetDemos/Item.vue +0 -85
- package/samples/MetroWidgetDemos/PerformanceTest/App.vue +0 -210
- package/samples/MetroWidgetDemos/PerformanceTest/Item.vue +0 -90
- package/samples/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/border.png +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +0 -386
- package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +0 -129
- package/samples/MetroWidgetDemos/PerformanceTest/data.js +0 -45
- package/samples/MetroWidgetDemos/PingPong/App.vue +0 -135
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +0 -73
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +0 -62
- package/samples/MetroWidgetDemos/PingPong/TabItem.vue +0 -84
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +0 -214
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +0 -75
- package/samples/MetroWidgetDemos/Simple/App.vue +0 -45
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +0 -111
- package/samples/MetroWidgetDemos/WidgetItem.vue +0 -89
- package/samples/MetroWidgetDemos/data.js +0 -205
- package/samples/NinePatchDemo/App.vue +0 -145
- package/samples/NinePatchDemo/Item.vue +0 -69
- package/samples/NinePatchDemo/assets/border.png +0 -0
- package/samples/Preload/App.vue +0 -135
- package/samples/Preload/Item.vue +0 -32
- package/samples/Preload/data.js +0 -23
- package/samples/Preload/images/awesomeface.png +0 -0
- package/samples/Preload/images/cat.jpg +0 -0
- package/samples/Preload/images/rank.png +0 -0
- package/samples/Preload/images/rank_focus.png +0 -0
- package/samples/Preload/images/rule.png +0 -0
- package/samples/Preload/images/rule_focus.png +0 -0
- package/samples/Preload/images/start.png +0 -0
- package/samples/Preload/images/start_focus.png +0 -0
- package/samples/QrcodeDemo/App.vue +0 -68
- package/samples/ScaleDownNeon/App.vue +0 -107
- package/samples/SoundPool/App.vue +0 -134
- package/samples/SoundPool/bgmusic.mp3 +0 -0
- package/samples/SoundPool/coin.mp3 +0 -0
- package/samples/SoundPool/jump.mp3 +0 -0
- package/samples/SoundPool/lose.mp3 +0 -0
- package/samples/SoundPool/run.mp3 +0 -0
- package/samples/SprayView/App.vue +0 -272
- package/samples/SprayView/assets/snow.png +0 -0
- package/samples/SpriteImage/App.vue +0 -173
- package/samples/SpriteImage/images/cat_run.png +0 -0
- package/samples/SpriteImage/images/egg_break.json +0 -116
- package/samples/SpriteImage/images/egg_break.png +0 -0
- package/samples/SpriteImage/images/sprite.png +0 -0
- package/samples/TextBox/App.vue +0 -91
- package/samples/TextBox/RenderCenter.vue +0 -133
- package/samples/TextBox/RenderLeft.vue +0 -138
- package/samples/TextBox/RenderOneLine.vue +0 -101
- package/samples/TextBox/RenderRight.vue +0 -131
- package/samples/TextShadowDemo/App.vue +0 -91
- package/samples/TextureAnimation/App.vue +0 -336
- package/samples/TextureAnimation/App2.vue +0 -111
- package/samples/TextureAnimation/assets/blackWhiteGrid.png +0 -0
- package/samples/TextureAnimation/assets/light.png +0 -0
- package/samples/TextureAnimation/assets/light2.png +0 -0
- package/samples/TextureAnimation/assets/mask.png +0 -0
- package/samples/TextureAnimation/assets/php.jpg +0 -0
- package/samples/TextureAnimation/assets/php2.png +0 -0
- package/samples/TextureAnimation/assets/swipLight.png +0 -0
- package/samples/TextureSize/App.vue +0 -132
- package/samples/TextureSize/bmpDemo.bmp +0 -0
- package/samples/TextureSize/jpegDemo.jpeg +0 -0
- package/samples/TextureSize/jpgDemo.jpg +0 -0
- package/samples/TextureSize/pngDemo.png +0 -0
- package/samples/TextureSize/pngNoAlphaDemo.png +0 -0
- package/samples/ThrowMoveDemo/AccelerateDemo.vue +0 -116
- package/samples/ThrowMoveDemo/App.vue +0 -114
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +0 -115
- package/samples/ThrowMoveDemo/TargetDemo.vue +0 -116
- package/samples/ThrowMoveDemo/UDParabolicDemo.vue +0 -121
- package/samples/TouchSample/App.vue +0 -136
- package/samples/TouchSample/Item.vue +0 -103
- package/samples/TouchSample/MetroWidgetHorizontal.vue +0 -144
- package/samples/TouchSample/MetroWidgetVertical.vue +0 -144
- package/samples/TouchSample/TouchContainerHorizontal.vue +0 -160
- package/samples/TouchSample/TouchContainerVertical.vue +0 -160
- package/samples/TouchSample/data.js +0 -81
- package/samples/TransitPage/App.vue +0 -29
- package/samples/VideoDemo/App.vue +0 -121
- package/samples/VideoDemo/components/Button.vue +0 -58
- package/samples/VideoDemo/components/Controllor.vue +0 -197
- package/samples/VideoDemo/components/VideoFrame.vue +0 -140
- package/samples/VisibleSensorDemo/App.vue +0 -234
- package/samples/assets/bmpDemo.bmp +0 -0
- package/samples/assets/jpegDemo.jpeg +0 -0
- package/samples/assets/pngDemo.png +0 -0
- package/samples/assets/pngNoAlphaDemo.png +0 -0
- package/samples/assets/webpDemo.webp +0 -0
- package/tsconfig.json +0 -47
- package/utils/index.d.ts +0 -3
- package/utils/index.js +0 -10
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, shallowRef } from "vue";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
style: Object,
|
|
5
|
-
autoFocus: Boolean,
|
|
6
|
-
name: String,
|
|
7
|
-
onClick: Function,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const hasFocused = ref(false);
|
|
11
|
-
|
|
12
|
-
const onFocus = () => {
|
|
13
|
-
hasFocused.value = true;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const onBlur = () => {
|
|
17
|
-
hasFocused.value = false;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const onKeyDown = (ev) => {
|
|
21
|
-
if (ev.keyCode === 13) {
|
|
22
|
-
// Enter
|
|
23
|
-
props.onClick?.();
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
};
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
<jsv-focus-block
|
|
32
|
-
:name="name"
|
|
33
|
-
:autoFocus="autoFocus ? '' : undefined"
|
|
34
|
-
:onAction="{
|
|
35
|
-
onFocus: onFocus,
|
|
36
|
-
onBlur: onBlur,
|
|
37
|
-
onKeyDown: onKeyDown,
|
|
38
|
-
}"
|
|
39
|
-
>
|
|
40
|
-
<div
|
|
41
|
-
class="item"
|
|
42
|
-
:style="{
|
|
43
|
-
...style,
|
|
44
|
-
backgroundColor: hasFocused ? '#FFFF00' : '#A8A8A8',
|
|
45
|
-
}"
|
|
46
|
-
>
|
|
47
|
-
<slot></slot>
|
|
48
|
-
</div>
|
|
49
|
-
</jsv-focus-block>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<style scoped>
|
|
53
|
-
.item {
|
|
54
|
-
text-align: center;
|
|
55
|
-
font-size: 24;
|
|
56
|
-
line-height: 40;
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { inject } from "vue";
|
|
3
|
-
import { useRouter } from "vue-router";
|
|
4
|
-
import Button from "./Button.vue";
|
|
5
|
-
|
|
6
|
-
const props = defineProps({
|
|
7
|
-
style: {
|
|
8
|
-
type: Object,
|
|
9
|
-
default() {
|
|
10
|
-
return { width: 1400, height: 50 };
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
const router = useRouter();
|
|
15
|
-
|
|
16
|
-
const useTexture = inject("useTexture");
|
|
17
|
-
const objectFit = inject("objectFit");
|
|
18
|
-
const videoRect = inject("videoRect");
|
|
19
|
-
const playVideo = inject("playVideo");
|
|
20
|
-
const seekVideo = inject("seekVideo");
|
|
21
|
-
const enableAnimation = inject("enableAnimation");
|
|
22
|
-
const videoTime = inject("videoTime");
|
|
23
|
-
const objectFitTitle = inject("objectFitTitle");
|
|
24
|
-
let objectFitIndex = 0;
|
|
25
|
-
let focusedItemIndex = 0;
|
|
26
|
-
|
|
27
|
-
const setObjectFit = (index) => {
|
|
28
|
-
if (typeof index === "number") {
|
|
29
|
-
objectFitIndex = index;
|
|
30
|
-
} else {
|
|
31
|
-
objectFitIndex = ++objectFitIndex % objectFitData.length;
|
|
32
|
-
}
|
|
33
|
-
const data = objectFitData[objectFitIndex];
|
|
34
|
-
objectFit.value = data.objectFit;
|
|
35
|
-
objectFitTitle.value = data.name;
|
|
36
|
-
videoRect.value = {
|
|
37
|
-
left: (1280 - data.width) / 2,
|
|
38
|
-
top: 50,
|
|
39
|
-
width: data.width,
|
|
40
|
-
height: 500,
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const buttonList = [
|
|
45
|
-
{
|
|
46
|
-
name: "ToVideoMode",
|
|
47
|
-
onClick: () => {
|
|
48
|
-
playVideo.value = null; // 停止并初始化播放
|
|
49
|
-
enableAnimation.value = false;
|
|
50
|
-
videoTime.currentTime = 0;
|
|
51
|
-
videoTime.duration = 0;
|
|
52
|
-
useTexture.value = !useTexture.value;
|
|
53
|
-
},
|
|
54
|
-
isModeButton: true,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "Play",
|
|
58
|
-
onClick: () => {
|
|
59
|
-
playVideo.value = !playVideo.value;
|
|
60
|
-
},
|
|
61
|
-
isPlayButton: true,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "Forward",
|
|
65
|
-
onClick: () => {
|
|
66
|
-
seekVideo.value = seekVideo.value !== 5 ? 5 : 5.1 /* 为了触发ref更新 */;
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: "Rewind",
|
|
71
|
-
onClick: () => {
|
|
72
|
-
seekVideo.value =
|
|
73
|
-
seekVideo.value !== -5 ? -5 : -5.1 /* 为了触发ref更新 */;
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "ObjectFit",
|
|
78
|
-
onClick: setObjectFit,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: "StartAnimation",
|
|
82
|
-
onClick: () => {
|
|
83
|
-
enableAnimation.value = !enableAnimation.value;
|
|
84
|
-
},
|
|
85
|
-
isAnimationButton: true,
|
|
86
|
-
},
|
|
87
|
-
];
|
|
88
|
-
const objectFitData = [
|
|
89
|
-
{ name: "contain-horizontal", objectFit: "contain", width: 1200 },
|
|
90
|
-
{ name: "contain-vertical", objectFit: "contain", width: 400 },
|
|
91
|
-
{ name: "fill", objectFit: "fill", width: 1200 },
|
|
92
|
-
{ name: "none-horizontal", objectFit: "none", width: 1200 },
|
|
93
|
-
{ name: "none-vertical", objectFit: "none", width: 400 },
|
|
94
|
-
{ name: "cover-horizontal", objectFit: "cover", width: 1200 },
|
|
95
|
-
{ name: "cover-vertical", objectFit: "cover", width: 400 },
|
|
96
|
-
];
|
|
97
|
-
|
|
98
|
-
const getButtonData = () => {
|
|
99
|
-
let length = buttonList.length;
|
|
100
|
-
if (!useTexture.value) {
|
|
101
|
-
// 只有texture方式可以做animation
|
|
102
|
-
length -= 1;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
let data = [];
|
|
106
|
-
for (let idx = 0; idx < length; idx++) {
|
|
107
|
-
const button = buttonList[idx];
|
|
108
|
-
data.push({
|
|
109
|
-
...button,
|
|
110
|
-
size: {
|
|
111
|
-
width: 180,
|
|
112
|
-
height: 40,
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
return data;
|
|
117
|
-
};
|
|
118
|
-
const getButtonDataLength = () => {
|
|
119
|
-
let length = buttonList.length;
|
|
120
|
-
if (!useTexture.value) {
|
|
121
|
-
// 只有texture方式可以做animation
|
|
122
|
-
length -= 1;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return length;
|
|
126
|
-
};
|
|
127
|
-
const onKeyDown = (ev) => {
|
|
128
|
-
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
129
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
130
|
-
router?.go(-1); // 有router时,回退
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
let changeFocusTo = -1;
|
|
135
|
-
const buttonCount = getButtonDataLength();
|
|
136
|
-
switch (ev.keyCode) {
|
|
137
|
-
case 37: // Left
|
|
138
|
-
changeFocusTo = (focusedItemIndex - 1 + buttonCount) % buttonCount;
|
|
139
|
-
break;
|
|
140
|
-
case 39: // Right
|
|
141
|
-
changeFocusTo = (focusedItemIndex + 1) % buttonCount;
|
|
142
|
-
break;
|
|
143
|
-
default:
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
if (changeFocusTo >= 0) {
|
|
147
|
-
ev.ownerNode
|
|
148
|
-
.findBlockByName("controllor.video-" + (changeFocusTo + 10).toString())
|
|
149
|
-
.requestFocus();
|
|
150
|
-
focusedItemIndex = changeFocusTo;
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return false;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const getShowName = (item) => {
|
|
158
|
-
if (item.isModeButton) {
|
|
159
|
-
return useTexture.value ? "ToVideoMode" : "ToOffscreenMode";
|
|
160
|
-
} else if (item.isPlayButton) {
|
|
161
|
-
return playVideo.value ? "Pause" : "Play";
|
|
162
|
-
} else if (item.isAnimationButton) {
|
|
163
|
-
return enableAnimation.value ? "StopAnimation" : "StartAnimation";
|
|
164
|
-
}
|
|
165
|
-
return item.name;
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
useTexture.value = false;
|
|
169
|
-
setObjectFit(0);
|
|
170
|
-
playVideo.value = !window.jsvIsBrowserDebug; // jsview自动播放该视频 TODO h5需做相应调整;
|
|
171
|
-
enableAnimation.value = false;
|
|
172
|
-
</script>
|
|
173
|
-
|
|
174
|
-
<template>
|
|
175
|
-
<div :style="style" :key="useTexture" :set="(leftOffset = 0)">
|
|
176
|
-
<jsv-focus-block namespace="controllor" :onKeyDown="onKeyDown">
|
|
177
|
-
<Button
|
|
178
|
-
v-for="(item, index) in getButtonData()"
|
|
179
|
-
:key="index"
|
|
180
|
-
:set="(leftOffset += item.size.width + 10)"
|
|
181
|
-
:style="{
|
|
182
|
-
left: leftOffset - item.size.width,
|
|
183
|
-
width: item.size.width,
|
|
184
|
-
height: item.size.height,
|
|
185
|
-
}"
|
|
186
|
-
:autoFocus="index === 0"
|
|
187
|
-
:name="'video-' + (index + 10).toString()"
|
|
188
|
-
:onClick="item.onClick"
|
|
189
|
-
>
|
|
190
|
-
{{ getShowName(item) }}
|
|
191
|
-
</Button>
|
|
192
|
-
</jsv-focus-block>
|
|
193
|
-
</div>
|
|
194
|
-
</template>
|
|
195
|
-
|
|
196
|
-
<style scoped>
|
|
197
|
-
</style>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { inject, watch, onMounted } from "vue";
|
|
3
|
-
import { JsvVideo } from "jsview";
|
|
4
|
-
|
|
5
|
-
const useTexture = inject("useTexture");
|
|
6
|
-
const objectFit = inject("objectFit");
|
|
7
|
-
const videoRect = inject("videoRect");
|
|
8
|
-
const playVideo = inject("playVideo");
|
|
9
|
-
const seekVideo = inject("seekVideo");
|
|
10
|
-
const enableAnimation = inject("enableAnimation");
|
|
11
|
-
const videoTime = inject("videoTime");
|
|
12
|
-
const playStatus = inject("playStatus");
|
|
13
|
-
const videoUrl =
|
|
14
|
-
"http://qcast-image.oss-cn-qingdao.aliyuncs.com/homepage/20190726/4cc4e6a8fd7d9d9c707ed4c4da27ca9d.mp4";
|
|
15
|
-
const canAutoPlay = !window.jsvIsBrowserDebug; // jsview自动播放该视频 TODO h5需做相应调整
|
|
16
|
-
const rect = {
|
|
17
|
-
top: 50,
|
|
18
|
-
left: 40,
|
|
19
|
-
width: 1200,
|
|
20
|
-
height: 500,
|
|
21
|
-
};
|
|
22
|
-
let video = null;
|
|
23
|
-
|
|
24
|
-
const onVideoRef = (ele) => {
|
|
25
|
-
video = ele;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const setPlayState = (play) => {
|
|
29
|
-
if (play) {
|
|
30
|
-
video?.play();
|
|
31
|
-
} else {
|
|
32
|
-
video?.pause();
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const seekVideoStep = (time) => {
|
|
37
|
-
if (video) {
|
|
38
|
-
let playEnd = false;
|
|
39
|
-
let seekTime = video.currentTime + Math.ceil(time);
|
|
40
|
-
if (seekTime < 0) {
|
|
41
|
-
seekTime = 0;
|
|
42
|
-
} else if (seekTime > videoTime.duration) {
|
|
43
|
-
seekTime = videoTime.duration;
|
|
44
|
-
if (video.currentTime != videoTime.duration) {
|
|
45
|
-
// 触发一次播放,收到ended事件
|
|
46
|
-
playEnd = true;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
video.currentTime = seekTime;
|
|
50
|
-
if (playEnd) {
|
|
51
|
-
this.setPlayState(true);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const onPlayStateChange = (event) => {
|
|
57
|
-
console.log("VideoFrame.onPlayStateChangeEvent()", event);
|
|
58
|
-
playVideo.value = event.type === "play" ? true : false;
|
|
59
|
-
if (!(playStatus.value == "ended" && event.type == "pause")) {
|
|
60
|
-
// 忽略播放结束后的pause事件
|
|
61
|
-
playStatus.value = event.type;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const onTimeUpdate = (event) => {
|
|
66
|
-
console.log("VideoFrame.onTimeUpdateEvent()", event);
|
|
67
|
-
videoTime.currentTime = video.currentTime;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const onDurationChange = (event) => {
|
|
71
|
-
console.log("VideoFrame.onDurationChangeEvent()", event);
|
|
72
|
-
videoTime.duration = video.duration;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const onEvent = (event) => {
|
|
76
|
-
console.log("VideoFrame.onEvent()", event);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
watch(playVideo, setPlayState);
|
|
80
|
-
watch(seekVideo, seekVideoStep);
|
|
81
|
-
|
|
82
|
-
onMounted(() => {
|
|
83
|
-
if (canAutoPlay) {
|
|
84
|
-
playVideo.value = true;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<template>
|
|
90
|
-
<div>
|
|
91
|
-
<div
|
|
92
|
-
:style="{
|
|
93
|
-
...videoRect,
|
|
94
|
-
backgroundColor: 'rgb(200,100,100)',
|
|
95
|
-
}"
|
|
96
|
-
></div>
|
|
97
|
-
<JsvVideo
|
|
98
|
-
:onRef="onVideoRef"
|
|
99
|
-
:useTexture="useTexture"
|
|
100
|
-
:src="videoUrl"
|
|
101
|
-
:autoplay="canAutoPlay ? 'autoplay' : undefined"
|
|
102
|
-
:style="{
|
|
103
|
-
...videoRect,
|
|
104
|
-
objectFit: objectFit,
|
|
105
|
-
animation:
|
|
106
|
-
useTexture && enableAnimation ? 'offscreenAnim 3s infinite' : null,
|
|
107
|
-
borderRadius: '80px 80px 160px 240px',
|
|
108
|
-
}"
|
|
109
|
-
:onCanPlay="onEvent"
|
|
110
|
-
:onCanPlayThrough="onEvent"
|
|
111
|
-
:onDurationChange="onDurationChange"
|
|
112
|
-
:onEnded="onPlayStateChange"
|
|
113
|
-
:onError="onPlayStateChange"
|
|
114
|
-
:onLoad="onEvent"
|
|
115
|
-
:onLoadedMetadata="onEvent"
|
|
116
|
-
:onLoadStart="onEvent"
|
|
117
|
-
:onPause="onPlayStateChange"
|
|
118
|
-
:onPlay="onPlayStateChange"
|
|
119
|
-
:onPlaying="onEvent"
|
|
120
|
-
:onProgress="onEvent"
|
|
121
|
-
:onSeeking="onEvent"
|
|
122
|
-
:onSeeked="onTimeUpdate"
|
|
123
|
-
:onStalled="onEvent"
|
|
124
|
-
:onTimeUpdate="onTimeUpdate"
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
</template>
|
|
128
|
-
|
|
129
|
-
<style scoped>
|
|
130
|
-
@keyframes offscreenAnim {
|
|
131
|
-
from {
|
|
132
|
-
transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, -360deg);
|
|
133
|
-
transform-origin: center center;
|
|
134
|
-
}
|
|
135
|
-
to {
|
|
136
|
-
transform: scale3d(0.4, 0.4, 0) rotate3d(0, 0, 1, 0);
|
|
137
|
-
transform-origin: center center;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
</style>
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { watch, reactive, onMounted, ref, shallowRef } from "vue";
|
|
3
|
-
import { useRouter } from "vue-router";
|
|
4
|
-
import { jJsvRuntimeBridge, JsvVisibleSensor } from "jsview";
|
|
5
|
-
|
|
6
|
-
const BOX_WIDTH = 150;
|
|
7
|
-
const BOX_HEIGHT = 150;
|
|
8
|
-
const BOX_COLOR = "rgba(0,255,255,0.6)";
|
|
9
|
-
const VISIBLE_RANGE = 0.25;
|
|
10
|
-
|
|
11
|
-
const router = useRouter();
|
|
12
|
-
|
|
13
|
-
const containerRef = shallowRef(null);
|
|
14
|
-
let case_config = shallowRef(null);
|
|
15
|
-
let status_text = reactive({
|
|
16
|
-
oldH: "false",
|
|
17
|
-
newH: "false",
|
|
18
|
-
oldV: "false",
|
|
19
|
-
newV: "false",
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
let test_case_type = ref(0);
|
|
23
|
-
|
|
24
|
-
window.LudlTestCase = test_case_type;
|
|
25
|
-
|
|
26
|
-
case_config.value = getTestCase(test_case_type.value);
|
|
27
|
-
|
|
28
|
-
watch(test_case_type, () => {
|
|
29
|
-
case_config.value = getTestCase(test_case_type.value);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
onMounted(() => {
|
|
33
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// const onAnimDone = () => {
|
|
37
|
-
// test_case_type.value = (test_case_type.value + 1) % 2;
|
|
38
|
-
// };
|
|
39
|
-
|
|
40
|
-
// 内部接口
|
|
41
|
-
const onBeVisible = (old_h, new_h, old_v, new_v) => {
|
|
42
|
-
status_text.oldH = old_h ? "true" : "false";
|
|
43
|
-
status_text.newH = new_h ? "true" : "false";
|
|
44
|
-
status_text.oldV = old_v ? "true" : "false";
|
|
45
|
-
status_text.newV = new_v ? "true" : "false";
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const onKeyDown = (ev) => {
|
|
49
|
-
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
50
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
51
|
-
router?.go(-1); // 有router时,回退
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
if (ev.keyCode == 13) {
|
|
55
|
-
test_case_type.value = (test_case_type.value + 1) % 2;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
function getTestCase(test_index) {
|
|
61
|
-
let test_config = {
|
|
62
|
-
animation: null,
|
|
63
|
-
text: null,
|
|
64
|
-
horizon: 1.0,
|
|
65
|
-
vertical: 1.0,
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
switch (test_index) {
|
|
69
|
-
case 0: {
|
|
70
|
-
// 上到下
|
|
71
|
-
test_config.animation = "visibleSensor_upDown 8s infinite linear";
|
|
72
|
-
test_config.text = "从上到下";
|
|
73
|
-
test_config.horizon = 1.0;
|
|
74
|
-
test_config.vertical = VISIBLE_RANGE;
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
case 1: {
|
|
78
|
-
// 左到右
|
|
79
|
-
test_config.animation = "visibleSensor_leftRight 8s infinite linear";
|
|
80
|
-
test_config.text = "从左到右";
|
|
81
|
-
test_config.horizon = VISIBLE_RANGE;
|
|
82
|
-
test_config.vertical = 1.0;
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return test_config;
|
|
88
|
-
}
|
|
89
|
-
</script>
|
|
90
|
-
|
|
91
|
-
<template>
|
|
92
|
-
<jsv-focus-block autoFocus :onKeyDown="onKeyDown">
|
|
93
|
-
<div :style="{ width: 1280, height: 720, backgroundColor: '#00F000' }">
|
|
94
|
-
<div
|
|
95
|
-
:style="{
|
|
96
|
-
left: 10,
|
|
97
|
-
top: 10,
|
|
98
|
-
height: 120,
|
|
99
|
-
width: 900,
|
|
100
|
-
fontColor: '#000000',
|
|
101
|
-
fontSize: 15,
|
|
102
|
-
lineHeight: 20,
|
|
103
|
-
}"
|
|
104
|
-
>
|
|
105
|
-
{{
|
|
106
|
-
`按OK键切换方向
|
|
107
|
-
new horizon: ${status_text.newH}
|
|
108
|
-
new vertical: ${status_text.newV}
|
|
109
|
-
-------
|
|
110
|
-
old horizon: ${status_text.oldH}
|
|
111
|
-
old vertical: ${status_text.oldV}`
|
|
112
|
-
}}
|
|
113
|
-
</div>
|
|
114
|
-
<div
|
|
115
|
-
ref="containerRef"
|
|
116
|
-
:style="{
|
|
117
|
-
left: 240,
|
|
118
|
-
top: 180,
|
|
119
|
-
width: 300,
|
|
120
|
-
height: 300,
|
|
121
|
-
backgroundColor: '#00F0F0',
|
|
122
|
-
}"
|
|
123
|
-
>
|
|
124
|
-
<div
|
|
125
|
-
:style="{
|
|
126
|
-
left: 50,
|
|
127
|
-
top: 50,
|
|
128
|
-
width: 200,
|
|
129
|
-
height: 200,
|
|
130
|
-
backgroundColor: '#00AAAA',
|
|
131
|
-
zIndex: test_case_type == 0 ? -22 : 0,
|
|
132
|
-
}"
|
|
133
|
-
/>
|
|
134
|
-
|
|
135
|
-
<div
|
|
136
|
-
:style="{
|
|
137
|
-
left: 80,
|
|
138
|
-
top: 30,
|
|
139
|
-
width: 140,
|
|
140
|
-
height: 240,
|
|
141
|
-
backgroundColor: '#0000AA',
|
|
142
|
-
zIndex: test_case_type == 0 ? -33 : 0,
|
|
143
|
-
}"
|
|
144
|
-
/>
|
|
145
|
-
|
|
146
|
-
<div
|
|
147
|
-
:style="{
|
|
148
|
-
left: 0,
|
|
149
|
-
top: 0,
|
|
150
|
-
animation: case_config.animation,
|
|
151
|
-
}"
|
|
152
|
-
>
|
|
153
|
-
<JsvVisibleSensor
|
|
154
|
-
:horizonShown="case_config.horizon"
|
|
155
|
-
:verticalShown="case_config.vertical"
|
|
156
|
-
:width="BOX_WIDTH"
|
|
157
|
-
:height="BOX_HEIGHT"
|
|
158
|
-
:enable="true"
|
|
159
|
-
:container="containerRef"
|
|
160
|
-
:callback="onBeVisible"
|
|
161
|
-
>
|
|
162
|
-
<div v-if="test_case_type == 0">
|
|
163
|
-
<div
|
|
164
|
-
:style="{
|
|
165
|
-
width: BOX_WIDTH,
|
|
166
|
-
height: BOX_HEIGHT * VISIBLE_RANGE,
|
|
167
|
-
backgroundColor: '#FF0000',
|
|
168
|
-
}"
|
|
169
|
-
/>
|
|
170
|
-
<div
|
|
171
|
-
:style="{
|
|
172
|
-
top: BOX_HEIGHT * (1 - VISIBLE_RANGE),
|
|
173
|
-
width: BOX_WIDTH,
|
|
174
|
-
height: BOX_HEIGHT * VISIBLE_RANGE,
|
|
175
|
-
backgroundColor: '#FF0000',
|
|
176
|
-
}"
|
|
177
|
-
/>
|
|
178
|
-
</div>
|
|
179
|
-
<div v-else>
|
|
180
|
-
<div
|
|
181
|
-
:style="{
|
|
182
|
-
width: BOX_WIDTH * VISIBLE_RANGE,
|
|
183
|
-
height: BOX_HEIGHT,
|
|
184
|
-
backgroundColor: '#FF0000',
|
|
185
|
-
}"
|
|
186
|
-
/>
|
|
187
|
-
<div
|
|
188
|
-
:style="{
|
|
189
|
-
left: BOX_WIDTH * (1 - VISIBLE_RANGE),
|
|
190
|
-
width: BOX_WIDTH * VISIBLE_RANGE,
|
|
191
|
-
height: BOX_HEIGHT,
|
|
192
|
-
backgroundColor: '#FF0000',
|
|
193
|
-
}"
|
|
194
|
-
/>
|
|
195
|
-
</div>
|
|
196
|
-
<div
|
|
197
|
-
:style="{
|
|
198
|
-
width: BOX_WIDTH,
|
|
199
|
-
height: BOX_HEIGHT,
|
|
200
|
-
backgroundColor: BOX_COLOR,
|
|
201
|
-
fontSize: 20,
|
|
202
|
-
lineHeight: 30,
|
|
203
|
-
}"
|
|
204
|
-
>
|
|
205
|
-
{{
|
|
206
|
-
`${case_config.text}\nH:${status_text.newH}\nV:${status_text.newV}`
|
|
207
|
-
}}
|
|
208
|
-
</div>
|
|
209
|
-
</JsvVisibleSensor>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
</jsv-focus-block>
|
|
214
|
-
</template>
|
|
215
|
-
|
|
216
|
-
<style scoped>
|
|
217
|
-
@keyframes visibleSensor_upDown {
|
|
218
|
-
from {
|
|
219
|
-
transform: translate3d(75px, -180px, 0);
|
|
220
|
-
}
|
|
221
|
-
to {
|
|
222
|
-
transform: translate3d(75px, 330px, 0);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
@keyframes visibleSensor_leftRight {
|
|
227
|
-
from {
|
|
228
|
-
transform: translate3d(-180px, 75px, 0);
|
|
229
|
-
}
|
|
230
|
-
to {
|
|
231
|
-
transform: translate3d(330px, 75px, 0);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
</style>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/tsconfig.json
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"jsx": "preserve",
|
|
7
|
-
"importHelpers": true,
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"experimentalDecorators": true,
|
|
10
|
-
"allowJs": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"allowSyntheticDefaultImports": true,
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"baseUrl": ".",
|
|
16
|
-
"paths": {
|
|
17
|
-
"jsview/*": [
|
|
18
|
-
"./*"
|
|
19
|
-
],
|
|
20
|
-
"jsview": [
|
|
21
|
-
"./index.js"
|
|
22
|
-
],
|
|
23
|
-
"jsview-vue/*": [
|
|
24
|
-
"./*"
|
|
25
|
-
],
|
|
26
|
-
"jsview-vue": [
|
|
27
|
-
"./index.js"
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"lib": [
|
|
31
|
-
"esnext",
|
|
32
|
-
"dom",
|
|
33
|
-
"dom.iterable",
|
|
34
|
-
"scripthost"
|
|
35
|
-
],
|
|
36
|
-
|
|
37
|
-
"alwaysStrict": true,
|
|
38
|
-
"noImplicitReturns": true
|
|
39
|
-
},
|
|
40
|
-
"include": [
|
|
41
|
-
"./**/*.vue"
|
|
42
|
-
],
|
|
43
|
-
"files": [
|
|
44
|
-
"./utils/JsViewEngineWidget/index.d.ts",
|
|
45
|
-
"./utils/JsViewVueTools/index.d.ts"
|
|
46
|
-
],
|
|
47
|
-
}
|
package/utils/index.d.ts
DELETED
package/utils/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-07-05 14:22:52
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-07-05 15:07:30
|
|
6
|
-
* @Description: file content
|
|
7
|
-
*/
|
|
8
|
-
export * from "./JsViewVueWidget";
|
|
9
|
-
export * from "./JsViewEngineWidget";
|
|
10
|
-
export * from "./JsViewVueTools";
|