@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,72 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:17
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ref } from "vue";
|
|
8
|
+
import { EdgeDirection } from "jsview";
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
data: Object,
|
|
12
|
+
onAction: Object,
|
|
13
|
+
anim: Object,
|
|
14
|
+
scaleRate: Number,
|
|
15
|
+
});
|
|
16
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterAnim/Scale/Item/background.png";
|
|
17
|
+
const transform = `scale3d(${props.scaleRate}, ${props.scaleRate}, 1)`;
|
|
18
|
+
|
|
19
|
+
const focused = ref(false);
|
|
20
|
+
const animation = ref(null);
|
|
21
|
+
|
|
22
|
+
// 注册回调
|
|
23
|
+
const onFocus = () => {
|
|
24
|
+
focused.value = true;
|
|
25
|
+
animation.value = `${props.anim.name} 0.4s`;
|
|
26
|
+
};
|
|
27
|
+
const onBlur = () => {
|
|
28
|
+
focused.value = false;
|
|
29
|
+
};
|
|
30
|
+
const onClick = () => {};
|
|
31
|
+
|
|
32
|
+
const onAnimEnd = () => {
|
|
33
|
+
animation.value = null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
props.onAction.register("onFocus", onFocus);
|
|
37
|
+
props.onAction.register("onBlur", onBlur);
|
|
38
|
+
props.onAction.register("onClick", onClick);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div
|
|
43
|
+
:style="{
|
|
44
|
+
width: data.width,
|
|
45
|
+
height: data.height,
|
|
46
|
+
animation: animation,
|
|
47
|
+
}"
|
|
48
|
+
@animationend="onAnimEnd"
|
|
49
|
+
>
|
|
50
|
+
<div
|
|
51
|
+
:style="{
|
|
52
|
+
width: data.width,
|
|
53
|
+
height: data.height,
|
|
54
|
+
transform: focused ? transform : null,
|
|
55
|
+
}"
|
|
56
|
+
>
|
|
57
|
+
<div
|
|
58
|
+
:style="{
|
|
59
|
+
width: data.width,
|
|
60
|
+
height: data.height,
|
|
61
|
+
fontSize: 30,
|
|
62
|
+
color: focused ? '#FF0000' : '#FFFFFF',
|
|
63
|
+
backgroundImage: bgImage,
|
|
64
|
+
lineHeight: data.height,
|
|
65
|
+
textAlign: 'center',
|
|
66
|
+
}"
|
|
67
|
+
>
|
|
68
|
+
缩放
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<metro-widget
|
|
3
|
+
name="scale"
|
|
4
|
+
:left="widgetLayout.left"
|
|
5
|
+
:top="widgetLayout.top"
|
|
6
|
+
:width="widgetLayout.width"
|
|
7
|
+
:height="widgetLayout.height"
|
|
8
|
+
:provideData="provideData"
|
|
9
|
+
:direction="HORIZONTAL"
|
|
10
|
+
:measures="measures"
|
|
11
|
+
:onEdge="onEdge"
|
|
12
|
+
:padding="padding"
|
|
13
|
+
>
|
|
14
|
+
<template #renderItem="{ data, onAction }">
|
|
15
|
+
<item :data="data" :onAction="onAction" :anim="anim" :scaleRate=scaleRate />
|
|
16
|
+
</template>
|
|
17
|
+
</metro-widget>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { onUnmounted } from "vue";
|
|
22
|
+
import { MetroWidget, HORIZONTAL } from "jsview";
|
|
23
|
+
import Item from "./Item.vue";
|
|
24
|
+
import { widgetLayout, padding, data } from "../CommonPageSetting.js";
|
|
25
|
+
import { getPosterAnim } from "../PosterAnim.js";
|
|
26
|
+
|
|
27
|
+
const scaleRate = 1.07;
|
|
28
|
+
const anim = getPosterAnim("scale", { scale0: 1 / 1.07, scale1: 1.05 });
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
onEdge: Function,
|
|
31
|
+
});
|
|
32
|
+
const provideData = () => {
|
|
33
|
+
return data;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const measures = (data) => {
|
|
37
|
+
return {
|
|
38
|
+
width: data.width,
|
|
39
|
+
height: data.height,
|
|
40
|
+
marginRight: data.marginRight,
|
|
41
|
+
marginBottom: data.marginBottom,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
onUnmounted(() => {
|
|
46
|
+
anim.release();
|
|
47
|
+
});
|
|
48
|
+
</script>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:17
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ref } from "vue";
|
|
8
|
+
import { EdgeDirection } from "jsview";
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
data: Object,
|
|
12
|
+
onAction: Object,
|
|
13
|
+
anim: Object,
|
|
14
|
+
});
|
|
15
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterAnim/Shake/Item/background.png";
|
|
16
|
+
|
|
17
|
+
const focused = ref(false);
|
|
18
|
+
const animation = ref(null);
|
|
19
|
+
|
|
20
|
+
// 注册回调
|
|
21
|
+
const onFocus = () => {
|
|
22
|
+
focused.value = true;
|
|
23
|
+
};
|
|
24
|
+
const onBlur = () => {
|
|
25
|
+
focused.value = false;
|
|
26
|
+
};
|
|
27
|
+
const onClick = () => {};
|
|
28
|
+
|
|
29
|
+
const onAnimEnd = () => {
|
|
30
|
+
animation.value = null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const onWidgetEdge = (info) => {
|
|
34
|
+
switch (info.direction) {
|
|
35
|
+
case EdgeDirection.left:
|
|
36
|
+
animation.value = `${props.anim.left.name} 0.15s`;
|
|
37
|
+
break;
|
|
38
|
+
case EdgeDirection.top:
|
|
39
|
+
animation.value = `${props.anim.top.name} 0.15s`;
|
|
40
|
+
break;
|
|
41
|
+
case EdgeDirection.right:
|
|
42
|
+
animation.value = `${props.anim.right.name} 0.15s`;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
props.onAction.register("onFocus", onFocus);
|
|
48
|
+
props.onAction.register("onBlur", onBlur);
|
|
49
|
+
props.onAction.register("onClick", onClick);
|
|
50
|
+
props.onAction.register("onWidgetEdge", onWidgetEdge);
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div
|
|
55
|
+
:style="{
|
|
56
|
+
width: data.width,
|
|
57
|
+
height: data.height,
|
|
58
|
+
transition: 'transform 0.2s',
|
|
59
|
+
transform: focused ? 'scale3d(1.05, 1.05, 1)' : null,
|
|
60
|
+
}"
|
|
61
|
+
>
|
|
62
|
+
<div
|
|
63
|
+
:style="{
|
|
64
|
+
width: data.width,
|
|
65
|
+
height: data.height,
|
|
66
|
+
animation: animation,
|
|
67
|
+
}"
|
|
68
|
+
@animationend="onAnimEnd"
|
|
69
|
+
>
|
|
70
|
+
<div
|
|
71
|
+
:style="{
|
|
72
|
+
width: data.width,
|
|
73
|
+
height: data.height,
|
|
74
|
+
fontSize: 30,
|
|
75
|
+
color: focused ? '#FF0000' : '#FFFFFF',
|
|
76
|
+
backgroundImage: bgImage,
|
|
77
|
+
lineHeight: data.height,
|
|
78
|
+
textAlign: 'center',
|
|
79
|
+
}"
|
|
80
|
+
>
|
|
81
|
+
边缘晃动
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<metro-widget
|
|
3
|
+
name="shake"
|
|
4
|
+
:left="widgetLayout.left"
|
|
5
|
+
:top="widgetLayout.top"
|
|
6
|
+
:width="widgetLayout.width"
|
|
7
|
+
:height="widgetLayout.height"
|
|
8
|
+
:provideData="provideData"
|
|
9
|
+
:direction="HORIZONTAL"
|
|
10
|
+
:measures="measures"
|
|
11
|
+
:onEdge="onEdge"
|
|
12
|
+
:padding="padding"
|
|
13
|
+
>
|
|
14
|
+
<template #renderItem="{ data, onAction }">
|
|
15
|
+
<item :data="data" :onAction="onAction" :anim="animObj" />
|
|
16
|
+
</template>
|
|
17
|
+
</metro-widget>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { onUnmounted } from "vue";
|
|
22
|
+
import { MetroWidget, HORIZONTAL } from "jsview";
|
|
23
|
+
import Item from "./Item.vue";
|
|
24
|
+
import { widgetLayout, padding, data } from "../CommonPageSetting.js";
|
|
25
|
+
import { getPosterAnim } from "../PosterAnim.js";
|
|
26
|
+
|
|
27
|
+
const anim = getPosterAnim("shake", { level: "middle" });
|
|
28
|
+
const animObj = {
|
|
29
|
+
left: anim,
|
|
30
|
+
right: anim,
|
|
31
|
+
top: anim,
|
|
32
|
+
bottom: anim,
|
|
33
|
+
};
|
|
34
|
+
const props = defineProps({
|
|
35
|
+
onEdge: Function,
|
|
36
|
+
});
|
|
37
|
+
const provideData = () => {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const measures = (data) => {
|
|
42
|
+
return {
|
|
43
|
+
width: data.width,
|
|
44
|
+
height: data.height,
|
|
45
|
+
marginRight: data.marginRight,
|
|
46
|
+
marginBottom: data.marginBottom,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
onUnmounted(() => {
|
|
51
|
+
anim.release();
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:08
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import {
|
|
8
|
+
MetroWidget,
|
|
9
|
+
HORIZONTAL,
|
|
10
|
+
useFocusHub,
|
|
11
|
+
JsvPreload,
|
|
12
|
+
buildPreloadInfo,
|
|
13
|
+
} from "jsview";
|
|
14
|
+
import Item from "./Item.vue";
|
|
15
|
+
import { onMounted } from "vue";
|
|
16
|
+
|
|
17
|
+
const ironmanSmall =
|
|
18
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/ironman_small.png";
|
|
19
|
+
const ironmanLarge =
|
|
20
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/ironman_large.png";
|
|
21
|
+
const spidermanSmall =
|
|
22
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/spiderman_small.png";
|
|
23
|
+
const spidermanLarge =
|
|
24
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/spiderman_large.png";
|
|
25
|
+
const captainSmall =
|
|
26
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/captain_small.png";
|
|
27
|
+
const captainLarge =
|
|
28
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/captain_large.png";
|
|
29
|
+
|
|
30
|
+
const focusHub = useFocusHub();
|
|
31
|
+
|
|
32
|
+
const data = [
|
|
33
|
+
{
|
|
34
|
+
width: 266,
|
|
35
|
+
height: 266,
|
|
36
|
+
marginRight: 20,
|
|
37
|
+
smallImg: ironmanSmall,
|
|
38
|
+
largeImg: ironmanLarge,
|
|
39
|
+
largeWidth: 566,
|
|
40
|
+
largeHeight: 566,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
width: 266,
|
|
44
|
+
height: 266,
|
|
45
|
+
marginRight: 20,
|
|
46
|
+
smallImg: spidermanSmall,
|
|
47
|
+
largeImg: spidermanLarge,
|
|
48
|
+
largeWidth: 566,
|
|
49
|
+
largeHeight: 566,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
width: 266,
|
|
53
|
+
height: 266,
|
|
54
|
+
marginRight: 20,
|
|
55
|
+
smallImg: captainSmall,
|
|
56
|
+
largeImg: captainLarge,
|
|
57
|
+
largeWidth: 566,
|
|
58
|
+
largeHeight: 566,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
const preloadList = [];
|
|
62
|
+
data.forEach((item) => {
|
|
63
|
+
preloadList.push(buildPreloadInfo(item.smallImg));
|
|
64
|
+
preloadList.push(buildPreloadInfo(item.largeImg));
|
|
65
|
+
});
|
|
66
|
+
const provideData = () => {
|
|
67
|
+
return data;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const measures = (data) => {
|
|
71
|
+
return {
|
|
72
|
+
width: data.width,
|
|
73
|
+
height: data.height,
|
|
74
|
+
marginRight: data.marginRight,
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const widgetLayout = {
|
|
79
|
+
left: 200,
|
|
80
|
+
top: 100,
|
|
81
|
+
width: 1058,
|
|
82
|
+
height: 266,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
//组件mount后设置焦点
|
|
87
|
+
focusHub.setFocus("mainMw");
|
|
88
|
+
});
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<div
|
|
93
|
+
:style="{
|
|
94
|
+
width: 1280,
|
|
95
|
+
height: 720,
|
|
96
|
+
backgroundColor: '#007788',
|
|
97
|
+
}"
|
|
98
|
+
/>
|
|
99
|
+
<JsvPreload :preloadList="preloadList"></JsvPreload>
|
|
100
|
+
|
|
101
|
+
<metro-widget
|
|
102
|
+
name="mainMw"
|
|
103
|
+
:left="widgetLayout.left"
|
|
104
|
+
:top="widgetLayout.top"
|
|
105
|
+
:width="widgetLayout.width"
|
|
106
|
+
:height="widgetLayout.height"
|
|
107
|
+
:provideData="provideData"
|
|
108
|
+
:direction="HORIZONTAL"
|
|
109
|
+
:measures="measures"
|
|
110
|
+
:disableClip="true"
|
|
111
|
+
>
|
|
112
|
+
<template #renderItem="{ data, onAction }">
|
|
113
|
+
<item :data="data" :onAction="onAction" />
|
|
114
|
+
</template>
|
|
115
|
+
</metro-widget>
|
|
116
|
+
</template>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:17
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ref, computed } from "vue";
|
|
8
|
+
import PosterOverflow from "./PosterOverflow.vue";
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
data: Object,
|
|
12
|
+
onAction: Object,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const focused = ref(false);
|
|
16
|
+
const showType = computed(() => {
|
|
17
|
+
return focused.value ? "large" : "small";
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// 注册回调
|
|
21
|
+
const onFocus = () => {
|
|
22
|
+
focused.value = true;
|
|
23
|
+
};
|
|
24
|
+
const onBlur = () => {
|
|
25
|
+
focused.value = false;
|
|
26
|
+
};
|
|
27
|
+
const onClick = () => {
|
|
28
|
+
console.log("item onclick ", props.data);
|
|
29
|
+
};
|
|
30
|
+
props.onAction.register("onFocus", onFocus);
|
|
31
|
+
props.onAction.register("onBlur", onBlur);
|
|
32
|
+
props.onAction.register("onClick", onClick);
|
|
33
|
+
const posterSizeInfo = {
|
|
34
|
+
width: props.data.width,
|
|
35
|
+
height: props.data.height,
|
|
36
|
+
largeWidth: props.data.largeWidth,
|
|
37
|
+
largeHeight: props.data.largeHeight,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const largePos = { left: -props.data.width / 2 - 17, top: -161 };
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div
|
|
45
|
+
:style="{
|
|
46
|
+
width: data.width,
|
|
47
|
+
height: data.height,
|
|
48
|
+
transform: focused ? 'scale3d(1.1, 1.1, 1)' : 'scale3d(1, 1, 1)',
|
|
49
|
+
transition: 'transform 0.3s',
|
|
50
|
+
}"
|
|
51
|
+
>
|
|
52
|
+
<PosterOverflow :showType="showType" :largePos="largePos">
|
|
53
|
+
<template #small>
|
|
54
|
+
<img
|
|
55
|
+
:src="`url(${data.smallImg})`"
|
|
56
|
+
:style="{ width: data.width, height: data.height }"
|
|
57
|
+
/>
|
|
58
|
+
</template>
|
|
59
|
+
<template #large>
|
|
60
|
+
<img
|
|
61
|
+
:src="`url(${data.largeImg})`"
|
|
62
|
+
:style="{ width: data.largeWidth, height: data.largeHeight }"
|
|
63
|
+
/>
|
|
64
|
+
</template>
|
|
65
|
+
</PosterOverflow>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="imgType == 'large'" :style="largePos">
|
|
3
|
+
<slot name="large"></slot>
|
|
4
|
+
</div>
|
|
5
|
+
<slot name="small"></slot>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref, watchEffect, computed } from "vue";
|
|
10
|
+
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
/**
|
|
13
|
+
* 控制图片显示类型
|
|
14
|
+
* @type {'small' | 'large'}
|
|
15
|
+
*/
|
|
16
|
+
showType: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* 大图位置样式配置对象
|
|
21
|
+
* @type {Object}
|
|
22
|
+
* @property {string} position - 定位方式
|
|
23
|
+
* @property {string} width - 宽度
|
|
24
|
+
* @property {string} height - 高度
|
|
25
|
+
* @property {string} left - 左侧位置
|
|
26
|
+
* @property {string} top - 顶部位置
|
|
27
|
+
*/
|
|
28
|
+
largePos: {
|
|
29
|
+
type: Object,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const imgType = ref("small");
|
|
34
|
+
|
|
35
|
+
// 监听showType变化更新图片类型
|
|
36
|
+
watchEffect(() => {
|
|
37
|
+
imgType.value = props.showType;
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{
|
|
4
|
+
width: 1280,
|
|
5
|
+
height: 720,
|
|
6
|
+
backgroundColor: '#007788',
|
|
7
|
+
}"
|
|
8
|
+
></div>
|
|
9
|
+
<div
|
|
10
|
+
:style="{
|
|
11
|
+
left: 300,
|
|
12
|
+
top: 100,
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
<Resize
|
|
16
|
+
name="resize"
|
|
17
|
+
:provideData="provideData"
|
|
18
|
+
:measures="measures"
|
|
19
|
+
:initFocusId="0"
|
|
20
|
+
:layout="widgetLayout"
|
|
21
|
+
:padding="padding"
|
|
22
|
+
:onEdge="onEdge"
|
|
23
|
+
:anim="anim"
|
|
24
|
+
>
|
|
25
|
+
<template #itemLarge="{ data }">
|
|
26
|
+
<div
|
|
27
|
+
:style="{
|
|
28
|
+
width: 400,
|
|
29
|
+
height: 120,
|
|
30
|
+
backgroundColor: '#0F0',
|
|
31
|
+
fontSize: 30,
|
|
32
|
+
transition,
|
|
33
|
+
}"
|
|
34
|
+
>
|
|
35
|
+
{{ "测试文字" + data.content + "测试文字" }}
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
<template #itemSmall="{ data, focused }">
|
|
39
|
+
<div
|
|
40
|
+
:style="{
|
|
41
|
+
width: focused ? 120 : 100,
|
|
42
|
+
height: focused ? 120 : 100,
|
|
43
|
+
backgroundColor: '#F00',
|
|
44
|
+
fontSize: 30,
|
|
45
|
+
transition,
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
{{ data.content + (data.resizable ? "展开" : "不展开") }}
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
<template #itemLeftEdge>
|
|
52
|
+
<div
|
|
53
|
+
:style="{
|
|
54
|
+
width: 10,
|
|
55
|
+
height: 10,
|
|
56
|
+
backgroundColor: '#00F',
|
|
57
|
+
}"
|
|
58
|
+
></div>
|
|
59
|
+
</template>
|
|
60
|
+
<template #itemRightEdge>
|
|
61
|
+
<div
|
|
62
|
+
:style="{
|
|
63
|
+
left: 90,
|
|
64
|
+
width: 10,
|
|
65
|
+
height: 10,
|
|
66
|
+
backgroundColor: '#00F',
|
|
67
|
+
}"
|
|
68
|
+
></div>
|
|
69
|
+
</template>
|
|
70
|
+
</Resize>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script setup>
|
|
75
|
+
import Resize from "./Resize/Resize.vue";
|
|
76
|
+
import { useFocusHub } from "jsview";
|
|
77
|
+
import { onMounted } from "vue";
|
|
78
|
+
|
|
79
|
+
const randomColor = () => {
|
|
80
|
+
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
81
|
+
return (
|
|
82
|
+
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const anim = {
|
|
87
|
+
duration: 200,
|
|
88
|
+
easing: "jsv-ease(0.2, 0.6, 2)",
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const transition = `left ${anim.duration / 1000}s ${anim.easing}, top ${
|
|
92
|
+
anim.duration / 1000
|
|
93
|
+
}s ${anim.easing}, width ${anim.duration / 1000}s ${anim.easing}, height ${
|
|
94
|
+
anim.duration / 1000
|
|
95
|
+
}s ${anim.easing}`;
|
|
96
|
+
|
|
97
|
+
const focusHub = useFocusHub();
|
|
98
|
+
const dataLength = 15;
|
|
99
|
+
const provideData = () => {
|
|
100
|
+
const data = [];
|
|
101
|
+
for (let i = 0; i < dataLength; ++i) {
|
|
102
|
+
data.push({
|
|
103
|
+
width: 100,
|
|
104
|
+
height: 100,
|
|
105
|
+
marginRight: 10,
|
|
106
|
+
color: randomColor(),
|
|
107
|
+
content: i,
|
|
108
|
+
resizable: i !== 5,
|
|
109
|
+
resizeDelay: 1000,
|
|
110
|
+
blurSize: {
|
|
111
|
+
w: 100,
|
|
112
|
+
h: 100,
|
|
113
|
+
},
|
|
114
|
+
focusSize: {
|
|
115
|
+
w: 120,
|
|
116
|
+
h: 120,
|
|
117
|
+
},
|
|
118
|
+
expandSize: {
|
|
119
|
+
w: 400,
|
|
120
|
+
h: 120,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return data;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const measures = (data) => {
|
|
128
|
+
return {
|
|
129
|
+
width: data.width,
|
|
130
|
+
height: data.height,
|
|
131
|
+
marginRight: data.marginRight,
|
|
132
|
+
marginBottom: data.marginBottom,
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const onEdge = (edgeInfo) => {
|
|
137
|
+
console.log("onEdge");
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const widgetLayout = {
|
|
141
|
+
left: 0,
|
|
142
|
+
top: 0,
|
|
143
|
+
width: 700,
|
|
144
|
+
height: 200,
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const padding = {
|
|
148
|
+
left: 80,
|
|
149
|
+
top: 50,
|
|
150
|
+
right: 80,
|
|
151
|
+
bottom: 50,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
onMounted(() => {
|
|
155
|
+
focusHub.setFocus("resize");
|
|
156
|
+
});
|
|
157
|
+
</script>
|