@shijiu/jsview-vue-samples 2.2.373 → 2.3.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/AnimatePic.vue +1 -1
- package/Basic/components/text/TextDirection.vue +7 -2
- package/BasicFocusControl/components/BaseBlock.vue +65 -18
- package/BreakRender/assets/imageList.json +235 -235
- package/ColorSpace/App.vue +4 -4
- package/CoupletsTest/App.vue +1 -1
- package/CoupletsTest/widget/Banger/Banger.vue +3 -3
- package/CoupletsTest/widget/Banger/MaroonLoader.vue +5 -5
- package/CoupletsTest/widget/Couplets/Couplets.vue +4 -4
- package/CoupletsTest/widget/Fireworks/Fireworks.vue +13 -13
- 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 +6 -6
- package/CustomShader/gaussianBlur.glsl +1 -1
- package/DashPath/App.vue +79 -0
- package/DashPath/AppForOperator.vue +35 -0
- package/DashPath/DashPath.vue +118 -0
- package/DemoForOperator/AnimPic/AnimPic.vue +47 -0
- package/DemoForOperator/AnimPic/App.vue +28 -0
- package/DemoForOperator/Banger/App.vue +26 -0
- package/DemoForOperator/Banger/Banger/Banger.vue +252 -0
- package/DemoForOperator/Banger/Banger/Maroon.vue +123 -0
- package/DemoForOperator/Banger/Banger/MaroonLoader.vue +78 -0
- package/DemoForOperator/Banger/Banger/SpriteDeal.js +30 -0
- package/DemoForOperator/Bounce/App.vue +43 -0
- package/DemoForOperator/Bounce/Bounce.vue +49 -0
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +139 -0
- package/DemoForOperator/ChunLian/App.vue +47 -0
- package/DemoForOperator/ChunLian/Couplets.vue +248 -0
- package/DemoForOperator/EpisodeList/App.vue +80 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +113 -0
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +176 -0
- package/DemoForOperator/EpisodeList/GroupItem.vue +65 -0
- package/DemoForOperator/EpisodeList/ListItem.vue +48 -0
- package/DemoForOperator/Firework1/App.vue +25 -0
- package/DemoForOperator/Firework1/Fireworks.vue +358 -0
- package/DemoForOperator/Firework1/SpriteDeal.js +30 -0
- package/DemoForOperator/FlipPage/App.vue +75 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +150 -0
- package/DemoForOperator/FlipPage/FlipPage/flipIn.glsl +41 -0
- package/DemoForOperator/FlipPage/FlipPage/flipOut.glsl +41 -0
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +70 -0
- package/DemoForOperator/Focus/Alpha/AlphaPage.vue +40 -0
- package/DemoForOperator/Focus/Alpha/Item.vue +64 -0
- package/DemoForOperator/Focus/App.vue +124 -0
- package/DemoForOperator/Focus/CommonPageSetting.js +30 -0
- package/DemoForOperator/Focus/Item.vue +46 -0
- package/DemoForOperator/Focus/Light/Item.vue +67 -0
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +46 -0
- package/DemoForOperator/Focus/Light/LightPage.vue +43 -0
- package/DemoForOperator/Focus/Light/utils/FrameCanvasStore.ts +68 -0
- package/DemoForOperator/Focus/Light/utils/RotateFrame.vue +146 -0
- package/DemoForOperator/Focus/Light/utils/circleHaloMask.png +0 -0
- package/DemoForOperator/Focus/Normal/Item.vue +64 -0
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +53 -0
- package/DemoForOperator/Focus/Normal/NormalPage.vue +41 -0
- package/DemoForOperator/Focus/SwipeLight/Item.vue +73 -0
- package/DemoForOperator/Focus/SwipeLight/SwipeLightBox.vue +62 -0
- package/DemoForOperator/Focus/SwipeLight/SwipeLightPage.vue +44 -0
- package/DemoForOperator/FullscreenIn/App.vue +105 -0
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +41 -0
- package/DemoForOperator/FullscreenIn/Item.vue +50 -0
- package/DemoForOperator/Genie/App.vue +78 -0
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +699 -0
- package/DemoForOperator/Genie/geniePakcer/genieBottom.glsl +49 -0
- package/DemoForOperator/Genie/geniePakcer/genieLeft.glsl +50 -0
- package/DemoForOperator/Genie/geniePakcer/genieRight.glsl +57 -0
- package/DemoForOperator/Genie/geniePakcer/genieTop.glsl +50 -0
- package/DemoForOperator/GrayFilter/App.vue +51 -0
- package/DemoForOperator/GrayFilter/GrayFilter.vue +38 -0
- package/DemoForOperator/Jigsaw/App.vue +45 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +100 -0
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +86 -0
- package/DemoForOperator/Particle/App.vue +69 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +176 -0
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +99 -0
- package/DemoForOperator/PosterAnim/App.vue +125 -0
- package/DemoForOperator/PosterAnim/Bounce/BouncePage.vue +54 -0
- package/DemoForOperator/PosterAnim/Bounce/Item.vue +85 -0
- package/DemoForOperator/PosterAnim/Breath/BreathPage.vue +47 -0
- package/DemoForOperator/PosterAnim/Breath/Item.vue +58 -0
- package/DemoForOperator/PosterAnim/CommonPageSetting.js +30 -0
- package/DemoForOperator/PosterAnim/Item.vue +46 -0
- package/DemoForOperator/PosterAnim/PosterAnim.js +58 -0
- package/DemoForOperator/PosterAnim/Scale/Item.vue +72 -0
- package/DemoForOperator/PosterAnim/Scale/ScalePage.vue +48 -0
- package/DemoForOperator/PosterAnim/Shake/Item.vue +85 -0
- package/DemoForOperator/PosterAnim/Shake/ShakePage.vue +53 -0
- package/DemoForOperator/PosterOverflow/App.vue +116 -0
- package/DemoForOperator/PosterOverflow/Item.vue +67 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +23 -0
- package/DemoForOperator/Ripple/App.vue +54 -0
- package/DemoForOperator/Ripple/Ripple.vue +50 -0
- package/DemoForOperator/ScalePoster/App.vue +4 -0
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
- package/DemoForOperator/Sprite/App.vue +33 -0
- package/DemoForOperator/Sprite/Sprite.vue +90 -0
- package/DemoForOperator/Stretch/App.vue +103 -0
- package/DemoForOperator/Stretch/Stretch/Item.vue +192 -0
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +168 -0
- package/DemoForOperator/TabContent/App.vue +89 -0
- package/DemoForOperator/TabContent/ContentPage.vue +66 -0
- package/DemoForOperator/TabContent/Item.vue +85 -0
- package/DemoForOperator/TabContent/PageItem.vue +40 -0
- package/DemoForOperator/TabContent/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContent/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +146 -0
- package/DemoForOperator/TabContent/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContent/TabContent/TabWidget.vue +243 -0
- package/DemoForOperator/TabContent/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContent/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContent/testData.js +241 -0
- package/DemoForOperator/Vortex/App.vue +78 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +154 -0
- package/DemoForOperator/Vortex/Vortex/vortexIn.glsl +38 -0
- package/DemoForOperator/Vortex/Vortex/vortexOut.glsl +38 -0
- package/DemoForOperator/index.js +6 -0
- package/DemoForOperator/routeList.js +142 -0
- package/DemoHomepage/App.vue +50 -30
- package/DemoHomepage/components/Dialog.vue +1 -0
- package/DemoHomepage/components/TabFrame.vue +7 -0
- package/DemoHomepage/router.js +104 -81
- package/DemoHomepage/views/Homepage.vue +7 -6
- package/DivMetroPerformance/components/ContentItem.vue +0 -1
- package/DivMetroPerformance/data.js +3 -3
- package/DriftScopeTest/App.vue +1 -1
- package/FilterDemo/AnimatePic.vue +1 -1
- package/FilterDemo/VideoLayer.vue +2 -2
- package/FlexCellDemo/TestFrame1.vue +0 -4
- package/FullScreenFlex/TestFrame2.vue +1 -1
- package/GiftRain/App.vue +12 -15
- package/HashParams/App.vue +0 -1
- package/JsvPreDownloader/App.vue +4 -6
- package/Marquee/App.vue +2 -2
- package/MediaDemo/components/frames/AudioFrame.vue +1 -1
- package/MediaDemo/components/frames/VideoFrame.vue +1 -1
- package/MetroWidgetDemos/MassiveItems/ContentItem.vue +1 -2
- package/MetroWidgetDemos/MassiveItems/data.js +1 -1
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +0 -1
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +18 -17
- package/MetroWidgetDemos/PerformanceTest/data.js +3 -3
- package/MetroWidgetDemos/RefreshDemo/assets/imageList.json +235 -235
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.json +235 -235
- package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +3 -1
- package/MetroWidgetDemos/routeList.js +17 -17
- package/Poster3d/App.vue +69 -0
- package/Poster3d/Poster3d.vue +92 -0
- package/PosterPacker/App.vue +5 -5
- package/PosterPacker/tools/geniePakcer/Genie.vue +2 -2
- package/PosterPacker/tools/vortexPacker/Vortex.vue +15 -15
- package/QrcodeDemo/App.vue +1 -1
- package/Ripple/App.vue +1 -1
- package/ScaleDownNeon/App.vue +13 -10
- package/SceneTransition/App.vue +7 -6
- package/SceneTransition/maskConfig/config2.js +12 -12
- package/SceneTransition/maskConfig/config3.js +14 -14
- package/SprayView/App.vue +96 -51
- package/SpringFestival/App.vue +73 -0
- package/SpringFestival/SpringFestivalScene/ChunLian.vue +211 -0
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +139 -0
- package/SpringFestival/SpringFestivalScene/LanternAnim.js +60 -0
- package/SpringFestival/SpringFestivalScene/Rain.vue +137 -0
- package/SpringFestival/SpringFestivalScene/Scene.vue +218 -0
- package/SpringFestival/SpringFestivalScene/imageConfig.js +87 -0
- package/SpringFestival/SpringFestivalScene/index.js +1 -0
- package/Swiper/App.vue +28 -29
- package/Swiper/Item.vue +19 -0
- package/SwiperTest/App.vue +9 -9
- package/TestNativeSharedView/AckEventDefine.ts +82 -0
- package/TestNativeSharedView/App.vue +4 -6
- package/TestNativeSharedView/JsvDemoTester.js +131 -0
- package/TextureAnimation/App3.vue +100 -0
- package/TextureAnimation/utils/FrameCanvasStore.ts +68 -0
- package/TextureAnimation/utils/RotateFrame.vue +146 -0
- package/TextureAnimation/utils/circleHaloMask.png +0 -0
- package/TextureSize/App.vue +5 -6
- package/TombSweepingDayTest/Raining/RainScene.vue +4 -4
- package/ViewOpacity/App.vue +6 -7
- package/package.json +1 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="show"
|
|
4
|
+
:style="{
|
|
5
|
+
left: layout.left,
|
|
6
|
+
top: layout.top,
|
|
7
|
+
width: layout.width,
|
|
8
|
+
height: layout.height,
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
v-for="(item, index) in list1"
|
|
14
|
+
:key="`item_${index}`"
|
|
15
|
+
:style="{
|
|
16
|
+
top: item.pos,
|
|
17
|
+
}"
|
|
18
|
+
>
|
|
19
|
+
<jsv-spray :pointRes="`url(${item.url})`" :sprayStyle="item.config" />
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="showSceond">
|
|
22
|
+
<div
|
|
23
|
+
v-for="(item, index) in list2"
|
|
24
|
+
:key="`item_${index}`"
|
|
25
|
+
:style="{
|
|
26
|
+
top: item.pos,
|
|
27
|
+
}"
|
|
28
|
+
>
|
|
29
|
+
<jsv-spray :pointRes="`url(${item.url})`" :sprayStyle="item.config" />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-if="showThird">
|
|
33
|
+
<div
|
|
34
|
+
v-for="(item, index) in list3"
|
|
35
|
+
:key="`item_${index}`"
|
|
36
|
+
:style="{
|
|
37
|
+
top: item.pos,
|
|
38
|
+
}"
|
|
39
|
+
>
|
|
40
|
+
<jsv-spray :pointRes="`url(${item.url})`" :sprayStyle="item.config" />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script setup>
|
|
47
|
+
import { JsvSpray } from "jsview";
|
|
48
|
+
import { ref, onBeforeUnmount, onMounted } from "vue";
|
|
49
|
+
|
|
50
|
+
const props = defineProps({
|
|
51
|
+
urlList: {
|
|
52
|
+
type: Array,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
autoStart: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: true,
|
|
58
|
+
},
|
|
59
|
+
layout: {
|
|
60
|
+
type: Object,
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
// low, middle, high
|
|
64
|
+
numLevel: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "middle",
|
|
67
|
+
},
|
|
68
|
+
sprayLevel: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "middle",
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
//获取一个随机顺序
|
|
75
|
+
function getRandomOrder(numbers) {
|
|
76
|
+
let currentIndex = numbers.length,
|
|
77
|
+
temporaryValue,
|
|
78
|
+
randomIndex;
|
|
79
|
+
// 从数组的最后一个元素开始,向前遍历
|
|
80
|
+
while (currentIndex !== 0) {
|
|
81
|
+
// 选取一个随机索引
|
|
82
|
+
randomIndex = Math.floor(Math.random() * currentIndex);
|
|
83
|
+
currentIndex -= 1;
|
|
84
|
+
|
|
85
|
+
// 交换当前索引和随机索引处的元素
|
|
86
|
+
temporaryValue = numbers[currentIndex];
|
|
87
|
+
numbers[currentIndex] = numbers[randomIndex];
|
|
88
|
+
numbers[randomIndex] = temporaryValue;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return numbers;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const levelToIndex = (level) => {
|
|
95
|
+
switch (level) {
|
|
96
|
+
case "low":
|
|
97
|
+
return 0;
|
|
98
|
+
case "high":
|
|
99
|
+
return 2;
|
|
100
|
+
default:
|
|
101
|
+
return 1;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const levelConfig = {
|
|
105
|
+
addSpeed: [0.001, 0.01, 0.1],
|
|
106
|
+
number: [10, 50, 100],
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
//目前版本的粒子生成有问题, 会在一开始就集中出现, 所以要随机拉开几个JsvSpray的位置
|
|
110
|
+
const positionRange = [-50, -100];
|
|
111
|
+
const step = (positionRange[1] - positionRange[0]) / props.urlList.length;
|
|
112
|
+
const urls = getRandomOrder(props.urlList);
|
|
113
|
+
const sprayInfos = [];
|
|
114
|
+
for (let i = 0; i < urls.length; ++i) {
|
|
115
|
+
sprayInfos.push({
|
|
116
|
+
url: urls[i],
|
|
117
|
+
pos: positionRange[0] + step * i,
|
|
118
|
+
config: {
|
|
119
|
+
type: 1,
|
|
120
|
+
particleNum: Math.round(
|
|
121
|
+
levelConfig.number[levelToIndex(props.numLevel)] / props.urlList.length
|
|
122
|
+
),
|
|
123
|
+
deltaAngle: 0,
|
|
124
|
+
deltaWidth: Math.round(props.layout.width / 2),
|
|
125
|
+
deltaHeight: 1,
|
|
126
|
+
pointSizeMin: 90,
|
|
127
|
+
pointSizeMax: 120,
|
|
128
|
+
speedMin: -10,
|
|
129
|
+
speedMax: -15,
|
|
130
|
+
lifeMin: 3500 + i * 200,
|
|
131
|
+
lifeMax: 4000 + i * 200,
|
|
132
|
+
accelerateX: 0,
|
|
133
|
+
accelerateY: 0,
|
|
134
|
+
particleAddSpeed: levelConfig.addSpeed[levelToIndex(props.sprayLevel)],
|
|
135
|
+
angularVelocityMin: 10,
|
|
136
|
+
angularVelocityMax: 15,
|
|
137
|
+
enableFade: false,
|
|
138
|
+
enableShrink: false,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
//粒子数量少的时候, 添加有bug, 为了规避此处分成三拨开始
|
|
144
|
+
let showSceond = ref(false);
|
|
145
|
+
let showThird = ref(false);
|
|
146
|
+
|
|
147
|
+
let list1 = sprayInfos.slice(0, 1);
|
|
148
|
+
let list2 = sprayInfos.slice(1, 3);
|
|
149
|
+
let list3 = sprayInfos.slice(3);
|
|
150
|
+
|
|
151
|
+
let show = ref(false);
|
|
152
|
+
let timeoutHandler = -1;
|
|
153
|
+
function start() {
|
|
154
|
+
show.value = true;
|
|
155
|
+
timeoutHandler = setTimeout(() => {
|
|
156
|
+
showSceond.value = true;
|
|
157
|
+
timeoutHandler = setTimeout(() => {
|
|
158
|
+
showThird.value = true;
|
|
159
|
+
}, 700);
|
|
160
|
+
}, 700);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
onMounted(() => {
|
|
164
|
+
if (props.autoStart) {
|
|
165
|
+
start();
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
onBeforeUnmount(() => {
|
|
170
|
+
clearTimeout(timeoutHandler);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
defineExpose({
|
|
174
|
+
start,
|
|
175
|
+
});
|
|
176
|
+
</script>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="token > 0"
|
|
4
|
+
:key="token"
|
|
5
|
+
:style="{
|
|
6
|
+
left: layout.left,
|
|
7
|
+
top: layout.top,
|
|
8
|
+
// width: layout.width,
|
|
9
|
+
// height: layout.height,
|
|
10
|
+
// backgroundColor: '#99000099'
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<jsv-spray
|
|
14
|
+
v-for="(url, index) in urlList"
|
|
15
|
+
:key="index"
|
|
16
|
+
:pointRes="`url(${url})`"
|
|
17
|
+
:sprayStyle="sprayStyle"
|
|
18
|
+
:ignoreClip="true"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import { JsvSpray } from "jsview";
|
|
25
|
+
import { shallowRef, computed } from "vue";
|
|
26
|
+
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
layout: {
|
|
29
|
+
type: Object,
|
|
30
|
+
requreid: true,
|
|
31
|
+
},
|
|
32
|
+
urlList: {
|
|
33
|
+
type: Array,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
numLevel: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "middle",
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const token = shallowRef(0);
|
|
43
|
+
|
|
44
|
+
/* 三个级别的粒子总个数:
|
|
45
|
+
low: 50个
|
|
46
|
+
middle: 150个,
|
|
47
|
+
high: 400个
|
|
48
|
+
*/
|
|
49
|
+
function getTotalParticleNum() {
|
|
50
|
+
switch (props.numLevel) {
|
|
51
|
+
case "low":
|
|
52
|
+
return 50;
|
|
53
|
+
case "high":
|
|
54
|
+
return 150;
|
|
55
|
+
default:
|
|
56
|
+
400;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const particleNum = computed(() => {
|
|
61
|
+
let totalNum;
|
|
62
|
+
switch (props.numLevel) {
|
|
63
|
+
case "low":
|
|
64
|
+
totalNum = 50;
|
|
65
|
+
break;
|
|
66
|
+
case "high":
|
|
67
|
+
totalNum = 400;
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
totalNum = 150;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
return Math.round(totalNum / props.urlList.length);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
let sprayStyle = {
|
|
77
|
+
type: 0,
|
|
78
|
+
particleNum: particleNum.value,
|
|
79
|
+
deltaAngle: 180,
|
|
80
|
+
deltaWidth: Math.round(props.layout.width / 2),
|
|
81
|
+
deltaHeight: Math.round(props.layout.height / 2),
|
|
82
|
+
pointSizeMin: 50,
|
|
83
|
+
pointSizeMax: 100,
|
|
84
|
+
speedMin: 4,
|
|
85
|
+
speedMax: 10,
|
|
86
|
+
lifeMin: 1000,
|
|
87
|
+
lifeMax: 2000,
|
|
88
|
+
accelerateX: 0,
|
|
89
|
+
accelerateY: 0,
|
|
90
|
+
enableFade: true,
|
|
91
|
+
enableShrink: true,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
defineExpose({
|
|
95
|
+
start() {
|
|
96
|
+
++token.value;
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
</script>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{ width: 1920, height: 1080, backgroundColor: '#F5F5DC' }"></div>
|
|
3
|
+
<div
|
|
4
|
+
:style="{
|
|
5
|
+
left: (1280 - 600) / 2,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
8
|
+
<bounce-page v-if="pageId == 0" :onEdge="pageOnEdge" />
|
|
9
|
+
<shake-page v-else-if="pageId == 1" :onEdge="pageOnEdge" />
|
|
10
|
+
<scale-page v-else-if="pageId == 2" :onEdge="pageOnEdge" />
|
|
11
|
+
<breath-page v-else-if="pageId == 3" :onEdge="pageOnEdge" />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
:style="{
|
|
16
|
+
left: (1280 - 240) / 2,
|
|
17
|
+
top: 400,
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<metro-widget
|
|
21
|
+
name="btn"
|
|
22
|
+
:width="widgetLayout.width"
|
|
23
|
+
:height="widgetLayout.height"
|
|
24
|
+
:provideData="provideData"
|
|
25
|
+
:direction="HORIZONTAL"
|
|
26
|
+
:measures="measures"
|
|
27
|
+
:onEdge="onEdge"
|
|
28
|
+
>
|
|
29
|
+
<template #renderItem="{ data, onAction, query }">
|
|
30
|
+
<item
|
|
31
|
+
:data="data"
|
|
32
|
+
:onAction="onAction"
|
|
33
|
+
:onItemFocus="onItemFocus"
|
|
34
|
+
:query="query"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
37
|
+
</metro-widget>
|
|
38
|
+
<div
|
|
39
|
+
:style="{
|
|
40
|
+
top: 60,
|
|
41
|
+
fontSize: 25,
|
|
42
|
+
color: '#000000',
|
|
43
|
+
}"
|
|
44
|
+
>
|
|
45
|
+
切换动画
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup>
|
|
51
|
+
import BouncePage from "./Bounce/BouncePage.vue";
|
|
52
|
+
import ShakePage from "./Shake/ShakePage.vue";
|
|
53
|
+
import ScalePage from "./Scale/ScalePage.vue";
|
|
54
|
+
import BreathPage from "./Breath/BreathPage.vue";
|
|
55
|
+
|
|
56
|
+
import Item from "./Item.vue";
|
|
57
|
+
import { useFocusHub, MetroWidget, HORIZONTAL, EdgeDirection } from "jsview";
|
|
58
|
+
import { onMounted, ref } from "vue";
|
|
59
|
+
|
|
60
|
+
const focusHub = useFocusHub();
|
|
61
|
+
|
|
62
|
+
const pageId = ref(0);
|
|
63
|
+
|
|
64
|
+
const provideData = () => {
|
|
65
|
+
const data = [];
|
|
66
|
+
for (let i = 0; i < 4; ++i) {
|
|
67
|
+
data.push({
|
|
68
|
+
width: 50,
|
|
69
|
+
height: 50,
|
|
70
|
+
marginRight: 10,
|
|
71
|
+
content: i,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return data;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const measures = (data) => {
|
|
78
|
+
return {
|
|
79
|
+
width: data.width,
|
|
80
|
+
height: data.height,
|
|
81
|
+
marginRight: data.marginRight,
|
|
82
|
+
marginBottom: data.marginBottom,
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const pageOnEdge = (edgeInfo) => {
|
|
87
|
+
if (edgeInfo.direction == EdgeDirection.bottom) {
|
|
88
|
+
focusHub.setFocus("btn");
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
// callbacks
|
|
92
|
+
const onEdge = (edgeInfo) => {
|
|
93
|
+
if (edgeInfo.direction == EdgeDirection.top) {
|
|
94
|
+
let name = null;
|
|
95
|
+
switch (pageId.value) {
|
|
96
|
+
case 0:
|
|
97
|
+
name = "bounce";
|
|
98
|
+
break;
|
|
99
|
+
case 1:
|
|
100
|
+
name = "shake";
|
|
101
|
+
break;
|
|
102
|
+
case 2:
|
|
103
|
+
name = "scale";
|
|
104
|
+
break;
|
|
105
|
+
case 3:
|
|
106
|
+
name = "breath";
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
if (name) focusHub.setFocus(name);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const onItemFocus = (index) => {
|
|
113
|
+
pageId.value = index;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const widgetLayout = {
|
|
117
|
+
width: 500,
|
|
118
|
+
height: 50,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
onMounted(() => {
|
|
122
|
+
//组件mount后设置焦点
|
|
123
|
+
focusHub.setFocus("btn");
|
|
124
|
+
});
|
|
125
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<metro-widget
|
|
3
|
+
name="bounce"
|
|
4
|
+
:left="widgetLayout.left"
|
|
5
|
+
:top="widgetLayout.top"
|
|
6
|
+
:width="widgetLayout.width"
|
|
7
|
+
:height="widgetLayout.height"
|
|
8
|
+
:provideData="provideData"
|
|
9
|
+
:direction="HORIZONTAL"
|
|
10
|
+
:measures="measures"
|
|
11
|
+
:onEdge="onEdge"
|
|
12
|
+
:padding="padding"
|
|
13
|
+
>
|
|
14
|
+
<template #renderItem="{ data, onAction }">
|
|
15
|
+
<item :data="data" :onAction="onAction" :anim="animObj" />
|
|
16
|
+
</template>
|
|
17
|
+
</metro-widget>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { onUnmounted } from "vue";
|
|
22
|
+
import { MetroWidget, HORIZONTAL } from "jsview";
|
|
23
|
+
import Item from "./Item.vue";
|
|
24
|
+
import { widgetLayout, padding, data } from "../CommonPageSetting";
|
|
25
|
+
import { getPosterAnim } from "../PosterAnim.js";
|
|
26
|
+
|
|
27
|
+
const animObj = {
|
|
28
|
+
left: getPosterAnim("bounce-left", { level: "middle" }),
|
|
29
|
+
right: getPosterAnim("bounce-right", { level: "middle" }),
|
|
30
|
+
top: getPosterAnim("bounce-top", { level: "middle" }),
|
|
31
|
+
bottom: getPosterAnim("bounce-bottom", { level: "middle" }),
|
|
32
|
+
};
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
onEdge: Function,
|
|
35
|
+
});
|
|
36
|
+
const provideData = () => {
|
|
37
|
+
return data;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const measures = (data) => {
|
|
41
|
+
return {
|
|
42
|
+
width: data.width,
|
|
43
|
+
height: data.height,
|
|
44
|
+
marginRight: data.marginRight,
|
|
45
|
+
marginBottom: data.marginBottom,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
onUnmounted(() => {
|
|
50
|
+
for (let key in animObj) {
|
|
51
|
+
animObj[key].release();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:17
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ref } from "vue";
|
|
8
|
+
import { EdgeDirection } from "jsview";
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
data: Object,
|
|
12
|
+
onAction: Object,
|
|
13
|
+
anim: Object,
|
|
14
|
+
});
|
|
15
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterAnim/Bounce/Item/background.png";
|
|
16
|
+
|
|
17
|
+
const focused = ref(false);
|
|
18
|
+
const animation = ref(null);
|
|
19
|
+
|
|
20
|
+
// 注册回调
|
|
21
|
+
const onFocus = () => {
|
|
22
|
+
focused.value = true;
|
|
23
|
+
};
|
|
24
|
+
const onBlur = () => {
|
|
25
|
+
focused.value = false;
|
|
26
|
+
};
|
|
27
|
+
const onClick = () => {};
|
|
28
|
+
|
|
29
|
+
const onAnimEnd = () => {
|
|
30
|
+
animation.value = null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const onWidgetEdge = (info) => {
|
|
34
|
+
switch (info.direction) {
|
|
35
|
+
case EdgeDirection.left:
|
|
36
|
+
animation.value = `${props.anim.left.name} 0.15s`;
|
|
37
|
+
break;
|
|
38
|
+
case EdgeDirection.top:
|
|
39
|
+
animation.value = `${props.anim.top.name} 0.15s`;
|
|
40
|
+
break;
|
|
41
|
+
case EdgeDirection.right:
|
|
42
|
+
animation.value = `${props.anim.right.name} 0.15s`;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
props.onAction.register("onFocus", onFocus);
|
|
48
|
+
props.onAction.register("onBlur", onBlur);
|
|
49
|
+
props.onAction.register("onClick", onClick);
|
|
50
|
+
props.onAction.register("onWidgetEdge", onWidgetEdge);
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div
|
|
55
|
+
:style="{
|
|
56
|
+
width: data.width,
|
|
57
|
+
height: data.height,
|
|
58
|
+
transition: 'transform 0.2s',
|
|
59
|
+
transform: focused ? 'scale3d(1.05, 1.05, 1)' : null,
|
|
60
|
+
}"
|
|
61
|
+
>
|
|
62
|
+
<div
|
|
63
|
+
:style="{
|
|
64
|
+
width: data.width,
|
|
65
|
+
height: data.height,
|
|
66
|
+
animation: animation,
|
|
67
|
+
}"
|
|
68
|
+
@animationend="onAnimEnd"
|
|
69
|
+
>
|
|
70
|
+
<div
|
|
71
|
+
:style="{
|
|
72
|
+
width: data.width,
|
|
73
|
+
height: data.height,
|
|
74
|
+
fontSize: 30,
|
|
75
|
+
color: focused ? '#FF0000' : '#FFFFFF',
|
|
76
|
+
backgroundImage: bgImage,
|
|
77
|
+
lineHeight: data.height,
|
|
78
|
+
textAlign: 'center',
|
|
79
|
+
}"
|
|
80
|
+
>
|
|
81
|
+
边缘抖动
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<metro-widget
|
|
3
|
+
name="breath"
|
|
4
|
+
:left="widgetLayout.left"
|
|
5
|
+
:top="widgetLayout.top"
|
|
6
|
+
:width="widgetLayout.width"
|
|
7
|
+
:height="widgetLayout.height"
|
|
8
|
+
:provideData="provideData"
|
|
9
|
+
:direction="HORIZONTAL"
|
|
10
|
+
:measures="measures"
|
|
11
|
+
:onEdge="onEdge"
|
|
12
|
+
:padding="padding"
|
|
13
|
+
>
|
|
14
|
+
<template #renderItem="{ data, onAction }">
|
|
15
|
+
<item :data="data" :onAction="onAction" :anim="anim" />
|
|
16
|
+
</template>
|
|
17
|
+
</metro-widget>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { onUnmounted } from "vue";
|
|
22
|
+
import { MetroWidget, HORIZONTAL } from "jsview";
|
|
23
|
+
import Item from "./Item.vue";
|
|
24
|
+
import { widgetLayout, padding, data } from "../CommonPageSetting.js";
|
|
25
|
+
import { getPosterAnim } from "../PosterAnim.js";
|
|
26
|
+
|
|
27
|
+
const anim = getPosterAnim("breath", { scale: 1.05 });
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
onEdge: Function,
|
|
30
|
+
});
|
|
31
|
+
const provideData = () => {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const measures = (data) => {
|
|
36
|
+
return {
|
|
37
|
+
width: data.width,
|
|
38
|
+
height: data.height,
|
|
39
|
+
marginRight: data.marginRight,
|
|
40
|
+
marginBottom: data.marginBottom,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
onUnmounted(() => {
|
|
45
|
+
anim.release();
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:17
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ref } from "vue";
|
|
8
|
+
import { EdgeDirection } from "jsview";
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
data: Object,
|
|
12
|
+
onAction: Object,
|
|
13
|
+
anim: Object,
|
|
14
|
+
});
|
|
15
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterAnim/Breath/Item/background.png";
|
|
16
|
+
|
|
17
|
+
const focused = ref(false);
|
|
18
|
+
const animation = ref(null);
|
|
19
|
+
|
|
20
|
+
// 注册回调
|
|
21
|
+
const onFocus = () => {
|
|
22
|
+
focused.value = true;
|
|
23
|
+
animation.value = `${props.anim.name} 2s infinite`;
|
|
24
|
+
};
|
|
25
|
+
const onBlur = () => {
|
|
26
|
+
focused.value = false;
|
|
27
|
+
animation.value = null;
|
|
28
|
+
};
|
|
29
|
+
const onClick = () => {};
|
|
30
|
+
|
|
31
|
+
props.onAction.register("onFocus", onFocus);
|
|
32
|
+
props.onAction.register("onBlur", onBlur);
|
|
33
|
+
props.onAction.register("onClick", onClick);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<div
|
|
38
|
+
:style="{
|
|
39
|
+
width: data.width,
|
|
40
|
+
height: data.height,
|
|
41
|
+
animation: animation,
|
|
42
|
+
}"
|
|
43
|
+
>
|
|
44
|
+
<div
|
|
45
|
+
:style="{
|
|
46
|
+
width: data.width,
|
|
47
|
+
height: data.height,
|
|
48
|
+
fontSize: 30,
|
|
49
|
+
color: focused ? '#FF0000' : '#FFFFFF',
|
|
50
|
+
backgroundImage: bgImage,
|
|
51
|
+
lineHeight: data.height,
|
|
52
|
+
textAlign: 'center',
|
|
53
|
+
}"
|
|
54
|
+
>
|
|
55
|
+
呼吸
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
export const widgetLayout = {
|
|
3
|
+
left: 50,
|
|
4
|
+
top: 50,
|
|
5
|
+
width: 600,
|
|
6
|
+
height: 300,
|
|
7
|
+
};
|
|
8
|
+
export const padding = {
|
|
9
|
+
left: 50,
|
|
10
|
+
right: 50,
|
|
11
|
+
top: 50,
|
|
12
|
+
bottom: 50,
|
|
13
|
+
};
|
|
14
|
+
export const data = [
|
|
15
|
+
{
|
|
16
|
+
width: 100,
|
|
17
|
+
height: 200,
|
|
18
|
+
marginRight: 10,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
width: 200,
|
|
22
|
+
height: 200,
|
|
23
|
+
marginRight: 10,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
width: 100,
|
|
27
|
+
height: 200,
|
|
28
|
+
marginRight: 10,
|
|
29
|
+
},
|
|
30
|
+
];
|