@shijiu/jsview-vue-samples 2.3.151-test.0 → 2.3.728-alpha.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.
Files changed (244) hide show
  1. package/ABImageAlt/App.vue +114 -0
  2. package/ABImageAlt/Item.vue +133 -0
  3. package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
  4. package/ABImageAlt/data.js +17 -0
  5. package/AI_Check_Rules.txt +5 -0
  6. package/AnimPicture/App.vue +20 -10
  7. package/ApicSwitch/App.vue +90 -0
  8. package/ApicSwitch/TabItem.vue +65 -0
  9. package/ApicSwitch/WebpShow.vue +24 -0
  10. package/ApicSwitch/data.js +50 -0
  11. package/Basic/AI_skills_update.md +1 -0
  12. package/Basic/components/div/ColorFormatTest.vue +93 -0
  13. package/Basic/components/div/DivRadius.vue +97 -15
  14. package/Basic/components/div/DivTag3Group.vue +30 -0
  15. package/Basic/components/img/ImageType.vue +65 -0
  16. package/Basic/components/panel/Panel2.vue +13 -1
  17. package/Basic/components/text/TextAlign.vue +7 -1
  18. package/BlobLoadTest/App.vue +201 -0
  19. package/BreakLinesApi/App.vue +82 -0
  20. package/CanvasDrawChart/App.vue +11 -0
  21. package/CanvasDrawChart/Graph1.vue +104 -0
  22. package/CanvasDrawChart/Graph2.vue +115 -0
  23. package/DemoForOperator/Blur/Blur.vue +1 -1
  24. package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +49 -23
  25. package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +1 -1
  26. package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +156 -20
  27. package/DemoForOperator/BookFlip/App.vue +1 -1
  28. package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
  29. package/DemoForOperator/Firework1/App.vue +12 -1
  30. package/DemoForOperator/Firework1/Fireworks.vue +18 -0
  31. package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +1 -0
  32. package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
  33. package/DemoForOperator/Focus/Light/Item.vue +1 -0
  34. package/DemoForOperator/Focus/Normal/Item.vue +1 -0
  35. package/DemoForOperator/Genie/App.vue +20 -6
  36. package/DemoForOperator/Genie/App2.vue +61 -0
  37. package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
  38. package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
  39. package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
  40. package/DemoForOperator/Jigsaw/JigsawFull.vue +12 -7
  41. package/DemoForOperator/Jigsaw/JigsawSingle.vue +13 -7
  42. package/DemoForOperator/LongChatBox/App.vue +13 -13
  43. package/DemoForOperator/LongChatBox/Bubble.vue +78 -66
  44. package/DemoForOperator/LongChatBox/LongChat.vue +67 -36
  45. package/DemoForOperator/LongChatBox/testData.js +7 -44
  46. package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +1 -1
  47. package/DemoForOperator/routeList.js +8 -2
  48. package/DemoHomepage/App.vue +74 -1
  49. package/DemoHomepage/components/BodyFrame.vue +5 -0
  50. package/DemoHomepage/components/TabFrame.vue +1 -1
  51. package/DemoHomepage/router.js +749 -165
  52. package/DemoHomepage/views/Homepage.vue +60 -2
  53. package/DemoHomepage/watchTest.vue +50 -0
  54. package/DomRenderer/App.vue +133 -0
  55. package/FilterDemo/AnimatePic.vue +63 -17
  56. package/FilterDemo/App.vue +3 -3
  57. package/FlexCellDemo/AI_skills_update.md +4 -0
  58. package/FlexCellDemo/TestFrame1.vue +12 -2
  59. package/FlexCellDemo/TestFrame2.vue +10 -1
  60. package/FlexCellDemo/TestFrame3.vue +114 -59
  61. package/FpsLimit/App.vue +102 -0
  62. package/FreeMove/App.vue +24 -279
  63. package/FreeMove/TestScene1.vue +260 -0
  64. package/FreeMove/TestScene3.vue +431 -0
  65. package/FreeMoveChildAttract/App.vue +18 -8
  66. package/FreeMoveLink/App.vue +51 -22
  67. package/Hover/App.vue +144 -0
  68. package/HttpRequestSSE/SSEReader.js +200 -0
  69. package/ImpactStop/App.vue +2 -2
  70. package/Input/FullKeyboard.vue +3 -3
  71. package/Input/InputPanel.vue +63 -3
  72. package/JsvLine/App.vue +53 -38
  73. package/LatexDemo/App.vue +3 -1
  74. package/LatexFormula/App.vue +196 -0
  75. package/LongImage/App.vue +1 -1
  76. package/LongImage/LongImageScroll.vue +111 -46
  77. package/LongImage/Scroll.vue +28 -9
  78. package/LongText/LongTextScroll.vue +14 -1
  79. package/Markdown/App.vue +36 -0
  80. package/Markdown/Bubble.vue +109 -0
  81. package/Markdown/LongChat.vue +216 -0
  82. package/Markdown/data.js +633 -0
  83. package/MetroWidgetDemos/AI_skills_update.md +2 -0
  84. package/MetroWidgetDemos/EpgFlowListType/App.vue +206 -0
  85. package/MetroWidgetDemos/EpgFlowListType/components/ContentCard.vue +105 -0
  86. package/MetroWidgetDemos/EpgFlowListType/components/FloorSection.vue +131 -0
  87. package/MetroWidgetDemos/EpgFlowListType/components/LeftTabItem.vue +41 -0
  88. package/MetroWidgetDemos/EpgFlowListType/data.js +78 -0
  89. package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
  90. package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
  91. package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
  92. package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
  93. package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
  94. package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
  95. package/MetroWidgetDemos/ListExpand/index.vue +88 -0
  96. package/MetroWidgetDemos/ListExpand/list.js +2421 -0
  97. package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
  98. package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
  99. package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
  100. package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
  101. package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
  102. package/MetroWidgetDemos/RenderAccelerate/Item.vue +67 -0
  103. package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
  104. package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
  105. package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
  106. package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
  107. package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
  108. package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
  109. package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
  110. package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
  111. package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
  112. package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
  113. package/MetroWidgetDemos/{TripleWidget → SpatialNav}/Item.vue +1 -8
  114. package/MetroWidgetDemos/{TripleWidget/WidgetItem.vue → SpatialNav/SimpleFloor.vue} +14 -45
  115. package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
  116. package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
  117. package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
  118. package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
  119. package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
  120. package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
  121. package/MetroWidgetDemos/basic2/App.vue +407 -0
  122. package/MetroWidgetDemos/basic2/Item.vue +68 -0
  123. package/MetroWidgetDemos/direction/App.vue +22 -0
  124. package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
  125. package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
  126. package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
  127. package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
  128. package/MetroWidgetDemos/ninePatchFocusPage/App.vue +23 -7
  129. package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
  130. package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
  131. package/MetroWidgetDemos/routeList.js +216 -12
  132. package/MetroWidgetDemos/slideSetting/App.vue +288 -99
  133. package/MetroWidgetDemos/zIndex/App.vue +117 -0
  134. package/MetroWidgetDemos/zIndex/Item.vue +61 -0
  135. package/NinePatchTester/App.vue +24 -31
  136. package/PreDecode/App.vue +140 -0
  137. package/ReactiveTest/App.vue +115 -0
  138. package/ReactiveTest/Item.vue +92 -0
  139. package/ReactiveTest/assets/imageList.js +245 -0
  140. package/ReactiveTest/component/TestSmartDiv.vue +50 -0
  141. package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
  142. package/ReactiveTest/component/TestSmartImage.vue +46 -0
  143. package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
  144. package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
  145. package/ReactiveTest/data.js +49 -0
  146. package/ScreenToBlob/App.vue +250 -0
  147. package/ScrollBoxTest/App.vue +52 -28
  148. package/ScrollBoxTest/ClipBar.vue +64 -2
  149. package/ScrollBoxTest/NinePatchBar.vue +64 -2
  150. package/ScrollBoxTest/SizeDivBar.vue +64 -2
  151. package/SecTorTest/App.vue +9 -3
  152. package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
  153. package/SyncDecode/App.vue +137 -0
  154. package/TextSizeLimit/App.vue +211 -0
  155. package/TextureAnimation/App3.vue +11 -1
  156. package/TouchWidget/App.vue +90 -5
  157. package/TouchWidget/WidgetItem.vue +1 -0
  158. package/TransitPage/App.vue +2 -0
  159. package/assets/logo.png +0 -0
  160. package/package.json +1 -1
  161. package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +0 -179
  162. package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +0 -310
  163. package/DemoForOperator/BookFlip/BookFlip/flip.glsl +0 -135
  164. package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -741
  165. package/DemoForOperator/LongChatBox/TextManager.ts +0 -147
  166. package/DemoForOperator/LongChatBox/VirtualList.vue +0 -298
  167. package/DemoForOperator/LongChatBox/utile.js +0 -331
  168. package/DivMetroPerformance/App.vue +0 -157
  169. package/DivMetroPerformance/Item.vue +0 -58
  170. package/DivMetroPerformance/assets/bg.jpg +0 -0
  171. package/DivMetroPerformance/assets/coupon_content.png +0 -0
  172. package/DivMetroPerformance/assets/coupon_left.png +0 -0
  173. package/DivMetroPerformance/assets/coupon_mid.png +0 -0
  174. package/DivMetroPerformance/assets/coupon_right.png +0 -0
  175. package/DivMetroPerformance/assets/focus_border.png +0 -0
  176. package/DivMetroPerformance/assets/holder_logo.png +0 -0
  177. package/DivMetroPerformance/assets/jrbm.png +0 -0
  178. package/DivMetroPerformance/assets/line_left.png +0 -0
  179. package/DivMetroPerformance/assets/line_mid.png +0 -0
  180. package/DivMetroPerformance/assets/line_right.png +0 -0
  181. package/DivMetroPerformance/assets/loading.png +0 -0
  182. package/DivMetroPerformance/assets/logo.png +0 -0
  183. package/DivMetroPerformance/assets/mcjx.png +0 -0
  184. package/DivMetroPerformance/assets/tao.png +0 -0
  185. package/DivMetroPerformance/assets/tmall.png +0 -0
  186. package/DivMetroPerformance/border.png +0 -0
  187. package/DivMetroPerformance/components/ContentItem.vue +0 -384
  188. package/DivMetroPerformance/components/MyTab.vue +0 -129
  189. package/DivMetroPerformance/data.js +0 -124
  190. package/DivMetroPerformance/utils/GridItem.vue +0 -28
  191. package/DivMetroPerformance/utils/GridPlate.vue +0 -85
  192. package/MediaDemo/App.vue +0 -127
  193. package/MediaDemo/assets/audio-poster.png +0 -0
  194. package/MediaDemo/components/Button.vue +0 -69
  195. package/MediaDemo/components/Controllor.vue +0 -286
  196. package/MediaDemo/components/StatusBar.vue +0 -100
  197. package/MediaDemo/components/frames/AudioFrame.vue +0 -39
  198. package/MediaDemo/components/frames/AudioPoster.vue +0 -48
  199. package/MediaDemo/components/frames/MediaFrame.vue +0 -153
  200. package/MediaDemo/components/frames/VideoFrame.vue +0 -39
  201. package/MetroWidgetDemos/TripleWidget/App.vue +0 -87
  202. package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -99
  203. package/Parkour/App.vue +0 -13
  204. package/Parkour/Common/Context.js +0 -21
  205. package/Parkour/Common/MatchmanInfo.js +0 -62
  206. package/Parkour/Common/Random.js +0 -61
  207. package/Parkour/Common/Sound.js +0 -50
  208. package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
  209. package/Parkour/appConfig/app.config.mjs +0 -5
  210. package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
  211. package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
  212. package/Parkour/appConfig/jsview.config.mjs +0 -39
  213. package/Parkour/assets/Bgimages/bg1.png +0 -0
  214. package/Parkour/assets/Bgimages/bg2.png +0 -0
  215. package/Parkour/assets/Bgimages/bg3.png +0 -0
  216. package/Parkour/assets/Bgimages/bg4.png +0 -0
  217. package/Parkour/assets/Bgimages/bg5.png +0 -0
  218. package/Parkour/assets/audio/jump.mp3 +0 -0
  219. package/Parkour/assets/audio/lose.mp3 +0 -0
  220. package/Parkour/assets/role_skin1/fail.json +0 -44
  221. package/Parkour/assets/role_skin1/fail.png +0 -0
  222. package/Parkour/assets/role_skin1/jump_down.json +0 -20
  223. package/Parkour/assets/role_skin1/jump_down.png +0 -0
  224. package/Parkour/assets/role_skin1/jump_up.json +0 -44
  225. package/Parkour/assets/role_skin1/jump_up.png +0 -0
  226. package/Parkour/assets/role_skin1/roll.json +0 -44
  227. package/Parkour/assets/role_skin1/roll.png +0 -0
  228. package/Parkour/assets/role_skin1/run.json +0 -52
  229. package/Parkour/assets/role_skin1/run.png +0 -0
  230. package/Parkour/components/Backdrop.vue +0 -61
  231. package/Parkour/components/GameSence.vue +0 -602
  232. package/Parkour/components/Matchman.vue +0 -85
  233. package/TextureAnimation/utils/FrameCanvasStore.ts +0 -68
  234. package/TextureAnimation/utils/RotateFrame.vue +0 -146
  235. package/TextureAnimation/utils/circleHaloMask.png +0 -0
  236. package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
  237. package/ThrowMoveDemo/App.vue +0 -104
  238. package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
  239. package/ThrowMoveDemo/TargetDemo.vue +0 -87
  240. package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
  241. /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
  242. /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
  243. /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
  244. /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>
