@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,110 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted, inject, ref, watch } from "vue";
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
onEdge: Function,
|
|
6
|
+
name: String,
|
|
7
|
+
layout: Object,
|
|
8
|
+
dataLoader: Function, // (tabId) => Promise
|
|
9
|
+
animDuration: { type: Number, default: 200 },
|
|
10
|
+
onFocus: Function,
|
|
11
|
+
onBlur: Function,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const globalInfo = inject("globalInfo");
|
|
15
|
+
const animState = inject("animState");
|
|
16
|
+
|
|
17
|
+
const page0Show = ref(false);
|
|
18
|
+
let page0Data = null;
|
|
19
|
+
const page0Anim = ref({ anim: null, onend: null });
|
|
20
|
+
const appSwiper_onFocus = () => {
|
|
21
|
+
console.log("testtest swiper on focus")
|
|
22
|
+
props.onFocus();
|
|
23
|
+
};
|
|
24
|
+
const appSwiper_onBlur = () => {
|
|
25
|
+
console.log("testtest swiper on blur")
|
|
26
|
+
props.onBlur();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const appSwiper_tabIdWatcher = (newValue, oldValue) => {
|
|
30
|
+
let direction = newValue > oldValue ? "left" : "right";
|
|
31
|
+
page0Show.value = false;
|
|
32
|
+
page0Data = null;
|
|
33
|
+
page0Anim.value = ref({ anim: null, onend: null });
|
|
34
|
+
props.dataLoader(newValue).then((data) => {
|
|
35
|
+
console.log("testtest swiper data", data);
|
|
36
|
+
if (oldValue > -1) {
|
|
37
|
+
animState.value = 1;
|
|
38
|
+
}
|
|
39
|
+
page0Anim.value = {
|
|
40
|
+
anim:
|
|
41
|
+
oldValue != -1
|
|
42
|
+
? `app-swiper-${direction}-slide-in ${
|
|
43
|
+
props.animDuration / 1000
|
|
44
|
+
}s cubic-bezier(0.05, 0.55, 0.13, 0.78) 1`
|
|
45
|
+
: null,
|
|
46
|
+
onend: () => {
|
|
47
|
+
animState.value = 0;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
page0Data = data;
|
|
51
|
+
page0Show.value = true;
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
watch(
|
|
56
|
+
() => globalInfo.updateTabId,
|
|
57
|
+
(newValue, oldValue) => {
|
|
58
|
+
console.log("ccht updateTabId changed", globalInfo.updateTabId);
|
|
59
|
+
appSwiper_tabIdWatcher(newValue, oldValue);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<jsv-focus-block
|
|
66
|
+
:name="name"
|
|
67
|
+
ref="focusNode"
|
|
68
|
+
:onAction="{
|
|
69
|
+
onFocus: appSwiper_onFocus,
|
|
70
|
+
onBlur: appSwiper_onBlur,
|
|
71
|
+
}"
|
|
72
|
+
>
|
|
73
|
+
<div
|
|
74
|
+
id="page0"
|
|
75
|
+
:style="{
|
|
76
|
+
left: layout.left,
|
|
77
|
+
top: layout.top,
|
|
78
|
+
width: layout.width,
|
|
79
|
+
height: layout.height,
|
|
80
|
+
animation: page0Anim.anim,
|
|
81
|
+
animationFillMode: 'forwards',
|
|
82
|
+
}"
|
|
83
|
+
@animationend="page0Anim.onend"
|
|
84
|
+
>
|
|
85
|
+
<slot v-if="page0Show" :data="page0Data" :onEdge="onEdge"></slot>
|
|
86
|
+
</div>
|
|
87
|
+
</jsv-focus-block>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<style>
|
|
91
|
+
@keyframes app-swiper-left-slide-in {
|
|
92
|
+
from {
|
|
93
|
+
transform: translate3d(0px, 180px, 0px);
|
|
94
|
+
}
|
|
95
|
+
to {
|
|
96
|
+
transform: translate3d(0px, 0px, 0px);
|
|
97
|
+
/* animation-timing-function: cubic-bezier(0.05, 0.55, 0.13, 0.78); */
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes app-swiper-right-slide-in {
|
|
102
|
+
from {
|
|
103
|
+
transform: translate3d(0px, -180px, 0px);
|
|
104
|
+
}
|
|
105
|
+
to {
|
|
106
|
+
transform: translate3d(0px, 0px, 0px);
|
|
107
|
+
/* animation-timing-function: cubic-bezier(0.05, 0.55, 0.13, 0.78); */
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// 导入所有图片
|
|
2
|
+
import movieTicket from './assets/movie_ticket.png';
|
|
3
|
+
import varietyShow from './assets/variety_show.png';
|
|
4
|
+
import childrenScience from './assets/children_science.png';
|
|
5
|
+
import tvDrama from './assets/tv_drama.png';
|
|
6
|
+
import documentary from './assets/documentary.png';
|
|
7
|
+
import myAccount from './assets/my_account.png';
|
|
8
|
+
import free from './assets/free.png';
|
|
9
|
+
import opera from './assets/opera.png';
|
|
10
|
+
import vip from './assets/vip.png';
|
|
11
|
+
import sports from './assets/sports.png';
|
|
12
|
+
import homeSelected from './assets/home_selected.png';
|
|
13
|
+
import game from './assets/game.png';
|
|
14
|
+
|
|
15
|
+
export const testData = [
|
|
16
|
+
{
|
|
17
|
+
"indexId": 0,
|
|
18
|
+
"itemTitle": "电影票",
|
|
19
|
+
"icon": movieTicket
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"indexId": 1,
|
|
23
|
+
"itemTitle": "综艺",
|
|
24
|
+
"icon": varietyShow
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"indexId": 2,
|
|
28
|
+
"itemTitle": "少儿科普",
|
|
29
|
+
"icon": childrenScience
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"indexId": 3,
|
|
33
|
+
"itemTitle": "电视剧",
|
|
34
|
+
"icon": tvDrama
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"indexId": 4,
|
|
38
|
+
"itemTitle": "纪录片",
|
|
39
|
+
"icon": documentary
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"indexId": 5,
|
|
43
|
+
"itemTitle": "我的",
|
|
44
|
+
"icon": myAccount,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"indexId": 6,
|
|
48
|
+
"itemTitle": "免费",
|
|
49
|
+
"icon": free,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"indexId": 7,
|
|
53
|
+
"itemTitle": "戏曲",
|
|
54
|
+
"icon": opera,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"indexId": 8,
|
|
58
|
+
"itemTitle": "VIP",
|
|
59
|
+
"icon": vip,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"indexId": 9,
|
|
63
|
+
"itemTitle": "体育",
|
|
64
|
+
"icon": sports,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"indexId": 10,
|
|
68
|
+
"itemTitle": "首页",
|
|
69
|
+
"icon": homeSelected,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"indexId": 11,
|
|
73
|
+
"itemTitle": "游戏",
|
|
74
|
+
"icon": game,
|
|
75
|
+
},
|
|
76
|
+
];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{ width: 1280, height: 720, backgroundColor: '#f5f57d' }"></div>
|
|
3
|
+
<jsv-focus-block
|
|
4
|
+
autoFocus
|
|
5
|
+
:onAction="{
|
|
6
|
+
onKeyDown,
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<Vortex
|
|
10
|
+
ref="cGenieRef"
|
|
11
|
+
:layout="{
|
|
12
|
+
left: 120,
|
|
13
|
+
top: 50,
|
|
14
|
+
width: width,
|
|
15
|
+
height: height,
|
|
16
|
+
}"
|
|
17
|
+
:time="1"
|
|
18
|
+
:onAnimEnd="onAnimEnd"
|
|
19
|
+
:initShow="true"
|
|
20
|
+
>
|
|
21
|
+
<img
|
|
22
|
+
:src="`url(${imageUrl})`"
|
|
23
|
+
:style="{
|
|
24
|
+
width: width,
|
|
25
|
+
height: height,
|
|
26
|
+
}"
|
|
27
|
+
@load="onImgLoaded"
|
|
28
|
+
/>
|
|
29
|
+
<div
|
|
30
|
+
:style="{
|
|
31
|
+
width: 1024,
|
|
32
|
+
height: 100,
|
|
33
|
+
backgroundColor: '#ffffff44',
|
|
34
|
+
}"
|
|
35
|
+
></div>
|
|
36
|
+
<div
|
|
37
|
+
:style="{
|
|
38
|
+
width: width,
|
|
39
|
+
height: height,
|
|
40
|
+
fontSize: 50,
|
|
41
|
+
color: '#fff',
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
}"
|
|
44
|
+
>
|
|
45
|
+
按OK键出场/入场
|
|
46
|
+
</div>
|
|
47
|
+
</Vortex>
|
|
48
|
+
</jsv-focus-block>
|
|
49
|
+
</template>
|
|
50
|
+
<script setup>
|
|
51
|
+
import Vortex from "./Vortex/Vortex.vue";
|
|
52
|
+
import { shallowRef } from "vue";
|
|
53
|
+
|
|
54
|
+
const cGenieRef = shallowRef();
|
|
55
|
+
const position = { x: -80, y: 600 };
|
|
56
|
+
const width = 1024;
|
|
57
|
+
const height = 576;
|
|
58
|
+
const imageUrl =
|
|
59
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Genie/App/element_228542_icon_20230610184253.jpg";
|
|
60
|
+
|
|
61
|
+
let imgLoaded = false;
|
|
62
|
+
function onImgLoaded() {
|
|
63
|
+
imgLoaded = true;
|
|
64
|
+
}
|
|
65
|
+
const onAnimEnd = () => {
|
|
66
|
+
console.log("anim end");
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
function onKeyDown(ev) {
|
|
70
|
+
if (ev.keyCode == 13) {
|
|
71
|
+
if (imgLoaded) {
|
|
72
|
+
cGenieRef.value.switch();
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
</script>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{
|
|
4
|
+
left: layout.left,
|
|
5
|
+
top: layout.top,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
8
|
+
<jsv-frag-shader-view
|
|
9
|
+
v-if="showFbo"
|
|
10
|
+
:key="keyCount"
|
|
11
|
+
ref="shaderViewRef"
|
|
12
|
+
:style="{
|
|
13
|
+
width: layout.width,
|
|
14
|
+
height: layout.height,
|
|
15
|
+
}"
|
|
16
|
+
:duration="shaderSetting.duration"
|
|
17
|
+
:shaderStr="shaderSetting.shader"
|
|
18
|
+
:autoplay="true"
|
|
19
|
+
:textures="shaderSetting.textures"
|
|
20
|
+
:onEnd="onAnimEnd"
|
|
21
|
+
></jsv-frag-shader-view>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
v-if="!showOrigin"
|
|
25
|
+
:style="{
|
|
26
|
+
width: 1,
|
|
27
|
+
height: 1,
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
}"
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
ref="slotRootRef"
|
|
33
|
+
:style="{
|
|
34
|
+
width: layout.width,
|
|
35
|
+
height: layout.height,
|
|
36
|
+
}"
|
|
37
|
+
>
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
v-else
|
|
43
|
+
ref="slotRootRef"
|
|
44
|
+
:style="{
|
|
45
|
+
width: layout.width,
|
|
46
|
+
height: layout.height,
|
|
47
|
+
}"
|
|
48
|
+
>
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup>
|
|
55
|
+
/**
|
|
56
|
+
* @slot 默认插槽 - 用于放置需要进行漩涡动画的内容
|
|
57
|
+
*/
|
|
58
|
+
import vortexOutShader from "./vortexOut.glsl?raw";
|
|
59
|
+
import vortexInShader from "./vortexIn.glsl?raw";
|
|
60
|
+
|
|
61
|
+
import { onMounted, onUnmounted, shallowRef, ref, computed } from "vue";
|
|
62
|
+
import {
|
|
63
|
+
JsvFragShaderView,
|
|
64
|
+
getKeyFramesGroup,
|
|
65
|
+
JsvTextureStoreApi,
|
|
66
|
+
} from "jsview";
|
|
67
|
+
|
|
68
|
+
const props = defineProps({
|
|
69
|
+
/**
|
|
70
|
+
* @type {Object} 布局配置对象
|
|
71
|
+
* @property {string} left - 组件左侧定位(如 '10px')
|
|
72
|
+
* @property {string} top - 组件顶部定位(如 '20px')
|
|
73
|
+
* @property {string} width - 组件宽度(如 '300px')
|
|
74
|
+
* @property {string} height - 组件高度(如 '200px')
|
|
75
|
+
*/
|
|
76
|
+
layout: {
|
|
77
|
+
type: Object,
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* @type {number} 动画持续时间(单位:秒)
|
|
82
|
+
* @default 1
|
|
83
|
+
*/
|
|
84
|
+
duration: {
|
|
85
|
+
type: Number,
|
|
86
|
+
default: 1,
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* @type {boolean} 初始显示状态
|
|
90
|
+
* @default true
|
|
91
|
+
*/
|
|
92
|
+
initShow: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: true,
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* @type {Function} 动画结束回调函数
|
|
98
|
+
*/
|
|
99
|
+
onAnimEnd: {
|
|
100
|
+
type: Function,
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const showOrigin = shallowRef(props.initShow);
|
|
105
|
+
const showFbo = shallowRef(false);
|
|
106
|
+
const slotRootRef = shallowRef();
|
|
107
|
+
const keyCount = ref(0);
|
|
108
|
+
const shaderViewRef = ref();
|
|
109
|
+
let state = props.initShow ? 1 : 0;
|
|
110
|
+
|
|
111
|
+
let shaderSetting = {
|
|
112
|
+
name: "vortex",
|
|
113
|
+
shader: "",
|
|
114
|
+
uniforms: [],
|
|
115
|
+
textures: [
|
|
116
|
+
{
|
|
117
|
+
name: "iChannel0",
|
|
118
|
+
resource: "",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
duration: Math.round(props.duration * 1000),
|
|
122
|
+
};
|
|
123
|
+
let _onEnd = null;
|
|
124
|
+
|
|
125
|
+
function animOut() {
|
|
126
|
+
shaderSetting.shader = vortexOutShader;
|
|
127
|
+
_onEnd = () => {
|
|
128
|
+
showOrigin.value = false;
|
|
129
|
+
};
|
|
130
|
+
capture();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function animIn() {
|
|
134
|
+
shaderSetting.shader = vortexInShader;
|
|
135
|
+
_onEnd = () => {
|
|
136
|
+
showOrigin.value = true;
|
|
137
|
+
};
|
|
138
|
+
capture();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function onAnimEnd() {
|
|
142
|
+
showFbo.value = false;
|
|
143
|
+
_onEnd();
|
|
144
|
+
props.onAnimEnd?.();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function capture() {
|
|
148
|
+
JsvTextureStoreApi.capture2Texture(
|
|
149
|
+
slotRootRef.value,
|
|
150
|
+
(textureName, autoRecycle, w, h) => {
|
|
151
|
+
shaderSetting.textures[0].resource = `jsvtexturestore://${textureName}`;
|
|
152
|
+
|
|
153
|
+
if (autoRecycle) {
|
|
154
|
+
// 已经是设置了texture的自动回收,所以不再需要主动调用 JsvTextureStoreApi.deleteTexture 来释放内存
|
|
155
|
+
}
|
|
156
|
+
showOrigin.value = false;
|
|
157
|
+
++keyCount.value;
|
|
158
|
+
showFbo.value = true;
|
|
159
|
+
},
|
|
160
|
+
true // 自动回收, 不填也行,默认为true
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
defineExpose({
|
|
165
|
+
/**
|
|
166
|
+
* 切换动画状态
|
|
167
|
+
* @example
|
|
168
|
+
* componentRef.value.switch();
|
|
169
|
+
*/
|
|
170
|
+
switch() {
|
|
171
|
+
if (state == 0) {
|
|
172
|
+
state = 1;
|
|
173
|
+
animIn();
|
|
174
|
+
} else {
|
|
175
|
+
state = 0;
|
|
176
|
+
animOut();
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#define RANGE 6.
|
|
2
|
+
#define SPEED .5
|
|
3
|
+
#define STRENGTH 6.
|
|
4
|
+
|
|
5
|
+
mat2 rotate(float a) {
|
|
6
|
+
float s = sin(a);
|
|
7
|
+
float c = cos(a);
|
|
8
|
+
return mat2(c, -s, s, c);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
void mainImage(out vec4 fragColor, vec2 coord) {
|
|
12
|
+
/** mediump精度10bit, 直接使用0-1的uv, 小值的normalize()会有精度问题, 导致异常大的结果; 但乘1920x1080又会有大值的问题, 所以选取16x9 */
|
|
13
|
+
vec2 aspect = (iResolution.xy / iResolution.y) * 9.;
|
|
14
|
+
vec2 center = 0.5 * aspect;
|
|
15
|
+
|
|
16
|
+
vec2 uv = coord / iResolution.xy * aspect;
|
|
17
|
+
uv -= center;
|
|
18
|
+
|
|
19
|
+
float d = length(uv);
|
|
20
|
+
float progress = 1. - iTime / iDuration;
|
|
21
|
+
|
|
22
|
+
//vortex
|
|
23
|
+
float cTime = STRENGTH * progress;
|
|
24
|
+
d = smoothstep(0., RANGE, RANGE - d) * cTime;
|
|
25
|
+
uv *= rotate(d);
|
|
26
|
+
|
|
27
|
+
//shrink
|
|
28
|
+
float edge = aspect.y * abs(progress);
|
|
29
|
+
uv = uv + normalize(uv) * edge;
|
|
30
|
+
|
|
31
|
+
uv += center;
|
|
32
|
+
uv /= aspect;
|
|
33
|
+
if(uv.x > 1. || uv.y > 1. || uv.x < 0. || uv.y < 0.) {
|
|
34
|
+
fragColor = vec4(0.0);
|
|
35
|
+
} else {
|
|
36
|
+
fragColor = jsvTexture2D(iChannel0, uv);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#define RANGE 6.
|
|
2
|
+
#define SPEED .5
|
|
3
|
+
#define STRENGTH 6.
|
|
4
|
+
|
|
5
|
+
mat2 rotate(float a) {
|
|
6
|
+
float s = sin(a);
|
|
7
|
+
float c = cos(a);
|
|
8
|
+
return mat2(c, -s, s, c);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
void mainImage(out vec4 fragColor, vec2 coord) {
|
|
12
|
+
/** mediump精度10bit, 直接使用0-1的uv, 小值的normalize()会有精度问题, 导致异常大的结果; 但乘1920x1080又会有大值的问题, 所以选取16x9 */
|
|
13
|
+
vec2 aspect = (iResolution.xy / iResolution.y) * 9.;
|
|
14
|
+
vec2 center = 0.5 * aspect;
|
|
15
|
+
|
|
16
|
+
vec2 uv = coord / iResolution.xy * aspect;
|
|
17
|
+
uv -= center;
|
|
18
|
+
|
|
19
|
+
float d = length(uv);
|
|
20
|
+
float progress = iTime / iDuration;
|
|
21
|
+
|
|
22
|
+
//vortex
|
|
23
|
+
float cTime = STRENGTH * progress;
|
|
24
|
+
d = smoothstep(0., RANGE, RANGE - d) * cTime;
|
|
25
|
+
uv *= rotate(d);
|
|
26
|
+
|
|
27
|
+
//shrink
|
|
28
|
+
float edge = aspect.y * abs(progress);
|
|
29
|
+
uv = uv + normalize(uv) * edge;
|
|
30
|
+
|
|
31
|
+
uv += center;
|
|
32
|
+
uv /= aspect;
|
|
33
|
+
if(uv.x > 1. || uv.y > 1. || uv.x < 0. || uv.y < 0.) {
|
|
34
|
+
fragColor = vec4(0.0);
|
|
35
|
+
} else {
|
|
36
|
+
fragColor = jsvTexture2D(iChannel0, uv);
|
|
37
|
+
}
|
|
38
|
+
}
|