@shijiu/jsview-vue-samples 2.2.201 → 2.2.373
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BakeViewDemo/App.vue +6 -1
- package/Basic/components/anim/AnimEasingCubicBezier.vue +56 -0
- package/Basic/components/anim/AnimGroup2.vue +33 -0
- package/Basic/components/panel/Panel2.vue +8 -3
- package/CoupletsTest/widget/Banger/Maroon.vue +0 -1
- package/CoupletsTest/widget/Fireworks/Fireworks.vue +0 -2
- package/CustomShader/App.vue +30 -13
- package/CustomShader/pageFlip.glsl +3 -2
- package/DemoHomepage/App.vue +14 -5
- package/DemoHomepage/components/Item.vue +23 -12
- package/DemoHomepage/index.d.ts +5 -2
- package/DemoHomepage/router.js +97 -74
- package/DispersedFocusControl/App.vue +67 -0
- package/DispersedFocusControl/Button.vue +76 -0
- package/DispersedFocusControl/data.js +44 -0
- package/DragBox/App.vue +148 -0
- package/FlexCellDemo/App.vue +47 -223
- package/FlexCellDemo/TestFrame1.vue +88 -0
- package/FlexCellDemo/TestFrame2.vue +100 -0
- package/FlexCellDemo/TestFrame3.vue +97 -0
- package/FlexCellDemo/TestFrame4.vue +60 -0
- package/FlexCellDemo/TestFrame5.vue +60 -0
- package/FlexCellDemo/images/6.jpg +0 -0
- package/FocusMoveStyle/App.vue +1 -0
- package/FocusMoveStyle/CreepFocus.vue +11 -1
- package/FocusMoveStyle/FoldableItem.vue +1 -1
- package/FullScreenFlex/App.vue +42 -0
- package/FullScreenFlex/TestFrame2.vue +107 -0
- package/FullScreenFlex/images/1.png +0 -0
- package/HashHistory/App.vue +8 -4
- package/Input/App.vue +184 -97
- package/Input/InputPanel.vue +98 -82
- package/LatexFormula/App.vue +97 -10
- package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +1 -1
- package/MetroWidgetDemos/routeList.js +17 -17
- package/MindMap/App.vue +10 -1
- package/MindMap/data.js +34 -8
- package/Parkour/appConfig/jsview.config.mjs +0 -4
- package/PosterPacker/App.vue +207 -0
- package/PosterPacker/images/bg.jpg +0 -0
- package/PosterPacker/images/blue.png +0 -0
- package/PosterPacker/images/darkGreen.png +0 -0
- package/PosterPacker/images/left.png +0 -0
- package/PosterPacker/images/orange.png +0 -0
- package/PosterPacker/images/pink.png +0 -0
- package/PosterPacker/images/purple.png +0 -0
- package/PosterPacker/images/red.png +0 -0
- package/PosterPacker/images/right.png +0 -0
- package/PosterPacker/images/yellowGreen.png +0 -0
- package/PosterPacker/tools/geniePakcer/Genie.vue +686 -0
- package/PosterPacker/tools/geniePakcer/genieBottom.glsl +49 -0
- package/PosterPacker/tools/geniePakcer/genieLeft.glsl +50 -0
- package/PosterPacker/tools/geniePakcer/genieRight.glsl +57 -0
- package/PosterPacker/tools/geniePakcer/genieTop.glsl +50 -0
- package/PosterPacker/tools/particlePacker/Particle.vue +71 -0
- package/PosterPacker/tools/vortexPacker/Vortex.vue +135 -0
- package/PosterPacker/tools/vortexPacker/vortex.glsl +37 -0
- package/Preload/App.vue +1 -1
- package/ScrollBoxTest/ClipBar.vue +1 -0
- package/ScrollBoxTest/NinePatchBar.vue +1 -0
- package/ScrollBoxTest/SizeDivBar.vue +1 -0
- package/SprayMove/App.vue +75 -0
- package/SprayMove/SprayMove.vue +173 -0
- package/SprayView/App.vue +8 -9
- package/TestNativeSharedView/App.vue +6 -4
- package/TextShadowDemo/App.vue +3 -3
- package/TextureAnimation/App.vue +244 -148
- package/TextureAnimation/App2.vue +66 -14
- package/TextureAnimation/assets/blackWhiteTurntable.png +0 -0
- package/TextureAnimation/assets/circleHaloMask.png +0 -0
- package/TouchWidget/App.vue +79 -40
- package/TouchWidget/Item.vue +15 -3
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/TextureAnimation/assets/mask.png +0 -0
- package/TextureAnimation/assets/php.jpg +0 -0
- package/TouchSample/App.vue +0 -136
- package/TouchSample/Item.vue +0 -102
- package/TouchSample/MetroWidgetHorizontal.vue +0 -144
- package/TouchSample/MetroWidgetVertical.vue +0 -144
- package/TouchSample/TouchContainerHorizontal.vue +0 -160
- package/TouchSample/TouchContainerVertical.vue +0 -160
- package/TouchSample/data.js +0 -81
- /package/TextureAnimation/assets/{php2.png → borderOpacity.png} +0 -0
package/TouchWidget/App.vue
CHANGED
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
* @Description: file content
|
|
5
5
|
-->
|
|
6
6
|
<script setup>
|
|
7
|
-
import { MetroWidget, VERTICAL, useFocusHub, METRO_WIDGET_CONST } from "jsview";
|
|
7
|
+
import { MetroWidget, VERTICAL, useFocusHub, METRO_WIDGET_CONST, JsvTouchModeSwitcher } from "jsview";
|
|
8
8
|
import WidgetItem from "./WidgetItem.vue";
|
|
9
|
-
import { onMounted } from "vue";
|
|
9
|
+
import { onMounted, ref, onBeforeUnmount, provide } from "vue";
|
|
10
10
|
|
|
11
11
|
const focusHub = useFocusHub();
|
|
12
|
+
focusHub.enableFocusTrace()
|
|
13
|
+
const modeSwitchRef = ref();
|
|
14
|
+
const modeString = ref("key")
|
|
12
15
|
|
|
13
16
|
const provideData = () => {
|
|
14
17
|
const data = [];
|
|
@@ -35,52 +38,88 @@ const measures = (item) => {
|
|
|
35
38
|
};
|
|
36
39
|
};
|
|
37
40
|
|
|
41
|
+
const onModeChange = (mode) => {
|
|
42
|
+
modeString.value = mode == 1 ? "key" : "touch";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
provide("modeSwitch", modeSwitchRef)
|
|
46
|
+
|
|
47
|
+
const widgetRef = ref();
|
|
48
|
+
function onScroll(visibleStart, range, totalSize) {
|
|
49
|
+
console.log("onScroll", visibleStart, range, totalSize);
|
|
50
|
+
}
|
|
38
51
|
onMounted(() => {
|
|
52
|
+
modeSwitchRef.value.registerCallback(onModeChange);
|
|
39
53
|
focusHub.setFocus("mwWidget");
|
|
54
|
+
widgetRef.value.setSensorSensitivity(12);
|
|
40
55
|
});
|
|
56
|
+
|
|
57
|
+
onBeforeUnmount(() => {
|
|
58
|
+
modeSwitchRef.value.unregisterCallback(onModeChange);
|
|
59
|
+
})
|
|
41
60
|
</script>
|
|
42
61
|
|
|
43
62
|
<template>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
:
|
|
47
|
-
|
|
48
|
-
top: 20,
|
|
49
|
-
width: 800,
|
|
50
|
-
height: 400,
|
|
51
|
-
fontSize: 30,
|
|
52
|
-
color: '#FFFFFF',
|
|
53
|
-
}"
|
|
54
|
-
>
|
|
55
|
-
{{ `MetroWidget的item是包含MetroWidget的组件` }}
|
|
56
|
-
</div>
|
|
57
|
-
<!-- 为了保证边缘的item缩放后依旧完整显示, 需要设置padding, 注意width/height是包含padding的 -->
|
|
58
|
-
<metro-widget
|
|
59
|
-
name="mwWidget"
|
|
60
|
-
:top="50"
|
|
61
|
-
:left="50"
|
|
62
|
-
:width="660"
|
|
63
|
-
:height="600"
|
|
64
|
-
:provideData="provideData"
|
|
65
|
-
:padding="{ left: 30, right: 30 }"
|
|
66
|
-
:direction="VERTICAL"
|
|
67
|
-
:measures="measures"
|
|
68
|
-
:touchFlag="1"
|
|
63
|
+
<jsv-touch-mode-switcher
|
|
64
|
+
ref="modeSwitchRef"
|
|
65
|
+
:width="1280"
|
|
66
|
+
:height="720"
|
|
69
67
|
>
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
<div :style="{ width: 1280, height: 720, backgroundColor: '#007788' }" />
|
|
69
|
+
<div
|
|
70
|
+
:style="{
|
|
71
|
+
left: 100,
|
|
72
|
+
top: 20,
|
|
73
|
+
width: 800,
|
|
74
|
+
height: 400,
|
|
75
|
+
fontSize: 30,
|
|
76
|
+
color: '#FFFFFF',
|
|
77
|
+
}"
|
|
78
|
+
>
|
|
79
|
+
{{ `MetroWidget的item是包含MetroWidget的组件` }}
|
|
80
|
+
</div>
|
|
81
|
+
<!-- 为了保证边缘的item缩放后依旧完整显示, 需要设置padding, 注意width/height是包含padding的 -->
|
|
82
|
+
<metro-widget
|
|
83
|
+
name="mwWidget"
|
|
84
|
+
ref="widgetRef"
|
|
85
|
+
:top="50"
|
|
86
|
+
:left="50"
|
|
87
|
+
:width="660"
|
|
88
|
+
:height="600"
|
|
89
|
+
:provideData="provideData"
|
|
90
|
+
:padding="{ left: 30, right: 30 }"
|
|
91
|
+
:direction="VERTICAL"
|
|
92
|
+
:measures="measures"
|
|
93
|
+
:touchFlag="1"
|
|
94
|
+
:onScroll="onScroll"
|
|
95
|
+
>
|
|
96
|
+
<!-- 重要代码: 为了实现焦点就近移动, 需要传递onItemEdge回调 -->
|
|
97
|
+
<template #renderItem="{ data, onAction, onItemEdge }">
|
|
98
|
+
<widget-item
|
|
99
|
+
:data="data"
|
|
100
|
+
:onAction="onAction"
|
|
101
|
+
:onItemEdge="onItemEdge"
|
|
102
|
+
/>
|
|
103
|
+
</template>
|
|
104
|
+
</metro-widget>
|
|
75
105
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
<div
|
|
107
|
+
:style="{
|
|
108
|
+
width: 50,
|
|
109
|
+
height: 50,
|
|
110
|
+
backgroundColor: '#ff000055',
|
|
111
|
+
animation: 'testRotate 2s infinite',
|
|
112
|
+
}"
|
|
113
|
+
></div>
|
|
114
|
+
</jsv-touch-mode-switcher>
|
|
115
|
+
<div :style="{
|
|
116
|
+
width: 300,
|
|
117
|
+
height: 50,
|
|
118
|
+
fontSize: 30,
|
|
119
|
+
color: '#ffffff'
|
|
120
|
+
}">
|
|
121
|
+
{{ modeString }}
|
|
122
|
+
</div>
|
|
84
123
|
</template>
|
|
85
124
|
|
|
86
125
|
<style scoped>
|
package/TouchWidget/Item.vue
CHANGED
|
@@ -4,20 +4,32 @@
|
|
|
4
4
|
* @Description: file content
|
|
5
5
|
-->
|
|
6
6
|
<script setup>
|
|
7
|
-
import { ref } from "vue";
|
|
7
|
+
import { ref, inject } from "vue";
|
|
8
8
|
|
|
9
9
|
const props = defineProps({
|
|
10
10
|
data: Object,
|
|
11
11
|
onAction: Object,
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
const modeSwitch = inject("modeSwitch");
|
|
14
14
|
const focused = ref(false);
|
|
15
15
|
|
|
16
|
+
const modeChangeCallback = (mode) => {
|
|
17
|
+
if (mode == 2) {
|
|
18
|
+
focused.value = false;
|
|
19
|
+
} else {
|
|
20
|
+
focused.value = true;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
16
24
|
// 自身的焦点状态自己记录, 通过回调来改变
|
|
17
25
|
const onFocus = () => {
|
|
18
|
-
|
|
26
|
+
modeSwitch.value?.registerCallback(modeChangeCallback);
|
|
27
|
+
if (modeSwitch.value?.getInteractiveMode() == 1) {
|
|
28
|
+
focused.value = true;
|
|
29
|
+
}
|
|
19
30
|
};
|
|
20
31
|
const onBlur = () => {
|
|
32
|
+
modeSwitch.value?.unregisterCallback(modeChangeCallback);
|
|
21
33
|
focused.value = false;
|
|
22
34
|
};
|
|
23
35
|
const onClick = () => {
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
package/TouchSample/App.vue
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-04-10 21:20:39
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-07-08 14:12:05
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
import MetroWidgetHorizontal from "./MetroWidgetHorizontal.vue";
|
|
10
|
-
import MetroWidgetVertical from "./MetroWidgetVertical.vue";
|
|
11
|
-
import TouchContainerHorizontal from "./TouchContainerHorizontal.vue";
|
|
12
|
-
import TouchContainerVertical from "./TouchContainerVertical.vue";
|
|
13
|
-
import { jJsvRuntimeBridge, JsvTouchContainer } from "jsview";
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
components: {
|
|
17
|
-
MetroWidgetHorizontal,
|
|
18
|
-
MetroWidgetVertical,
|
|
19
|
-
TouchContainerHorizontal,
|
|
20
|
-
JsvTouchContainer,
|
|
21
|
-
TouchContainerVertical,
|
|
22
|
-
},
|
|
23
|
-
data() {
|
|
24
|
-
return {
|
|
25
|
-
metroVerticalVisible: false,
|
|
26
|
-
metroHorizontalVisible: true,
|
|
27
|
-
touchContainerHorizontalVisible: false,
|
|
28
|
-
touchContainerVerticalVisible: false,
|
|
29
|
-
head: "SimpleWidget 横向",
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
setup() {
|
|
33
|
-
const tabList = [
|
|
34
|
-
"SimpleWidget 横向",
|
|
35
|
-
"SimpleWidget 纵向",
|
|
36
|
-
"TouchContainer 横向",
|
|
37
|
-
"TouchContainer 纵向",
|
|
38
|
-
];
|
|
39
|
-
return {
|
|
40
|
-
tabList,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
methods: {
|
|
44
|
-
_onClick(id) {
|
|
45
|
-
switch (id) {
|
|
46
|
-
case 0:
|
|
47
|
-
this.head = "SimpleWidget 横向";
|
|
48
|
-
this.metroVerticalVisible = false;
|
|
49
|
-
this.metroHorizontalVisible = true;
|
|
50
|
-
this.touchContainerHorizontalVisible = false;
|
|
51
|
-
this.touchContainerVerticalVisible = false;
|
|
52
|
-
break;
|
|
53
|
-
case 1:
|
|
54
|
-
this.head = "SimpleWidget 纵向";
|
|
55
|
-
this.metroVerticalVisible = true;
|
|
56
|
-
this.metroHorizontalVisible = false;
|
|
57
|
-
this.touchContainerHorizontalVisible = false;
|
|
58
|
-
this.touchContainerVerticalVisible = false;
|
|
59
|
-
break;
|
|
60
|
-
case 2:
|
|
61
|
-
this.head = "TouchContainer 横向";
|
|
62
|
-
this.metroVerticalVisible = false;
|
|
63
|
-
this.metroHorizontalVisible = false;
|
|
64
|
-
this.touchContainerHorizontalVisible = true;
|
|
65
|
-
this.touchContainerVerticalVisible = false;
|
|
66
|
-
break;
|
|
67
|
-
case 3:
|
|
68
|
-
this.head = "TouchContainer 纵向";
|
|
69
|
-
this.metroVerticalVisible = false;
|
|
70
|
-
this.metroHorizontalVisible = false;
|
|
71
|
-
this.touchContainerHorizontalVisible = false;
|
|
72
|
-
this.touchContainerVerticalVisible = true;
|
|
73
|
-
break;
|
|
74
|
-
default:
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
return true;
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
mounted() {
|
|
81
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
</script>
|
|
85
|
-
|
|
86
|
-
<template>
|
|
87
|
-
<div
|
|
88
|
-
:style="{
|
|
89
|
-
width: 1280,
|
|
90
|
-
height: 720 * 2,
|
|
91
|
-
backgroundColor: '#1b2697',
|
|
92
|
-
}"
|
|
93
|
-
>
|
|
94
|
-
<jsv-touch-container
|
|
95
|
-
v-for="(title, index) of tabList"
|
|
96
|
-
:key="'tab' + index"
|
|
97
|
-
:style="{
|
|
98
|
-
left: 50 + 300 * index,
|
|
99
|
-
top: 10,
|
|
100
|
-
width: 280,
|
|
101
|
-
height: 50,
|
|
102
|
-
backgroundColor: '#ff0000',
|
|
103
|
-
fontSize: 18,
|
|
104
|
-
lineHeight: 50,
|
|
105
|
-
}"
|
|
106
|
-
:onClick="
|
|
107
|
-
() => {
|
|
108
|
-
return this._onClick(index);
|
|
109
|
-
}
|
|
110
|
-
"
|
|
111
|
-
:direction="DIRECTION_DISABLE"
|
|
112
|
-
>
|
|
113
|
-
{{ title }}
|
|
114
|
-
</jsv-touch-container>
|
|
115
|
-
|
|
116
|
-
<div
|
|
117
|
-
:style="{
|
|
118
|
-
left: 30,
|
|
119
|
-
top: 60,
|
|
120
|
-
width: 400,
|
|
121
|
-
height: 50,
|
|
122
|
-
fontSize: 30,
|
|
123
|
-
lineHeight: 50,
|
|
124
|
-
color: '#f0ef29',
|
|
125
|
-
}"
|
|
126
|
-
>
|
|
127
|
-
{{ head }}
|
|
128
|
-
</div>
|
|
129
|
-
<div :style="{ left: 30, top: 120 }">
|
|
130
|
-
<metro-widget-horizontal v-if="metroHorizontalVisible" />
|
|
131
|
-
<metro-widget-vertical v-if="metroVerticalVisible" />
|
|
132
|
-
<touch-container-horizontal v-if="touchContainerHorizontalVisible" />
|
|
133
|
-
<touch-container-vertical v-if="touchContainerVerticalVisible" />
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</template>
|
package/TouchSample/Item.vue
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-04-10 21:21:43
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-04-10 21:21:44
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
function randomColor() {
|
|
10
|
-
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
11
|
-
return (
|
|
12
|
-
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
export default {
|
|
16
|
-
props: {
|
|
17
|
-
data: Object,
|
|
18
|
-
query: Object,
|
|
19
|
-
onEdge: Function,
|
|
20
|
-
onAction: Object,
|
|
21
|
-
test: Object,
|
|
22
|
-
},
|
|
23
|
-
data() {
|
|
24
|
-
return {
|
|
25
|
-
focused: false,
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
setup() {
|
|
29
|
-
return {
|
|
30
|
-
randomColor,
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
computed: {
|
|
34
|
-
style() {
|
|
35
|
-
return {
|
|
36
|
-
width: this.data.width,
|
|
37
|
-
height: this.data.height,
|
|
38
|
-
color: "#FFFFFF",
|
|
39
|
-
backgroundColor: this.focused ? "#FF0000" : this.data.color,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
methods: {
|
|
44
|
-
onFocus() {
|
|
45
|
-
this.focused = true;
|
|
46
|
-
console.log("cchtest item onfocus", this.data);
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
onBlur() {
|
|
50
|
-
this.focused = false;
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
onClick() {
|
|
54
|
-
console.log(`item ${this.query.id} clicked`);
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
created() {
|
|
58
|
-
// console.log("cchtest item created", this.data.content)
|
|
59
|
-
this.onAction.register("onFocus", this.onFocus);
|
|
60
|
-
this.onAction.register("onBlur", this.onBlur);
|
|
61
|
-
this.onAction.register("onClick", this.onClick);
|
|
62
|
-
},
|
|
63
|
-
mounted() {
|
|
64
|
-
// console.log("cchtest item mounted", this.data.content)
|
|
65
|
-
},
|
|
66
|
-
beforeUnmount() {
|
|
67
|
-
// console.log("cchtest item unmount", this.data.content)
|
|
68
|
-
},
|
|
69
|
-
updated() {
|
|
70
|
-
// console.log("cchtest item update", this.data.content)
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
</script>
|
|
74
|
-
|
|
75
|
-
<template>
|
|
76
|
-
<div ref="element" :class="focused ? 'focus' : 'blur'" :style="style">
|
|
77
|
-
{{ data.content }}
|
|
78
|
-
</div>
|
|
79
|
-
<div
|
|
80
|
-
:style="{
|
|
81
|
-
left: data.width / 2,
|
|
82
|
-
top: data.height / 2,
|
|
83
|
-
width: 10,
|
|
84
|
-
height: 10,
|
|
85
|
-
backgroundColor: focused ? '#000000' : '#FF0000',
|
|
86
|
-
}"
|
|
87
|
-
/>
|
|
88
|
-
</template>
|
|
89
|
-
|
|
90
|
-
<style scoped>
|
|
91
|
-
.focus {
|
|
92
|
-
transform: scale3d(1, 1, 1);
|
|
93
|
-
transition: transform 0.25s linear;
|
|
94
|
-
font-size: 30;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.blur {
|
|
98
|
-
transform: scale3d(1, 1, 1);
|
|
99
|
-
transition: transform 0.25s linear;
|
|
100
|
-
font-size: 30;
|
|
101
|
-
}
|
|
102
|
-
</style>
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
3
|
-
HORIZONTAL,
|
|
4
|
-
MetroWidget,
|
|
5
|
-
WholePageSlide,
|
|
6
|
-
SeamlessSlide,
|
|
7
|
-
FixPositionSlide,
|
|
8
|
-
} from "jsview";
|
|
9
|
-
|
|
10
|
-
import Item from "./Item.vue";
|
|
11
|
-
|
|
12
|
-
import { metroWidgetH, measures } from "./data.js";
|
|
13
|
-
import { ref } from "vue";
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
components: {
|
|
17
|
-
MetroWidget,
|
|
18
|
-
Item,
|
|
19
|
-
},
|
|
20
|
-
setup() {
|
|
21
|
-
return {
|
|
22
|
-
measures,
|
|
23
|
-
name: "/metroWidgetH",
|
|
24
|
-
direction: HORIZONTAL,
|
|
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: 100,
|
|
39
|
-
CONST_ITEM_HEIGHT: 200,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
methods: {
|
|
43
|
-
_provideData() {
|
|
44
|
-
return metroWidgetH;
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
mounted() {},
|
|
49
|
-
};
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<template>
|
|
53
|
-
<div class="rootSize">
|
|
54
|
-
<div :style="{ width: 1280, height: 720, left: 50 }">
|
|
55
|
-
<div
|
|
56
|
-
:style="{
|
|
57
|
-
top: 0,
|
|
58
|
-
width: 200,
|
|
59
|
-
height: 40,
|
|
60
|
-
fontSize: 25,
|
|
61
|
-
lineHeight: 40,
|
|
62
|
-
color: '#fff753',
|
|
63
|
-
}"
|
|
64
|
-
>
|
|
65
|
-
整页滑动
|
|
66
|
-
</div>
|
|
67
|
-
<div
|
|
68
|
-
:style="{
|
|
69
|
-
top: 50,
|
|
70
|
-
width: CONST_ITEM_WIDTH * 10 + 20,
|
|
71
|
-
height: CONST_ITEM_HEIGHT + 20,
|
|
72
|
-
backgroundColor: '#ff0000',
|
|
73
|
-
}"
|
|
74
|
-
>
|
|
75
|
-
<metro-widget
|
|
76
|
-
name="simpleWidgetHorizontal1"
|
|
77
|
-
:width="CONST_ITEM_WIDTH * 10 + 20"
|
|
78
|
-
:height="CONST_ITEM_HEIGHT + 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_WIDTH * 10"
|
|
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
|
-
top: CONST_ITEM_HEIGHT + 100,
|
|
98
|
-
width: 200,
|
|
99
|
-
height: 40,
|
|
100
|
-
fontSize: 25,
|
|
101
|
-
lineHeight: 40,
|
|
102
|
-
color: '#fff753',
|
|
103
|
-
}"
|
|
104
|
-
>
|
|
105
|
-
普通滑动
|
|
106
|
-
</div>
|
|
107
|
-
<div
|
|
108
|
-
:style="{
|
|
109
|
-
top: CONST_ITEM_HEIGHT + 100 + 50,
|
|
110
|
-
width: CONST_ITEM_WIDTH * 10 + 20,
|
|
111
|
-
height: CONST_ITEM_HEIGHT + 20,
|
|
112
|
-
backgroundColor: '#ff0000',
|
|
113
|
-
}"
|
|
114
|
-
>
|
|
115
|
-
<metro-widget
|
|
116
|
-
name="simpleWidgetHorizontal2"
|
|
117
|
-
:width="CONST_ITEM_WIDTH * 10 + 20"
|
|
118
|
-
:height="CONST_ITEM_HEIGHT + 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>
|