@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,144 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import {
|
|
3
|
+
VERTICAL,
|
|
4
|
+
MetroWidget,
|
|
5
|
+
WholePageSlide,
|
|
6
|
+
SeamlessSlide,
|
|
7
|
+
FixPositionSlide,
|
|
8
|
+
} from "jsview";
|
|
9
|
+
|
|
10
|
+
import Item from "./Item.vue";
|
|
11
|
+
|
|
12
|
+
import { metroWidgetV, measures } from "./data.js";
|
|
13
|
+
import { ref, shallowRef } from "vue";
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
components: {
|
|
17
|
+
MetroWidget,
|
|
18
|
+
Item,
|
|
19
|
+
},
|
|
20
|
+
setup() {
|
|
21
|
+
return {
|
|
22
|
+
measures,
|
|
23
|
+
name: "/metroWidgetH",
|
|
24
|
+
direction: VERTICAL,
|
|
25
|
+
wholePageSlide: new WholePageSlide({
|
|
26
|
+
speed: 1.5,
|
|
27
|
+
}),
|
|
28
|
+
seamlessSlide: new SeamlessSlide({
|
|
29
|
+
startPercent: 0.4,
|
|
30
|
+
endPercent: 0.6,
|
|
31
|
+
speed: 0.5,
|
|
32
|
+
}),
|
|
33
|
+
fixPositionSlide: new FixPositionSlide({
|
|
34
|
+
fixPercent: 0.5,
|
|
35
|
+
speed: 0.5,
|
|
36
|
+
}),
|
|
37
|
+
token: ref(0),
|
|
38
|
+
CONST_ITEM_WIDTH: 300,
|
|
39
|
+
CONST_ITEM_HEIGHT: 100,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
_provideData() {
|
|
44
|
+
return metroWidgetV;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
mounted() {},
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<div class="rootSize">
|
|
54
|
+
<div :style="{ width: 1280, height: 720, left: 50, overflow: 'hidden' }">
|
|
55
|
+
<div
|
|
56
|
+
:style="{
|
|
57
|
+
left: 0,
|
|
58
|
+
width: 200,
|
|
59
|
+
height: 40,
|
|
60
|
+
fontSize: 25,
|
|
61
|
+
lineHeight: '40px',
|
|
62
|
+
color: '#fff753',
|
|
63
|
+
}"
|
|
64
|
+
>
|
|
65
|
+
整页滑动
|
|
66
|
+
</div>
|
|
67
|
+
<div
|
|
68
|
+
:style="{
|
|
69
|
+
left: 200,
|
|
70
|
+
width: CONST_ITEM_WIDTH + 20,
|
|
71
|
+
height: CONST_ITEM_HEIGHT * 5 + 20,
|
|
72
|
+
backgroundColor: '#ff0000',
|
|
73
|
+
}"
|
|
74
|
+
>
|
|
75
|
+
<metro-widget
|
|
76
|
+
name="simpleWidgetVertical1"
|
|
77
|
+
:width="CONST_ITEM_WIDTH + 20"
|
|
78
|
+
:height="CONST_ITEM_HEIGHT * 5 + 20"
|
|
79
|
+
:direction="direction"
|
|
80
|
+
:measures="measures"
|
|
81
|
+
:provideData="_provideData"
|
|
82
|
+
:padding="{ top: 10, left: 10, right: 10, bottom: 10 }"
|
|
83
|
+
:enableTouch="true"
|
|
84
|
+
:flingPageWidth="CONST_ITEM_HEIGHT * 5"
|
|
85
|
+
>
|
|
86
|
+
<template #renderItem="{ data, query, onEdge, onAction }">
|
|
87
|
+
<item
|
|
88
|
+
:data="data"
|
|
89
|
+
:query="query"
|
|
90
|
+
:onEdge="onEdge"
|
|
91
|
+
:onAction="onAction"
|
|
92
|
+
/> </template
|
|
93
|
+
></metro-widget>
|
|
94
|
+
</div>
|
|
95
|
+
<div
|
|
96
|
+
:style="{
|
|
97
|
+
left: 600,
|
|
98
|
+
width: 200,
|
|
99
|
+
height: 40,
|
|
100
|
+
fontSize: 25,
|
|
101
|
+
lineHeight: '40px',
|
|
102
|
+
color: '#fff753',
|
|
103
|
+
}"
|
|
104
|
+
>
|
|
105
|
+
普通滑动
|
|
106
|
+
</div>
|
|
107
|
+
<div
|
|
108
|
+
:style="{
|
|
109
|
+
left: 800,
|
|
110
|
+
width: CONST_ITEM_WIDTH + 20,
|
|
111
|
+
height: CONST_ITEM_HEIGHT * 5 + 20,
|
|
112
|
+
backgroundColor: '#ff0000',
|
|
113
|
+
}"
|
|
114
|
+
>
|
|
115
|
+
<metro-widget
|
|
116
|
+
name="simpleWidgetVertical2"
|
|
117
|
+
:width="CONST_ITEM_WIDTH + 20"
|
|
118
|
+
:height="CONST_ITEM_HEIGHT * 5 + 20"
|
|
119
|
+
:direction="direction"
|
|
120
|
+
:measures="measures"
|
|
121
|
+
:provideData="_provideData"
|
|
122
|
+
:padding="{ top: 10, left: 10, right: 10, bottom: 10 }"
|
|
123
|
+
:enableTouch="true"
|
|
124
|
+
>
|
|
125
|
+
<template #renderItem="{ data, query, onEdge, onAction }">
|
|
126
|
+
<item
|
|
127
|
+
:data="data"
|
|
128
|
+
:query="query"
|
|
129
|
+
:onEdge="onEdge"
|
|
130
|
+
:onAction="onAction"
|
|
131
|
+
/> </template
|
|
132
|
+
></metro-widget>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<style scoped>
|
|
139
|
+
.rootSize {
|
|
140
|
+
width: 1920;
|
|
141
|
+
height: 1080;
|
|
142
|
+
background-color: #334c4c;
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-04-10 21:21:02
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-08 14:40:19
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script>
|
|
9
|
+
import {
|
|
10
|
+
JsvTouchContainer,
|
|
11
|
+
DIRECTION_VERTICAL,
|
|
12
|
+
DIRECTION_HORIZONTAL,
|
|
13
|
+
DIRECTION_DISABLE,
|
|
14
|
+
} from "jsview";
|
|
15
|
+
import { touchContainerH, measures } from "./data.js";
|
|
16
|
+
function randomColor() {
|
|
17
|
+
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
18
|
+
return (
|
|
19
|
+
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export default {
|
|
23
|
+
components: {
|
|
24
|
+
JsvTouchContainer,
|
|
25
|
+
},
|
|
26
|
+
setup() {
|
|
27
|
+
return {
|
|
28
|
+
DIRECTION_VERTICAL,
|
|
29
|
+
DIRECTION_HORIZONTAL,
|
|
30
|
+
DIRECTION_DISABLE,
|
|
31
|
+
touchContainerH,
|
|
32
|
+
measures,
|
|
33
|
+
randomColor,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
_onClick(msg) {
|
|
38
|
+
console.log(`_onClick:${JSON.stringify(msg)}`);
|
|
39
|
+
return true;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<div :style="{ width: 1280, height: 720, overflow: 'hidden' }">
|
|
47
|
+
<jsv-touch-container
|
|
48
|
+
:style="{ width: 1280, height: 720 * 2, backgroundColor: '#7b7a1c' }"
|
|
49
|
+
:direction="DIRECTION_VERTICAL"
|
|
50
|
+
:dragLimitArea="{ x: 0, y: 0, width: 1280, height: 720 }"
|
|
51
|
+
>
|
|
52
|
+
<div
|
|
53
|
+
:style="{
|
|
54
|
+
left: 30,
|
|
55
|
+
top: 0,
|
|
56
|
+
width: 400,
|
|
57
|
+
height: 30,
|
|
58
|
+
fontSize: 18,
|
|
59
|
+
lineHeight: '30px',
|
|
60
|
+
color: '#f0ef29',
|
|
61
|
+
}"
|
|
62
|
+
>
|
|
63
|
+
整屏幕滑动
|
|
64
|
+
</div>
|
|
65
|
+
<jsv-touch-container
|
|
66
|
+
:style="{
|
|
67
|
+
left: 0,
|
|
68
|
+
top: 40,
|
|
69
|
+
width: (1280 - 60) * 5,
|
|
70
|
+
height: 220,
|
|
71
|
+
backgroundColor: 'rgba(255,0,0,0.5)',
|
|
72
|
+
}"
|
|
73
|
+
:direction="DIRECTION_HORIZONTAL"
|
|
74
|
+
:flingPageWidth="1280 - 60"
|
|
75
|
+
:dragLimitArea="{ x: 0, y: 0, width: 1280 - 60, height: 220 }"
|
|
76
|
+
>
|
|
77
|
+
<div
|
|
78
|
+
v-for="(tabList, tabIndex) in touchContainerH"
|
|
79
|
+
:key="'tab' + tabIndex"
|
|
80
|
+
:style="{
|
|
81
|
+
left: (1280 - 60) * tabIndex,
|
|
82
|
+
top: 0,
|
|
83
|
+
width: 1280 - 60,
|
|
84
|
+
height: 220,
|
|
85
|
+
backgroundColor: randomColor(),
|
|
86
|
+
}"
|
|
87
|
+
>
|
|
88
|
+
<jsv-touch-container
|
|
89
|
+
v-for="(item, itemIndex) in tabList"
|
|
90
|
+
:key="'tab' + tabIndex + '-' + itemIndex"
|
|
91
|
+
:style="{
|
|
92
|
+
left: item.left,
|
|
93
|
+
top: item.top,
|
|
94
|
+
width: item.width,
|
|
95
|
+
height: item.height,
|
|
96
|
+
backgroundColor: item.backgroundColor,
|
|
97
|
+
fontSize: 18,
|
|
98
|
+
}"
|
|
99
|
+
:onClick="_onClick"
|
|
100
|
+
:direction="DIRECTION_DISABLE"
|
|
101
|
+
>{{ item.content }}</jsv-touch-container
|
|
102
|
+
>
|
|
103
|
+
</div>
|
|
104
|
+
</jsv-touch-container>
|
|
105
|
+
|
|
106
|
+
<div
|
|
107
|
+
:style="{
|
|
108
|
+
left: 30,
|
|
109
|
+
top: 280,
|
|
110
|
+
width: 400,
|
|
111
|
+
height: 40,
|
|
112
|
+
fontSize: 18,
|
|
113
|
+
lineHeight: '40px',
|
|
114
|
+
color: '#f0ef29',
|
|
115
|
+
}"
|
|
116
|
+
>
|
|
117
|
+
左右滑动
|
|
118
|
+
</div>
|
|
119
|
+
<jsv-touch-container
|
|
120
|
+
:style="{
|
|
121
|
+
left: 0,
|
|
122
|
+
top: 320,
|
|
123
|
+
width: (1280 - 60) * 5,
|
|
124
|
+
height: 220,
|
|
125
|
+
backgroundColor: '#1d9797',
|
|
126
|
+
}"
|
|
127
|
+
:direction="DIRECTION_HORIZONTAL"
|
|
128
|
+
:dragLimitArea="{ x: 0, y: 0, width: 1280 - 60, height: 220 }"
|
|
129
|
+
>
|
|
130
|
+
<div
|
|
131
|
+
v-for="(tabList, tabIndex) in touchContainerH"
|
|
132
|
+
:key="'tab' + tabIndex"
|
|
133
|
+
:style="{
|
|
134
|
+
left: (1280 - 60) * tabIndex,
|
|
135
|
+
top: 0,
|
|
136
|
+
width: 1280 - 60,
|
|
137
|
+
height: 220,
|
|
138
|
+
backgroundColor: randomColor(),
|
|
139
|
+
}"
|
|
140
|
+
>
|
|
141
|
+
<jsv-touch-container
|
|
142
|
+
v-for="(item, itemIndex) in tabList"
|
|
143
|
+
:key="'tab' + tabIndex + '-' + itemIndex"
|
|
144
|
+
:style="{
|
|
145
|
+
left: item.left,
|
|
146
|
+
top: item.top,
|
|
147
|
+
width: item.width,
|
|
148
|
+
height: item.height,
|
|
149
|
+
backgroundColor: item.backgroundColor,
|
|
150
|
+
fontSize: 18,
|
|
151
|
+
}"
|
|
152
|
+
:onClick="_onClick"
|
|
153
|
+
:direction="DIRECTION_DISABLE"
|
|
154
|
+
>{{ item.content }}</jsv-touch-container
|
|
155
|
+
>
|
|
156
|
+
</div>
|
|
157
|
+
</jsv-touch-container>
|
|
158
|
+
</jsv-touch-container>
|
|
159
|
+
</div>
|
|
160
|
+
</template>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-04-10 21:21:02
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-04-11 09:04:26
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script>
|
|
9
|
+
import {
|
|
10
|
+
JsvTouchContainer,
|
|
11
|
+
DIRECTION_VERTICAL,
|
|
12
|
+
DIRECTION_HORIZONTAL,
|
|
13
|
+
DIRECTION_DISABLE,
|
|
14
|
+
} from "jsview";
|
|
15
|
+
import { touchContainerV, measures } from "./data.js";
|
|
16
|
+
function randomColor() {
|
|
17
|
+
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
18
|
+
return (
|
|
19
|
+
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export default {
|
|
23
|
+
components: {
|
|
24
|
+
JsvTouchContainer,
|
|
25
|
+
},
|
|
26
|
+
setup() {
|
|
27
|
+
return {
|
|
28
|
+
DIRECTION_VERTICAL,
|
|
29
|
+
DIRECTION_HORIZONTAL,
|
|
30
|
+
DIRECTION_DISABLE,
|
|
31
|
+
touchContainerV,
|
|
32
|
+
measures,
|
|
33
|
+
randomColor,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
_onClick(msg) {
|
|
38
|
+
console.log(`_onClick:${JSON.stringify(msg)}`);
|
|
39
|
+
return true;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<div :style="{ width: 1280, height: 720, overflow: 'hidden' }">
|
|
47
|
+
<jsv-touch-container
|
|
48
|
+
:style="{ width: 1280, height: 720 * 2, backgroundColor: '#7b7a1c' }"
|
|
49
|
+
:direction="DIRECTION_HORIZONTAL"
|
|
50
|
+
:dragLimitArea="{ x: 0, y: 0, width: 1280, height: 720 }"
|
|
51
|
+
>
|
|
52
|
+
<div
|
|
53
|
+
:style="{
|
|
54
|
+
left: 30,
|
|
55
|
+
top: 0,
|
|
56
|
+
width: 400,
|
|
57
|
+
height: 40,
|
|
58
|
+
fontSize: 25,
|
|
59
|
+
lineHeight: '40px',
|
|
60
|
+
color: '#f0ef29',
|
|
61
|
+
}"
|
|
62
|
+
>
|
|
63
|
+
整屏幕滑动
|
|
64
|
+
</div>
|
|
65
|
+
<jsv-touch-container
|
|
66
|
+
:style="{
|
|
67
|
+
left: 30,
|
|
68
|
+
top: 50,
|
|
69
|
+
width: 400,
|
|
70
|
+
height: 500 * 5,
|
|
71
|
+
backgroundColor: '#810000',
|
|
72
|
+
}"
|
|
73
|
+
:direction="DIRECTION_VERTICAL"
|
|
74
|
+
:flingPageWidth="500"
|
|
75
|
+
:dragLimitArea="{ x: 0, y: 0, width: 400, height: 500 }"
|
|
76
|
+
>
|
|
77
|
+
<div
|
|
78
|
+
v-for="(tabList, tabIndex) in touchContainerV"
|
|
79
|
+
:key="'tab' + tabIndex"
|
|
80
|
+
:style="{
|
|
81
|
+
left: 0,
|
|
82
|
+
top: 500 * tabIndex,
|
|
83
|
+
width: 400,
|
|
84
|
+
height: 500,
|
|
85
|
+
backgroundColor: randomColor(),
|
|
86
|
+
}"
|
|
87
|
+
>
|
|
88
|
+
<jsv-touch-container
|
|
89
|
+
v-for="(item, itemIndex) in tabList"
|
|
90
|
+
:key="'tab' + tabIndex + '-' + itemIndex"
|
|
91
|
+
:style="{
|
|
92
|
+
left: item.left,
|
|
93
|
+
top: item.top,
|
|
94
|
+
width: item.width,
|
|
95
|
+
height: item.height,
|
|
96
|
+
backgroundColor: item.backgroundColor,
|
|
97
|
+
fontSize: 18,
|
|
98
|
+
}"
|
|
99
|
+
:onClick="_onClick"
|
|
100
|
+
:direction="DIRECTION_DISABLE"
|
|
101
|
+
>{{ item.content }}</jsv-touch-container
|
|
102
|
+
>
|
|
103
|
+
</div>
|
|
104
|
+
</jsv-touch-container>
|
|
105
|
+
|
|
106
|
+
<div
|
|
107
|
+
:style="{
|
|
108
|
+
left: 530,
|
|
109
|
+
top: 0,
|
|
110
|
+
width: 400,
|
|
111
|
+
height: 40,
|
|
112
|
+
fontSize: 25,
|
|
113
|
+
lineHeight: '40px',
|
|
114
|
+
color: '#f0ef29',
|
|
115
|
+
}"
|
|
116
|
+
>
|
|
117
|
+
上下滑动
|
|
118
|
+
</div>
|
|
119
|
+
<jsv-touch-container
|
|
120
|
+
:style="{
|
|
121
|
+
left: 530,
|
|
122
|
+
top: 50,
|
|
123
|
+
width: 400,
|
|
124
|
+
height: 500 * 5,
|
|
125
|
+
backgroundColor: '#810000',
|
|
126
|
+
}"
|
|
127
|
+
:direction="DIRECTION_VERTICAL"
|
|
128
|
+
:dragLimitArea="{ x: 0, y: 0, width: 400, height: 500 }"
|
|
129
|
+
>
|
|
130
|
+
<div
|
|
131
|
+
v-for="(tabList, tabIndex) in touchContainerV"
|
|
132
|
+
:key="'tab' + tabIndex"
|
|
133
|
+
:style="{
|
|
134
|
+
left: 0,
|
|
135
|
+
top: 500 * tabIndex,
|
|
136
|
+
width: 400,
|
|
137
|
+
height: 500,
|
|
138
|
+
backgroundColor: randomColor(),
|
|
139
|
+
}"
|
|
140
|
+
>
|
|
141
|
+
<jsv-touch-container
|
|
142
|
+
v-for="(item, itemIndex) in tabList"
|
|
143
|
+
:key="'tab' + tabIndex + '-' + itemIndex"
|
|
144
|
+
:style="{
|
|
145
|
+
left: item.left,
|
|
146
|
+
top: item.top,
|
|
147
|
+
width: item.width,
|
|
148
|
+
height: item.height,
|
|
149
|
+
backgroundColor: item.backgroundColor,
|
|
150
|
+
fontSize: 18,
|
|
151
|
+
}"
|
|
152
|
+
:onClick="_onClick"
|
|
153
|
+
:direction="DIRECTION_DISABLE"
|
|
154
|
+
>{{ item.content }}</jsv-touch-container
|
|
155
|
+
>
|
|
156
|
+
</div>
|
|
157
|
+
</jsv-touch-container>
|
|
158
|
+
</jsv-touch-container>
|
|
159
|
+
</div>
|
|
160
|
+
</template>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-04-10 21:23:15
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-04-11 10:03:21
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
function randomColor() {
|
|
9
|
+
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
10
|
+
return (
|
|
11
|
+
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const metroWidgetH = [];
|
|
16
|
+
for (let i = 0; i < 500; i++) {
|
|
17
|
+
metroWidgetH.push({
|
|
18
|
+
content: i,
|
|
19
|
+
id: i,
|
|
20
|
+
width: 100,
|
|
21
|
+
height: 200,
|
|
22
|
+
color: randomColor(),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const metroWidgetV = [];
|
|
27
|
+
for (let i = 0; i < 500; i++) {
|
|
28
|
+
metroWidgetV.push({
|
|
29
|
+
content: i,
|
|
30
|
+
id: i,
|
|
31
|
+
width: 200,
|
|
32
|
+
height: 100,
|
|
33
|
+
color: randomColor(),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const touchContainerH = [];
|
|
38
|
+
for (let i = 0; i < 5; i++) {
|
|
39
|
+
const tabData = [];
|
|
40
|
+
for (let i = 0; i < 20; i++) {
|
|
41
|
+
tabData.push({
|
|
42
|
+
content: i,
|
|
43
|
+
id: i,
|
|
44
|
+
left: (122 / 2) * i,
|
|
45
|
+
top: 10,
|
|
46
|
+
width: 122 / 2 - 10,
|
|
47
|
+
height: 200,
|
|
48
|
+
backgroundColor: randomColor(),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
touchContainerH.push(tabData);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const touchContainerV = [];
|
|
55
|
+
for (let i = 0; i < 5; i++) {
|
|
56
|
+
const tabData = [];
|
|
57
|
+
for (let i = 0; i < 20; i++) {
|
|
58
|
+
tabData.push({
|
|
59
|
+
content: i,
|
|
60
|
+
id: i,
|
|
61
|
+
left: 10,
|
|
62
|
+
top: 50 * i,
|
|
63
|
+
width: 300,
|
|
64
|
+
height: 40,
|
|
65
|
+
backgroundColor: randomColor(),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
touchContainerV.push(tabData);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function measures(item) {
|
|
72
|
+
return item;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
metroWidgetH,
|
|
77
|
+
metroWidgetV,
|
|
78
|
+
touchContainerH,
|
|
79
|
+
touchContainerV,
|
|
80
|
+
measures,
|
|
81
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import DemoApp from "../DemoHomepage/App.vue";
|
|
3
|
+
import ActivityApp from "../MetroWidgetDemos/PerformanceTest/App.vue"; // TODO
|
|
4
|
+
import { jJsvRuntimeBridge } from "jsview";
|
|
5
|
+
import { ref, shallowRef, onMounted } from "vue";
|
|
6
|
+
|
|
7
|
+
const getShowMode = () => {
|
|
8
|
+
let showMode = 0;
|
|
9
|
+
// showMode信息可被URL中的?后缀信息替换
|
|
10
|
+
if (window.location.search.indexOf("showMode=0") >= 0) {
|
|
11
|
+
showMode = 0;
|
|
12
|
+
} else if (window.location.search.indexOf("showMode=1") >= 0) {
|
|
13
|
+
showMode = 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return showMode;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const showMode = ref(getShowMode());
|
|
20
|
+
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<DemoApp v-if="showMode === 0" />
|
|
28
|
+
<ActivityApp v-else-if="showMode === 1" />
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { provide, reactive, ref, shallowRef, watch } from "vue";
|
|
3
|
+
import Controllor from "./components/Controllor.vue";
|
|
4
|
+
import VideoFrame from "./components/VideoFrame.vue";
|
|
5
|
+
|
|
6
|
+
const Caption = {
|
|
7
|
+
offscreenVideo:
|
|
8
|
+
"名称:OffscreenVideo(自动播放)\n" +
|
|
9
|
+
"功能描述:\n" +
|
|
10
|
+
"1.离屏视频播放、支持前进/后退控制\n" +
|
|
11
|
+
"2.支持圆角设置\n" +
|
|
12
|
+
"3.支持平移、缩放、旋转等动画\n" +
|
|
13
|
+
"4.支持ObjectFit调整\n",
|
|
14
|
+
normalVideo:
|
|
15
|
+
"名称:Video\n" +
|
|
16
|
+
"功能描述:\n" +
|
|
17
|
+
"1.视频播放、支持前进/后退控制\n" +
|
|
18
|
+
"2.支持ObjectFit调整\n",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
let caption = shallowRef(null);
|
|
22
|
+
let useTexture = shallowRef(null);
|
|
23
|
+
let videoTime = reactive({
|
|
24
|
+
currentTime: 0,
|
|
25
|
+
duration: 0,
|
|
26
|
+
});
|
|
27
|
+
let objectFitTitle = shallowRef(null);
|
|
28
|
+
let playStatus = ref("");
|
|
29
|
+
provide("useTexture", useTexture);
|
|
30
|
+
provide("objectFit", shallowRef(null));
|
|
31
|
+
provide("videoRect", ref({}));
|
|
32
|
+
provide("playVideo", shallowRef(null));
|
|
33
|
+
provide("seekVideo", shallowRef(null));
|
|
34
|
+
provide("enableAnimation", shallowRef(null));
|
|
35
|
+
provide("videoTime", videoTime);
|
|
36
|
+
provide("objectFitTitle", objectFitTitle);
|
|
37
|
+
provide("playStatus", playStatus);
|
|
38
|
+
watch(useTexture, () => {
|
|
39
|
+
caption.value = useTexture.value ? Caption.offscreenVideo : Caption.normalVideo;
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div
|
|
45
|
+
:style="{
|
|
46
|
+
top: 0,
|
|
47
|
+
left: 0,
|
|
48
|
+
width: 1280,
|
|
49
|
+
height: 720,
|
|
50
|
+
backgroundColor: 'rgb(222,211,140)',
|
|
51
|
+
}"
|
|
52
|
+
>
|
|
53
|
+
<!-- :key="useTexture" => 当useTexture属性变化时,重建VideoFrame -->
|
|
54
|
+
<VideoFrame :key="useTexture" />
|
|
55
|
+
|
|
56
|
+
<!-- :key="useTexture" => JsView bug,当useTexture属性变化时,为了保证显示在VideoFrame前面 -->
|
|
57
|
+
<div class="caption" :key="useTexture">
|
|
58
|
+
{{ caption }}
|
|
59
|
+
</div>
|
|
60
|
+
<div>
|
|
61
|
+
<div class="text status">
|
|
62
|
+
{{ "播放状态: " + playStatus }}
|
|
63
|
+
</div>
|
|
64
|
+
<div class="text objectFit">
|
|
65
|
+
{{ objectFitTitle }}
|
|
66
|
+
</div>
|
|
67
|
+
<div class="text current">
|
|
68
|
+
{{ Math.ceil(videoTime.currentTime) }}
|
|
69
|
+
</div>
|
|
70
|
+
<div class="text duration">
|
|
71
|
+
{{ "/" + Math.ceil(videoTime.duration) }}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<Controllor class="controllor" />
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<style scoped>
|
|
79
|
+
.caption {
|
|
80
|
+
text-align: left;
|
|
81
|
+
font-size: 24px;
|
|
82
|
+
line-height: 30px;
|
|
83
|
+
color: #ffffff;
|
|
84
|
+
left: 10;
|
|
85
|
+
top: 10;
|
|
86
|
+
width: 400;
|
|
87
|
+
height: 180;
|
|
88
|
+
background-color: rgba(27, 38, 151, 0.8);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.text {
|
|
92
|
+
color: #ff0000;
|
|
93
|
+
font-size: 24px;
|
|
94
|
+
top: 550;
|
|
95
|
+
width: 60;
|
|
96
|
+
height: 40;
|
|
97
|
+
}
|
|
98
|
+
.status {
|
|
99
|
+
left: 50;
|
|
100
|
+
width: 300;
|
|
101
|
+
}
|
|
102
|
+
.objectFit {
|
|
103
|
+
left: 800;
|
|
104
|
+
width: 200;
|
|
105
|
+
text-align: center;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.current {
|
|
109
|
+
left: 1060;
|
|
110
|
+
text-align: right;
|
|
111
|
+
}
|
|
112
|
+
.duration {
|
|
113
|
+
left: 1120;
|
|
114
|
+
text-align: left;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.controllor {
|
|
118
|
+
left: 40;
|
|
119
|
+
top: 600;
|
|
120
|
+
}
|
|
121
|
+
</style>
|