@shijiu/jsview-vue-samples 2.2.128 → 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 +4 -7
- package/CoupletsTest/widget/Fireworks/Fireworks.vue +52 -44
- package/CustomShader/App.vue +174 -0
- package/CustomShader/gaussianBlur.glsl +27 -0
- package/CustomShader/pageFlip.glsl +41 -0
- package/CustomShader/sdf.glsl +22 -0
- package/CustomShader/test.glsl +8 -0
- package/CustomShader/vortex.glsl +38 -0
- package/DemoHomepage/App.vue +50 -32
- package/DemoHomepage/components/Item.vue +23 -12
- package/DemoHomepage/index.d.ts +5 -2
- package/DemoHomepage/router.js +105 -72
- 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/DriftScopeTest/App.vue +128 -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/FreeMove/App.vue +62 -64
- package/FreeMoveLink/App.vue +2 -2
- 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/ImpactStop/App.vue +45 -45
- package/Input/App.vue +184 -97
- package/Input/InputPanel.vue +98 -82
- package/LatexFormula/App.vue +97 -10
- package/LongImage/App.vue +1 -2
- package/LongText/App.vue +2 -2
- package/LongText/LongTextScroll.vue +22 -22
- package/LongText/Scroll.vue +28 -9
- package/MetroWidgetDemos/RefreshDemo/App.vue +172 -56
- package/MetroWidgetDemos/RefreshDemo/ControlItem.vue +45 -0
- package/MetroWidgetDemos/RefreshDemo/Item.vue +20 -4
- 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/SceneTransition/JsvSceneTransition.vue +30 -42
- package/ScrollBoxTest/App.vue +35 -86
- package/ScrollBoxTest/ClipBar.vue +154 -0
- package/ScrollBoxTest/DrawCircle.ts +25 -0
- package/ScrollBoxTest/NinePatchBar.vue +188 -0
- package/ScrollBoxTest/NoBackgroundBar.vue +125 -0
- package/ScrollBoxTest/SizeDivBar.vue +139 -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/TombSweepingDayTest/Raining/Rain.vue +8 -8
- package/TouchWidget/App.vue +79 -40
- package/TouchWidget/Item.vue +15 -3
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/MetroWidgetDemos/RefreshDemo/data.js +0 -16
- 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/DemoHomepage/App.vue
CHANGED
|
@@ -6,16 +6,24 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script setup>
|
|
9
|
-
import { shallowRef, onMounted, onUnmounted } from "vue";
|
|
10
|
-
import {
|
|
9
|
+
import { shallowRef, onMounted, onUnmounted, provide } from "vue";
|
|
10
|
+
import {
|
|
11
|
+
JsvPreload,
|
|
12
|
+
buildPreloadInfo,
|
|
13
|
+
jJsvRuntimeBridge,
|
|
14
|
+
JsvFocusBlock,
|
|
15
|
+
useFocusHub,
|
|
16
|
+
JsvTouchModeSwitcher,
|
|
17
|
+
} from "jsview";
|
|
11
18
|
import { useRouter } from "vue-router";
|
|
12
|
-
import { setDataUrl, getDataUrl } from "../CommonUtils/ResourceData.js"
|
|
13
|
-
import { getSearchQuery } from "../CommonUtils/getSearchQuery.js"
|
|
19
|
+
import { setDataUrl, getDataUrl } from "../CommonUtils/ResourceData.js";
|
|
20
|
+
import { getSearchQuery } from "../CommonUtils/getSearchQuery.js";
|
|
14
21
|
|
|
15
|
-
let DemoResourceBase=shallowRef("")
|
|
22
|
+
let DemoResourceBase = shallowRef("");
|
|
16
23
|
let backgroundImageUrl = shallowRef(null);
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
const touchModeSwitcherRef = shallowRef();
|
|
25
|
+
provide("touchModeSwitcherRef", touchModeSwitcherRef);
|
|
26
|
+
// let preloadInfo = shallowRef([]);
|
|
19
27
|
|
|
20
28
|
window.DebugFocusHub = useFocusHub();
|
|
21
29
|
|
|
@@ -41,52 +49,63 @@ let testKeepAliveModeText = shallowRef(1);
|
|
|
41
49
|
let testKeepAliveTimer = -1;
|
|
42
50
|
|
|
43
51
|
//解析url
|
|
44
|
-
let query = getSearchQuery(window.location.href, undefined, 0)
|
|
52
|
+
let query = getSearchQuery(window.location.href, undefined, 0);
|
|
45
53
|
if (query.DemoResourceBase) {
|
|
46
|
-
setDataUrl(query.DemoResourceBase)
|
|
54
|
+
setDataUrl(query.DemoResourceBase);
|
|
47
55
|
//无网络环境下使用
|
|
48
|
-
DemoResourceBase.value = getDataUrl()
|
|
56
|
+
DemoResourceBase.value = getDataUrl();
|
|
49
57
|
}
|
|
50
58
|
onMounted(() => {
|
|
59
|
+
touchModeSwitcherRef.value?.registerCallback((mode) => {
|
|
60
|
+
console.log("change mode to", mode == 1 ? "key" : "touch");
|
|
61
|
+
});
|
|
51
62
|
console.log("simulate async get background url");
|
|
52
63
|
setTimeout(() => {
|
|
53
64
|
console.log("simulate background url got");
|
|
54
|
-
backgroundImageUrl.value = DemoResourceBase.value
|
|
55
|
-
|
|
56
|
-
"https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg";
|
|
57
|
-
preloadInfo.value = [buildPreloadInfo(backgroundImageUrl.value)];
|
|
65
|
+
backgroundImageUrl.value = DemoResourceBase.value
|
|
66
|
+
? `${DemoResourceBase.value}/BackgroundLongmao.jpg`
|
|
67
|
+
: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg";
|
|
68
|
+
// preloadInfo.value = [buildPreloadInfo(backgroundImageUrl.value)];
|
|
58
69
|
}, 0);
|
|
59
70
|
|
|
60
71
|
console.log("start homepage interval");
|
|
61
|
-
testKeepAliveTimer = setInterval(()=>{
|
|
72
|
+
testKeepAliveTimer = setInterval(() => {
|
|
62
73
|
testKeepAliveModeText.value++;
|
|
63
|
-
}, 1000)
|
|
74
|
+
}, 1000);
|
|
64
75
|
});
|
|
65
76
|
|
|
66
|
-
onUnmounted(()=>{
|
|
77
|
+
onUnmounted(() => {
|
|
67
78
|
if (testKeepAliveTimer > 0) {
|
|
68
79
|
console.log("remove homepage interval");
|
|
69
80
|
clearInterval(testKeepAliveTimer);
|
|
70
81
|
testKeepAliveTimer = -1;
|
|
71
82
|
}
|
|
72
|
-
})
|
|
73
|
-
|
|
83
|
+
});
|
|
74
84
|
</script>
|
|
75
85
|
|
|
76
86
|
<template>
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
<jsv-touch-mode-switcher
|
|
88
|
+
ref="touchModeSwitcherRef"
|
|
89
|
+
:width="1280"
|
|
90
|
+
:height="720"
|
|
91
|
+
>
|
|
92
|
+
<!-- <jsv-preload :key="backgroundImageUrl" :preloadList="preloadInfo" :onPreloadDone="_onPreloadDone" /> -->
|
|
93
|
+
<img
|
|
94
|
+
:src="backgroundImageUrl"
|
|
95
|
+
:style="{
|
|
96
|
+
width: 1280,
|
|
97
|
+
height: 720,
|
|
98
|
+
}"
|
|
99
|
+
@load="_onPreloadDone"
|
|
100
|
+
/>
|
|
84
101
|
<div class="TestKeepAliveDiv">
|
|
85
|
-
{{ "
|
|
102
|
+
{{ "更新页面计数:" + testKeepAliveModeText }}
|
|
86
103
|
</div>
|
|
87
|
-
<jsv-focus-block
|
|
88
|
-
|
|
89
|
-
|
|
104
|
+
<jsv-focus-block
|
|
105
|
+
:onAction="{
|
|
106
|
+
onKeyDown: _OnKeyDown,
|
|
107
|
+
}"
|
|
108
|
+
>
|
|
90
109
|
<router-view v-slot="{ Component, route }">
|
|
91
110
|
<keep-alive>
|
|
92
111
|
<component v-if="route.meta.keepAlive" :is="Component" />
|
|
@@ -94,7 +113,7 @@ onUnmounted(()=>{
|
|
|
94
113
|
<component v-if="!route.meta.keepAlive" :is="Component" />
|
|
95
114
|
</router-view>
|
|
96
115
|
</jsv-focus-block>
|
|
97
|
-
</
|
|
116
|
+
</jsv-touch-mode-switcher>
|
|
98
117
|
</template>
|
|
99
118
|
|
|
100
119
|
<style scoped>
|
|
@@ -107,5 +126,4 @@ onUnmounted(()=>{
|
|
|
107
126
|
line-height: 30;
|
|
108
127
|
color: #eb20c6;
|
|
109
128
|
}
|
|
110
|
-
|
|
111
129
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { shallowRef, computed } from "vue"
|
|
2
|
+
import { shallowRef, computed, inject } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
style: Object,
|
|
5
5
|
itemClick: Function,
|
|
@@ -7,16 +7,17 @@ const props = defineProps({
|
|
|
7
7
|
data: Object,
|
|
8
8
|
query: Object,
|
|
9
9
|
onAction: Object,
|
|
10
|
-
})
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
let focused = shallowRef(false)
|
|
12
|
+
let focused = shallowRef(false);
|
|
13
|
+
const touchModeSwitcherRef = inject("touchModeSwitcherRef");
|
|
13
14
|
|
|
14
15
|
const foucsStyle = computed(() => {
|
|
15
16
|
return {
|
|
16
17
|
width: props.style.width,
|
|
17
18
|
height: props.style.height,
|
|
18
19
|
};
|
|
19
|
-
})
|
|
20
|
+
});
|
|
20
21
|
|
|
21
22
|
const itemStyle = computed(() => {
|
|
22
23
|
return {
|
|
@@ -25,31 +26,41 @@ const itemStyle = computed(() => {
|
|
|
25
26
|
backgroundColor: props.style.backgroundColor,
|
|
26
27
|
color: props.style.color,
|
|
27
28
|
};
|
|
29
|
+
});
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
const modeChangeCallback = (mode) => {
|
|
32
|
+
if (mode == 2) {
|
|
33
|
+
focused.value = false;
|
|
34
|
+
} else {
|
|
35
|
+
focused.value = true;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
30
38
|
|
|
31
39
|
const onFocus = () => {
|
|
32
|
-
|
|
40
|
+
//为了避免每个item都注册回调, 这里onFocus时注册, onBlur时注销
|
|
41
|
+
touchModeSwitcherRef.value.registerCallback(modeChangeCallback);
|
|
42
|
+
if (touchModeSwitcherRef.value.getInteractiveMode() == 1) {
|
|
43
|
+
focused.value = true;
|
|
44
|
+
}
|
|
33
45
|
if (props.itemFocus) {
|
|
34
46
|
props.itemFocus(props.data);
|
|
35
47
|
}
|
|
36
|
-
}
|
|
48
|
+
};
|
|
37
49
|
|
|
38
50
|
const onBlur = () => {
|
|
51
|
+
touchModeSwitcherRef.value.unregisterCallback(modeChangeCallback);
|
|
39
52
|
focused.value = false;
|
|
40
|
-
}
|
|
53
|
+
};
|
|
41
54
|
|
|
42
55
|
const onClick = () => {
|
|
43
|
-
console.log("testtest", "onclick ", props.data.name)
|
|
44
56
|
if (props.itemClick) {
|
|
45
57
|
props?.itemClick(props.query.id, props.data);
|
|
46
58
|
}
|
|
47
|
-
}
|
|
59
|
+
};
|
|
48
60
|
|
|
49
61
|
props.onAction.register("onFocus", onFocus);
|
|
50
62
|
props.onAction.register("onBlur", onBlur);
|
|
51
63
|
props.onAction.register("onClick", onClick);
|
|
52
|
-
|
|
53
64
|
</script>
|
|
54
65
|
|
|
55
66
|
<template>
|
|
@@ -72,4 +83,4 @@ props.onAction.register("onClick", onClick);
|
|
|
72
83
|
text-align: center;
|
|
73
84
|
font-size: 30;
|
|
74
85
|
}
|
|
75
|
-
</style>
|
|
86
|
+
</style>
|