@shijiu/jsview-vue-samples 2.3.0 → 3.0.0-next-vue.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/CssPreprocessor/Scss/PanelData.js +1 -1
- package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +4 -3
- package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +2 -2
- 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 +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/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 +205 -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 +1 -0
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +772 -135
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -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/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +49 -20
- 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 +100 -47
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +1 -0
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +206 -0
- package/Markdown/Markdown/Markdown.vue +156 -0
- package/Markdown/Markdown/index.ts +1 -0
- package/Markdown/Markdown/marked/LICENSE.md +45 -0
- package/Markdown/Markdown/marked/index.ts +2 -0
- package/Markdown/Markdown/marked/marked.d.ts +756 -0
- package/Markdown/Markdown/marked/marked.js +71 -0
- package/Markdown/Markdown/parser.ts +1365 -0
- package/Markdown/data.js +581 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -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 +22 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +216 -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/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/TransitPage/App.vue +2 -0
- package/ViewOpacity/App.vue +19 -0
- package/assets/logo.png +0 -0
- package/package.json +5 -5
- 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/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
|
@@ -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>
|