@shijiu/jsview-vue-samples 2.2.426-test.0 → 2.3.151-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/AnimatePic.vue +1 -1
- package/Basic/components/text/TextDirection.vue +7 -1
- package/BasicFocusControl/components/BaseBlock.vue +65 -18
- package/BreakRender/assets/imageList.json +235 -235
- package/ColorSpace/App.vue +2 -2
- 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/CustomShader/App.vue +4 -4
- package/CustomShader/gaussianBlur.glsl +1 -1
- package/DashPath/App.vue +80 -0
- package/DashPath/AppForOperator.vue +33 -0
- package/DemoForOperator/AnimPic/AnimPic.vue +69 -0
- package/DemoForOperator/AnimPic/App.vue +28 -0
- package/DemoForOperator/Banger/App.vue +26 -0
- package/DemoForOperator/Banger/Banger/Banger.vue +316 -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/Blur/Blur.vue +146 -0
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +158 -0
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +113 -0
- package/DemoForOperator/BookFlip/App.vue +115 -0
- package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +179 -0
- package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +310 -0
- package/DemoForOperator/BookFlip/BookFlip/flip.glsl +135 -0
- package/DemoForOperator/BookFlip/BookPage.vue +82 -0
- package/DemoForOperator/Bounce/App.vue +43 -0
- package/DemoForOperator/Bounce/Bounce.vue +81 -0
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +139 -0
- package/DemoForOperator/ChunLian/App.vue +47 -0
- package/DemoForOperator/ChunLian/Couplets.vue +291 -0
- package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
- package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
- package/DemoForOperator/DominantColor/App.vue +187 -0
- package/DemoForOperator/EpisodeList/App.vue +80 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +110 -0
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +250 -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 +397 -0
- package/DemoForOperator/Firework1/SpriteDeal.js +30 -0
- package/DemoForOperator/FlipPage/App.vue +75 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +178 -0
- package/DemoForOperator/FlipPage/FlipPage/flipIn.glsl +41 -0
- package/DemoForOperator/FlipPage/FlipPage/flipOut.glsl +41 -0
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +95 -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 +87 -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 +65 -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/FrameShadow/App.vue +193 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
- package/DemoForOperator/FullscreenIn/App.vue +105 -0
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +56 -0
- package/DemoForOperator/FullscreenIn/Item.vue +50 -0
- package/DemoForOperator/Genie/App.vue +78 -0
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +741 -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 +59 -0
- package/DemoForOperator/Jigsaw/App.vue +45 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +142 -0
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +118 -0
- package/DemoForOperator/LongChatBox/App.vue +36 -0
- package/DemoForOperator/LongChatBox/Bubble.vue +104 -0
- package/DemoForOperator/LongChatBox/LongChat.vue +173 -0
- package/DemoForOperator/LongChatBox/TextManager.ts +147 -0
- package/DemoForOperator/LongChatBox/VirtualList.vue +298 -0
- package/DemoForOperator/LongChatBox/testData.js +51 -0
- package/DemoForOperator/LongChatBox/utile.js +331 -0
- package/DemoForOperator/Particle/App.vue +69 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +208 -0
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +120 -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 +79 -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 +39 -0
- package/DemoForOperator/Resize/App.vue +157 -0
- package/DemoForOperator/Resize/Resize/Item.vue +234 -0
- package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
- package/DemoForOperator/Ripple/App.vue +54 -0
- package/DemoForOperator/Ripple/Ripple.vue +65 -0
- package/DemoForOperator/ScreenShootScale/App.vue +96 -0
- package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
- package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
- package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
- package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
- package/DemoForOperator/SmoothSwiper/App.vue +50 -0
- package/DemoForOperator/Sound/Bounce/App.vue +56 -0
- package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
- package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
- package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
- package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
- package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
- package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
- package/DemoForOperator/Sound/Rain/App.vue +11 -0
- package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
- package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
- package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
- package/DemoForOperator/Sound/Sound/index.js +4 -0
- package/DemoForOperator/Sound/Sound/useSound.js +112 -0
- package/DemoForOperator/Sprite/App.vue +33 -0
- package/DemoForOperator/Sprite/Sprite.vue +147 -0
- package/DemoForOperator/Stretch/App.vue +103 -0
- package/DemoForOperator/Stretch/Stretch/Item.vue +192 -0
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +218 -0
- package/DemoForOperator/Swiper/App.vue +101 -0
- package/DemoForOperator/Swiper/Item.vue +56 -0
- package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -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 +184 -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/TabContentVertical/App.vue +104 -0
- package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
- package/DemoForOperator/TabContentVertical/Item.vue +94 -0
- package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
- package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
- package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
- package/DemoForOperator/TabContentVertical/testData.js +76 -0
- package/DemoForOperator/Vortex/App.vue +78 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +180 -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 +259 -0
- package/DemoHomepage/App.vue +50 -30
- package/DemoHomepage/components/Dialog.vue +1 -0
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/components/TabFrame.vue +7 -0
- package/DemoHomepage/router.js +178 -81
- package/DemoHomepage/views/Homepage.vue +7 -2
- 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/FullScreenFlex/TestFrame2.vue +1 -1
- package/GiftRain/App.vue +12 -12
- package/GiftRain/components/SpriteTranslate.vue +68 -48
- package/HashHistory/App.vue +2 -2
- package/HashHistory/router.js +1 -1
- package/JsvPreDownloader/App.vue +4 -4
- package/MediaDemo/components/frames/AudioFrame.vue +1 -1
- package/MediaDemo/components/frames/VideoFrame.vue +1 -1
- package/MetroWidgetDemos/MassiveItems/ContentItem.vue +1 -1
- package/MetroWidgetDemos/MassiveItems/data.js +1 -1
- 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/TripleWidget/App.vue +7 -1
- package/MetroWidgetDemos/TripleWidget/Item.vue +16 -2
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +7 -1
- package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +8 -2
- package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +3 -1
- package/MetroWidgetDemos/routeList.js +34 -17
- package/Poster3d/App.vue +69 -0
- package/Poster3d/Poster3d.vue +92 -0
- package/PosterPacker/App.vue +5 -5
- package/PosterPacker/tools/vortexPacker/Vortex.vue +1 -1
- package/QrcodeDemo/App.vue +1 -1
- package/Ripple/App.vue +1 -1
- package/ScaleDownNeon/App.vue +4 -4
- package/SceneTransition/App.vue +2 -2
- 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/App.vue +16 -6
- 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/TombSweepingDayTest/Raining/RainScene.vue +4 -4
- package/ViewOpacity/App.vue +21 -2
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
/**
|
|
29
|
+
* 粒子容器的布局配置
|
|
30
|
+
* @type {Object}
|
|
31
|
+
* @property {string} left - 左定位(带单位)
|
|
32
|
+
* @property {string} top - 上定位(带单位)
|
|
33
|
+
* @property {number} width - 容器宽度
|
|
34
|
+
* @property {number} height - 容器高度
|
|
35
|
+
*/
|
|
36
|
+
layout: {
|
|
37
|
+
type: Object,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* 粒子图片URL列表
|
|
42
|
+
* @type {Array<string>}
|
|
43
|
+
*/
|
|
44
|
+
urlList: {
|
|
45
|
+
type: Array,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* 粒子密度级别
|
|
50
|
+
* @type {'low'|'middle'|'high'}
|
|
51
|
+
* @default 'middle'
|
|
52
|
+
*/
|
|
53
|
+
numLevel: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "middle",
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const token = shallowRef(0);
|
|
60
|
+
|
|
61
|
+
/* 三个级别的粒子总个数:
|
|
62
|
+
low: 50个
|
|
63
|
+
middle: 150个,
|
|
64
|
+
high: 400个
|
|
65
|
+
*/
|
|
66
|
+
function getTotalParticleNum() {
|
|
67
|
+
switch (props.numLevel) {
|
|
68
|
+
case "low":
|
|
69
|
+
return 50;
|
|
70
|
+
case "high":
|
|
71
|
+
return 150;
|
|
72
|
+
default:
|
|
73
|
+
return 400;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const particleNum = computed(() => {
|
|
78
|
+
let totalNum;
|
|
79
|
+
switch (props.numLevel) {
|
|
80
|
+
case "low":
|
|
81
|
+
totalNum = 50;
|
|
82
|
+
break;
|
|
83
|
+
case "high":
|
|
84
|
+
totalNum = 400;
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
totalNum = 150;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
return Math.round(totalNum / props.urlList.length);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
let sprayStyle = {
|
|
94
|
+
type: 0,
|
|
95
|
+
particleNum: particleNum.value,
|
|
96
|
+
deltaAngle: 180,
|
|
97
|
+
deltaWidth: Math.round(props.layout.width / 2),
|
|
98
|
+
deltaHeight: Math.round(props.layout.height / 2),
|
|
99
|
+
pointSizeMin: 50,
|
|
100
|
+
pointSizeMax: 100,
|
|
101
|
+
speedMin: 4,
|
|
102
|
+
speedMax: 10,
|
|
103
|
+
lifeMin: 1000,
|
|
104
|
+
lifeMax: 2000,
|
|
105
|
+
accelerateX: 0,
|
|
106
|
+
accelerateY: 0,
|
|
107
|
+
enableFade: true,
|
|
108
|
+
enableShrink: true,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
defineExpose({
|
|
112
|
+
/**
|
|
113
|
+
* 触发粒子动画开始
|
|
114
|
+
* @description 通过改变token值强制重新渲染组件来启动动画
|
|
115
|
+
*/
|
|
116
|
+
start() {
|
|
117
|
+
++token.value;
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
</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
|
+
];
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
data: Object,
|
|
11
|
+
onAction: Object,
|
|
12
|
+
onItemFocus: Function,
|
|
13
|
+
query: Object,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const focused = ref(false);
|
|
17
|
+
|
|
18
|
+
// 注册回调
|
|
19
|
+
const onFocus = () => {
|
|
20
|
+
focused.value = true;
|
|
21
|
+
props.onItemFocus(props.query.index);
|
|
22
|
+
};
|
|
23
|
+
const onBlur = () => {
|
|
24
|
+
focused.value = false;
|
|
25
|
+
};
|
|
26
|
+
const onClick = () => {};
|
|
27
|
+
props.onAction.register("onFocus", onFocus);
|
|
28
|
+
props.onAction.register("onBlur", onBlur);
|
|
29
|
+
props.onAction.register("onClick", onClick);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div
|
|
34
|
+
:style="{
|
|
35
|
+
width: data.width,
|
|
36
|
+
height: data.height,
|
|
37
|
+
fontSize: 30,
|
|
38
|
+
color: '#000000',
|
|
39
|
+
backgroundColor: focused ? '#009900' : '#ff000033',
|
|
40
|
+
lineHeight: data.height,
|
|
41
|
+
textAlign: 'center',
|
|
42
|
+
}"
|
|
43
|
+
>
|
|
44
|
+
{{ data.content }}
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { getKeyFramesGroup } from "jsview"
|
|
2
|
+
let token = 0;
|
|
3
|
+
const bounceLevel = [10, 20, 30];
|
|
4
|
+
const scaleLevel = [1.03, 1.07, 1.1];
|
|
5
|
+
const shaleLevel = [1, 3, 5];
|
|
6
|
+
|
|
7
|
+
let styleSheet = null;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 获取海报动画配置
|
|
11
|
+
* @param {string} type - 动画类型,可选值:
|
|
12
|
+
* 'bounce-left' - 向左弹跳
|
|
13
|
+
* 'bounce-bottom' - 向下弹跳
|
|
14
|
+
* 'bounce-right' - 向右弹跳
|
|
15
|
+
* 'bounce-top' - 向上弹跳
|
|
16
|
+
* 'shake' - 摇晃
|
|
17
|
+
* 'scale' - 缩放
|
|
18
|
+
* 'breath' - 呼吸效果
|
|
19
|
+
* @param {Object} params - 动画参数
|
|
20
|
+
* @param {'low'|'middle'|'high'} params.level - 动画幅度级别
|
|
21
|
+
* @param {number} [params.scale0] - scale动画的起始缩放值
|
|
22
|
+
* @param {number} [params.scale1] - scale动画的中间缩放值
|
|
23
|
+
* @param {number} [params.scale] - breath动画的缩放值
|
|
24
|
+
* @returns {Object} 动画配置对象
|
|
25
|
+
* @property {string} name - 动画名称
|
|
26
|
+
* @property {Function} release - 释放动画资源的函数
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export function getPosterAnim(type, params) {
|
|
30
|
+
if (!styleSheet) {
|
|
31
|
+
styleSheet = getKeyFramesGroup();
|
|
32
|
+
}
|
|
33
|
+
++token;
|
|
34
|
+
const levelIndex = params.level == "high" ? 2 : params.level == "middle" ? 1 : 0;
|
|
35
|
+
let name = undefined, body = undefined;
|
|
36
|
+
switch (type) {
|
|
37
|
+
case "bounce-left": {
|
|
38
|
+
name = `poster-anim-bounce-left-${token}`
|
|
39
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(-${bounceLevel[levelIndex]}, 0, 0);}}`
|
|
40
|
+
} break;
|
|
41
|
+
case "bounce-bottom": {
|
|
42
|
+
name = `poster-anim-bounce-bottom-${token}`
|
|
43
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(0, ${bounceLevel[levelIndex]}, 0);}}`
|
|
44
|
+
} break;
|
|
45
|
+
case "bounce-right": {
|
|
46
|
+
name = `poster-anim-bounce-right-${token}`
|
|
47
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(${bounceLevel[levelIndex]}, 0, 0);}}`
|
|
48
|
+
} break;
|
|
49
|
+
case "bounce-top": {
|
|
50
|
+
name = `poster-anim-bounce-top-${token}`
|
|
51
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(0, -${bounceLevel[levelIndex]}, 0);}}`
|
|
52
|
+
} break;
|
|
53
|
+
case "shake": {
|
|
54
|
+
name = `poster-anim-shake-${token}`
|
|
55
|
+
body = `@keyframes ${name} {0%, 35% { transform: rotate3d(0, 0, 1, ${shaleLevel[levelIndex]}deg); } 70% { transform: rotate3d(0, 0, 1, -${shaleLevel[levelIndex]}deg); } 100% { transform: rotate3d(0, 0, 1, 0deg); } }`
|
|
56
|
+
} break;
|
|
57
|
+
|
|
58
|
+
case "scale": {
|
|
59
|
+
const s0 = params.scale0
|
|
60
|
+
const s1 = params.scale1;
|
|
61
|
+
name = `poster-anim-scale-${token}`
|
|
62
|
+
body = `@keyframes ${name} {0% { transform: scale3d(${s0}, ${s0}, 1); } 50% { transform: scale3d(${s1}, ${s1}, 1); } 100% { transform: scale3d(1, 1, 1); }}`
|
|
63
|
+
} break;
|
|
64
|
+
case "breath": {
|
|
65
|
+
const s0 = params.scale
|
|
66
|
+
name = `poster-anim-breath-${token}`
|
|
67
|
+
body = `@keyframes ${name} {0% { transform: scale3d(1, 1, 1); transform-origin: center center;} 50% { transform: scale3d(${s0}, ${s0}, 1); transform-origin: center center;} 100% { transform: scale3d(1, 1, 1); transform-origin: center center;}}`
|
|
68
|
+
} break;
|
|
69
|
+
}
|
|
70
|
+
if (typeof body != "undefined") {
|
|
71
|
+
styleSheet.insertRule(body);
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
name,
|
|
75
|
+
release: () => {
|
|
76
|
+
styleSheet.removeRule(name)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|