@shijiu/jsview-vue-samples 2.2.373 → 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 -2
- package/BasicFocusControl/components/BaseBlock.vue +65 -18
- package/BreakRender/assets/imageList.json +235 -235
- package/ColorSpace/App.vue +4 -4
- 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/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +0 -1
- package/CssPreprocessor/utils/ContentBlock.vue +3 -3
- package/CssPreprocessor/utils/{FontStyle.css → FontConfig.css} +3 -3
- package/CssPreprocessor/utils/TitleBar.vue +2 -2
- package/CustomShader/App.vue +6 -6
- 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 -6
- package/DivMetroPerformance/components/ContentItem.vue +0 -1
- 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/FlexCellDemo/TestFrame1.vue +0 -4
- package/FullScreenFlex/TestFrame2.vue +1 -1
- package/GiftRain/App.vue +12 -15
- package/HashParams/App.vue +0 -1
- package/JsvPreDownloader/App.vue +4 -6
- package/Marquee/App.vue +2 -2
- package/MediaDemo/components/frames/AudioFrame.vue +1 -1
- package/MediaDemo/components/frames/VideoFrame.vue +1 -1
- package/MetroWidgetDemos/MassiveItems/ContentItem.vue +1 -2
- package/MetroWidgetDemos/MassiveItems/data.js +1 -1
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +0 -1
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +18 -17
- 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 +5 -5
- package/PosterPacker/tools/geniePakcer/Genie.vue +2 -2
- package/PosterPacker/tools/vortexPacker/Vortex.vue +15 -15
- package/QrcodeDemo/App.vue +1 -1
- package/Ripple/App.vue +1 -1
- package/ScaleDownNeon/App.vue +13 -10
- package/SceneTransition/App.vue +7 -6
- 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/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/TextureSize/App.vue +5 -6
- package/TombSweepingDayTest/Raining/RainScene.vue +4 -4
- package/ViewOpacity/App.vue +6 -7
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<rotate-frame
|
|
3
|
+
:imageUrl="src"
|
|
4
|
+
:left="layout.left"
|
|
5
|
+
:top="layout.top"
|
|
6
|
+
:width="layout.width"
|
|
7
|
+
:height="layout.height"
|
|
8
|
+
:maxViewSize="texCoord"
|
|
9
|
+
:borderRadius="borderRadius"
|
|
10
|
+
:lineWidth="borderWidth"
|
|
11
|
+
:withHalo="withHalo"
|
|
12
|
+
:oneCircleTime="circleTime"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import RotateFrame from "./utils/RotateFrame.vue";
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
src: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
layout: {
|
|
24
|
+
type: Object,
|
|
25
|
+
},
|
|
26
|
+
borderWidth: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 6,
|
|
29
|
+
},
|
|
30
|
+
borderRadius: {
|
|
31
|
+
type: Number,
|
|
32
|
+
},
|
|
33
|
+
circleTime: {
|
|
34
|
+
//秒
|
|
35
|
+
type: Number,
|
|
36
|
+
},
|
|
37
|
+
withHalo: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const texCoord = {
|
|
43
|
+
width: 500,
|
|
44
|
+
height: 500,
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<metro-widget
|
|
3
|
+
name="light"
|
|
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"/>
|
|
16
|
+
</template>
|
|
17
|
+
</metro-widget>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { MetroWidget, HORIZONTAL } from "jsview";
|
|
22
|
+
import { onMounted, ref } from "vue";
|
|
23
|
+
import Item from "./Item.vue";
|
|
24
|
+
import { widgetLayout, padding, data } from "../CommonPageSetting";
|
|
25
|
+
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
onEdge: Function
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Focus/Light/LightPage/background.png";
|
|
31
|
+
const provideData = () => {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const measures = (data) => {
|
|
36
|
+
return {
|
|
37
|
+
width: data.width,
|
|
38
|
+
height: data.height,
|
|
39
|
+
marginRight: data.marginRight,
|
|
40
|
+
marginBottom: data.marginBottom,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
JsvTextureStoreApi,
|
|
3
|
+
} from "jsview";
|
|
4
|
+
|
|
5
|
+
declare interface CacheInfoType {
|
|
6
|
+
borderRadius: number;
|
|
7
|
+
lineWidth: number;
|
|
8
|
+
canvasSourceId: String;
|
|
9
|
+
borderOutset: number;
|
|
10
|
+
canvasWidth: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let sCurrentCacheList: Array<CacheInfoType> = [];
|
|
14
|
+
|
|
15
|
+
function checkCache(border_radius: number, line_width: number): CacheInfoType | null {
|
|
16
|
+
for (let cache_item of sCurrentCacheList) {
|
|
17
|
+
if (cache_item.borderRadius == border_radius && cache_item.lineWidth == line_width) {
|
|
18
|
+
return cache_item;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function BuildFrame(border_radius: number, line_width: number): CacheInfoType {
|
|
25
|
+
let frame_cache: CacheInfoType | null;
|
|
26
|
+
|
|
27
|
+
frame_cache = checkCache(border_radius, line_width);
|
|
28
|
+
if (frame_cache != null) {
|
|
29
|
+
return frame_cache;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let sampleImageWidth = (border_radius + line_width + 3) * 2;
|
|
33
|
+
let canvasRef = JsvTextureStoreApi.canvasTexture(
|
|
34
|
+
sampleImageWidth,
|
|
35
|
+
sampleImageWidth
|
|
36
|
+
); // 创建画布
|
|
37
|
+
|
|
38
|
+
let circleInnerDiameter = border_radius * 2; // 环形内直径, 为所要包括图形的borderRadius的一倍
|
|
39
|
+
let circleLineWidth = line_width; // 线宽
|
|
40
|
+
let circleRadius = Math.floor(circleInnerDiameter / 2 + circleLineWidth / 2); // 绘制线是圆圈的轨迹中线
|
|
41
|
+
let customPath = canvasRef.circlePath(
|
|
42
|
+
Math.floor(sampleImageWidth / 2),
|
|
43
|
+
Math.floor(sampleImageWidth / 2),
|
|
44
|
+
circleRadius
|
|
45
|
+
); // 创建圆环绘制路径,圆形在画布的中心点位置
|
|
46
|
+
canvasRef.drawColor("rgba(0,0,0,0)"); // 画布绘制半透明底色
|
|
47
|
+
customPath!.stroke(circleLineWidth, "#000000FF"); // 以给定线宽绘制圆环
|
|
48
|
+
let source_id = canvasRef.commit(); // texture和div的textureStore绑定
|
|
49
|
+
|
|
50
|
+
frame_cache = {
|
|
51
|
+
canvasWidth: sampleImageWidth,
|
|
52
|
+
borderRadius: border_radius,
|
|
53
|
+
lineWidth: line_width,
|
|
54
|
+
canvasSourceId: source_id,
|
|
55
|
+
borderOutset: Math.floor((sampleImageWidth - circleInnerDiameter) / 2), // (画布 - 圆环内直径) / 2
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// 永远保存,不删除,界面上理论上不会有太多种转框,所以只存不清理
|
|
59
|
+
sCurrentCacheList.push(frame_cache);
|
|
60
|
+
|
|
61
|
+
console.log("Rotate frame cache increase to " + sCurrentCacheList.length);
|
|
62
|
+
|
|
63
|
+
return frame_cache;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
BuildFrame,
|
|
68
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { defineProps } from "vue";
|
|
3
|
+
import { JsvTextureAnim, DECORATE_NINEPATCH_ALPHA_MIX } from "jsview";
|
|
4
|
+
import { BuildFrame } from "./FrameCanvasStore";
|
|
5
|
+
import mask from "./circleHaloMask.png";
|
|
6
|
+
|
|
7
|
+
const rProps = defineProps({
|
|
8
|
+
// 旋转圈内的url,可以是import内容,也可以是https内容
|
|
9
|
+
imageUrl: {
|
|
10
|
+
type: String,
|
|
11
|
+
require: true,
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
// 所包含区域的left, top, width, height
|
|
15
|
+
left: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 0,
|
|
18
|
+
},
|
|
19
|
+
top: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
width: {
|
|
24
|
+
type: Number,
|
|
25
|
+
require: true,
|
|
26
|
+
},
|
|
27
|
+
height: {
|
|
28
|
+
type: Number,
|
|
29
|
+
require: true,
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// 所包含区域的圆角值borderRadius
|
|
33
|
+
borderRadius: {
|
|
34
|
+
type: Number,
|
|
35
|
+
require: true,
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
// 焦点框的线宽
|
|
39
|
+
lineWidth: {
|
|
40
|
+
type: Number,
|
|
41
|
+
require: true,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// 焦点框旋转一圈所用的时间
|
|
45
|
+
oneCircleTime: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 0.5, // 转一圈0.5秒
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// 是否需要外发光光晕
|
|
51
|
+
withHalo: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 设置转盘的绘制覆盖区域
|
|
58
|
+
* 注意texture的尺寸需要兼顾最大的view即可
|
|
59
|
+
*/
|
|
60
|
+
maxViewSize: {
|
|
61
|
+
type: Object, // { width: Number, height: Number },
|
|
62
|
+
default: {
|
|
63
|
+
width: 400,
|
|
64
|
+
height: 400,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// 基础旋转动画
|
|
70
|
+
const cRotateAnimation =
|
|
71
|
+
"{from {transform: rotate3d(0,0,1,0);} to {transform: rotate3d(0,0,1,360deg);}}";
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 创建右图的边缘遮罩,可调节边框的粗细:circleLineWidth
|
|
75
|
+
*/
|
|
76
|
+
// 设置设定模拟绘制.9图
|
|
77
|
+
const cFrameInfo = BuildFrame(rProps.borderRadius, rProps.lineWidth);
|
|
78
|
+
|
|
79
|
+
// 创建内边框(实心不发光部分)
|
|
80
|
+
const ninePatchDecorator1 = {
|
|
81
|
+
type: DECORATE_NINEPATCH_ALPHA_MIX,
|
|
82
|
+
url: `jsvtexturestore://${cFrameInfo.canvasSourceId}`,
|
|
83
|
+
imageWidth: cFrameInfo.canvasWidth, // 等同于画布宽
|
|
84
|
+
centerWidth: 2, // 固定为1或2, 但1在PC上绘制可能有异常
|
|
85
|
+
borderOutset: cFrameInfo.borderOutset, // (画布 - 圆环内直径) / 2
|
|
86
|
+
animTime: rProps.oneCircleTime,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 导入右图的边缘光晕部分的遮罩
|
|
91
|
+
*/
|
|
92
|
+
// 外发光的圈的图片信息, 完全按照 circleHaloMask来配置
|
|
93
|
+
const cOriginPngInfo = {
|
|
94
|
+
size: 160, // 图片尺寸
|
|
95
|
+
radius: 56, // 图片中的圆的圆内半径
|
|
96
|
+
};
|
|
97
|
+
const cRectRadius = Math.floor(rProps.borderRadius + rProps.lineWidth); // 光环在描边之外,留出描边的宽度
|
|
98
|
+
const ninePatchDecorator2 = {
|
|
99
|
+
type: DECORATE_NINEPATCH_ALPHA_MIX,
|
|
100
|
+
url: `url(${mask})`,
|
|
101
|
+
imageWidth: cOriginPngInfo.size,
|
|
102
|
+
imageDspWidth: Math.floor(
|
|
103
|
+
(cRectRadius / cOriginPngInfo.radius) * cOriginPngInfo.size
|
|
104
|
+
),
|
|
105
|
+
centerWidth: 2,
|
|
106
|
+
borderOutset: Math.floor(cOriginPngInfo.size / 2 - cOriginPngInfo.radius),
|
|
107
|
+
animTime: rProps.oneCircleTime,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const texCoord = {
|
|
111
|
+
width: rProps.maxViewSize.width,
|
|
112
|
+
height: rProps.maxViewSize.height,
|
|
113
|
+
};
|
|
114
|
+
</script>
|
|
115
|
+
<template>
|
|
116
|
+
<div>
|
|
117
|
+
<!-- 光晕(halo)在下,实心区域在上 -->
|
|
118
|
+
<jsv-texture-anim
|
|
119
|
+
v-if="rProps.withHalo"
|
|
120
|
+
:src="rProps.imageUrl"
|
|
121
|
+
:left="rProps.left"
|
|
122
|
+
:top="rProps.top"
|
|
123
|
+
:width="rProps.width"
|
|
124
|
+
:height="rProps.height"
|
|
125
|
+
:texCoord="texCoord"
|
|
126
|
+
:animation="cRotateAnimation"
|
|
127
|
+
:duration="5000"
|
|
128
|
+
:repeat="-1"
|
|
129
|
+
:autoStart="true"
|
|
130
|
+
:decorate="ninePatchDecorator2"
|
|
131
|
+
></jsv-texture-anim>
|
|
132
|
+
<jsv-texture-anim
|
|
133
|
+
:src="rProps.imageUrl"
|
|
134
|
+
:left="rProps.left"
|
|
135
|
+
:top="rProps.top"
|
|
136
|
+
:width="rProps.width"
|
|
137
|
+
:height="rProps.height"
|
|
138
|
+
:texCoord="texCoord"
|
|
139
|
+
:animation="cRotateAnimation"
|
|
140
|
+
:duration="5000"
|
|
141
|
+
:repeat="-1"
|
|
142
|
+
:autoStart="true"
|
|
143
|
+
:decorate="ninePatchDecorator1"
|
|
144
|
+
></jsv-texture-anim>
|
|
145
|
+
</div>
|
|
146
|
+
</template>
|
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
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 NormalFocusBox from "./NormalFocusBox.vue";
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
data: Object,
|
|
12
|
+
onAction: Object,
|
|
13
|
+
});
|
|
14
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Focus/Normal/Item/background.png";
|
|
15
|
+
|
|
16
|
+
const focused = ref(false);
|
|
17
|
+
|
|
18
|
+
// 注册回调
|
|
19
|
+
const onFocus = () => {
|
|
20
|
+
focused.value = true;
|
|
21
|
+
};
|
|
22
|
+
const onBlur = () => {
|
|
23
|
+
focused.value = false;
|
|
24
|
+
};
|
|
25
|
+
const onClick = () => {};
|
|
26
|
+
props.onAction.register("onFocus", onFocus);
|
|
27
|
+
props.onAction.register("onBlur", onBlur);
|
|
28
|
+
props.onAction.register("onClick", onClick);
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div
|
|
33
|
+
:style="{
|
|
34
|
+
width: data.width,
|
|
35
|
+
height: data.height,
|
|
36
|
+
transition: 'transform 0.2s',
|
|
37
|
+
transform: focused ? 'scale3d(1.05, 1.05, 1)' : null,
|
|
38
|
+
}"
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
:style="{
|
|
42
|
+
width: data.width,
|
|
43
|
+
height: data.height,
|
|
44
|
+
fontSize: 30,
|
|
45
|
+
color: '#FFFFFF',
|
|
46
|
+
backgroundImage: bgImage,
|
|
47
|
+
lineHeight: data.height,
|
|
48
|
+
textAlign: 'center',
|
|
49
|
+
}"
|
|
50
|
+
>
|
|
51
|
+
普通
|
|
52
|
+
</div>
|
|
53
|
+
<normal-focus-box
|
|
54
|
+
v-if="focused"
|
|
55
|
+
color="#ffffff"
|
|
56
|
+
:layout="{
|
|
57
|
+
width: data.width,
|
|
58
|
+
height: data.height,
|
|
59
|
+
}"
|
|
60
|
+
:borderWidth="5"
|
|
61
|
+
:borderRadius="10"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<JsvNinePatch
|
|
3
|
+
:style="layout"
|
|
4
|
+
:imageUrl="`jsvtexturestore://${sourceId}`"
|
|
5
|
+
:imageWidth="sampleImageWidth"
|
|
6
|
+
:centerWidth="2"
|
|
7
|
+
:imageDspWidth="sampleImageWidth"
|
|
8
|
+
:borderOutset="borderWidth"
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
<script setup>
|
|
12
|
+
import { JsvNinePatch, JsvTextureStoreApi } from "jsview";
|
|
13
|
+
import { onBeforeUnmount } from "vue";
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
color: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
layout: {
|
|
20
|
+
type: Object
|
|
21
|
+
},
|
|
22
|
+
borderWidth: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 3,
|
|
25
|
+
},
|
|
26
|
+
borderRadius: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 0
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
let canvasRef;
|
|
33
|
+
let circleRadius = props.borderRadius;
|
|
34
|
+
let sampleImageWidth = circleRadius * 2 + props.borderWidth + 2;
|
|
35
|
+
canvasRef = JsvTextureStoreApi.canvasTexture(
|
|
36
|
+
sampleImageWidth,
|
|
37
|
+
sampleImageWidth
|
|
38
|
+
); // 创建画布
|
|
39
|
+
|
|
40
|
+
let circleLineWidth = props.borderWidth;
|
|
41
|
+
let customPath = canvasRef.circlePath(
|
|
42
|
+
Math.floor(sampleImageWidth / 2),
|
|
43
|
+
Math.floor(sampleImageWidth / 2),
|
|
44
|
+
circleRadius
|
|
45
|
+
); // 创建圆环绘制路径,圆形在画布的中心点位置
|
|
46
|
+
canvasRef.drawColor("rgba(0,0,0,0)"); // 画布绘制半透明底色
|
|
47
|
+
customPath.stroke(circleLineWidth, props.color); // 以给定线宽绘制圆环
|
|
48
|
+
const sourceId = canvasRef.commit(); // texture和div的textureStore绑定
|
|
49
|
+
|
|
50
|
+
onBeforeUnmount(() => {
|
|
51
|
+
JsvTextureStoreApi.deleteTexture(sourceId);
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<metro-widget
|
|
3
|
+
name="normal"
|
|
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" />
|
|
16
|
+
</template>
|
|
17
|
+
</metro-widget>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { MetroWidget, HORIZONTAL } from "jsview";
|
|
22
|
+
import Item from "./Item.vue";
|
|
23
|
+
import { widgetLayout, padding, data } from "../CommonPageSetting";
|
|
24
|
+
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
onEdge: Function
|
|
27
|
+
})
|
|
28
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Focus/Normal/NormalPage/background.png";
|
|
29
|
+
const provideData = () => {
|
|
30
|
+
return data;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const measures = (data) => {
|
|
34
|
+
return {
|
|
35
|
+
width: data.width,
|
|
36
|
+
height: data.height,
|
|
37
|
+
marginRight: data.marginRight,
|
|
38
|
+
marginBottom: data.marginBottom,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
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 SwipeLightBox from "./SwipeLightBox.vue";
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
data: Object,
|
|
12
|
+
onAction: Object,
|
|
13
|
+
lightImg: String,
|
|
14
|
+
});
|
|
15
|
+
const bgImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Focus/SwipeLight/Item/background.png";
|
|
16
|
+
|
|
17
|
+
const focused = ref(false);
|
|
18
|
+
const showLight = ref(false);
|
|
19
|
+
|
|
20
|
+
// 注册回调
|
|
21
|
+
const onFocus = () => {
|
|
22
|
+
focused.value = true;
|
|
23
|
+
showLight.value = true;
|
|
24
|
+
};
|
|
25
|
+
const onBlur = () => {
|
|
26
|
+
focused.value = false;
|
|
27
|
+
showLight.value = false;
|
|
28
|
+
};
|
|
29
|
+
const onClick = () => {};
|
|
30
|
+
props.onAction.register("onFocus", onFocus);
|
|
31
|
+
props.onAction.register("onBlur", onBlur);
|
|
32
|
+
props.onAction.register("onClick", onClick);
|
|
33
|
+
|
|
34
|
+
function onAnimEnd() {
|
|
35
|
+
showLight.value = false;
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<div
|
|
41
|
+
:style="{
|
|
42
|
+
width: data.width,
|
|
43
|
+
height: data.height,
|
|
44
|
+
transition: 'transform 0.2s',
|
|
45
|
+
transform: focused ? 'scale3d(1.05, 1.05, 1)' : null,
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
:style="{
|
|
50
|
+
width: data.width,
|
|
51
|
+
height: data.height,
|
|
52
|
+
fontSize: 30,
|
|
53
|
+
color: '#FFFFFF',
|
|
54
|
+
backgroundImage: bgImage,
|
|
55
|
+
lineHeight: data.height,
|
|
56
|
+
textAlign: 'center',
|
|
57
|
+
borderRadius: 20,
|
|
58
|
+
}"
|
|
59
|
+
>
|
|
60
|
+
扫光
|
|
61
|
+
</div>
|
|
62
|
+
<swipe-light-box
|
|
63
|
+
v-if="showLight"
|
|
64
|
+
:lightImg="lightImg"
|
|
65
|
+
:size="{
|
|
66
|
+
width: data.width,
|
|
67
|
+
height: data.height,
|
|
68
|
+
}"
|
|
69
|
+
:borderRadius="20"
|
|
70
|
+
:onAnimEnd="onAnimEnd"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<jsv-texture-anim
|
|
3
|
+
:src="lightImg"
|
|
4
|
+
:animation="swipAnim"
|
|
5
|
+
:width="size.width"
|
|
6
|
+
:height="size.height"
|
|
7
|
+
:duration="msDuration"
|
|
8
|
+
:transform="transform"
|
|
9
|
+
:borderRadius="borderRadius"
|
|
10
|
+
:repeat="repeat"
|
|
11
|
+
:autoStart="true"
|
|
12
|
+
:onAnimationEnd="onAnimationEnd"
|
|
13
|
+
></jsv-texture-anim>
|
|
14
|
+
</template>
|
|
15
|
+
<script setup>
|
|
16
|
+
import { JsvTextureAnim } from "jsview";
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
lightImg: {
|
|
20
|
+
type: String,
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
type: Object,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
borderRadius: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 0,
|
|
29
|
+
},
|
|
30
|
+
duration: {
|
|
31
|
+
//秒
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 1,
|
|
34
|
+
},
|
|
35
|
+
angle: {
|
|
36
|
+
//度数
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 30,
|
|
39
|
+
},
|
|
40
|
+
lightWidth: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: 100,
|
|
43
|
+
},
|
|
44
|
+
repeat: {
|
|
45
|
+
// 重复次数, -1 无限循环; >=0 重复次数
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 0,
|
|
48
|
+
},
|
|
49
|
+
onAnimEnd: {
|
|
50
|
+
type: Function,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const msDuration = Math.round(props.duration * 1000);
|
|
55
|
+
const transform = `scale3d(0.5, 1, 1) rotate3d(0,0,1, ${props.angle}deg)`;
|
|
56
|
+
const swipAnim =
|
|
57
|
+
"{from {transform: translate3d(-100%, 0, 0);} to {transform: translate3d(100%, 0, 0);}}";
|
|
58
|
+
|
|
59
|
+
function onAnimationEnd() {
|
|
60
|
+
props.onAnimEnd?.();
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<JsvPreload :preloadList="preload_info"></JsvPreload>
|
|
3
|
+
<metro-widget
|
|
4
|
+
name="swipeLight"
|
|
5
|
+
:left="widgetLayout.left"
|
|
6
|
+
:top="widgetLayout.top"
|
|
7
|
+
:width="widgetLayout.width"
|
|
8
|
+
:height="widgetLayout.height"
|
|
9
|
+
:provideData="provideData"
|
|
10
|
+
:direction="HORIZONTAL"
|
|
11
|
+
:measures="measures"
|
|
12
|
+
:onEdge="onEdge"
|
|
13
|
+
:padding="padding"
|
|
14
|
+
>
|
|
15
|
+
<template #renderItem="{ data, onAction }">
|
|
16
|
+
<item :data="data" :onAction="onAction" :lightImg="swipLight" />
|
|
17
|
+
</template>
|
|
18
|
+
</metro-widget>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup>
|
|
22
|
+
import { MetroWidget, HORIZONTAL, JsvPreload, buildPreloadInfo } from "jsview";
|
|
23
|
+
import Item from "./Item.vue";
|
|
24
|
+
import { widgetLayout, padding, data } from "../CommonPageSetting";
|
|
25
|
+
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
onEdge: Function,
|
|
28
|
+
});
|
|
29
|
+
const swipLight = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Focus/SwipeLight/SwipeLightPage/swipLight.png";
|
|
30
|
+
const preload_info = [buildPreloadInfo(swipLight)];
|
|
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
|
+
</script>
|