@shijiu/jsview-vue-samples 2.2.426-test.0 → 2.3.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 +79 -0
- package/DashPath/AppForOperator.vue +35 -0
- package/DashPath/DashPath.vue +118 -0
- package/DemoForOperator/AnimPic/AnimPic.vue +47 -0
- package/DemoForOperator/AnimPic/App.vue +28 -0
- package/DemoForOperator/Banger/App.vue +26 -0
- package/DemoForOperator/Banger/Banger/Banger.vue +252 -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/Bounce/App.vue +43 -0
- package/DemoForOperator/Bounce/Bounce.vue +49 -0
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +139 -0
- package/DemoForOperator/ChunLian/App.vue +47 -0
- package/DemoForOperator/ChunLian/Couplets.vue +248 -0
- package/DemoForOperator/EpisodeList/App.vue +80 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +113 -0
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +176 -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 +358 -0
- package/DemoForOperator/Firework1/SpriteDeal.js +30 -0
- package/DemoForOperator/FlipPage/App.vue +75 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +150 -0
- package/DemoForOperator/FlipPage/FlipPage/flipIn.glsl +41 -0
- package/DemoForOperator/FlipPage/FlipPage/flipOut.glsl +41 -0
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +70 -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 +46 -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 +53 -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/FullscreenIn/App.vue +105 -0
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +41 -0
- package/DemoForOperator/FullscreenIn/Item.vue +50 -0
- package/DemoForOperator/Genie/App.vue +78 -0
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +699 -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 +38 -0
- package/DemoForOperator/Jigsaw/App.vue +45 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +100 -0
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +86 -0
- package/DemoForOperator/Particle/App.vue +69 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +176 -0
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +99 -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 +58 -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 +23 -0
- package/DemoForOperator/Ripple/App.vue +54 -0
- package/DemoForOperator/Ripple/Ripple.vue +50 -0
- package/DemoForOperator/ScalePoster/App.vue +4 -0
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
- package/DemoForOperator/Sprite/App.vue +33 -0
- package/DemoForOperator/Sprite/Sprite.vue +90 -0
- package/DemoForOperator/Stretch/App.vue +103 -0
- package/DemoForOperator/Stretch/Stretch/Item.vue +192 -0
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +168 -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 +146 -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/Vortex/App.vue +78 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +154 -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 +142 -0
- package/DemoHomepage/App.vue +50 -30
- package/DemoHomepage/components/Dialog.vue +1 -0
- package/DemoHomepage/components/TabFrame.vue +7 -0
- package/DemoHomepage/router.js +104 -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/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/focusableItemMetroWidget/WidgetItem.vue +3 -1
- package/MetroWidgetDemos/routeList.js +17 -17
- package/Poster3d/App.vue +69 -0
- package/Poster3d/Poster3d.vue +92 -0
- package/PosterPacker/App.vue +3 -3
- 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 +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
data: Object,
|
|
11
|
+
onAction: Object,
|
|
12
|
+
onItemFocus: Function,
|
|
13
|
+
query: Object,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const focused = ref(false);
|
|
17
|
+
|
|
18
|
+
// 注册回调
|
|
19
|
+
const onFocus = () => {
|
|
20
|
+
focused.value = true;
|
|
21
|
+
props.onItemFocus(props.query.index);
|
|
22
|
+
};
|
|
23
|
+
const onBlur = () => {
|
|
24
|
+
focused.value = false;
|
|
25
|
+
};
|
|
26
|
+
const onClick = () => {};
|
|
27
|
+
props.onAction.register("onFocus", onFocus);
|
|
28
|
+
props.onAction.register("onBlur", onBlur);
|
|
29
|
+
props.onAction.register("onClick", onClick);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div
|
|
34
|
+
:style="{
|
|
35
|
+
width: data.width,
|
|
36
|
+
height: data.height,
|
|
37
|
+
fontSize: 30,
|
|
38
|
+
color: '#000000',
|
|
39
|
+
backgroundColor: focused ? '#009900' : '#ff000033',
|
|
40
|
+
lineHeight: data.height,
|
|
41
|
+
textAlign: 'center',
|
|
42
|
+
}"
|
|
43
|
+
>
|
|
44
|
+
{{ data.content }}
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getKeyFramesGroup } from "jsview"
|
|
2
|
+
let token = 0;
|
|
3
|
+
const bounceLevel = [10, 20, 30];
|
|
4
|
+
const scaleLevel = [1.03, 1.07, 1.1];
|
|
5
|
+
const shaleLevel = [1, 3, 5];
|
|
6
|
+
|
|
7
|
+
let styleSheet = null;
|
|
8
|
+
export function getPosterAnim(type, params) {
|
|
9
|
+
if (!styleSheet) {
|
|
10
|
+
styleSheet = getKeyFramesGroup();
|
|
11
|
+
}
|
|
12
|
+
++token;
|
|
13
|
+
const levelIndex = params.level == "high" ? 2 : params.level == "middle" ? 1 : 0;
|
|
14
|
+
let name = undefined, body = undefined;
|
|
15
|
+
switch (type) {
|
|
16
|
+
case "bounce-left": {
|
|
17
|
+
name = `poster-anim-bounce-left-${token}`
|
|
18
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(-${bounceLevel[levelIndex]}, 0, 0);}}`
|
|
19
|
+
} break;
|
|
20
|
+
case "bounce-bottom": {
|
|
21
|
+
name = `poster-anim-bounce-bottom-${token}`
|
|
22
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(0, ${bounceLevel[levelIndex]}, 0);}}`
|
|
23
|
+
} break;
|
|
24
|
+
case "bounce-right": {
|
|
25
|
+
name = `poster-anim-bounce-right-${token}`
|
|
26
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(${bounceLevel[levelIndex]}, 0, 0);}}`
|
|
27
|
+
} break;
|
|
28
|
+
case "bounce-top": {
|
|
29
|
+
name = `poster-anim-bounce-top-${token}`
|
|
30
|
+
body = `@keyframes ${name} {0%,70%,100% { transform: translate3d(0, 0, 0);} 35% {transform: translate3d(0, -${bounceLevel[levelIndex]}, 0);}}`
|
|
31
|
+
} break;
|
|
32
|
+
case "shake": {
|
|
33
|
+
name = `poster-anim-shake-${token}`
|
|
34
|
+
body = `@keyframes ${name} {0%, 35% { transform: rotate3d(0, 0, 1, ${shaleLevel[levelIndex]}deg); } 70% { transform: rotate3d(0, 0, 1, -${shaleLevel[levelIndex]}deg); } 100% { transform: rotate3d(0, 0, 1, 0deg); } }`
|
|
35
|
+
} break;
|
|
36
|
+
|
|
37
|
+
case "scale": {
|
|
38
|
+
const s0 = params.scale0
|
|
39
|
+
const s1 = params.scale1;
|
|
40
|
+
name = `poster-anim-scale-${token}`
|
|
41
|
+
body = `@keyframes ${name} {0% { transform: scale3d(${s0}, ${s0}, 1); } 50% { transform: scale3d(${s1}, ${s1}, 1); } 100% { transform: scale3d(1, 1, 1); }}`
|
|
42
|
+
} break;
|
|
43
|
+
case "breath": {
|
|
44
|
+
const s0 = params.scale
|
|
45
|
+
name = `poster-anim-breath-${token}`
|
|
46
|
+
body = `@keyframes ${name} {0% { transform: scale3d(1, 1, 1); transform-origin: center center;} 50% { transform: scale3d(${s0}, ${s0}, 1); transform-origin: center center;} 100% { transform: scale3d(1, 1, 1); transform-origin: center center;}}`
|
|
47
|
+
} break;
|
|
48
|
+
}
|
|
49
|
+
if (typeof body != "undefined") {
|
|
50
|
+
styleSheet.insertRule(body);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
name,
|
|
54
|
+
release: () => {
|
|
55
|
+
styleSheet.removeRule(name)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -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,23 @@
|
|
|
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
|
+
const props = defineProps({
|
|
11
|
+
showType: {
|
|
12
|
+
type: String,
|
|
13
|
+
},
|
|
14
|
+
largePos: {
|
|
15
|
+
type: Object,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const imgType = ref("small");
|
|
20
|
+
watchEffect(() => {
|
|
21
|
+
imgType.value = props.showType;
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<jsv-focus-block autoFocus :onAction="{ onKeyDown }">
|
|
3
|
+
<Ripple
|
|
4
|
+
ref="rippleRef"
|
|
5
|
+
:layout="{
|
|
6
|
+
left: 320,
|
|
7
|
+
top: 200,
|
|
8
|
+
width: 640,
|
|
9
|
+
height: 360,
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
:style="{ width: 640, height: 360, backgroundImage: `url(${bg})` }"
|
|
14
|
+
></div>
|
|
15
|
+
</Ripple>
|
|
16
|
+
<div
|
|
17
|
+
:style="{
|
|
18
|
+
width: 640,
|
|
19
|
+
height: 50,
|
|
20
|
+
left: 320,
|
|
21
|
+
top: 100,
|
|
22
|
+
fontSize: 30,
|
|
23
|
+
backgroundColor: '#ffffff77',
|
|
24
|
+
textAlign: 'center',
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
按OK键生成波纹
|
|
28
|
+
</div>
|
|
29
|
+
</jsv-focus-block>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup>
|
|
33
|
+
import Ripple from "./Ripple.vue";
|
|
34
|
+
import { shallowRef } from "vue";
|
|
35
|
+
const bg =
|
|
36
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/TombSweepingDayTest/Raining/RainScene/qingming_bg.jpg";
|
|
37
|
+
|
|
38
|
+
const rippleRef = shallowRef();
|
|
39
|
+
const onKeyDown = (ev) => {
|
|
40
|
+
if (ev.keyCode == 13) {
|
|
41
|
+
const left = Math.round(Math.random() * 500 + 70);
|
|
42
|
+
const top = Math.round(Math.random() * 300 + 30);
|
|
43
|
+
rippleRef.value?.addRipple(
|
|
44
|
+
{
|
|
45
|
+
left,
|
|
46
|
+
top,
|
|
47
|
+
},
|
|
48
|
+
4000
|
|
49
|
+
);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{ left: layout.left, top: layout.top }">
|
|
3
|
+
<JsvRipple
|
|
4
|
+
:width="layout.width"
|
|
5
|
+
:height="layout.height"
|
|
6
|
+
ref="rippleViewRef"
|
|
7
|
+
>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</JsvRipple>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { JsvRipple, JsvRippleShape } from "jsview";
|
|
15
|
+
import { shallowRef } from "vue";
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
layout: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const rippleViewRef = shallowRef();
|
|
24
|
+
|
|
25
|
+
defineExpose({
|
|
26
|
+
/* position: 位置, duration: 时长(秒) */
|
|
27
|
+
addRipple(position, duration = 3) {
|
|
28
|
+
//duration = ln(amplitude) / timeDecay => timeDecay = ln(amplitude) / duration
|
|
29
|
+
const amplitude = 50;
|
|
30
|
+
|
|
31
|
+
const timeDecay = Math.log(amplitude) / (duration);
|
|
32
|
+
|
|
33
|
+
rippleViewRef.value.addSource(
|
|
34
|
+
position.left,
|
|
35
|
+
position.top,
|
|
36
|
+
amplitude,
|
|
37
|
+
{
|
|
38
|
+
type: JsvRippleShape.CIRCLE,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
timeDecay: timeDecay,
|
|
42
|
+
distanceDecay: 8,
|
|
43
|
+
speed: 60,
|
|
44
|
+
frequency: 2,
|
|
45
|
+
waveNum: 2,
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
File without changes
|