@shijiu/jsview-vue-samples 2.3.0 → 2.3.728-alpha.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/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/DashPath/App.vue +17 -16
- package/DashPath/AppForOperator.vue +2 -4
- package/DemoForOperator/AnimPic/AnimPic.vue +24 -2
- package/DemoForOperator/Banger/Banger/Banger.vue +73 -9
- package/DemoForOperator/Blur/Blur.vue +146 -0
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +184 -0
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +249 -0
- package/DemoForOperator/BookFlip/App.vue +115 -0
- package/DemoForOperator/BookFlip/BookPage.vue +82 -0
- package/DemoForOperator/Bounce/Bounce.vue +33 -1
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/ChunLian/Couplets.vue +44 -1
- package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
- package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
- package/DemoForOperator/DominantColor/App.vue +187 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +0 -3
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +76 -2
- package/DemoForOperator/Firework1/App.vue +13 -2
- package/DemoForOperator/Firework1/Fireworks.vue +68 -11
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +30 -1
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +27 -2
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +42 -1
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +12 -0
- package/DemoForOperator/FrameShadow/App.vue +193 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
- package/DemoForOperator/FullscreenIn/App.vue +1 -1
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +18 -3
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/GrayFilter/GrayFilter.vue +21 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +58 -11
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +47 -9
- package/DemoForOperator/LongChatBox/App.vue +36 -0
- package/DemoForOperator/LongChatBox/Bubble.vue +116 -0
- package/DemoForOperator/LongChatBox/LongChat.vue +204 -0
- package/DemoForOperator/LongChatBox/testData.js +14 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +33 -1
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +23 -2
- package/DemoForOperator/PosterAnim/PosterAnim.js +21 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +16 -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/Ripple.vue +16 -1
- 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/Sprite.vue +62 -5
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +52 -2
- package/DemoForOperator/Swiper/App.vue +101 -0
- package/DemoForOperator/Swiper/Item.vue +56 -0
- package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +39 -1
- 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/Vortex/Vortex.vue +26 -0
- package/DemoForOperator/routeList.js +125 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +5 -0
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +798 -140
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/DomRenderer/App.vue +133 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMove/App.vue +24 -279
- package/FreeMove/TestScene1.vue +260 -0
- package/FreeMove/TestScene3.vue +431 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +51 -22
- package/GiftRain/components/SpriteTranslate.vue +68 -48
- package/HashHistory/App.vue +2 -2
- package/HashHistory/router.js +1 -1
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +111 -46
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +14 -1
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +216 -0
- package/Markdown/data.js +633 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/EpgFlowListType/App.vue +206 -0
- package/MetroWidgetDemos/EpgFlowListType/components/ContentCard.vue +105 -0
- package/MetroWidgetDemos/EpgFlowListType/components/FloorSection.vue +131 -0
- package/MetroWidgetDemos/EpgFlowListType/components/LeftTabItem.vue +41 -0
- package/MetroWidgetDemos/EpgFlowListType/data.js +78 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/{TripleWidget → RenderAccelerate}/Item.vue +6 -3
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/SpatialNav/Item.vue +71 -0
- package/MetroWidgetDemos/SpatialNav/SimpleFloor.vue +86 -0
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +23 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +229 -8
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PosterPacker/App.vue +2 -2
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/ScrollBoxTest/App.vue +52 -28
- package/ScrollBoxTest/ClipBar.vue +64 -2
- package/ScrollBoxTest/NinePatchBar.vue +64 -2
- package/ScrollBoxTest/SizeDivBar.vue +64 -2
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TextureAnimation/App3.vue +11 -1
- package/TouchWidget/App.vue +90 -5
- package/TouchWidget/WidgetItem.vue +1 -0
- package/TransitPage/App.vue +2 -0
- package/ViewOpacity/App.vue +19 -0
- package/assets/logo.png +0 -0
- package/package.json +1 -1
- package/DashPath/DashPath.vue +0 -118
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -699
- package/DemoForOperator/ScalePoster/App.vue +0 -4
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -81
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -93
- package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +0 -111
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/TextureAnimation/utils/FrameCanvasStore.ts +0 -68
- package/TextureAnimation/utils/RotateFrame.vue +0 -146
- package/TextureAnimation/utils/circleHaloMask.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /package/{AnimPicture/assets → assets}/quan.webp +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
onKeyDown,
|
|
7
7
|
}"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
9
|
+
<GenieSlot
|
|
10
10
|
ref="cGenieRef"
|
|
11
11
|
:width="width"
|
|
12
12
|
:height="height"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
:position="position"
|
|
17
17
|
:time="1"
|
|
18
18
|
:onAnimEnd="onAnimEnd"
|
|
19
|
-
:initShow="
|
|
19
|
+
:initShow="false"
|
|
20
20
|
>
|
|
21
21
|
<img
|
|
22
22
|
:src="`url(${imageUrl})`"
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
>
|
|
45
45
|
按OK键进场/出场
|
|
46
46
|
</div>
|
|
47
|
-
</
|
|
47
|
+
</GenieSlot>
|
|
48
48
|
</jsv-focus-block>
|
|
49
49
|
</template>
|
|
50
50
|
<script setup>
|
|
51
|
-
import
|
|
52
|
-
import { shallowRef } from "vue";
|
|
51
|
+
import GenieSlot from "./geniePakcer/GenieSlot.vue";
|
|
52
|
+
import { shallowRef, onBeforeUnmount } from "vue";
|
|
53
53
|
|
|
54
54
|
const cGenieRef = shallowRef();
|
|
55
55
|
const position = { x: -80, y: 600 };
|
|
@@ -59,13 +59,27 @@ const imageUrl =
|
|
|
59
59
|
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Genie/App/element_228542_icon_20230610184253.jpg";
|
|
60
60
|
|
|
61
61
|
let imgLoaded = false;
|
|
62
|
+
let unmounted = false;
|
|
63
|
+
|
|
64
|
+
onBeforeUnmount(()=>{
|
|
65
|
+
unmounted = true;
|
|
66
|
+
})
|
|
67
|
+
|
|
62
68
|
function onImgLoaded() {
|
|
63
|
-
|
|
69
|
+
// 进行setTimeout(1), 为了规避已加载的图片onLoad太早破坏了先绘制再截图的时序
|
|
70
|
+
setTimeout(()=>{
|
|
71
|
+
imgLoaded = true;
|
|
72
|
+
if (!unmounted) {
|
|
73
|
+
cGenieRef.value.switcher();
|
|
74
|
+
}
|
|
75
|
+
}, 1)
|
|
64
76
|
}
|
|
77
|
+
|
|
65
78
|
const onAnimEnd = () => {
|
|
66
79
|
console.log("anim end");
|
|
67
80
|
};
|
|
68
81
|
|
|
82
|
+
|
|
69
83
|
function onKeyDown(ev) {
|
|
70
84
|
if (ev.keyCode == 13) {
|
|
71
85
|
if (imgLoaded) {
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
<GenieImage
|
|
10
|
+
ref="cGenieRef"
|
|
11
|
+
:width="width"
|
|
12
|
+
:height="height"
|
|
13
|
+
:left="128"
|
|
14
|
+
:top="72"
|
|
15
|
+
direction="horizontal"
|
|
16
|
+
:position="position"
|
|
17
|
+
:time="1"
|
|
18
|
+
:onAnimEnd="onAnimEnd"
|
|
19
|
+
:initShow="false"
|
|
20
|
+
:imageUrl="imageUrl"
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
</GenieImage>
|
|
24
|
+
</jsv-focus-block>
|
|
25
|
+
</template>
|
|
26
|
+
<script setup>
|
|
27
|
+
import GenieImage from "./geniePakcer/GenieImage.vue";
|
|
28
|
+
import { shallowRef, onBeforeUnmount, onMounted } from "vue";
|
|
29
|
+
|
|
30
|
+
const cGenieRef = shallowRef();
|
|
31
|
+
const position = { x: -80, y: 600 };
|
|
32
|
+
const width = 1024;
|
|
33
|
+
const height = 576;
|
|
34
|
+
const imageUrl =
|
|
35
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Genie/App/element_228542_icon_20230610184253.jpg";
|
|
36
|
+
|
|
37
|
+
let imgLoaded = false;
|
|
38
|
+
let unmounted = false;
|
|
39
|
+
|
|
40
|
+
onBeforeUnmount(()=>{
|
|
41
|
+
unmounted = true;
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const onAnimEnd = () => {
|
|
45
|
+
console.log("anim end");
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
function onKeyDown(ev) {
|
|
49
|
+
if (ev.keyCode == 13) {
|
|
50
|
+
cGenieRef.value.switcher();
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
onMounted(()=>{
|
|
57
|
+
cGenieRef.value.switcher();
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
</script>
|
|
61
|
+
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import buildGenieAnimation from "./GenieTools.ts";
|
|
3
|
+
import {
|
|
4
|
+
shallowRef,
|
|
5
|
+
onMounted,
|
|
6
|
+
onUnmounted,
|
|
7
|
+
onBeforeUnmount,
|
|
8
|
+
} from "vue";
|
|
9
|
+
import {
|
|
10
|
+
JsvFragShaderView,
|
|
11
|
+
getKeyFramesGroup,
|
|
12
|
+
} from "jsview";
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
/**
|
|
15
|
+
* 组件宽度(必填),且不支持响应式
|
|
16
|
+
* @type {Number}
|
|
17
|
+
*/
|
|
18
|
+
width: { type: Number, require: true },
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 组件高度(必填),且不支持响应式
|
|
22
|
+
* @type {Number}
|
|
23
|
+
*/
|
|
24
|
+
height: { type: Number, require: true },
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 左侧定位位置,且不支持响应式
|
|
28
|
+
* @type {Number}
|
|
29
|
+
* @default 0
|
|
30
|
+
*/
|
|
31
|
+
left: { type: Number, default: 0 },
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 顶部定位位置,且不支持响应式
|
|
35
|
+
* @type {Number}
|
|
36
|
+
* @default 0
|
|
37
|
+
*/
|
|
38
|
+
top: { type: Number, default: 0 },
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 动画持续时间(秒),且不支持响应式
|
|
42
|
+
* @type {Number}
|
|
43
|
+
* @default 2
|
|
44
|
+
*/
|
|
45
|
+
time: { type: Number, default: 2 },
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 动画中心点坐标(必填),且不支持响应式
|
|
49
|
+
* @type {Object}
|
|
50
|
+
* @property {Number} x - X轴坐标
|
|
51
|
+
* @property {Number} y - Y轴坐标
|
|
52
|
+
*/
|
|
53
|
+
position: { type: Object, require: true },
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 缩放比例,且不支持响应式
|
|
57
|
+
* @type {Number}
|
|
58
|
+
* @default 1
|
|
59
|
+
*/
|
|
60
|
+
size: { type: Number, default: 1 },
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 动画方向(必填),且不支持响应式
|
|
64
|
+
* @type {'horizontal'|'vertical'}
|
|
65
|
+
*/
|
|
66
|
+
direction: { type: String, require: true },
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 动画结束回调函数
|
|
70
|
+
* @type {Function}
|
|
71
|
+
* @default () => {}
|
|
72
|
+
*/
|
|
73
|
+
onAnimEnd: { type: Function, default: () => {} },
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 初始显示状态(必填),且不支持响应式
|
|
77
|
+
* @type {Boolean}
|
|
78
|
+
*/
|
|
79
|
+
initShow: { type: Boolean, require: true },
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 截屏后的纹理名称
|
|
83
|
+
* @type {String}
|
|
84
|
+
*/
|
|
85
|
+
textureName: { type: String, default: null },
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 图片url, 与截屏二选一
|
|
89
|
+
* @type {String}
|
|
90
|
+
*/
|
|
91
|
+
imageUrl: { type: String, default: null },
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
let rSlotShowOnDone = shallowRef(false);
|
|
96
|
+
|
|
97
|
+
let vUnmounted = false; // 当前组件是否已经卸载, 用于控制Timer回调后的有效性
|
|
98
|
+
|
|
99
|
+
// 初始状态slot显示状态
|
|
100
|
+
const STAGE_DONE = 1;
|
|
101
|
+
// 截屏回调执行了doAnim后, 此动作会v-if加载JsvFragShaderView, 并隐藏slot
|
|
102
|
+
const STAGE_STARTING_ANIMATION = 3;
|
|
103
|
+
// JsvFragShaderView加载完成(onRef回调), 设置动画属性来开始动画
|
|
104
|
+
const STAGE_ANIMATING = 4;
|
|
105
|
+
// 动画结束的onAllAnimEnd回调后, 至此, setTimeout(1)后, 设置为STAGE_DONE, 并进行props.onAnimEnd回调
|
|
106
|
+
const STAGE_CLOSING_ANIMATION = 5;
|
|
107
|
+
|
|
108
|
+
let rStageMachine = shallowRef(STAGE_DONE);
|
|
109
|
+
|
|
110
|
+
//动画
|
|
111
|
+
const cStyleShell = getKeyFramesGroup();
|
|
112
|
+
//动画字符串
|
|
113
|
+
let vAniStr = shallowRef(null);
|
|
114
|
+
|
|
115
|
+
const {
|
|
116
|
+
vRelease,
|
|
117
|
+
vContract,
|
|
118
|
+
vShader,
|
|
119
|
+
vTransformDirection, //位移动画中心点方向
|
|
120
|
+
KeyFrameReleaseName,
|
|
121
|
+
KeyFrameContractName,
|
|
122
|
+
} = buildGenieAnimation(props.position, props.width, props.height, props.direction);
|
|
123
|
+
|
|
124
|
+
// Shader配置, 因为组件在动画时都是重新创建的, 所以不用做成响应式
|
|
125
|
+
const cShaderInfo = {
|
|
126
|
+
shader: "",
|
|
127
|
+
uniforms: [],
|
|
128
|
+
textures: [
|
|
129
|
+
{
|
|
130
|
+
name: "iChannel0",
|
|
131
|
+
resource: null,
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
duration: props.time * 1000,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// 制作基础版shader
|
|
138
|
+
const cLocalizationShader = vShader;
|
|
139
|
+
|
|
140
|
+
//根据初始状态展示
|
|
141
|
+
if (props.initShow) {
|
|
142
|
+
rSlotShowOnDone.value = true;
|
|
143
|
+
} else {
|
|
144
|
+
rSlotShowOnDone.value = false;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const onAllAnimEnd = () => {
|
|
148
|
+
rStageMachine.value = STAGE_CLOSING_ANIMATION;
|
|
149
|
+
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
rStageMachine.value = STAGE_DONE;
|
|
152
|
+
if (!vUnmounted) {
|
|
153
|
+
if (props.onAnimEnd) {
|
|
154
|
+
props.onAnimEnd();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}, 1);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const onShaderViewNewRef = (widgetRef) => {
|
|
161
|
+
if (widgetRef != null) {
|
|
162
|
+
rStageMachine.value = STAGE_ANIMATING;
|
|
163
|
+
|
|
164
|
+
widgetRef.startAnim();
|
|
165
|
+
} else {
|
|
166
|
+
// 动画结束后的组件消失回调, 不需要做任何事情
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
cStyleShell.insertRule(vContract);
|
|
171
|
+
cStyleShell.insertRule(vRelease);
|
|
172
|
+
|
|
173
|
+
function doAnim() {
|
|
174
|
+
rStageMachine.value = STAGE_STARTING_ANIMATION;
|
|
175
|
+
|
|
176
|
+
if (rSlotShowOnDone.value) {
|
|
177
|
+
vAniStr = KeyFrameReleaseName;
|
|
178
|
+
cShaderInfo.shader = cLocalizationShader.replace(/\$\{myTime\}/g, "(iDuration - iTime) / iDuration");
|
|
179
|
+
} else {
|
|
180
|
+
vAniStr = KeyFrameContractName;
|
|
181
|
+
cShaderInfo.shader = cLocalizationShader.replace(/\$\{myTime\}/g, "iTime / iDuration");
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
let vWaitingImageLoadResolveFunc = null;
|
|
186
|
+
let vImageLoaded = false;
|
|
187
|
+
|
|
188
|
+
const onImageLoad = () => {
|
|
189
|
+
if (vUnmounted) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
vImageLoaded = true;
|
|
194
|
+
|
|
195
|
+
if (vWaitingImageLoadResolveFunc) {
|
|
196
|
+
vWaitingImageLoadResolveFunc();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const switcher = async () => {
|
|
201
|
+
if (rStageMachine.value != STAGE_DONE) {
|
|
202
|
+
// 动画还没结束, 不能切换
|
|
203
|
+
// 结束后因为slot显示资源可能要重新加载, 所以也不适宜做switcher指令堆积处理
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (props.imageUrl && !vImageLoaded) {
|
|
208
|
+
// 等待图片加载完成
|
|
209
|
+
await new Promise((resolve) => {
|
|
210
|
+
vWaitingImageLoadResolveFunc = resolve;
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (props.textureName) {
|
|
215
|
+
cShaderInfo.textures[0].resource = `jsvtexturestore://${props.textureName}`;
|
|
216
|
+
} else {
|
|
217
|
+
cShaderInfo.textures[0].resource = props.imageUrl;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// 反转显示目标
|
|
221
|
+
rSlotShowOnDone.value = !rSlotShowOnDone.value;
|
|
222
|
+
|
|
223
|
+
doAnim();
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
onMounted(() => {
|
|
227
|
+
window.JsvCoreApi.enableFpsDisplay(true);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
onUnmounted(() => {
|
|
231
|
+
vUnmounted = true;
|
|
232
|
+
window.JsvCoreApi.enableFpsDisplay(false);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
onBeforeUnmount(() => {
|
|
236
|
+
cStyleShell.removeRule(KeyFrameContractName);
|
|
237
|
+
cStyleShell.removeRule(KeyFrameReleaseName);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
defineExpose({
|
|
241
|
+
/**
|
|
242
|
+
* 触发精灵动画切换
|
|
243
|
+
* 执行截屏并启动收缩/展开动画
|
|
244
|
+
*/
|
|
245
|
+
switcher,
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
</script>
|
|
249
|
+
<template>
|
|
250
|
+
<div
|
|
251
|
+
:style="{
|
|
252
|
+
left: props.left,
|
|
253
|
+
top: props.top,
|
|
254
|
+
}"
|
|
255
|
+
>
|
|
256
|
+
<div
|
|
257
|
+
v-if="rStageMachine == STAGE_ANIMATING || rStageMachine == STAGE_STARTING_ANIMATION"
|
|
258
|
+
:style="{
|
|
259
|
+
width: props.width,
|
|
260
|
+
height: props.height,
|
|
261
|
+
animation: `${vAniStr} ${props.time}s`,
|
|
262
|
+
transformOrigin: vTransformDirection,
|
|
263
|
+
}"
|
|
264
|
+
@animationend="onAllAnimEnd"
|
|
265
|
+
>
|
|
266
|
+
<jsv-frag-shader-view
|
|
267
|
+
:ref="onShaderViewNewRef"
|
|
268
|
+
:style="{
|
|
269
|
+
width: props.width,
|
|
270
|
+
height: props.height,
|
|
271
|
+
}"
|
|
272
|
+
:duration="cShaderInfo.duration"
|
|
273
|
+
:shaderStr="cShaderInfo.shader"
|
|
274
|
+
:autoplay="false"
|
|
275
|
+
:textures="cShaderInfo.textures"
|
|
276
|
+
:loadComfirmed="true"
|
|
277
|
+
>
|
|
278
|
+
</jsv-frag-shader-view>
|
|
279
|
+
</div>
|
|
280
|
+
<div
|
|
281
|
+
v-show="rStageMachine == STAGE_DONE || rStageMachine == STAGE_CLOSING_ANIMATION"
|
|
282
|
+
>
|
|
283
|
+
<div
|
|
284
|
+
v-if="props.textureName"
|
|
285
|
+
:style="{
|
|
286
|
+
width: rSlotShowOnDone ? props.width : 1,
|
|
287
|
+
height: rSlotShowOnDone ? props.height : 1,
|
|
288
|
+
backgroundImage: `url(jsvtexturestore://${props.textureName})`,
|
|
289
|
+
}"/>
|
|
290
|
+
<img v-else :src="props.imageUrl" :style="{
|
|
291
|
+
width: rSlotShowOnDone ? props.width : 1,
|
|
292
|
+
height: rSlotShowOnDone ? props.height : 1,
|
|
293
|
+
}"
|
|
294
|
+
@load="onImageLoad"
|
|
295
|
+
/>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
</template>
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import buildGenieAnimation from "./GenieTools.ts";
|
|
3
|
+
import {
|
|
4
|
+
shallowRef,
|
|
5
|
+
onMounted,
|
|
6
|
+
onUnmounted,
|
|
7
|
+
onBeforeUnmount,
|
|
8
|
+
} from "vue";
|
|
9
|
+
import {
|
|
10
|
+
JsvFragShaderView,
|
|
11
|
+
getKeyFramesGroup,
|
|
12
|
+
JsvTextureStoreApi,
|
|
13
|
+
} from "jsview";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
/**
|
|
16
|
+
* 组件宽度(必填),且不支持响应式
|
|
17
|
+
* @type {Number}
|
|
18
|
+
*/
|
|
19
|
+
width: { type: Number, require: true },
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 组件高度(必填),且不支持响应式
|
|
23
|
+
* @type {Number}
|
|
24
|
+
*/
|
|
25
|
+
height: { type: Number, require: true },
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 左侧定位位置,且不支持响应式
|
|
29
|
+
* @type {Number}
|
|
30
|
+
* @default 0
|
|
31
|
+
*/
|
|
32
|
+
left: { type: Number, default: 0 },
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 顶部定位位置,且不支持响应式
|
|
36
|
+
* @type {Number}
|
|
37
|
+
* @default 0
|
|
38
|
+
*/
|
|
39
|
+
top: { type: Number, default: 0 },
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 动画持续时间(秒),且不支持响应式
|
|
43
|
+
* @type {Number}
|
|
44
|
+
* @default 2
|
|
45
|
+
*/
|
|
46
|
+
time: { type: Number, default: 2 },
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 动画中心点坐标(必填),且不支持响应式
|
|
50
|
+
* @type {Object}
|
|
51
|
+
* @property {Number} x - X轴坐标
|
|
52
|
+
* @property {Number} y - Y轴坐标
|
|
53
|
+
*/
|
|
54
|
+
position: { type: Object, require: true },
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 缩放比例,且不支持响应式
|
|
58
|
+
* @type {Number}
|
|
59
|
+
* @default 1
|
|
60
|
+
*/
|
|
61
|
+
size: { type: Number, default: 1 },
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 动画方向(必填),且不支持响应式
|
|
65
|
+
* @type {'horizontal'|'vertical'}
|
|
66
|
+
*/
|
|
67
|
+
direction: { type: String, require: true },
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 动画结束回调函数
|
|
71
|
+
* @type {Function}
|
|
72
|
+
* @default () => {}
|
|
73
|
+
*/
|
|
74
|
+
onAnimEnd: { type: Function, default: () => {} },
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 初始显示状态(必填),且不支持响应式
|
|
78
|
+
* @type {Boolean}
|
|
79
|
+
*/
|
|
80
|
+
initShow: { type: Boolean, require: true },
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
let rSlotShowOnDone = shallowRef(false);
|
|
85
|
+
|
|
86
|
+
let vUnmounted = false; // 当前组件是否已经卸载, 用于控制Timer回调后的有效性
|
|
87
|
+
|
|
88
|
+
// 初始状态slot显示状态
|
|
89
|
+
const STAGE_DONE = 1;
|
|
90
|
+
// 对slot进行截屏
|
|
91
|
+
const STAGE_CAPTURE = 2;
|
|
92
|
+
// 截屏回调执行了doAnim后, 此动作会v-if加载JsvFragShaderView, 并隐藏slot
|
|
93
|
+
const STAGE_STARTING_ANIMATION = 3;
|
|
94
|
+
// JsvFragShaderView加载完成(onRef回调), 设置动画属性来开始动画
|
|
95
|
+
const STAGE_ANIMATING = 4;
|
|
96
|
+
// 动画结束的onAllAnimEnd回调后, 至此, setTimeout(1)后, 设置为STAGE_DONE, 并进行props.onAnimEnd回调
|
|
97
|
+
const STAGE_CLOSING_ANIMATION = 5;
|
|
98
|
+
|
|
99
|
+
let rStageMachine = shallowRef(STAGE_DONE);
|
|
100
|
+
|
|
101
|
+
//动画
|
|
102
|
+
const cStyleShell = getKeyFramesGroup();
|
|
103
|
+
//动画字符串
|
|
104
|
+
let vAniStr = shallowRef(null);
|
|
105
|
+
|
|
106
|
+
const {
|
|
107
|
+
vRelease,
|
|
108
|
+
vContract,
|
|
109
|
+
vShader,
|
|
110
|
+
vTransformDirection, //位移动画中心点方向
|
|
111
|
+
KeyFrameReleaseName,
|
|
112
|
+
KeyFrameContractName,
|
|
113
|
+
} = buildGenieAnimation(props.position, props.width, props.height, props.direction);
|
|
114
|
+
|
|
115
|
+
// Shader配置, 因为组件在动画时都是重新创建的, 所以不用做成响应式
|
|
116
|
+
const cShaderInfo = {
|
|
117
|
+
shader: "",
|
|
118
|
+
uniforms: [],
|
|
119
|
+
textures: [
|
|
120
|
+
{
|
|
121
|
+
name: "iChannel0",
|
|
122
|
+
resource: null,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
duration: props.time * 1000,
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// 制作基础版shader
|
|
129
|
+
const cLocalizationShader = vShader;
|
|
130
|
+
|
|
131
|
+
//根据初始状态展示
|
|
132
|
+
if (props.initShow) {
|
|
133
|
+
rSlotShowOnDone.value = true;
|
|
134
|
+
} else {
|
|
135
|
+
rSlotShowOnDone.value = false;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const onAllAnimEnd = () => {
|
|
139
|
+
rStageMachine.value = STAGE_CLOSING_ANIMATION;
|
|
140
|
+
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
rStageMachine.value = STAGE_DONE;
|
|
143
|
+
if (!vUnmounted) {
|
|
144
|
+
if (props.onAnimEnd) {
|
|
145
|
+
props.onAnimEnd();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, 1);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const onShaderViewNewRef = (widgetRef) => {
|
|
152
|
+
if (widgetRef != null) {
|
|
153
|
+
rStageMachine.value = STAGE_ANIMATING;
|
|
154
|
+
|
|
155
|
+
widgetRef.startAnim();
|
|
156
|
+
} else {
|
|
157
|
+
// 动画结束后的组件消失回调, 不需要做任何事情
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
cStyleShell.insertRule(vContract);
|
|
162
|
+
cStyleShell.insertRule(vRelease);
|
|
163
|
+
|
|
164
|
+
function doAnim() {
|
|
165
|
+
rStageMachine.value = STAGE_STARTING_ANIMATION;
|
|
166
|
+
|
|
167
|
+
if (rSlotShowOnDone.value) {
|
|
168
|
+
vAniStr = KeyFrameReleaseName;
|
|
169
|
+
cShaderInfo.shader = cLocalizationShader.replace(/\$\{myTime\}/g, "(iDuration - iTime) / iDuration");
|
|
170
|
+
} else {
|
|
171
|
+
vAniStr = KeyFrameContractName;
|
|
172
|
+
cShaderInfo.shader = cLocalizationShader.replace(/\$\{myTime\}/g, "iTime / iDuration");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
let rSlotRootRef = shallowRef(null);
|
|
177
|
+
|
|
178
|
+
let rDebugCaptureResult = shallowRef(null);
|
|
179
|
+
|
|
180
|
+
const switcher = () => {
|
|
181
|
+
if (rStageMachine.value != STAGE_DONE) {
|
|
182
|
+
// 动画还没结束, 不能切换
|
|
183
|
+
// 结束后因为slot显示资源可能要重新加载, 所以也不适宜做switcher指令堆积处理
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
rStageMachine.value = STAGE_CAPTURE;
|
|
189
|
+
JsvTextureStoreApi.capture2Texture(
|
|
190
|
+
rSlotRootRef.value,
|
|
191
|
+
(textureName, autoRecycle, w, h) => {
|
|
192
|
+
if (vUnmounted) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
cShaderInfo.textures[0].resource = `jsvtexturestore://${textureName}`;
|
|
197
|
+
rDebugCaptureResult.value = `jsvtexturestore://${textureName}`;
|
|
198
|
+
|
|
199
|
+
if (autoRecycle) {
|
|
200
|
+
// 已经是设置了texture的自动回收,所以不再需要主动调用 JsvTextureStoreApi.deleteTexture 来释放内存
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 截图后反转状态
|
|
204
|
+
rSlotShowOnDone.value = !rSlotShowOnDone.value;
|
|
205
|
+
|
|
206
|
+
doAnim();
|
|
207
|
+
},
|
|
208
|
+
true // 自动回收, 不填也行,默认为true
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
onMounted(() => {
|
|
213
|
+
window.JsvCoreApi.enableFpsDisplay(true);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
onUnmounted(() => {
|
|
217
|
+
vUnmounted = true;
|
|
218
|
+
window.JsvCoreApi.enableFpsDisplay(false);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
onBeforeUnmount(() => {
|
|
222
|
+
cStyleShell.removeRule(KeyFrameContractName);
|
|
223
|
+
cStyleShell.removeRule(KeyFrameReleaseName);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
defineExpose({
|
|
227
|
+
/**
|
|
228
|
+
* 触发精灵动画切换
|
|
229
|
+
* 执行截屏并启动收缩/展开动画
|
|
230
|
+
*/
|
|
231
|
+
switcher,
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
</script>
|
|
235
|
+
<template>
|
|
236
|
+
<div
|
|
237
|
+
:style="{
|
|
238
|
+
left: props.left,
|
|
239
|
+
top: props.top,
|
|
240
|
+
}"
|
|
241
|
+
>
|
|
242
|
+
<div
|
|
243
|
+
v-if="rStageMachine == STAGE_ANIMATING || rStageMachine == STAGE_STARTING_ANIMATION"
|
|
244
|
+
:style="{
|
|
245
|
+
width: props.width,
|
|
246
|
+
height: props.height,
|
|
247
|
+
animation: `${vAniStr} ${props.time}s`,
|
|
248
|
+
transformOrigin: vTransformDirection,
|
|
249
|
+
}"
|
|
250
|
+
@animationend="onAllAnimEnd"
|
|
251
|
+
>
|
|
252
|
+
<jsv-frag-shader-view
|
|
253
|
+
:ref="onShaderViewNewRef"
|
|
254
|
+
:style="{
|
|
255
|
+
width: props.width,
|
|
256
|
+
height: props.height,
|
|
257
|
+
}"
|
|
258
|
+
:duration="cShaderInfo.duration"
|
|
259
|
+
:shaderStr="cShaderInfo.shader"
|
|
260
|
+
:autoplay="false"
|
|
261
|
+
:textures="cShaderInfo.textures"
|
|
262
|
+
>
|
|
263
|
+
</jsv-frag-shader-view>
|
|
264
|
+
</div>
|
|
265
|
+
<div
|
|
266
|
+
v-show="rStageMachine == STAGE_CAPTURE || rStageMachine == STAGE_DONE || rStageMachine == STAGE_CLOSING_ANIMATION"
|
|
267
|
+
:style="{
|
|
268
|
+
width: rSlotShowOnDone ? props.width : 1,
|
|
269
|
+
height: rSlotShowOnDone ? props.height : 1,
|
|
270
|
+
overflow: rSlotShowOnDone ? null : 'hidden',
|
|
271
|
+
// width: props.width,
|
|
272
|
+
// height: props.height,
|
|
273
|
+
}"
|
|
274
|
+
>
|
|
275
|
+
<div
|
|
276
|
+
ref="rSlotRootRef"
|
|
277
|
+
:style="{
|
|
278
|
+
width: props.width,
|
|
279
|
+
height: props.height,
|
|
280
|
+
}"
|
|
281
|
+
>
|
|
282
|
+
<slot></slot>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
<!-- <div :style="{
|
|
286
|
+
width: 320,
|
|
287
|
+
height: 160,
|
|
288
|
+
backgroundImage: rDebugCaptureResult ? `url(${rDebugCaptureResult})` : '',
|
|
289
|
+
}"/> -->
|
|
290
|
+
|
|
291
|
+
</div>
|
|
292
|
+
</template>
|