@@ -121,7 +121,7 @@ export function captureBlurTexture(divRef, blurRadius) {
121
121
  JsvTextureStoreApi.capture2Texture(
122
122
  divRef,
123
123
  (textureName, autoRecycle, w, h) => {
124
- console.log("ccht captureBlurTexture", textureName, autoRecycle, w, h);
124
+ console.log("captureBlurTexture", textureName, autoRecycle, w, h);
125
125
  if (textureName) {
126
126
  resolve({
127
127
  textureId: textureName,
@@ -1,24 +1,36 @@
1
1
  <script setup>
2
- import { shallowRef, onMounted } from "vue";
2
+ import { shallowRef, onBeforeUnmount } from "vue";
3
3
  import Blur, { captureBlurTexture } from "../Blur.vue";
4
4
  import StaticBgSlide from "./StaticBgSlide.vue";
5
5
 
6
- const vToCapture = shallowRef(null);
7
- const vTextureInfo = shallowRef(null);
6
+ const rToCapture = shallowRef(null);
7
+ const rTextureInfo = shallowRef(null);
8
+ const rTriggerLoadKey = shallowRef(0);
8
9
 
9
10
  let isBlur = false;
11
+
12
+ // 要确认图片完成显示时再进行捕获并处理成模糊纹理
13
+ function handleLoadDone() {
14
+ if (isBlur) {
15
+ console.log("start captureBlurTexture");
16
+ captureBlurTexture(rToCapture.value, 12).then((textureInfo) => {
17
+ rTextureInfo.value = textureInfo;
18
+ console.log("done captureBlurTexture");
19
+ setTimeout(() => {
20
+ curPosition.left = 0;
21
+ rBgAnim.value?.slide(curPosition);
22
+ }, 0);
23
+ });
24
+ }
25
+ }
26
+
10
27
  function enableBlur() {
11
28
  if (isBlur) {
12
29
  return;
13
30
  }
14
31
  isBlur = true;
15
- captureBlurTexture(vToCapture.value, 12).then((textureInfo) => {
16
- vTextureInfo.value = textureInfo;
17
- setTimeout(() => {
18
- curPosition.left = 0;
19
- bgAnim.value?.slide(curPosition);
20
- }, 0);
21
- });
32
+ // 触发图片加载,然后捕获模糊纹理
33
+ rTriggerLoadKey.value++;
22
34
  }
23
35
 
24
36
  const ImagePanda =
@@ -30,32 +42,32 @@ let curPosition = {
30
42
  };
31
43
  let width1 = 300;
32
44
  let height1 = 720;
33
- const bgAnim = shallowRef(null);
45
+ const rBgAnim = shallowRef(null);
34
46
  const onKeyDown = (ev) => {
35
47
  console.log("ccht", ev.keyCode);
36
48
  switch (ev.keyCode) {
37
49
  case 37:
38
50
  if (isBlur) {
39
51
  curPosition.left = -width1;
40
- bgAnim.value?.slide(curPosition);
52
+ rBgAnim.value?.slide(curPosition);
41
53
  }
42
54
 
43
55
  break;
44
56
  case 39:
45
57
  if (isBlur) {
46
58
  curPosition.left = 0;
47
- bgAnim.value?.slide(curPosition);
59
+ rBgAnim.value?.slide(curPosition);
48
60
  } else {
49
61
  enableBlur();
50
62
  }
51
63
  break;
52
64
  // case 38:
53
65
  // curPosition.top = curPosition.top - 100;
54
- // bgAnim.value?.slide(curPosition);
66
+ // rBgAnim.value?.slide(curPosition);
55
67
  // break;
56
68
  // case 40:
57
69
  // curPosition.top = curPosition.top + 100;
58
- // bgAnim.value?.slide(curPosition);
70
+ // rBgAnim.value?.slide(curPosition);
59
71
  // break;
60
72
  // case 13:
61
73
  // enableBlur();
@@ -65,8 +77,20 @@ const onKeyDown = (ev) => {
65
77
  }
66
78
  };
67
79
 
68
- onMounted(() => {
69
- // enableBlur();
80
+ const cVisibleCallback = (info) => {
81
+ console.log("onVisibilityChange", info);
82
+ if (info.status == "show") {
83
+ rTriggerLoadKey.value++; // 刷新img标签, 触发onload后的重新捕获模糊纹理
84
+ }
85
+ };
86
+
87
+ // 为了应对 window.JsvCoreApi.delayRemoveGLView/ window.JsvCoreApi.restoreGLView 对应的GL重建处理后,
88
+ // 需要重新捕获模糊纹理的场景
89
+ window.JsvCoreApi.onVisibilityChange(cVisibleCallback);
90
+
91
+ onBeforeUnmount(() => {
92
+ // 取消注册一定不要漏
93
+ window.JsvCoreApi.removeEventCallback(cVisibleCallback);
70
94
  });
71
95
  </script>
72
96
 
@@ -78,18 +102,20 @@ onMounted(() => {
78
102
  }"
79
103
  >
80
104
  <div
81
- ref="vToCapture"
105
+ ref="rToCapture"
82
106
  :style="{
83
107
  width: 1280, // 截屏区域的宽
84
108
  height: 720, // 截屏区域的高
85
109
  }"
86
110
  >
87
- <div
111
+ <img
112
+ :key="rTriggerLoadKey"
113
+ :src="ImagePanda"
88
114
  :style="{
89
115
  width: 1280,
90
116
  height: 720,
91
- backgroundImage: `url(${ImagePanda})`,
92
117
  }"
118
+ :onLoad="handleLoadDone"
93
119
  />
94
120
  <div
95
121
  :style="{
@@ -112,11 +138,11 @@ onMounted(() => {
112
138
  </div>
113
139
  </div>
114
140
 
115
- <div v-if="vTextureInfo">
141
+ <div v-if="rTextureInfo">
116
142
  <StaticBgSlide
117
143
  key="bg"
118
- ref="bgAnim"
119
- :imgUrl="`jsvtexturestore://${vTextureInfo.textureId}`"
144
+ ref="rBgAnim"
145
+ :imgUrl="`jsvtexturestore://${rTextureInfo.textureId}`"
120
146
  :width="width1"
121
147
  :height="height1"
122
148
  :bgWidth="1280"
@@ -66,7 +66,7 @@ const props = defineProps({
66
66
  default: "linear",
67
67
  },
68
68
  borderRadius: {
69
- type: Number,
69
+ type: [Number, String],
70
70
  default: 0,
71
71
  },
72
72
  initPosition: {
@@ -1,14 +1,45 @@
1
1
  <script setup>
2
- import { shallowRef } from "vue";
2
+ import { shallowRef, onBeforeUnmount } from "vue";
3
3
  import Blur, { captureBlurTexture } from "../Blur.vue";
4
4
 
5
- const vToCapture = shallowRef(null);
6
- const vTextureInfo = shallowRef(null);
5
+ const rToCapture = shallowRef(null);
6
+ const rTextureInfo = shallowRef(null);
7
+ const rTriggerLoadKey = shallowRef(0);
8
+ const rBlurTextureKeeps = shallowRef(null);
9
+
10
+ var vEnableBlur = false;
11
+
12
+ // 要确认图片完成显示时在进行捕获并处理成模糊纹理
13
+ function handleLoadDone() {
14
+ if (vEnableBlur) {
15
+ console.log("start captureBlurTexture");
16
+
17
+ // 捕获模糊纹理, 此纹理可以多个blur组件共享, 共享时最好用1x1的div把持, 避免自动释放
18
+ captureBlurTexture(rToCapture.value, 12/* blurRadius */).then((textureInfo) => {
19
+ rTextureInfo.value = textureInfo;
20
+
21
+ // 用1x1的div把持模糊纹理, 避免自动释放, 适合多区域模糊内容共享的场景
22
+ rBlurTextureKeeps.value = `jsvtexturestore://${textureInfo.textureId}`;
23
+
24
+ console.log("done captureBlurTexture");
25
+ });
26
+ }
27
+ }
7
28
 
8
29
  function enableBlur() {
9
- captureBlurTexture(vToCapture.value, 12).then((textureInfo) => {
10
- vTextureInfo.value = textureInfo;
11
- });
30
+ // 触发图片加载,然后捕获模糊纹理
31
+ rTriggerLoadKey.value++;
32
+ vEnableBlur = true;
33
+ }
34
+
35
+ const MOVE_STEP = 30;
36
+
37
+ function movePopups(dx, dy) {
38
+ rPopupLeft.value += dx;
39
+ rPopupTop.value += dy;
40
+ rPopup2Left.value += dx;
41
+ rPopup2Top.value += dy;
42
+ return true;
12
43
  }
13
44
 
14
45
  const _onKeyDown = (ev) => {
@@ -16,14 +47,56 @@ const _onKeyDown = (ev) => {
16
47
  enableBlur();
17
48
  return true;
18
49
  }
50
+ switch (ev.keyCode) {
51
+ case 37: // 左
52
+ return movePopups(-MOVE_STEP, 0);
53
+ case 38: // 上
54
+ return movePopups(0, -MOVE_STEP);
55
+ case 39: // 右
56
+ return movePopups(MOVE_STEP, 0);
57
+ case 40: // 下
58
+ return movePopups(0, MOVE_STEP);
59
+ default:
60
+ break;
61
+ }
62
+ };
63
+
64
+ const cVisibleCallback = (info) => {
65
+ console.log("onVisibilityChange", info);
66
+ if (info.status == "show") {
67
+ rTriggerLoadKey.value++; // 刷新img标签, 触发onload后的重新捕获模糊纹理
68
+ }
19
69
  };
20
70
 
71
+ // 为了应对 window.JsvCoreApi.delayRemoveGLView/ window.JsvCoreApi.restoreGLView 对应的GL重建处理后,
72
+ // 需要重新捕获模糊纹理的场景
73
+ window.JsvCoreApi.onVisibilityChange(cVisibleCallback);
74
+
75
+ const POPUP_WIDTH = 400;
76
+ const POPUP_HEIGHT = 400;
77
+ const POPUP_MARGIN = 200;
78
+ const POPUP_TOP = (720 - POPUP_HEIGHT) / 2;
79
+
21
80
  const popupViewLayout = {
22
- left: (1280 - 400) / 2,
23
- top: 100,
24
- width: 400,
25
- height: 400,
81
+ width: POPUP_WIDTH,
82
+ height: POPUP_HEIGHT,
83
+ };
84
+
85
+ const popupViewLayout2 = {
86
+ width: POPUP_WIDTH,
87
+ height: POPUP_HEIGHT,
26
88
  };
89
+
90
+ const rPopupLeft = shallowRef(POPUP_MARGIN);
91
+ const rPopupTop = shallowRef(POPUP_TOP);
92
+ const rPopup2Left = shallowRef(1280 - POPUP_WIDTH - POPUP_MARGIN);
93
+ const rPopup2Top = shallowRef(POPUP_TOP);
94
+
95
+ onBeforeUnmount(() => {
96
+ // 取消注册一定不要漏
97
+ window.JsvCoreApi.removeEventCallback(cVisibleCallback);
98
+ });
99
+
27
100
  </script>
28
101
 
29
102
  <template>
@@ -33,19 +106,29 @@ const popupViewLayout = {
33
106
  onKeyDown: _onKeyDown,
34
107
  }"
35
108
  >
109
+
110
+ <!-- 设置屏幕内1x1的div, 用来让captureBlurTexture有div把持, 避免自动释放, 适合多区域模糊内容共享的场景 -->
111
+ <div :style="{
112
+ width: 1,
113
+ height: 1,
114
+ backgroundImage: `url(${rBlurTextureKeeps})`,
115
+ }"/>
116
+
36
117
  <div
37
- ref="vToCapture"
118
+ ref="rToCapture"
38
119
  :style="{
39
120
  width: 1280, // 截屏区域的宽
40
121
  height: 720, // 截屏区域的高
41
122
  }"
42
123
  >
43
- <div
124
+ <img
125
+ :key="rTriggerLoadKey"
126
+ src="https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoHomepage/App/BackgroundLongmao.jpg"
44
127
  :style="{
45
128
  width: 1280,
46
129
  height: 720,
47
- backgroundImage: `url(https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoHomepage/App/BackgroundLongmao.jpg)`,
48
130
  }"
131
+ :onLoad="handleLoadDone"
49
132
  />
50
133
  <div
51
134
  :style="{
@@ -63,14 +146,14 @@ const popupViewLayout = {
63
146
  </div>
64
147
 
65
148
  <div
66
- v-if="vTextureInfo"
149
+ v-if="rTextureInfo"
67
150
  :style="{
68
- left: popupViewLayout.left,
69
- top: popupViewLayout.top,
151
+ left: rPopupLeft,
152
+ top: rPopupTop,
70
153
  }"
71
154
  >
72
155
  <blur
73
- :textureInfo="vTextureInfo"
156
+ :textureInfo="rTextureInfo"
74
157
  :layout="{
75
158
  left: 0,
76
159
  top: 0,
@@ -78,8 +161,8 @@ const popupViewLayout = {
78
161
  height: popupViewLayout.height,
79
162
  }"
80
163
  :showRectPos="{
81
- left: popupViewLayout.left,
82
- top: popupViewLayout.top,
164
+ left: rPopupLeft,
165
+ top: rPopupTop,
83
166
  }"
84
167
  :borderRadius="30"
85
168
  />
@@ -95,9 +178,62 @@ const popupViewLayout = {
95
178
  fontSize: 40,
96
179
  }"
97
180
  >
98
- 弹窗内容
181
+ {{ '弹窗内容' }}
99
182
  </div>
100
183
  </div>
184
+
185
+ <div
186
+ v-if="rTextureInfo"
187
+ :style="{
188
+ left: rPopup2Left,
189
+ top: rPopup2Top,
190
+ }"
191
+ >
192
+ <blur
193
+ :textureInfo="rTextureInfo"
194
+ :layout="{
195
+ left: 0,
196
+ top: 0,
197
+ width: popupViewLayout2.width,
198
+ height: popupViewLayout2.height,
199
+ }"
200
+ :showRectPos="{
201
+ left: rPopup2Left,
202
+ top: rPopup2Top,
203
+ }"
204
+ :borderRadius="30"
205
+ />
206
+ <div
207
+ :style="{
208
+ width: popupViewLayout2.width,
209
+ height: popupViewLayout2.height,
210
+ backgroundColor: 'rgba(0, 0, 0, 0.3)',
211
+ borderRadius: 30,
212
+ lineHeight: popupViewLayout2.height,
213
+ textAlign: 'center',
214
+ color: '#ffffff',
215
+ fontSize: 40,
216
+ }"
217
+ >
218
+ 弹窗内容 2
219
+ </div>
220
+ </div>
221
+
222
+ <div
223
+ v-if="rTextureInfo"
224
+ :style="{
225
+ top: 620,
226
+ width: 1280,
227
+ height: 100,
228
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
229
+ color: '#ffffff',
230
+ fontSize: 40,
231
+ textAlign: 'center',
232
+ lineHeight: 100,
233
+ }"
234
+ >
235
+ 按上下左右可以调整弹窗位置
236
+ </div>
101
237
  </jsv-focus-block>
102
238
  </template>
103
239
 
@@ -52,7 +52,7 @@
52
52
 
53
53
  <script setup>
54
54
  import { ref } from "vue";
55
- import FlippingBook from "./BookFlip/FlippingBook.vue";
55
+ import { FlippingBook } from "@shijiu/jsview-vue-plus";
56
56
  import BookPage from "./BookPage.vue";
57
57
  import { JsvFocusBlock } from "jsview";
58
58
 
@@ -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, undefined).then([
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
  });
@@ -17,6 +17,7 @@
17
17
  :shaderStr="shaderSetting.shader"
18
18
  :autoplay="true"
19
19
  :textures="shaderSetting.textures"
20
+ :loadComfirmed="true"
20
21
  :onEnd="onAnimEnd"
21
22
  ></jsv-frag-shader-view>
22
23
 
@@ -46,6 +46,7 @@ props.onAction.register("onClick", onClick);
46
46
  backgroundImage: bgImage,
47
47
  lineHeight: data.height,
48
48
  textAlign: 'center',
49
+ borderRadius: '10',
49
50
  }"
50
51
  >
51
52
  明暗
@@ -47,6 +47,7 @@ props.onAction.register("onClick", onClick);
47
47
  backgroundImage: bgImage,
48
48
  lineHeight: data.height,
49
49
  textAlign: 'center',
50
+ borderRadius: '10',
50
51
  }"
51
52
  >
52
53
  旋转光
@@ -46,6 +46,7 @@ props.onAction.register("onClick", onClick);
46
46
  backgroundImage: bgImage,
47
47
  lineHeight: data.height,
48
48
  textAlign: 'center',
49
+ borderRadius: '10',
49
50
  }"
50
51
  >
51
52
  普通