@shijiu/jsview-vue-samples 2.3.151-test.0 → 3.0.0-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/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/CssPreprocessor/Scss/PanelData.js +1 -1
- package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +4 -3
- package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +2 -2
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/Firework1/App.vue +12 -1
- package/DemoForOperator/Firework1/Fireworks.vue +18 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +1 -0
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +1 -1
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +12 -7
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +13 -7
- package/DemoForOperator/LongChatBox/App.vue +13 -13
- package/DemoForOperator/LongChatBox/Bubble.vue +78 -66
- package/DemoForOperator/LongChatBox/LongChat.vue +68 -36
- package/DemoForOperator/LongChatBox/testData.js +7 -44
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/routeList.js +8 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +1 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +723 -160
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +49 -20
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +100 -47
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +1 -0
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +206 -0
- package/Markdown/Markdown/Markdown.vue +156 -0
- package/Markdown/Markdown/index.ts +1 -0
- package/Markdown/Markdown/marked/LICENSE.md +45 -0
- package/Markdown/Markdown/marked/index.ts +2 -0
- package/Markdown/Markdown/marked/marked.d.ts +756 -0
- package/Markdown/Markdown/marked/marked.js +71 -0
- package/Markdown/Markdown/parser.ts +1365 -0
- package/Markdown/data.js +581 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/RenderAccelerate/Item.vue +67 -0
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/{TripleWidget → SpatialNav}/Item.vue +1 -8
- package/MetroWidgetDemos/{TripleWidget/WidgetItem.vue → SpatialNav/SimpleFloor.vue} +14 -45
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +22 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +203 -12
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TransitPage/App.vue +2 -0
- package/assets/logo.png +0 -0
- package/package.json +5 -5
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -741
- package/DemoForOperator/LongChatBox/TextManager.ts +0 -147
- package/DemoForOperator/LongChatBox/VirtualList.vue +0 -298
- package/DemoForOperator/LongChatBox/utile.js +0 -331
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -87
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -99
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /package/{AnimPicture/assets → assets}/quan.webp +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{
|
|
4
|
+
width: 400,
|
|
5
|
+
height: 400,
|
|
6
|
+
backgroundColor: '#007788',
|
|
7
|
+
}"
|
|
8
|
+
></div>
|
|
9
|
+
<div
|
|
10
|
+
:style="{
|
|
11
|
+
width: 400,
|
|
12
|
+
height: 400,
|
|
13
|
+
backgroundImage: `url(jsvtexturestore://${sourceId})`,
|
|
14
|
+
}"
|
|
15
|
+
></div>
|
|
16
|
+
<div
|
|
17
|
+
v-for="pos in position"
|
|
18
|
+
:key="pos.x + pos.y"
|
|
19
|
+
:style="{
|
|
20
|
+
left: pos.x - 5,
|
|
21
|
+
top: pos.y - 5,
|
|
22
|
+
width: 10,
|
|
23
|
+
height: 10,
|
|
24
|
+
backgroundColor: '#00ff0055',
|
|
25
|
+
}"
|
|
26
|
+
></div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script setup>
|
|
30
|
+
import { JsvTextureStoreApi } from "jsview";
|
|
31
|
+
import { JsvDashPath } from "jsview";
|
|
32
|
+
import { onBeforeUnmount } from "vue";
|
|
33
|
+
|
|
34
|
+
const chartHelper = JsvTextureStoreApi.getChartHelper(
|
|
35
|
+
400,
|
|
36
|
+
400,
|
|
37
|
+
[-50, 450],
|
|
38
|
+
[-50, 450]
|
|
39
|
+
);
|
|
40
|
+
const canvas = chartHelper.getCanvas();
|
|
41
|
+
|
|
42
|
+
//绘制x轴
|
|
43
|
+
const { path: xAxis } = chartHelper.linePath(
|
|
44
|
+
[
|
|
45
|
+
{ x: -30, y: 0 },
|
|
46
|
+
{ x: 430, y: 0 },
|
|
47
|
+
],
|
|
48
|
+
0,
|
|
49
|
+
0
|
|
50
|
+
);
|
|
51
|
+
xAxis.strokeWithSetting({
|
|
52
|
+
lineWidth: 1,
|
|
53
|
+
color: "#000000",
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
//绘制y轴
|
|
57
|
+
const { path: yAxis } = chartHelper.linePath(
|
|
58
|
+
[
|
|
59
|
+
{ x: 0, y: -30 },
|
|
60
|
+
{ x: 0, y: 430 },
|
|
61
|
+
],
|
|
62
|
+
0,
|
|
63
|
+
0
|
|
64
|
+
);
|
|
65
|
+
yAxis.strokeWithSetting({
|
|
66
|
+
lineWidth: 1,
|
|
67
|
+
color: "#000000",
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const data = [
|
|
71
|
+
{ x: 0, y: 200 },
|
|
72
|
+
{ x: 50, y: 130 },
|
|
73
|
+
{ x: 100, y: 200 },
|
|
74
|
+
{ x: 150, y: 150 },
|
|
75
|
+
{ x: 200, y: 300 },
|
|
76
|
+
{ x: 250, y: 100 },
|
|
77
|
+
{ x: 300, y: 20 },
|
|
78
|
+
{ x: 350, y: 150 },
|
|
79
|
+
{ x: 400, y: 10 },
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
//绘制折线图(不闭合)
|
|
83
|
+
/**
|
|
84
|
+
* linePath参数说明
|
|
85
|
+
* @param data {Data[]} 数据点数组,每个点包含 x 和 y 坐标
|
|
86
|
+
* @param isBroken {boolean} 是否为折线
|
|
87
|
+
* @param close {number}
|
|
88
|
+
* 0: 不闭合,绘制线段用,
|
|
89
|
+
* 1: 闭合到x轴(自动绘制左右两端垂直于x轴的线段), 需要填充颜色时用
|
|
90
|
+
* 2: 闭合到y轴(自动绘制上下两端垂直于y轴的线段), 需要填充颜色时用
|
|
91
|
+
* @returns {CustomPath, Data[]} 路径对象和数据点数组,每个点包含 x 和 y 坐标
|
|
92
|
+
*/
|
|
93
|
+
const { path, position } = chartHelper.linePath(data, true, 0);
|
|
94
|
+
path.strokeWithSetting({
|
|
95
|
+
lineWidth: 2,
|
|
96
|
+
color: "#0088FF",
|
|
97
|
+
dash: [10, 5],
|
|
98
|
+
phase: 0,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
//绘制柱状图
|
|
102
|
+
const originPos = chartHelper.getOriginPosition();
|
|
103
|
+
//data2Pos获取数据点对应的坐标
|
|
104
|
+
const pos2 = chartHelper.data2Pos(data);
|
|
105
|
+
for (const pos of pos2) {
|
|
106
|
+
const rect = canvas.rectPath(pos.x - 10, pos.y, pos.x + 10, originPos.y);
|
|
107
|
+
rect.fill("#0000FF88");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const sourceId = canvas.commit();
|
|
111
|
+
onBeforeUnmount(() => {
|
|
112
|
+
//注意释放资源
|
|
113
|
+
JsvTextureStoreApi.deleteTexture(sourceId);
|
|
114
|
+
});
|
|
115
|
+
</script>
|
|
@@ -40,7 +40,7 @@ const contentListData = [
|
|
|
40
40
|
{ title: "关键帧- @keyframes", obj: ScssKeyframes},
|
|
41
41
|
],
|
|
42
42
|
[
|
|
43
|
-
{ title: "导入- @
|
|
43
|
+
{ title: "导入- @use", obj: ScssImporting, zoom: 2 },
|
|
44
44
|
{ title: undefined, obj: undefined, zoom: 0 },
|
|
45
45
|
],
|
|
46
46
|
];
|
|
@@ -18,14 +18,15 @@ export default {
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<style scoped lang='scss'>
|
|
21
|
+
@use 'sass:map';
|
|
22
|
+
|
|
21
23
|
$font-sizes: (
|
|
22
24
|
small: 10, medium: 14, large: 18,
|
|
23
25
|
);
|
|
24
26
|
|
|
25
27
|
.scss-map {
|
|
26
|
-
font-size: map
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
font-size: map.get($font-sizes, medium);
|
|
29
|
+
|
|
29
30
|
color: #126085;
|
|
30
31
|
left: 10;
|
|
31
32
|
top: 3;
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
{{'ScssImportFile.vue\n'
|
|
10
10
|
+ '\n'
|
|
11
11
|
+ '<style scoped lang=\'scss\'>\n'
|
|
12
|
-
+ '@
|
|
12
|
+
+ '@use \'./TextSettings\';\n'
|
|
13
13
|
+ '</style>\n'
|
|
14
14
|
+ '\n'
|
|
15
15
|
+ '=================\n'
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<style scoped lang='scss'>
|
|
31
|
-
@
|
|
31
|
+
@use './TextSettings';
|
|
32
32
|
.scss-bounds {
|
|
33
33
|
left: 10;
|
|
34
34
|
top: 0;
|
|
@@ -119,7 +119,7 @@ export function buildBounce(
|
|
|
119
119
|
cmds.state().removeConditionByGroup(condGroupId),
|
|
120
120
|
|
|
121
121
|
// wallPosition用于规避运动路程计算超出(times越大超出越多)时,解决动画结尾的回弹问题
|
|
122
|
-
cmds.condition(condGroupId, true, sWallConditionName).wallPosition(wallname, 0
|
|
122
|
+
cmds.condition(condGroupId, true, sWallConditionName).wallPosition(wallname, 0).then([
|
|
123
123
|
cmds.action().teleportTo(0, undefined),
|
|
124
124
|
cmds.action().setSpdAndAccel(0, undefined, undefined, undefined),
|
|
125
125
|
]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :style="{ width: 1280, height: 720, backgroundColor: '#00000055' }"></div>
|
|
3
|
-
<Fireworks :top="500" :left="600" :srcConfig="config" />
|
|
3
|
+
<Fireworks :top="500" :left="600" :srcConfig="config" :onShoot="onShoot" :onExplode="onExplode" />
|
|
4
4
|
</template>
|
|
5
5
|
|
|
6
6
|
<script setup>
|
|
@@ -22,4 +22,15 @@ const config = {
|
|
|
22
22
|
//精灵图素材
|
|
23
23
|
fireworkSpriteSrc: "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/firework1/fireworks.png",
|
|
24
24
|
};
|
|
25
|
+
|
|
26
|
+
const onShoot = () => {
|
|
27
|
+
//可以加音效
|
|
28
|
+
console.log("onShoot");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const onExplode = () => {
|
|
32
|
+
//可以加音效
|
|
33
|
+
console.log("onExplode");
|
|
34
|
+
}
|
|
35
|
+
|
|
25
36
|
</script>
|
|
@@ -196,6 +196,12 @@ const props = defineProps({
|
|
|
196
196
|
srcConfig: {
|
|
197
197
|
type: Object,
|
|
198
198
|
require: true
|
|
199
|
+
},
|
|
200
|
+
onShoot: {
|
|
201
|
+
type: Function,
|
|
202
|
+
},
|
|
203
|
+
onExplode: {
|
|
204
|
+
type: Function,
|
|
199
205
|
}
|
|
200
206
|
});
|
|
201
207
|
|
|
@@ -236,6 +242,7 @@ const spray = () => {
|
|
|
236
242
|
timer.id2 = setTimeout(() => {
|
|
237
243
|
let randomIndex = Math.floor(Math.random() * sprayArray.length);
|
|
238
244
|
sprayArray[randomIndex].value = true;
|
|
245
|
+
onExplode()
|
|
239
246
|
timer.id = setInterval(() => {
|
|
240
247
|
let remainingItems = sprayArray.filter((item) => !item.value);
|
|
241
248
|
if (remainingItems.length === 0) {
|
|
@@ -244,6 +251,7 @@ const spray = () => {
|
|
|
244
251
|
} else {
|
|
245
252
|
randomIndex = Math.floor(Math.random() * remainingItems.length);
|
|
246
253
|
remainingItems[randomIndex].value = true;
|
|
254
|
+
onExplode();
|
|
247
255
|
}
|
|
248
256
|
}, 100);
|
|
249
257
|
}, 500);
|
|
@@ -355,6 +363,14 @@ for (let i = 1; i <= 5; i++) {
|
|
|
355
363
|
remainingGroups.splice(randomIndex, 1);
|
|
356
364
|
}
|
|
357
365
|
|
|
366
|
+
const onShoot = () => {
|
|
367
|
+
props.onShoot?.();
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const onExplode = () => {
|
|
371
|
+
props.onExplode?.();
|
|
372
|
+
}
|
|
373
|
+
|
|
358
374
|
watch(readyNum, (n, o) => {
|
|
359
375
|
if (o != 2 && n == 2) {
|
|
360
376
|
myShow.value = true;
|
|
@@ -376,11 +392,13 @@ watch(readyNum, (n, o) => {
|
|
|
376
392
|
cmds.action().stopMoving(),
|
|
377
393
|
() => {
|
|
378
394
|
isSpray.value = true;
|
|
395
|
+
onExplode();
|
|
379
396
|
isShow.value = false;
|
|
380
397
|
spray();
|
|
381
398
|
},
|
|
382
399
|
]),
|
|
383
400
|
]);
|
|
401
|
+
onShoot();
|
|
384
402
|
}, 0);
|
|
385
403
|
}
|
|
386
404
|
});
|
|
@@ -43,7 +43,7 @@ const cImageMaps = {
|
|
|
43
43
|
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources-2/DemoForOperator/FrameShadow/FrameShadow.png",
|
|
44
44
|
down: "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources-2/DemoForOperator/FrameShadow/FrameShadow-down.png",
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
let vImageUrl = cImageMaps[props.type];
|
|
47
47
|
if (vImageUrl === undefined) {
|
|
48
48
|
vImageUrl = cImageMaps["surround"];
|
|
49
49
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
onKeyDown,
|
|
7
7
|
}"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
9
|
+
<GenieSlot
|
|
10
10
|
ref="cGenieRef"
|
|
11
11
|
:width="width"
|
|
12
12
|
:height="height"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
:position="position"
|
|
17
17
|
:time="1"
|
|
18
18
|
:onAnimEnd="onAnimEnd"
|
|
19
|
-
:initShow="
|
|
19
|
+
:initShow="false"
|
|
20
20
|
>
|
|
21
21
|
<img
|
|
22
22
|
:src="`url(${imageUrl})`"
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
>
|
|
45
45
|
按OK键进场/出场
|
|
46
46
|
</div>
|
|
47
|
-
</
|
|
47
|
+
</GenieSlot>
|
|
48
48
|
</jsv-focus-block>
|
|
49
49
|
</template>
|
|
50
50
|
<script setup>
|
|
51
|
-
import
|
|
52
|
-
import { shallowRef } from "vue";
|
|
51
|
+
import GenieSlot from "./geniePakcer/GenieSlot.vue";
|
|
52
|
+
import { shallowRef, onBeforeUnmount } from "vue";
|
|
53
53
|
|
|
54
54
|
const cGenieRef = shallowRef();
|
|
55
55
|
const position = { x: -80, y: 600 };
|
|
@@ -59,13 +59,27 @@ const imageUrl =
|
|
|
59
59
|
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Genie/App/element_228542_icon_20230610184253.jpg";
|
|
60
60
|
|
|
61
61
|
let imgLoaded = false;
|
|
62
|
+
let unmounted = false;
|
|
63
|
+
|
|
64
|
+
onBeforeUnmount(()=>{
|
|
65
|
+
unmounted = true;
|
|
66
|
+
})
|
|
67
|
+
|
|
62
68
|
function onImgLoaded() {
|
|
63
|
-
|
|
69
|
+
// 进行setTimeout(1), 为了规避已加载的图片onLoad太早破坏了先绘制再截图的时序
|
|
70
|
+
setTimeout(()=>{
|
|
71
|
+
imgLoaded = true;
|
|
72
|
+
if (!unmounted) {
|
|
73
|
+
cGenieRef.value.switcher();
|
|
74
|
+
}
|
|
75
|
+
}, 1)
|
|
64
76
|
}
|
|
77
|
+
|
|
65
78
|
const onAnimEnd = () => {
|
|
66
79
|
console.log("anim end");
|
|
67
80
|
};
|
|
68
81
|
|
|
82
|
+
|
|
69
83
|
function onKeyDown(ev) {
|
|
70
84
|
if (ev.keyCode == 13) {
|
|
71
85
|
if (imgLoaded) {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{ width: 1280, height: 720, backgroundColor: '#f5f57d' }"></div>
|
|
3
|
+
<jsv-focus-block
|
|
4
|
+
autoFocus
|
|
5
|
+
:onAction="{
|
|
6
|
+
onKeyDown,
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<GenieImage
|
|
10
|
+
ref="cGenieRef"
|
|
11
|
+
:width="width"
|
|
12
|
+
:height="height"
|
|
13
|
+
:left="128"
|
|
14
|
+
:top="72"
|
|
15
|
+
direction="horizontal"
|
|
16
|
+
:position="position"
|
|
17
|
+
:time="1"
|
|
18
|
+
:onAnimEnd="onAnimEnd"
|
|
19
|
+
:initShow="false"
|
|
20
|
+
:imageUrl="imageUrl"
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
</GenieImage>
|
|
24
|
+
</jsv-focus-block>
|
|
25
|
+
</template>
|
|
26
|
+
<script setup>
|
|
27
|
+
import GenieImage from "./geniePakcer/GenieImage.vue";
|
|
28
|
+
import { shallowRef, onBeforeUnmount, onMounted } from "vue";
|
|
29
|
+
|
|
30
|
+
const cGenieRef = shallowRef();
|
|
31
|
+
const position = { x: -80, y: 600 };
|
|
32
|
+
const width = 1024;
|
|
33
|
+
const height = 576;
|
|
34
|
+
const imageUrl =
|
|
35
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Genie/App/element_228542_icon_20230610184253.jpg";
|
|
36
|
+
|
|
37
|
+
let imgLoaded = false;
|
|
38
|
+
let unmounted = false;
|
|
39
|
+
|
|
40
|
+
onBeforeUnmount(()=>{
|
|
41
|
+
unmounted = true;
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const onAnimEnd = () => {
|
|
45
|
+
console.log("anim end");
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
function onKeyDown(ev) {
|
|
49
|
+
if (ev.keyCode == 13) {
|
|
50
|
+
cGenieRef.value.switcher();
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
onMounted(()=>{
|
|
57
|
+
cGenieRef.value.switcher();
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
</script>
|
|
61
|
+
|