@shijiu/jsview-vue-samples 2.2.201 → 2.2.426-test.0
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/Basic/components/text/TextDirection.vue +0 -1
- package/ColorSpace/App.vue +2 -2
- package/CoupletsTest/widget/Banger/Maroon.vue +0 -1
- package/CoupletsTest/widget/Fireworks/Fireworks.vue +0 -2
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +0 -1
- package/CssPreprocessor/utils/ContentBlock.vue +3 -3
- package/CssPreprocessor/utils/{FontStyle.css → FontConfig.css} +3 -3
- package/CssPreprocessor/utils/TitleBar.vue +2 -2
- package/CustomShader/App.vue +32 -15
- 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/DemoHomepage/views/Homepage.vue +0 -4
- package/DispersedFocusControl/App.vue +67 -0
- package/DispersedFocusControl/Button.vue +76 -0
- package/DispersedFocusControl/data.js +44 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -1
- package/DragBox/App.vue +148 -0
- package/FlexCellDemo/App.vue +47 -223
- package/FlexCellDemo/TestFrame1.vue +84 -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/GiftRain/App.vue +0 -3
- package/HashHistory/App.vue +8 -4
- package/HashParams/App.vue +0 -1
- package/Input/App.vue +184 -97
- package/Input/InputPanel.vue +98 -82
- package/JsvPreDownloader/App.vue +0 -2
- package/LatexFormula/App.vue +97 -10
- package/Marquee/App.vue +2 -2
- package/MetroWidgetDemos/MassiveItems/ContentItem.vue +0 -1
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +0 -1
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +18 -17
- 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/ScaleDownNeon/App.vue +13 -10
- package/SceneTransition/App.vue +5 -4
- 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 +237 -151
- package/TextureAnimation/App2.vue +66 -14
- package/TextureAnimation/assets/blackWhiteTurntable.png +0 -0
- package/TextureAnimation/assets/circleHaloMask.png +0 -0
- package/TextureSize/App.vue +5 -6
- package/TouchWidget/App.vue +79 -40
- package/TouchWidget/Item.vue +15 -3
- package/ViewOpacity/App.vue +4 -5
- 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
|
@@ -12,7 +12,7 @@ const props = defineProps({
|
|
|
12
12
|
name: String,
|
|
13
13
|
onEdgeDown: Function,
|
|
14
14
|
onItemFocus: Function,
|
|
15
|
-
})
|
|
15
|
+
});
|
|
16
16
|
|
|
17
17
|
let activeId = shallowRef(0);
|
|
18
18
|
let focused = shallowRef(false);
|
|
@@ -25,7 +25,7 @@ const tab1Class = computed(() => {
|
|
|
25
25
|
} else {
|
|
26
26
|
return "text-normal item-normal";
|
|
27
27
|
}
|
|
28
|
-
})
|
|
28
|
+
});
|
|
29
29
|
const tab2Class = computed(() => {
|
|
30
30
|
if (activeId.value == 1) {
|
|
31
31
|
return focused.value
|
|
@@ -34,7 +34,7 @@ const tab2Class = computed(() => {
|
|
|
34
34
|
} else {
|
|
35
35
|
return "text-normal item-normal";
|
|
36
36
|
}
|
|
37
|
-
})
|
|
37
|
+
});
|
|
38
38
|
const tab3Class = computed(() => {
|
|
39
39
|
if (activeId.value == 2) {
|
|
40
40
|
return focused.value
|
|
@@ -43,8 +43,7 @@ const tab3Class = computed(() => {
|
|
|
43
43
|
} else {
|
|
44
44
|
return "text-normal item-normal";
|
|
45
45
|
}
|
|
46
|
-
})
|
|
47
|
-
|
|
46
|
+
});
|
|
48
47
|
|
|
49
48
|
const onKeyDown = (ev) => {
|
|
50
49
|
switch (ev.keyCode) {
|
|
@@ -54,35 +53,37 @@ const onKeyDown = (ev) => {
|
|
|
54
53
|
activeId.value = 2;
|
|
55
54
|
}
|
|
56
55
|
props.onItemFocus(activeId.value);
|
|
57
|
-
|
|
56
|
+
return true;
|
|
58
57
|
case 39:
|
|
59
58
|
activeId.value++;
|
|
60
59
|
if (activeId.value > 2) {
|
|
61
60
|
activeId.value = 0;
|
|
62
61
|
}
|
|
63
62
|
props.onItemFocus(activeId.value);
|
|
64
|
-
|
|
63
|
+
return true;
|
|
65
64
|
case 40:
|
|
66
65
|
props.onEdgeDown();
|
|
67
|
-
|
|
66
|
+
return true;
|
|
68
67
|
}
|
|
69
|
-
}
|
|
68
|
+
};
|
|
70
69
|
const onFocus = () => {
|
|
71
70
|
focused.value = true;
|
|
72
|
-
}
|
|
71
|
+
};
|
|
73
72
|
const onBlur = () => {
|
|
74
73
|
focused.value = false;
|
|
75
|
-
}
|
|
74
|
+
};
|
|
76
75
|
const actionDefines = {
|
|
77
76
|
onBlur,
|
|
78
77
|
onFocus,
|
|
79
|
-
onKeyDown
|
|
80
|
-
}
|
|
81
|
-
|
|
78
|
+
onKeyDown,
|
|
79
|
+
};
|
|
82
80
|
</script>
|
|
83
81
|
|
|
84
82
|
<template>
|
|
85
|
-
<jsv-focus-block
|
|
83
|
+
<jsv-focus-block
|
|
84
|
+
:name="props.name"
|
|
85
|
+
:onAction="actionDefines"
|
|
86
|
+
></jsv-focus-block>
|
|
86
87
|
<div :class="tab1Class">Tab1</div>
|
|
87
88
|
<div :class="tab2Class" :style="{ left: 220 }">Tab2</div>
|
|
88
89
|
<div :class="tab3Class" :style="{ left: 440 }">Tab3</div>
|
|
@@ -115,6 +116,6 @@ const actionDefines = {
|
|
|
115
116
|
.item-normal {
|
|
116
117
|
width: 200;
|
|
117
118
|
height: 50;
|
|
118
|
-
background-color: #
|
|
119
|
+
background-color: #87cecb;
|
|
119
120
|
}
|
|
120
|
-
</style>
|
|
121
|
+
</style>
|
|
@@ -7,95 +7,95 @@ export default [
|
|
|
7
7
|
{
|
|
8
8
|
name: "基础示例",
|
|
9
9
|
path: "/metroWidget/basic",
|
|
10
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/basic/App.vue"),
|
|
10
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/basic/App.vue"),
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
name: "direction",
|
|
14
14
|
path: "/metroWidget/direction",
|
|
15
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/direction/App.vue"),
|
|
15
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/direction/App.vue"),
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
name: "padding",
|
|
19
19
|
path: "/metroWidget/padding",
|
|
20
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/padding/App.vue"),
|
|
20
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/padding/App.vue"),
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
name: "slideSetting",
|
|
24
24
|
path: "/metroWidget/slideSetting",
|
|
25
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/slideSetting/App.vue"),
|
|
25
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/slideSetting/App.vue"),
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
name: "layoutType",
|
|
29
29
|
path: "/metroWidget/layoutType",
|
|
30
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/layoutType/App.vue"),
|
|
30
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/layoutType/App.vue"),
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
name: "嵌套(基础)",
|
|
34
34
|
path: "/metroWidget/focusableItemBasic",
|
|
35
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/focusableItemBasic/App.vue"),
|
|
35
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/focusableItemBasic/App.vue"),
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
name: "嵌套(混合)",
|
|
39
39
|
path: "/metroWidget/focusableItemMix",
|
|
40
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/focusableItemMix/App.vue"),
|
|
40
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/focusableItemMix/App.vue"),
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
name: "嵌套(MetroWidget)",
|
|
44
44
|
path: "/metroWidget/focusableItemMetroWidget",
|
|
45
|
-
component: () => import("jsview-vue-samples/MetroWidgetDemos/focusableItemMetroWidget/App.vue"),
|
|
45
|
+
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/focusableItemMetroWidget/App.vue"),
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
name: "乒乓模式",
|
|
49
49
|
path: "/metroWidget/PingPong",
|
|
50
50
|
component: () =>
|
|
51
|
-
import("jsview-vue-samples/MetroWidgetDemos/PingPong/App.vue"),
|
|
51
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/PingPong/App.vue"),
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
name: "性能测试",
|
|
55
55
|
path: "/metroWidget/PerformanceTest",
|
|
56
56
|
component: () =>
|
|
57
|
-
import("jsview-vue-samples/MetroWidgetDemos/PerformanceTest/App.vue"),
|
|
57
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/PerformanceTest/App.vue"),
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
name: "骨架图",
|
|
61
61
|
path: "/metroWidget/SkeletonDiagram",
|
|
62
62
|
component: () =>
|
|
63
|
-
import("jsview-vue-samples/MetroWidgetDemos/SkeletonDiagram/App.vue"),
|
|
63
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/SkeletonDiagram/App.vue"),
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
name: ".9焦点页面",
|
|
67
67
|
path: "/metroWidget/ninePatchFocusPage",
|
|
68
68
|
component: () =>
|
|
69
|
-
import("jsview-vue-samples/MetroWidgetDemos/ninePatchFocusPage/App.vue"),
|
|
69
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/ninePatchFocusPage/App.vue"),
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
name: "item尺寸更新",
|
|
73
73
|
path: "/metroWidget/itemSizeUpdate",
|
|
74
74
|
component: () =>
|
|
75
|
-
import("jsview-vue-samples/MetroWidgetDemos/itemSizeUpdate/App.vue"),
|
|
75
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/itemSizeUpdate/App.vue"),
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
name: "三层嵌套",
|
|
79
79
|
path: "/metroWidget/TripleWidget",
|
|
80
80
|
component: () =>
|
|
81
|
-
import("jsview-vue-samples/MetroWidgetDemos/TripleWidget/App.vue"),
|
|
81
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/TripleWidget/App.vue"),
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
name: "数据刷新demo",
|
|
85
85
|
path: "/metroWidget/RefreshDemo",
|
|
86
86
|
component: () =>
|
|
87
|
-
import("jsview-vue-samples/MetroWidgetDemos/RefreshDemo/App.vue"),
|
|
87
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/RefreshDemo/App.vue"),
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
name: "剧集翻页",
|
|
91
91
|
path: "/metroWidget/SeamlessSlide",
|
|
92
92
|
component: () =>
|
|
93
|
-
import("jsview-vue-samples/MetroWidgetDemos/SeamlessSlide/App.vue"),
|
|
93
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/SeamlessSlide/App.vue"),
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
name: "多item分段显示",
|
|
97
97
|
path: "/metroWidget/MassiveItems",
|
|
98
98
|
component: () =>
|
|
99
|
-
import("jsview-vue-samples/MetroWidgetDemos/MassiveItems/App.vue"),
|
|
99
|
+
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/MassiveItems/App.vue"),
|
|
100
100
|
},
|
|
101
101
|
]
|
package/MindMap/App.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { onMounted } from "vue"
|
|
2
|
+
import { onMounted, shallowRef } from "vue"
|
|
3
3
|
import { JsvMindMap, useFocusHub } from "jsview";
|
|
4
4
|
import Item from "./Item.vue";
|
|
5
5
|
import { data } from "./data"
|
|
@@ -9,6 +9,7 @@ const provideData = () => {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const focusHub = useFocusHub();
|
|
12
|
+
const widgetRef = shallowRef();
|
|
12
13
|
|
|
13
14
|
const lineColor = {
|
|
14
15
|
0: "#ff0000",
|
|
@@ -31,20 +32,27 @@ const formatNode = (item, depth) => {
|
|
|
31
32
|
backgroundColor: lineColor[depth],
|
|
32
33
|
lineWidth: 3,
|
|
33
34
|
},
|
|
35
|
+
enableTap: true,
|
|
34
36
|
};
|
|
35
37
|
};
|
|
36
38
|
const onEdge = (info) => {
|
|
37
39
|
console.log("onEdge ", info);
|
|
38
40
|
};
|
|
39
41
|
|
|
42
|
+
function onMove(pos) {
|
|
43
|
+
console.log("onMove", pos)
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
const componentName = "mindMapDemo";
|
|
41
47
|
onMounted(() => {
|
|
42
48
|
focusHub.setFocus(componentName);
|
|
49
|
+
widgetRef.value?.setSensor(onMove)
|
|
43
50
|
})
|
|
44
51
|
</script>
|
|
45
52
|
|
|
46
53
|
<template>
|
|
47
54
|
<jsv-mind-map
|
|
55
|
+
ref="widgetRef"
|
|
48
56
|
:name="componentName"
|
|
49
57
|
:left="200"
|
|
50
58
|
:top="100"
|
|
@@ -53,6 +61,7 @@ onMounted(() => {
|
|
|
53
61
|
:formatNode="formatNode"
|
|
54
62
|
:provideData="provideData"
|
|
55
63
|
:onEdge="onEdge"
|
|
64
|
+
:touchFlag="1"
|
|
56
65
|
>
|
|
57
66
|
<template v-slot="{ data, onAction, handler }">
|
|
58
67
|
<item :data="data" :onAction="onAction" :handler="handler"></item>
|
package/MindMap/data.js
CHANGED
|
@@ -8,6 +8,7 @@ const n = (left, top) => {
|
|
|
8
8
|
id: id++,
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
+
|
|
11
12
|
export const data = {
|
|
12
13
|
...n(400, 500),
|
|
13
14
|
moveType: "star",
|
|
@@ -57,16 +58,22 @@ export const data = {
|
|
|
57
58
|
...n(600, 400),
|
|
58
59
|
children: [
|
|
59
60
|
{
|
|
60
|
-
...n(700, 400)
|
|
61
|
+
...n(700, 400),
|
|
62
|
+
children: [
|
|
63
|
+
{
|
|
64
|
+
...n(800, 400),
|
|
65
|
+
children: [
|
|
66
|
+
{
|
|
67
|
+
...n(900, 400)
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
61
72
|
}
|
|
62
73
|
]
|
|
63
74
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
...n(600, 600)
|
|
69
|
-
},
|
|
75
|
+
n(600, 500),
|
|
76
|
+
n(600, 600),
|
|
70
77
|
]
|
|
71
78
|
},
|
|
72
79
|
{
|
|
@@ -83,4 +90,23 @@ export const data = {
|
|
|
83
90
|
]
|
|
84
91
|
},
|
|
85
92
|
]
|
|
86
|
-
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// export const data = {
|
|
96
|
+
// ...n(100, 100),
|
|
97
|
+
// moveType: "star",
|
|
98
|
+
// children: [
|
|
99
|
+
// {
|
|
100
|
+
// ...n(0, 100),
|
|
101
|
+
// },
|
|
102
|
+
// {
|
|
103
|
+
// ...n(100, 0),
|
|
104
|
+
// },
|
|
105
|
+
// {
|
|
106
|
+
// ...n(200, 100),
|
|
107
|
+
// },
|
|
108
|
+
// {
|
|
109
|
+
// ...n(100, 200),
|
|
110
|
+
// },
|
|
111
|
+
// ]
|
|
112
|
+
// }
|
|
@@ -16,10 +16,6 @@ export default {
|
|
|
16
16
|
cookies: {
|
|
17
17
|
domain: '' // 当非null非空时,激活cookie功能,使ajax请求时自动带上cookies,并且document.cookie的get/set可用
|
|
18
18
|
},
|
|
19
|
-
|
|
20
|
-
// (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,
|
|
21
|
-
// 用于image/import.then的相对寻址, vue3默认值是/js/
|
|
22
|
-
jsSubPath: '/js/'
|
|
23
19
|
},
|
|
24
20
|
|
|
25
21
|
vendorConfig: {
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted, onUnmounted, ref, computed, shallowRef } from "vue";
|
|
3
|
+
import Vortex from "./tools/vortexPacker/Vortex.vue";
|
|
4
|
+
import Genie from "./tools/geniePakcer/Genie.vue";
|
|
5
|
+
import particlePacker from "./tools/particlePacker/Particle.vue";
|
|
6
|
+
import orange from "./images/orange.png";
|
|
7
|
+
import pink from "./images/pink.png";
|
|
8
|
+
import red from "./images/red.png";
|
|
9
|
+
import yellowGreen from "./images/yellowGreen.png";
|
|
10
|
+
import blue from "./images/blue.png";
|
|
11
|
+
import darkGreen from "./images/darkGreen.png";
|
|
12
|
+
import purple from "./images/purple.png";
|
|
13
|
+
//particle特效图片素材
|
|
14
|
+
const ImgData = [orange, pink, red, yellowGreen, blue, darkGreen, purple];
|
|
15
|
+
|
|
16
|
+
const ImageChinChilla =
|
|
17
|
+
"https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg";
|
|
18
|
+
const ImageLandscape = "https://oss.image.qcast.cn/ai-draw/landscape.jpeg";
|
|
19
|
+
const ImageOwl = "https://oss.image.qcast.cn/ai-draw/owl.jpeg";
|
|
20
|
+
//旋涡子组件的引用
|
|
21
|
+
const cChildRef1 = ref(null);
|
|
22
|
+
//genie子组件的引用
|
|
23
|
+
const cChildRef2 = ref(null);
|
|
24
|
+
const cShaderSettings = [
|
|
25
|
+
{
|
|
26
|
+
name: "vortex",
|
|
27
|
+
text: "左右键切换效果,【OK】键随机焦点开始",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "genie",
|
|
31
|
+
text: "【OK】键进行收或放。上下键切换样例点",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "particle",
|
|
35
|
+
text: "左右键切换效果 遮罩粒子组件",
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const rKeyCount = ref(2);
|
|
40
|
+
const rShaderInfo = computed(() => {
|
|
41
|
+
return cShaderSettings[rKeyCount.value];
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//genie组件测试数组(14个)
|
|
45
|
+
//index
|
|
46
|
+
let rPositionIndex = shallowRef(0);
|
|
47
|
+
//key值
|
|
48
|
+
let rKey = shallowRef(1);
|
|
49
|
+
//数组
|
|
50
|
+
const cPositionArray = [
|
|
51
|
+
{ x: -80, y: -60, direction: "horizontal" }, //左上横向
|
|
52
|
+
{ x: -80, y: -60, direction: "vertical" }, //左上纵向
|
|
53
|
+
{ x: 280, y: -60, direction: "vertical" }, //正上
|
|
54
|
+
{ x: 1080, y: -60, direction: "horizontal" }, //右上横向
|
|
55
|
+
{ x: 1080, y: -60, direction: "vertical" }, //右上纵向
|
|
56
|
+
{ x: -80, y: 270, direction: "horizontal" }, //正左
|
|
57
|
+
{ x: 1080, y: 270, direction: "horizontal" }, //正右
|
|
58
|
+
{ x: -80, y: 600, direction: "horizontal" }, //左下横向
|
|
59
|
+
{ x: -80, y: 600, direction: "vertical" }, //左下纵向
|
|
60
|
+
{ x: 280, y: 600, direction: "vertical" }, //正下
|
|
61
|
+
{ x: 1080, y: 600, direction: "horizontal" }, //右下横向
|
|
62
|
+
{ x: 1080, y: 600, direction: "vertical" }, //右下纵向
|
|
63
|
+
{ x: 200, y: 200, direction: "vertical" }, //内部纵向
|
|
64
|
+
{ x: 700, y: 500, direction: "horizontal" }, //内部横向
|
|
65
|
+
];
|
|
66
|
+
const onKeyDown = (ev) => {
|
|
67
|
+
switch (ev.keyCode) {
|
|
68
|
+
case 37: {
|
|
69
|
+
rKeyCount.value =
|
|
70
|
+
rKeyCount.value > 1 ? rKeyCount.value - 1 : rKeyCount.value;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
case 39: {
|
|
74
|
+
rKeyCount.value =
|
|
75
|
+
rKeyCount.value < cShaderSettings.length - 1
|
|
76
|
+
? rKeyCount.value + 1
|
|
77
|
+
: rKeyCount.value;
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
case 13: {
|
|
81
|
+
if (rKeyCount.value == 0) {
|
|
82
|
+
cChildRef1.value.getRandomDecimal();
|
|
83
|
+
} else {
|
|
84
|
+
cChildRef2.value.switcher();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
case 38: {
|
|
90
|
+
if (rKeyCount.value == 1) {
|
|
91
|
+
rPositionIndex.value =
|
|
92
|
+
rPositionIndex.value == 0 ? 0 : (rPositionIndex.value -= 1);
|
|
93
|
+
rKey.value += 1;
|
|
94
|
+
console.log(rPositionIndex.value);
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
case 40: {
|
|
99
|
+
if (rKeyCount.value == 1) {
|
|
100
|
+
rPositionIndex.value =
|
|
101
|
+
rPositionIndex.value == cPositionArray.length - 1
|
|
102
|
+
? cPositionArray.length - 1
|
|
103
|
+
: (rPositionIndex.value += 1);
|
|
104
|
+
rKey.value += 1;
|
|
105
|
+
console.log(rPositionIndex.value);
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
default:
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const myEnd = () => {
|
|
114
|
+
console.log("动画结束");
|
|
115
|
+
};
|
|
116
|
+
onMounted(() => {
|
|
117
|
+
window.JsvCoreApi.enableFpsDisplay(true);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
onUnmounted(() => {
|
|
121
|
+
window.JsvCoreApi.enableFpsDisplay(false);
|
|
122
|
+
});
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<template>
|
|
126
|
+
<jsv-focus-block
|
|
127
|
+
autoFocus
|
|
128
|
+
:onAction="{
|
|
129
|
+
onKeyDown,
|
|
130
|
+
}"
|
|
131
|
+
:style="{
|
|
132
|
+
width: 1280,
|
|
133
|
+
height: 720,
|
|
134
|
+
backgroundImage: `url(${ImageChinChilla})`,
|
|
135
|
+
}"
|
|
136
|
+
></jsv-focus-block>
|
|
137
|
+
<Vortex
|
|
138
|
+
v-if="rKeyCount == 0"
|
|
139
|
+
ref="cChildRef1"
|
|
140
|
+
:width="640"
|
|
141
|
+
:height="360"
|
|
142
|
+
></Vortex>
|
|
143
|
+
<Genie
|
|
144
|
+
:key="rKey"
|
|
145
|
+
v-else-if="rKeyCount == 1"
|
|
146
|
+
ref="cChildRef2"
|
|
147
|
+
:width="1024"
|
|
148
|
+
:height="576"
|
|
149
|
+
:left="128"
|
|
150
|
+
:top="72"
|
|
151
|
+
:direction="cPositionArray[rPositionIndex].direction"
|
|
152
|
+
:position="cPositionArray[rPositionIndex]"
|
|
153
|
+
:time="1"
|
|
154
|
+
:imgUrl="ImageLandscape"
|
|
155
|
+
:aniEnd="myEnd"
|
|
156
|
+
:initShow="true"
|
|
157
|
+
></Genie>
|
|
158
|
+
<div v-else>
|
|
159
|
+
<div
|
|
160
|
+
:style="{
|
|
161
|
+
width: 600,
|
|
162
|
+
height: 300,
|
|
163
|
+
top: 210,
|
|
164
|
+
left: 340,
|
|
165
|
+
backgroundImage: ImageOwl,
|
|
166
|
+
}"
|
|
167
|
+
></div>
|
|
168
|
+
<particlePacker
|
|
169
|
+
:style="{
|
|
170
|
+
width: 600,
|
|
171
|
+
height: 300,
|
|
172
|
+
top: 210,
|
|
173
|
+
left: 340,
|
|
174
|
+
}"
|
|
175
|
+
:imgArray="ImgData"
|
|
176
|
+
>
|
|
177
|
+
</particlePacker>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div
|
|
181
|
+
:key="rKeyCount"
|
|
182
|
+
:style="{
|
|
183
|
+
top: 100,
|
|
184
|
+
left: 20,
|
|
185
|
+
width: 560,
|
|
186
|
+
height: 50,
|
|
187
|
+
fontSize: 30,
|
|
188
|
+
backgroundColor: '#00000055',
|
|
189
|
+
color: '#ffffff',
|
|
190
|
+
}"
|
|
191
|
+
>
|
|
192
|
+
{{ `${rShaderInfo.name}(${rPositionIndex})` }}
|
|
193
|
+
</div>
|
|
194
|
+
<div
|
|
195
|
+
:style="{
|
|
196
|
+
top: 150,
|
|
197
|
+
left: 20,
|
|
198
|
+
width: 560,
|
|
199
|
+
height: 50,
|
|
200
|
+
fontSize: 30,
|
|
201
|
+
backgroundColor: '#00000055',
|
|
202
|
+
color: '#ffffff',
|
|
203
|
+
}"
|
|
204
|
+
>
|
|
205
|
+
{{ rShaderInfo.text }}
|
|
206
|
+
</div>
|
|
207
|
+
</template>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|