@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,158 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shallowRef, onMounted } from "vue";
|
|
3
|
+
import Blur, { captureBlurTexture } from "../Blur.vue";
|
|
4
|
+
import StaticBgSlide from "./StaticBgSlide.vue";
|
|
5
|
+
|
|
6
|
+
const vToCapture = shallowRef(null);
|
|
7
|
+
const vTextureInfo = shallowRef(null);
|
|
8
|
+
|
|
9
|
+
let isBlur = false;
|
|
10
|
+
function enableBlur() {
|
|
11
|
+
if (isBlur) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
isBlur = true;
|
|
15
|
+
captureBlurTexture(vToCapture.value, 12).then((textureInfo) => {
|
|
16
|
+
vTextureInfo.value = textureInfo;
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
curPosition.left = 0;
|
|
19
|
+
bgAnim.value?.slide(curPosition);
|
|
20
|
+
}, 0);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const ImagePanda =
|
|
25
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CustomShader/App/panda.jpeg";
|
|
26
|
+
|
|
27
|
+
let curPosition = {
|
|
28
|
+
left: 0,
|
|
29
|
+
top: 0,
|
|
30
|
+
};
|
|
31
|
+
let width1 = 300;
|
|
32
|
+
let height1 = 720;
|
|
33
|
+
const bgAnim = shallowRef(null);
|
|
34
|
+
const onKeyDown = (ev) => {
|
|
35
|
+
console.log("ccht", ev.keyCode);
|
|
36
|
+
switch (ev.keyCode) {
|
|
37
|
+
case 37:
|
|
38
|
+
if (isBlur) {
|
|
39
|
+
curPosition.left = -width1;
|
|
40
|
+
bgAnim.value?.slide(curPosition);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
break;
|
|
44
|
+
case 39:
|
|
45
|
+
if (isBlur) {
|
|
46
|
+
curPosition.left = 0;
|
|
47
|
+
bgAnim.value?.slide(curPosition);
|
|
48
|
+
} else {
|
|
49
|
+
enableBlur();
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
// case 38:
|
|
53
|
+
// curPosition.top = curPosition.top - 100;
|
|
54
|
+
// bgAnim.value?.slide(curPosition);
|
|
55
|
+
// break;
|
|
56
|
+
// case 40:
|
|
57
|
+
// curPosition.top = curPosition.top + 100;
|
|
58
|
+
// bgAnim.value?.slide(curPosition);
|
|
59
|
+
// break;
|
|
60
|
+
// case 13:
|
|
61
|
+
// enableBlur();
|
|
62
|
+
// break;
|
|
63
|
+
default:
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
onMounted(() => {
|
|
69
|
+
// enableBlur();
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<jsv-focus-block
|
|
75
|
+
autoFocus
|
|
76
|
+
:onAction="{
|
|
77
|
+
onKeyDown: onKeyDown,
|
|
78
|
+
}"
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
ref="vToCapture"
|
|
82
|
+
:style="{
|
|
83
|
+
width: 1280, // 截屏区域的宽
|
|
84
|
+
height: 720, // 截屏区域的高
|
|
85
|
+
}"
|
|
86
|
+
>
|
|
87
|
+
<div
|
|
88
|
+
:style="{
|
|
89
|
+
width: 1280,
|
|
90
|
+
height: 720,
|
|
91
|
+
backgroundImage: `url(${ImagePanda})`,
|
|
92
|
+
}"
|
|
93
|
+
/>
|
|
94
|
+
<div
|
|
95
|
+
:style="{
|
|
96
|
+
top: 300,
|
|
97
|
+
width: 1280,
|
|
98
|
+
// height: 81,
|
|
99
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
100
|
+
color: '#ffffff',
|
|
101
|
+
// fontSize: 68,
|
|
102
|
+
textAlign: 'center',
|
|
103
|
+
// lineHeight: 81,
|
|
104
|
+
|
|
105
|
+
height: 38,
|
|
106
|
+
lineHeight: 38,
|
|
107
|
+
fontSize: 36,
|
|
108
|
+
fontWeight: 'bold',
|
|
109
|
+
}"
|
|
110
|
+
>
|
|
111
|
+
左右键展开/隐藏面板
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div v-if="vTextureInfo">
|
|
116
|
+
<StaticBgSlide
|
|
117
|
+
key="bg"
|
|
118
|
+
ref="bgAnim"
|
|
119
|
+
:imgUrl="`jsvtexturestore://${vTextureInfo.textureId}`"
|
|
120
|
+
:width="width1"
|
|
121
|
+
:height="height1"
|
|
122
|
+
:bgWidth="1280"
|
|
123
|
+
:bgHeight="720"
|
|
124
|
+
:borderRadius="'0 30 30 0'"
|
|
125
|
+
:initPosition="{
|
|
126
|
+
left: -width1,
|
|
127
|
+
top: 0,
|
|
128
|
+
}"
|
|
129
|
+
>
|
|
130
|
+
<div
|
|
131
|
+
:style="{
|
|
132
|
+
width: width1,
|
|
133
|
+
height: height1,
|
|
134
|
+
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
135
|
+
borderRadius: '0 30 30 0',
|
|
136
|
+
lineHeight: height1,
|
|
137
|
+
textAlign: 'center',
|
|
138
|
+
color: '#ffffff',
|
|
139
|
+
fontSize: 40,
|
|
140
|
+
}"
|
|
141
|
+
>
|
|
142
|
+
弹窗内容
|
|
143
|
+
</div>
|
|
144
|
+
</StaticBgSlide>
|
|
145
|
+
</div>
|
|
146
|
+
</jsv-focus-block>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<style>
|
|
150
|
+
@keyframes rotate {
|
|
151
|
+
0% {
|
|
152
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
153
|
+
}
|
|
154
|
+
100% {
|
|
155
|
+
transform: rotate3d(0, 0, 1, 360deg);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<jsv-preload
|
|
3
|
+
v-if="needPreload"
|
|
4
|
+
key="preload"
|
|
5
|
+
:preloadList="[preloadInfo]"
|
|
6
|
+
:onPreloadDone="handlePreloadDone"
|
|
7
|
+
></jsv-preload>
|
|
8
|
+
<div
|
|
9
|
+
:style="{
|
|
10
|
+
width: props.width,
|
|
11
|
+
height: props.height,
|
|
12
|
+
left: curPosition.left,
|
|
13
|
+
top: curPosition.top,
|
|
14
|
+
transition: `left ${props.duration}ms, top ${props.duration}ms`,
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<jsv-texture-anim
|
|
18
|
+
v-if="isPreloadDone"
|
|
19
|
+
ref="pandaAnim"
|
|
20
|
+
:src="props.imgUrl"
|
|
21
|
+
:width="props.width"
|
|
22
|
+
:height="props.height"
|
|
23
|
+
:animation="appliedAnim"
|
|
24
|
+
:duration="props.duration"
|
|
25
|
+
:transform="appliedTrans"
|
|
26
|
+
:borderRadius="props.borderRadius"
|
|
27
|
+
:autoStart="false"
|
|
28
|
+
:onAnimationEnd="onAnimEnd"
|
|
29
|
+
></jsv-texture-anim>
|
|
30
|
+
<slot></slot>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup>
|
|
35
|
+
import { ref, shallowRef, computed, reactive } from "vue";
|
|
36
|
+
import { JsvPreload, buildPreloadInfo } from "jsview";
|
|
37
|
+
import { JsvTextureAnim } from "jsview";
|
|
38
|
+
|
|
39
|
+
const props = defineProps({
|
|
40
|
+
imgUrl: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
width: {
|
|
45
|
+
type: Number,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
height: {
|
|
49
|
+
type: Number,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
bgWidth: {
|
|
53
|
+
type: Number,
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
bgHeight: {
|
|
57
|
+
type: Number,
|
|
58
|
+
required: true,
|
|
59
|
+
},
|
|
60
|
+
duration: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: 200,
|
|
63
|
+
},
|
|
64
|
+
easing: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "linear",
|
|
67
|
+
},
|
|
68
|
+
borderRadius: {
|
|
69
|
+
type: Number,
|
|
70
|
+
default: 0,
|
|
71
|
+
},
|
|
72
|
+
initPosition: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: () => ({
|
|
75
|
+
left: 0,
|
|
76
|
+
top: 0,
|
|
77
|
+
}),
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const needPreload = ref(false);
|
|
82
|
+
const isPreloadDone = ref(false);
|
|
83
|
+
let preloadInfo = [];
|
|
84
|
+
if (props.imgUrl.includes("jsvtexturestore://")) {
|
|
85
|
+
needPreload.value = false;
|
|
86
|
+
isPreloadDone.value = true;
|
|
87
|
+
} else {
|
|
88
|
+
needPreload.value = true;
|
|
89
|
+
isPreloadDone.value = false;
|
|
90
|
+
preloadInfo = buildPreloadInfo(props.imgUrl);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const pandaAnim = shallowRef(null);
|
|
94
|
+
//view相对于bg的偏移量
|
|
95
|
+
const curPosition = reactive(props.initPosition);
|
|
96
|
+
|
|
97
|
+
const baseScale = computed(
|
|
98
|
+
() =>
|
|
99
|
+
`scale3d(${props.bgWidth / props.width}, ${
|
|
100
|
+
props.bgHeight / props.height
|
|
101
|
+
}, 1)`
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const scaleOffset = {
|
|
105
|
+
left: (props.width - props.bgWidth) / 2,
|
|
106
|
+
top: (props.height - props.bgHeight) / 2,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const getTargetTransform = (target) => {
|
|
110
|
+
return `translate3d(${
|
|
111
|
+
((-target.left - scaleOffset.left) / props.width) * 100
|
|
112
|
+
}%, ${((-target.top - scaleOffset.top) / props.height) * 100}%, 0) ${
|
|
113
|
+
baseScale.value
|
|
114
|
+
}`;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const appliedTrans = ref(getTargetTransform(curPosition));
|
|
118
|
+
const appliedAnim = ref(null);
|
|
119
|
+
|
|
120
|
+
//TODO JsvPreload 的回调会执行多次,所以需要一个标志来判断是否已经执行过
|
|
121
|
+
let loadDone = false;
|
|
122
|
+
|
|
123
|
+
const handlePreloadDone = (resultMap) => {
|
|
124
|
+
if (loadDone) return;
|
|
125
|
+
loadDone = true;
|
|
126
|
+
appliedTrans.value = getTargetTransform(curPosition);
|
|
127
|
+
isPreloadDone.value = true;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
let onAnimEnd = (normalEnd) => {
|
|
131
|
+
if (normalEnd) {
|
|
132
|
+
appliedTrans.value = getTargetTransform(curPosition);
|
|
133
|
+
}
|
|
134
|
+
appliedAnim.value = null;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
function slide(to) {
|
|
138
|
+
const prePosition = {
|
|
139
|
+
left: curPosition.left,
|
|
140
|
+
top: curPosition.top,
|
|
141
|
+
};
|
|
142
|
+
curPosition.left = to.left ?? prePosition.left;
|
|
143
|
+
curPosition.top = to.top ?? prePosition.top;
|
|
144
|
+
|
|
145
|
+
if (
|
|
146
|
+
prePosition.left === curPosition.left &&
|
|
147
|
+
prePosition.top === curPosition.top
|
|
148
|
+
) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
appliedTrans.value = null;
|
|
153
|
+
appliedAnim.value = `{from {transform: ${getTargetTransform(
|
|
154
|
+
prePosition
|
|
155
|
+
)};} to {transform: ${getTargetTransform(curPosition)};}}`;
|
|
156
|
+
pandaAnim.value.start(appliedAnim.value);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
defineExpose({
|
|
160
|
+
slide,
|
|
161
|
+
});
|
|
162
|
+
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shallowRef } from "vue";
|
|
3
|
+
import Blur, { captureBlurTexture } from "../Blur.vue";
|
|
4
|
+
|
|
5
|
+
const vToCapture = shallowRef(null);
|
|
6
|
+
const vTextureInfo = shallowRef(null);
|
|
7
|
+
|
|
8
|
+
function enableBlur() {
|
|
9
|
+
captureBlurTexture(vToCapture.value, 12).then((textureInfo) => {
|
|
10
|
+
vTextureInfo.value = textureInfo;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const _onKeyDown = (ev) => {
|
|
15
|
+
if (ev.keyCode == 13) {
|
|
16
|
+
enableBlur();
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const popupViewLayout = {
|
|
22
|
+
left: (1280 - 400) / 2,
|
|
23
|
+
top: 100,
|
|
24
|
+
width: 400,
|
|
25
|
+
height: 400,
|
|
26
|
+
};
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<jsv-focus-block
|
|
31
|
+
autoFocus
|
|
32
|
+
:onAction="{
|
|
33
|
+
onKeyDown: _onKeyDown,
|
|
34
|
+
}"
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
ref="vToCapture"
|
|
38
|
+
:style="{
|
|
39
|
+
width: 1280, // 截屏区域的宽
|
|
40
|
+
height: 720, // 截屏区域的高
|
|
41
|
+
}"
|
|
42
|
+
>
|
|
43
|
+
<div
|
|
44
|
+
:style="{
|
|
45
|
+
width: 1280,
|
|
46
|
+
height: 720,
|
|
47
|
+
backgroundImage: `url(https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoHomepage/App/BackgroundLongmao.jpg)`,
|
|
48
|
+
}"
|
|
49
|
+
/>
|
|
50
|
+
<div
|
|
51
|
+
:style="{
|
|
52
|
+
top: 300,
|
|
53
|
+
width: 1280,
|
|
54
|
+
height: 100,
|
|
55
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
56
|
+
color: '#ffffff',
|
|
57
|
+
fontSize: 40,
|
|
58
|
+
textAlign: 'center',
|
|
59
|
+
}"
|
|
60
|
+
>
|
|
61
|
+
按OK键弹出带模糊背景的框
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div
|
|
66
|
+
v-if="vTextureInfo"
|
|
67
|
+
:style="{
|
|
68
|
+
left: popupViewLayout.left,
|
|
69
|
+
top: popupViewLayout.top,
|
|
70
|
+
}"
|
|
71
|
+
>
|
|
72
|
+
<blur
|
|
73
|
+
:textureInfo="vTextureInfo"
|
|
74
|
+
:layout="{
|
|
75
|
+
left: 0,
|
|
76
|
+
top: 0,
|
|
77
|
+
width: popupViewLayout.width,
|
|
78
|
+
height: popupViewLayout.height,
|
|
79
|
+
}"
|
|
80
|
+
:showRectPos="{
|
|
81
|
+
left: popupViewLayout.left,
|
|
82
|
+
top: popupViewLayout.top,
|
|
83
|
+
}"
|
|
84
|
+
:borderRadius="30"
|
|
85
|
+
/>
|
|
86
|
+
<div
|
|
87
|
+
:style="{
|
|
88
|
+
width: popupViewLayout.width,
|
|
89
|
+
height: popupViewLayout.height,
|
|
90
|
+
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
91
|
+
borderRadius: 30,
|
|
92
|
+
lineHeight: popupViewLayout.height,
|
|
93
|
+
textAlign: 'center',
|
|
94
|
+
color: '#ffffff',
|
|
95
|
+
fontSize: 40,
|
|
96
|
+
}"
|
|
97
|
+
>
|
|
98
|
+
弹窗内容
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</jsv-focus-block>
|
|
102
|
+
</template>
|
|
103
|
+
|
|
104
|
+
<style>
|
|
105
|
+
@keyframes rotate {
|
|
106
|
+
0% {
|
|
107
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
108
|
+
}
|
|
109
|
+
100% {
|
|
110
|
+
transform: rotate3d(0, 0, 1, 360deg);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<FlippingBook
|
|
4
|
+
:page-count="totalPages"
|
|
5
|
+
:position="position"
|
|
6
|
+
:page-size="pageSize"
|
|
7
|
+
ref="bookFlipRef"
|
|
8
|
+
>
|
|
9
|
+
<template #default="{ pageIndex, triggerFlush }">
|
|
10
|
+
<BookPage
|
|
11
|
+
:width="pageSize.width"
|
|
12
|
+
:height="pageSize.height"
|
|
13
|
+
:index="pageIndex"
|
|
14
|
+
:flushTrigger="triggerFlush"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
</FlippingBook>
|
|
18
|
+
|
|
19
|
+
<div :style="{ top: 650 }">
|
|
20
|
+
<JsvFocusBlock :autoFocus="true" :onKeyDown="handleKeyDown">
|
|
21
|
+
<div
|
|
22
|
+
class="page-info"
|
|
23
|
+
:style="{
|
|
24
|
+
top: -40,
|
|
25
|
+
left: 400,
|
|
26
|
+
height: 50,
|
|
27
|
+
width: 480,
|
|
28
|
+
lineHeight: 50,
|
|
29
|
+
textAlign: 'center',
|
|
30
|
+
color: '#FFFFFF',
|
|
31
|
+
}"
|
|
32
|
+
>
|
|
33
|
+
左右键进行翻页
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
class="page-info"
|
|
37
|
+
:style="{
|
|
38
|
+
left: 400,
|
|
39
|
+
height: 50,
|
|
40
|
+
width: 480,
|
|
41
|
+
lineHeight: 50,
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
color: '#FF0000',
|
|
44
|
+
}"
|
|
45
|
+
>
|
|
46
|
+
当前页: {{ currentPage + 1 }} / {{ totalPages }}
|
|
47
|
+
</div>
|
|
48
|
+
</JsvFocusBlock>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script setup>
|
|
54
|
+
import { ref } from "vue";
|
|
55
|
+
import FlippingBook from "./BookFlip/FlippingBook.vue";
|
|
56
|
+
import BookPage from "./BookPage.vue";
|
|
57
|
+
import { JsvFocusBlock } from "jsview";
|
|
58
|
+
|
|
59
|
+
// 配置参数
|
|
60
|
+
const totalPages = 8;
|
|
61
|
+
const pageSize = {
|
|
62
|
+
width: 980,
|
|
63
|
+
height: 500,
|
|
64
|
+
};
|
|
65
|
+
const position = {
|
|
66
|
+
x: 150,
|
|
67
|
+
y: 100,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// 组件引用和状态
|
|
71
|
+
const bookFlipRef = ref(null);
|
|
72
|
+
const currentPage = ref(0);
|
|
73
|
+
|
|
74
|
+
// 翻页方法
|
|
75
|
+
const nextPage = () => {
|
|
76
|
+
if (currentPage.value < totalPages - 1) {
|
|
77
|
+
currentPage.value++;
|
|
78
|
+
bookFlipRef.value.setCurrentPage(currentPage.value);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const prevPage = () => {
|
|
83
|
+
if (currentPage.value > 0) {
|
|
84
|
+
currentPage.value--;
|
|
85
|
+
bookFlipRef.value.setCurrentPage(currentPage.value);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// 按键处理
|
|
90
|
+
const handleKeyDown = (event) => {
|
|
91
|
+
switch (event.keyCode) {
|
|
92
|
+
case 37: // 左键的keyCode
|
|
93
|
+
prevPage();
|
|
94
|
+
return true;
|
|
95
|
+
case 39: // 右键的keyCode
|
|
96
|
+
nextPage();
|
|
97
|
+
return true;
|
|
98
|
+
default:
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<style scoped>
|
|
105
|
+
.control-btn {
|
|
106
|
+
font-size: 30;
|
|
107
|
+
background-color: rgba(76, 175, 80, 1);
|
|
108
|
+
color: rgba(128, 255, 255, 1);
|
|
109
|
+
border-radius: 4;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.page-info {
|
|
113
|
+
font-size: 30;
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { JsvFragShaderView, JsvPreload, buildPreloadInfo } from "jsview";
|
|
4
|
+
import pageFlipShader from "./flip.glsl?raw";
|
|
5
|
+
|
|
6
|
+
// 定义组件的 props
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
// 第一张图片资源
|
|
9
|
+
imageFrom: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
// 第二张图片资源
|
|
14
|
+
imageTo: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
// 初始页
|
|
19
|
+
initPage: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "from",
|
|
22
|
+
},
|
|
23
|
+
// 动画持续时间
|
|
24
|
+
duration: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 3000,
|
|
27
|
+
},
|
|
28
|
+
// 宽度
|
|
29
|
+
width: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 1280,
|
|
32
|
+
},
|
|
33
|
+
// 高度
|
|
34
|
+
height: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 720,
|
|
37
|
+
},
|
|
38
|
+
// 书本范围, 单位为组件的百分比
|
|
39
|
+
bookRect: {
|
|
40
|
+
type: Object,
|
|
41
|
+
default: () => ({
|
|
42
|
+
left: 0.15,
|
|
43
|
+
top: 0.05,
|
|
44
|
+
right: 0.85,
|
|
45
|
+
bottom: 0.95,
|
|
46
|
+
}),
|
|
47
|
+
validator: (value) => {
|
|
48
|
+
return (
|
|
49
|
+
value.left >= 0 &&
|
|
50
|
+
value.top >= 0 &&
|
|
51
|
+
value.right <= 1 &&
|
|
52
|
+
value.bottom <= 1
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// 定义事件
|
|
59
|
+
const emit = defineEmits(["animEnd"]);
|
|
60
|
+
|
|
61
|
+
const curPage = ref(props.initPage == "to" ? 1 : 0); // 0: from, 1: to
|
|
62
|
+
const rShowImg = ref(true);
|
|
63
|
+
let duringAnim = false;
|
|
64
|
+
const rImgUrl = computed(() => {
|
|
65
|
+
return curPage.value == 0 ? props.imageFrom : props.imageTo;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const rImgLayout = computed(() => {
|
|
69
|
+
const cBookRect = props.bookRect;
|
|
70
|
+
return {
|
|
71
|
+
left: cBookRect.left * props.width,
|
|
72
|
+
top: cBookRect.top * props.height,
|
|
73
|
+
width: (cBookRect.right - cBookRect.left) * props.width,
|
|
74
|
+
height: (cBookRect.bottom - cBookRect.top) * props.height,
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// 修改着色器代码,替换书籍范围常量
|
|
79
|
+
const rModifiedShader = computed(() => {
|
|
80
|
+
// 替换着色器中的 BOOK_BOUND 定义
|
|
81
|
+
return pageFlipShader.replace(
|
|
82
|
+
"#define BOOK_BOUND vec4(0.15, 0.05, 0.85, 0.95)",
|
|
83
|
+
`#define BOOK_BOUND vec4(${props.bookRect.left.toFixed(6)}, ${
|
|
84
|
+
1 - props.bookRect.bottom.toFixed(6)
|
|
85
|
+
}, ${props.bookRect.right.toFixed(6)}, ${
|
|
86
|
+
1 - props.bookRect.top.toFixed(6)
|
|
87
|
+
})`
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const rPageFlipSettings = computed(() => {
|
|
92
|
+
return {
|
|
93
|
+
name: "pageFlip",
|
|
94
|
+
shader: rModifiedShader.value,
|
|
95
|
+
uniforms: [],
|
|
96
|
+
textures: [
|
|
97
|
+
{
|
|
98
|
+
name: "iChannel0",
|
|
99
|
+
resource: props.imageFrom,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "iChannel1",
|
|
103
|
+
resource: props.imageTo,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
duration: props.duration,
|
|
107
|
+
onEnd: (id, cStatus) => {
|
|
108
|
+
emit("animEnd", cStatus);
|
|
109
|
+
|
|
110
|
+
curPage.value = curPage.value == 0 ? 1 : 0;
|
|
111
|
+
rShowImg.value = true;
|
|
112
|
+
duringAnim = false;
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const rWidgetRef = ref();
|
|
118
|
+
const rIsPreloadDone = ref(false);
|
|
119
|
+
let vPendingAnim = false;
|
|
120
|
+
|
|
121
|
+
const rPreloadList = computed(() => {
|
|
122
|
+
return [buildPreloadInfo(props.imageFrom), buildPreloadInfo(props.imageTo)];
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const handlePreloadDone = () => {
|
|
126
|
+
console.log("图片预加载完成");
|
|
127
|
+
rIsPreloadDone.value = true;
|
|
128
|
+
if (vPendingAnim) {
|
|
129
|
+
_startAnim();
|
|
130
|
+
vPendingAnim = false;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// 内部实际执行动画的方法
|
|
135
|
+
const _startAnim = (reverse = false) => {
|
|
136
|
+
console.log("开始翻页动画", reverse);
|
|
137
|
+
duringAnim = true;
|
|
138
|
+
rShowImg.value = false;
|
|
139
|
+
rWidgetRef.value?.startAnim(undefined, undefined, reverse);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// 暴露组件方法给父组件
|
|
143
|
+
defineExpose({
|
|
144
|
+
/**
|
|
145
|
+
* 翻页
|
|
146
|
+
*/
|
|
147
|
+
flip: () => {
|
|
148
|
+
if (duringAnim) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (rIsPreloadDone.value) {
|
|
152
|
+
_startAnim(curPage.value == 1);
|
|
153
|
+
} else {
|
|
154
|
+
vPendingAnim = true;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
getCurPage: () => {
|
|
158
|
+
return curPage == 0 ? "from" : "to";
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
</script>
|
|
162
|
+
|
|
163
|
+
<template>
|
|
164
|
+
<jsv-preload
|
|
165
|
+
:preloadList="rPreloadList"
|
|
166
|
+
:onPreloadDone="handlePreloadDone"
|
|
167
|
+
></jsv-preload>
|
|
168
|
+
<jsv-frag-shader-view
|
|
169
|
+
ref="rWidgetRef"
|
|
170
|
+
:style="{ left: 0, top: 0, width: width, height: height }"
|
|
171
|
+
:duration="rPageFlipSettings.duration"
|
|
172
|
+
:shaderStr="rPageFlipSettings.shader"
|
|
173
|
+
:autoplay="false"
|
|
174
|
+
:textures="rPageFlipSettings.textures"
|
|
175
|
+
:onEnd="rPageFlipSettings.onEnd"
|
|
176
|
+
:hideAfterEnd="false"
|
|
177
|
+
></jsv-frag-shader-view>
|
|
178
|
+
<img v-if="rShowImg" :src="rImgUrl" :style="rImgLayout" />
|
|
179
|
+
</template>
|