@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.
Files changed (181) hide show
  1. package/BakeViewDemo/AnimatePic.vue +1 -1
  2. package/Basic/components/text/TextDirection.vue +7 -2
  3. package/BasicFocusControl/components/BaseBlock.vue +65 -18
  4. package/BreakRender/assets/imageList.json +235 -235
  5. package/ColorSpace/App.vue +4 -4
  6. package/CoupletsTest/App.vue +1 -1
  7. package/CoupletsTest/widget/Banger/Banger.vue +3 -3
  8. package/CoupletsTest/widget/Banger/MaroonLoader.vue +5 -5
  9. package/CoupletsTest/widget/Couplets/Couplets.vue +4 -4
  10. package/CoupletsTest/widget/Fireworks/Fireworks.vue +13 -13
  11. package/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +0 -1
  12. package/CssPreprocessor/utils/ContentBlock.vue +3 -3
  13. package/CssPreprocessor/utils/{FontStyle.css → FontConfig.css} +3 -3
  14. package/CssPreprocessor/utils/TitleBar.vue +2 -2
  15. package/CustomShader/App.vue +6 -6
  16. package/CustomShader/gaussianBlur.glsl +1 -1
  17. package/DashPath/App.vue +79 -0
  18. package/DashPath/AppForOperator.vue +35 -0
  19. package/DashPath/DashPath.vue +118 -0
  20. package/DemoForOperator/AnimPic/AnimPic.vue +47 -0
  21. package/DemoForOperator/AnimPic/App.vue +28 -0
  22. package/DemoForOperator/Banger/App.vue +26 -0
  23. package/DemoForOperator/Banger/Banger/Banger.vue +252 -0
  24. package/DemoForOperator/Banger/Banger/Maroon.vue +123 -0
  25. package/DemoForOperator/Banger/Banger/MaroonLoader.vue +78 -0
  26. package/DemoForOperator/Banger/Banger/SpriteDeal.js +30 -0
  27. package/DemoForOperator/Bounce/App.vue +43 -0
  28. package/DemoForOperator/Bounce/Bounce.vue +49 -0
  29. package/DemoForOperator/Bounce/FreeMoveBuilder.js +139 -0
  30. package/DemoForOperator/ChunLian/App.vue +47 -0
  31. package/DemoForOperator/ChunLian/Couplets.vue +248 -0
  32. package/DemoForOperator/EpisodeList/App.vue +80 -0
  33. package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +113 -0
  34. package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +176 -0
  35. package/DemoForOperator/EpisodeList/GroupItem.vue +65 -0
  36. package/DemoForOperator/EpisodeList/ListItem.vue +48 -0
  37. package/DemoForOperator/Firework1/App.vue +25 -0
  38. package/DemoForOperator/Firework1/Fireworks.vue +358 -0
  39. package/DemoForOperator/Firework1/SpriteDeal.js +30 -0
  40. package/DemoForOperator/FlipPage/App.vue +75 -0
  41. package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +150 -0
  42. package/DemoForOperator/FlipPage/FlipPage/flipIn.glsl +41 -0
  43. package/DemoForOperator/FlipPage/FlipPage/flipOut.glsl +41 -0
  44. package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +70 -0
  45. package/DemoForOperator/Focus/Alpha/AlphaPage.vue +40 -0
  46. package/DemoForOperator/Focus/Alpha/Item.vue +64 -0
  47. package/DemoForOperator/Focus/App.vue +124 -0
  48. package/DemoForOperator/Focus/CommonPageSetting.js +30 -0
  49. package/DemoForOperator/Focus/Item.vue +46 -0
  50. package/DemoForOperator/Focus/Light/Item.vue +67 -0
  51. package/DemoForOperator/Focus/Light/LightFocusBox.vue +46 -0
  52. package/DemoForOperator/Focus/Light/LightPage.vue +43 -0
  53. package/DemoForOperator/Focus/Light/utils/FrameCanvasStore.ts +68 -0
  54. package/DemoForOperator/Focus/Light/utils/RotateFrame.vue +146 -0
  55. package/DemoForOperator/Focus/Light/utils/circleHaloMask.png +0 -0
  56. package/DemoForOperator/Focus/Normal/Item.vue +64 -0
  57. package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +53 -0
  58. package/DemoForOperator/Focus/Normal/NormalPage.vue +41 -0
  59. package/DemoForOperator/Focus/SwipeLight/Item.vue +73 -0
  60. package/DemoForOperator/Focus/SwipeLight/SwipeLightBox.vue +62 -0
  61. package/DemoForOperator/Focus/SwipeLight/SwipeLightPage.vue +44 -0
  62. package/DemoForOperator/FullscreenIn/App.vue +105 -0
  63. package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +41 -0
  64. package/DemoForOperator/FullscreenIn/Item.vue +50 -0
  65. package/DemoForOperator/Genie/App.vue +78 -0
  66. package/DemoForOperator/Genie/geniePakcer/Genie.vue +699 -0
  67. package/DemoForOperator/Genie/geniePakcer/genieBottom.glsl +49 -0
  68. package/DemoForOperator/Genie/geniePakcer/genieLeft.glsl +50 -0
  69. package/DemoForOperator/Genie/geniePakcer/genieRight.glsl +57 -0
  70. package/DemoForOperator/Genie/geniePakcer/genieTop.glsl +50 -0
  71. package/DemoForOperator/GrayFilter/App.vue +51 -0
  72. package/DemoForOperator/GrayFilter/GrayFilter.vue +38 -0
  73. package/DemoForOperator/Jigsaw/App.vue +45 -0
  74. package/DemoForOperator/Jigsaw/JigsawFull.vue +100 -0
  75. package/DemoForOperator/Jigsaw/JigsawSingle.vue +86 -0
  76. package/DemoForOperator/Particle/App.vue +69 -0
  77. package/DemoForOperator/Particle/Drop/DropParticle.vue +176 -0
  78. package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +99 -0
  79. package/DemoForOperator/PosterAnim/App.vue +125 -0
  80. package/DemoForOperator/PosterAnim/Bounce/BouncePage.vue +54 -0
  81. package/DemoForOperator/PosterAnim/Bounce/Item.vue +85 -0
  82. package/DemoForOperator/PosterAnim/Breath/BreathPage.vue +47 -0
  83. package/DemoForOperator/PosterAnim/Breath/Item.vue +58 -0
  84. package/DemoForOperator/PosterAnim/CommonPageSetting.js +30 -0
  85. package/DemoForOperator/PosterAnim/Item.vue +46 -0
  86. package/DemoForOperator/PosterAnim/PosterAnim.js +58 -0
  87. package/DemoForOperator/PosterAnim/Scale/Item.vue +72 -0
  88. package/DemoForOperator/PosterAnim/Scale/ScalePage.vue +48 -0
  89. package/DemoForOperator/PosterAnim/Shake/Item.vue +85 -0
  90. package/DemoForOperator/PosterAnim/Shake/ShakePage.vue +53 -0
  91. package/DemoForOperator/PosterOverflow/App.vue +116 -0
  92. package/DemoForOperator/PosterOverflow/Item.vue +67 -0
  93. package/DemoForOperator/PosterOverflow/PosterOverflow.vue +23 -0
  94. package/DemoForOperator/Ripple/App.vue +54 -0
  95. package/DemoForOperator/Ripple/Ripple.vue +50 -0
  96. package/DemoForOperator/ScalePoster/App.vue +4 -0
  97. package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
  98. package/DemoForOperator/Sprite/App.vue +33 -0
  99. package/DemoForOperator/Sprite/Sprite.vue +90 -0
  100. package/DemoForOperator/Stretch/App.vue +103 -0
  101. package/DemoForOperator/Stretch/Stretch/Item.vue +192 -0
  102. package/DemoForOperator/Stretch/Stretch/Stretch.vue +168 -0
  103. package/DemoForOperator/TabContent/App.vue +89 -0
  104. package/DemoForOperator/TabContent/ContentPage.vue +66 -0
  105. package/DemoForOperator/TabContent/Item.vue +85 -0
  106. package/DemoForOperator/TabContent/PageItem.vue +40 -0
  107. package/DemoForOperator/TabContent/TabContent/CreepFocus.vue +160 -0
  108. package/DemoForOperator/TabContent/TabContent/Item.vue +63 -0
  109. package/DemoForOperator/TabContent/TabContent/TabContent.vue +146 -0
  110. package/DemoForOperator/TabContent/TabContent/TabItem.vue +368 -0
  111. package/DemoForOperator/TabContent/TabContent/TabWidget.vue +243 -0
  112. package/DemoForOperator/TabContent/TabContent/Util.js +3 -0
  113. package/DemoForOperator/TabContent/TabContent/ViewSwiper.vue +110 -0
  114. package/DemoForOperator/TabContent/testData.js +241 -0
  115. package/DemoForOperator/Vortex/App.vue +78 -0
  116. package/DemoForOperator/Vortex/Vortex/Vortex.vue +154 -0
  117. package/DemoForOperator/Vortex/Vortex/vortexIn.glsl +38 -0
  118. package/DemoForOperator/Vortex/Vortex/vortexOut.glsl +38 -0
  119. package/DemoForOperator/index.js +6 -0
  120. package/DemoForOperator/routeList.js +142 -0
  121. package/DemoHomepage/App.vue +50 -30
  122. package/DemoHomepage/components/Dialog.vue +1 -0
  123. package/DemoHomepage/components/TabFrame.vue +7 -0
  124. package/DemoHomepage/router.js +104 -81
  125. package/DemoHomepage/views/Homepage.vue +7 -6
  126. package/DivMetroPerformance/components/ContentItem.vue +0 -1
  127. package/DivMetroPerformance/data.js +3 -3
  128. package/DriftScopeTest/App.vue +1 -1
  129. package/FilterDemo/AnimatePic.vue +1 -1
  130. package/FilterDemo/VideoLayer.vue +2 -2
  131. package/FlexCellDemo/TestFrame1.vue +0 -4
  132. package/FullScreenFlex/TestFrame2.vue +1 -1
  133. package/GiftRain/App.vue +12 -15
  134. package/HashParams/App.vue +0 -1
  135. package/JsvPreDownloader/App.vue +4 -6
  136. package/Marquee/App.vue +2 -2
  137. package/MediaDemo/components/frames/AudioFrame.vue +1 -1
  138. package/MediaDemo/components/frames/VideoFrame.vue +1 -1
  139. package/MetroWidgetDemos/MassiveItems/ContentItem.vue +1 -2
  140. package/MetroWidgetDemos/MassiveItems/data.js +1 -1
  141. package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +0 -1
  142. package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +18 -17
  143. package/MetroWidgetDemos/PerformanceTest/data.js +3 -3
  144. package/MetroWidgetDemos/RefreshDemo/assets/imageList.json +235 -235
  145. package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.json +235 -235
  146. package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +3 -1
  147. package/MetroWidgetDemos/routeList.js +17 -17
  148. package/Poster3d/App.vue +69 -0
  149. package/Poster3d/Poster3d.vue +92 -0
  150. package/PosterPacker/App.vue +5 -5
  151. package/PosterPacker/tools/geniePakcer/Genie.vue +2 -2
  152. package/PosterPacker/tools/vortexPacker/Vortex.vue +15 -15
  153. package/QrcodeDemo/App.vue +1 -1
  154. package/Ripple/App.vue +1 -1
  155. package/ScaleDownNeon/App.vue +13 -10
  156. package/SceneTransition/App.vue +7 -6
  157. package/SceneTransition/maskConfig/config2.js +12 -12
  158. package/SceneTransition/maskConfig/config3.js +14 -14
  159. package/SprayView/App.vue +96 -51
  160. package/SpringFestival/App.vue +73 -0
  161. package/SpringFestival/SpringFestivalScene/ChunLian.vue +211 -0
  162. package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +139 -0
  163. package/SpringFestival/SpringFestivalScene/LanternAnim.js +60 -0
  164. package/SpringFestival/SpringFestivalScene/Rain.vue +137 -0
  165. package/SpringFestival/SpringFestivalScene/Scene.vue +218 -0
  166. package/SpringFestival/SpringFestivalScene/imageConfig.js +87 -0
  167. package/SpringFestival/SpringFestivalScene/index.js +1 -0
  168. package/Swiper/App.vue +28 -29
  169. package/Swiper/Item.vue +19 -0
  170. package/SwiperTest/App.vue +9 -9
  171. package/TestNativeSharedView/AckEventDefine.ts +82 -0
  172. package/TestNativeSharedView/App.vue +4 -6
  173. package/TestNativeSharedView/JsvDemoTester.js +131 -0
  174. package/TextureAnimation/App3.vue +100 -0
  175. package/TextureAnimation/utils/FrameCanvasStore.ts +68 -0
  176. package/TextureAnimation/utils/RotateFrame.vue +146 -0
  177. package/TextureAnimation/utils/circleHaloMask.png +0 -0
  178. package/TextureSize/App.vue +5 -6
  179. package/TombSweepingDayTest/Raining/RainScene.vue +4 -4
  180. package/ViewOpacity/App.vue +6 -7
  181. package/package.json +1 -1
@@ -0,0 +1,49 @@
1
+ #define VTIME 0.3
2
+
3
+ float yPoint(float y0, float y1, float x) {
4
+ float a = 2. * (y0 - y1);
5
+ float b = 3. * (y1 - y0);
6
+ float d = y0;
7
+ return a * x * x * x + b * x * x + d;
8
+ }
9
+
10
+ float remap2(float uv, float inputLow, float inputHigh, float outputLow, float outputHigh){
11
+ float t = (uv - inputLow)/(inputHigh - inputLow);
12
+ float final = mix(outputLow,outputHigh,t);
13
+ return final;
14
+ }
15
+
16
+ void mainImage( out vec4 fragColor, in vec2 fragCoord )
17
+ {
18
+ // Normalized pixel coordinates (from 0 to 1)
19
+ vec2 uv = fragCoord/iResolution.xy;
20
+ float t = ${myTime} ;
21
+ // float t = abs(sin(iTime));
22
+ //v animation
23
+ if (t < VTIME) {
24
+ float vAnimP = (t) / VTIME;
25
+ float top = mix(1.0, ${RANGE_1}, vAnimP);
26
+ float bottom = mix(0.0, ${RANGE_2}, vAnimP);
27
+ float xTop = yPoint(top, 1., uv.y); // Swap uv.x with uv.y
28
+ float xBottom = yPoint(bottom, 0., uv.y); // Swap uv.x with uv.y
29
+ float newUvX = remap2(uv.x, xBottom, xTop, 0.0, 1.0); // Swap uv.x with uv.y
30
+ if (newUvX > 1. || newUvX < 0.) {
31
+ fragColor = vec4(0.);
32
+ } else {
33
+ fragColor = jsvTexture2D(iChannel0, vec2(newUvX, uv.y));
34
+ }
35
+ } else {
36
+ //h animation
37
+ float xTop = yPoint(${RANGE_1}, 1., uv.y); // Swap uv.x with uv.y
38
+ float xBottom = yPoint(${RANGE_2}, 0., uv.y); // Swap uv.x with uv.y
39
+ float newUvX = remap2(uv.x, xBottom, xTop, 0.0, 1.0); // Swap uv.x with uv.y
40
+ float hAnimP = (t - VTIME) / (1. - VTIME);
41
+ float yStart = mix(0., 1., hAnimP); // Calculate the vertical shift
42
+ float newUvY = uv.y + yStart; // Adjust the y-coordinate
43
+ if (newUvX > 1. || newUvX < 0. || newUvY > 1. || newUvY < 0.) {
44
+ fragColor = vec4(0.);
45
+ } else {
46
+ fragColor = jsvTexture2D(iChannel0, vec2(newUvX, newUvY));
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,50 @@
1
+ #define VTIME 0.3
2
+
3
+ float yPoint(float y0, float y1, float x) {
4
+ float a = 2. * (y0 - y1);
5
+ float b = 3. * (y1 - y0);
6
+ //float c. = 0.;
7
+ float d = y0;
8
+ return a * x * x * x + b * x * x + d;
9
+ }
10
+
11
+ float remap2(float uv, float inputLow, float inputHigh, float outputLow, float outputHigh){
12
+ float t = (uv - inputLow)/(inputHigh - inputLow);
13
+ float final = mix(outputLow,outputHigh,t);
14
+ return final;
15
+ }
16
+
17
+ void mainImage( out vec4 fragColor, in vec2 fragCoord )
18
+ {
19
+ // Normalized pixel coordinates (from 0 to 1)
20
+ vec2 uv = fragCoord/iResolution.xy;
21
+ float t = ${myTime} ;
22
+ // float t = abs(sin(iTime));
23
+ //v animation
24
+ if (t < VTIME) {
25
+ float vAnimP = (t) / VTIME;
26
+ float top = mix(1.0, ${RANGE_1}, vAnimP);
27
+ float bottom = mix(0.0, ${RANGE_2}, vAnimP);
28
+ float yTop = yPoint(top, 1., uv.x);
29
+ float yBottom = yPoint(bottom, 0., uv.x);
30
+ float newUvY = remap2(uv.y, yBottom, yTop, 0.0, 1.0);
31
+ if (newUvY > 1. || newUvY < 0.) {
32
+ fragColor = vec4(0.);
33
+ } else {
34
+ fragColor = jsvTexture2D(iChannel0, vec2(uv.x, newUvY));
35
+ }
36
+ } else {
37
+ //h animation
38
+ float yTop = yPoint(${RANGE_1}, 1., uv.x);
39
+ float yBottom = yPoint(${RANGE_2}, 0., uv.x);
40
+ float newUvY = remap2(uv.y, yBottom, yTop, 0.0, 1.0);
41
+ float hAnimP = (t - VTIME) / (1. - VTIME);
42
+ float xStart = mix(0., 1., hAnimP);
43
+ float newUvX = uv.x + xStart;
44
+ if (newUvY > 1. || newUvY < 0. || newUvX > 1. || newUvY < 0.) {
45
+ fragColor = vec4(0.);
46
+ } else {
47
+ fragColor = jsvTexture2D(iChannel0, vec2(newUvX, newUvY));
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,57 @@
1
+ #define VTIME 0.3
2
+
3
+ float yPoint(float y0, float y1, float x) {
4
+ float a = 2. * (y1 - y0); // 交换 y0 和 y1
5
+ float b = 3. * (y0 - y1);
6
+ float d = y1; // 交换 y0 和 y1
7
+ return a * x * x * x + b * x * x + d;
8
+ }
9
+
10
+ float remap2(float uv, float inputLow, float inputHigh, float outputLow, float outputHigh){
11
+ float t = (uv - inputLow)/(inputHigh - inputLow);
12
+ float final = mix(outputLow,outputHigh,t);
13
+ return final;
14
+ }
15
+
16
+ void mainImage( out vec4 fragColor, in vec2 fragCoord )
17
+ {
18
+ // Normalized pixel coordinates (from 0 to 1)
19
+ vec2 uv = fragCoord/iResolution.xy;
20
+ float t = ${myTime} ;
21
+ // float t = abs(sin(iTime));
22
+ //v animation
23
+ if (t < VTIME) {
24
+ // 垂直动画
25
+ float vAnimP = (t) / VTIME;
26
+ float top = mix(1.0, ${RANGE_1}, vAnimP);
27
+ float bottom = mix(0.0, ${RANGE_2}, vAnimP);
28
+ float yTop = yPoint(top, 1., uv.x);
29
+ float yBottom = yPoint(bottom, 0., uv.x);
30
+ float newUvY = remap2(uv.y, yBottom, yTop, 0.0, 1.0);
31
+ if (newUvY > 1. || newUvY < 0.) {
32
+ fragColor = vec4(0.);
33
+ } else {
34
+ fragColor = jsvTexture2D(iChannel0, vec2(uv.x, newUvY));
35
+ }
36
+ } else {
37
+ // 水平动画
38
+ float yTop = yPoint(${RANGE_1}, 1., uv.x);
39
+ float yBottom = yPoint(${RANGE_2}, 0., uv.x);
40
+ float newUvY = remap2(uv.y, yBottom, yTop, 0.0, 1.0);
41
+
42
+ // 水平收缩动画的进度
43
+ float hAnimP = (t - VTIME) / (1. - VTIME);
44
+
45
+ // 从左到右收缩效果,xStart 从 0 渐变到 1
46
+ float xStart = mix(0., 1., hAnimP);
47
+
48
+ // 计算新的 UV X
49
+ float newUvX = uv.x - xStart;
50
+ // 确保 newUvX 和 newUvY 在合法范围内
51
+ if (newUvY > 1. || newUvY < 0. || newUvX > 1. || newUvX < 0.) {
52
+ fragColor = vec4(0.);
53
+ } else {
54
+ fragColor = jsvTexture2D(iChannel0, vec2(newUvX, newUvY));
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,50 @@
1
+ #define VTIME 0.3
2
+
3
+
4
+ float yPoint(float y0, float y1, float x) {
5
+ float a = 2. * (y1 - y0);
6
+ float b = 3. * (y0 - y1);
7
+ float d = y1;
8
+ return a * x * x * x + b * x * x + d;
9
+ }
10
+
11
+ float remap2(float uv, float inputLow, float inputHigh, float outputLow, float outputHigh){
12
+ float t = (uv - inputLow)/(inputHigh - inputLow);
13
+ float final = mix(outputLow, outputHigh, t);
14
+ return final;
15
+ }
16
+
17
+ void mainImage( out vec4 fragColor, in vec2 fragCoord )
18
+ {
19
+ // Normalized pixel coordinates (from 0 to 1)
20
+ vec2 uv = fragCoord/iResolution.xy;
21
+ float t = ${myTime} ;
22
+ // float t = abs(sin(iTime));
23
+ //v animation
24
+ if (t < VTIME) {
25
+ float vAnimP = (t) / VTIME;
26
+ float top = mix(1.0, ${RANGE_1}, vAnimP);
27
+ float bottom = mix(0.0, ${RANGE_2}, vAnimP);
28
+ float xTop = yPoint(top, 1., uv.y);
29
+ float xBottom = yPoint(bottom, 0., uv.y);
30
+ float newUvX = remap2(uv.x, xBottom, xTop, 0.0, 1.0);
31
+ if (newUvX > 1. || newUvX < 0.) {
32
+ fragColor = vec4(0.);
33
+ } else {
34
+ fragColor = jsvTexture2D(iChannel0, vec2(newUvX, uv.y));
35
+ }
36
+ } else {
37
+ //h animation
38
+ float xTop = yPoint(${RANGE_1}, 1., uv.y);
39
+ float xBottom = yPoint(${RANGE_2}, 0., uv.y);
40
+ float newUvX = remap2(uv.x, xBottom, xTop, 0.0, 1.0);
41
+ float hAnimP = (t - VTIME) / (1. - VTIME);
42
+ float yStart = mix(0., 1., hAnimP); // Calculate the vertical shift
43
+ float newUvY = uv.y - yStart; // Adjust the y-coordinate for downward animation
44
+ if (newUvX > 1. || newUvX < 0. || newUvY > 1. || newUvY < 0.) {
45
+ fragColor = vec4(0.);
46
+ } else {
47
+ fragColor = jsvTexture2D(iChannel0, vec2(newUvX, newUvY));
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <jsv-focus-block autoFocus :onAction="{ onKeyDown }"></jsv-focus-block>
3
+ <gray-filter
4
+ :open="openFilter"
5
+ :left="50"
6
+ :top="50"
7
+ :width="400"
8
+ :height="400"
9
+ >
10
+ <div
11
+ :style="{
12
+ width: 400,
13
+ height: 400,
14
+ backgroundColor: '#00ffff',
15
+ }"
16
+ >
17
+ <img
18
+ :src="`url(${imageUrl})`"
19
+ :style="{
20
+ width: 300,
21
+ height: 300,
22
+ }"
23
+ />
24
+ <div
25
+ :style="{
26
+ top: 320,
27
+ width: 300,
28
+ height: 100,
29
+ color: '#ff0000',
30
+ fontSize: 30,
31
+ }"
32
+ >
33
+ 按OK键切换
34
+ </div>
35
+ </div>
36
+ </gray-filter>
37
+ </template>
38
+ <script setup>
39
+ import GrayFilter from "./GrayFilter.vue";
40
+ import { ref } from "vue";
41
+
42
+ const imageUrl = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/GrayFilter/App/jpegDemo.jpeg";
43
+ const openFilter = ref(false);
44
+ const onKeyDown = (ev) => {
45
+ if (ev.keyCode == 13) {
46
+ openFilter.value = !openFilter.value;
47
+ return true;
48
+ }
49
+ return false;
50
+ };
51
+ </script>
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <jsv-filter-view :left="left" :top="top" :width="width" :height="height" :filterType="filterType">
3
+ <slot></slot>
4
+ </jsv-filter-view>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { JsvFilterView } from "jsview";
9
+ import { shallowRef, watchEffect } from "vue";
10
+
11
+ const props = defineProps({
12
+ open: {
13
+ type: Boolean,
14
+ },
15
+ width: {
16
+ type: Number,
17
+ },
18
+ height: {
19
+ type: Number,
20
+ },
21
+ left: {
22
+ type: Number,
23
+ },
24
+ top: {
25
+ type: Number,
26
+ }
27
+ });
28
+
29
+ const filterType = shallowRef(props.open ? "gray-down" : null);
30
+
31
+ watchEffect(() => {
32
+ if (props.open) {
33
+ filterType.value = "gray-down";
34
+ } else {
35
+ filterType.value = null;
36
+ }
37
+ });
38
+ </script>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div :style="{width: 1280, height: 720, backgroundColor: '#007788'}"></div>
3
+ <div
4
+ :style="{
5
+ left: 100,
6
+ top: 100,
7
+ }"
8
+ >
9
+ <JigsawFull
10
+ :imgInfo="{ src: imageSrc, width: 654, height: 654 }"
11
+ :strokeSrc="strokeSrc"
12
+ :size="{
13
+ width: 327,
14
+ height: 327,
15
+ }"
16
+ :configUrl="jsonSrc"
17
+ :displaySetting="[1, 0, 1, 1]"
18
+ />
19
+ </div>
20
+
21
+ <div
22
+ :style="{
23
+ left: 300,
24
+ top: 100,
25
+ }"
26
+ >
27
+ <JigsawSingle
28
+ :imgInfo="{ src: imageSrc, width: 654, height: 654 }"
29
+ :size="{
30
+ width: 327,
31
+ height: 327,
32
+ }"
33
+ :configUrl="jsonSrc"
34
+ :pieceIndex="1"
35
+ />
36
+ </div>
37
+ </template>
38
+ <script setup>
39
+ import JigsawFull from "./JigsawFull.vue";
40
+ import JigsawSingle from "./JigsawSingle.vue";
41
+
42
+ const jsonSrc = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Jigsaw/App/config.json";
43
+ const imageSrc = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Jigsaw/App/php.jpg";
44
+ const strokeSrc = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Jigsaw/App/stroke.png";
45
+ </script>
@@ -0,0 +1,100 @@
1
+ <template>
2
+ <JsvPreload
3
+ v-if="showPreload"
4
+ :preloadList="preloadList"
5
+ :onPreloadDone="preloadDone"
6
+ ></JsvPreload>
7
+
8
+ <div v-if="showComponent">
9
+ <div v-for="(item, index) in maskConfig">
10
+ <jsv-mask-clip-div
11
+ :key="index"
12
+ v-if="displaySetting[index] == 1"
13
+ :style="{
14
+ top: (item.top * size.width) / imgInfo.width,
15
+ left: (item.left * size.width) / imgInfo.width,
16
+ width: (item.width * size.width) / imgInfo.width,
17
+ height: (item.height * size.width) / imgInfo.width,
18
+ }"
19
+ :viewSrc="imgInfo.src"
20
+ :maskSrc="item.src"
21
+ :maskLeft="item.left / imgInfo.width"
22
+ :maskTop="item.top / imgInfo.height"
23
+ :maskWidth="item.width / imgInfo.width"
24
+ :maskHeight="item.height / imgInfo.height"
25
+ />
26
+ </div>
27
+ </div>
28
+ <img
29
+ :src="strokeSrc"
30
+ :style="{
31
+ width: size.width,
32
+ height: size.height,
33
+ }"
34
+ />
35
+ </template>
36
+
37
+ <script setup>
38
+ import { shallowRef } from "vue";
39
+ import { JsvMaskClipDiv, JsvPreload, buildPreloadInfo } from "jsview";
40
+
41
+ const props = defineProps({
42
+ //每一片的配置, 格式 { pieces: [{file: "", left: 0, top: 0, width: 0, height: 0}]}
43
+ //注意, mask的图片资源和json在同目录下
44
+ configUrl: {
45
+ type: String,
46
+ },
47
+ size: {
48
+ type: Object,
49
+ },
50
+ //每一片的显示设置, 0表示不显示, 1表示显示
51
+ displaySetting: {
52
+ type: Array,
53
+ },
54
+ //图片信息, 格式 { src: "", width: 0, height: 0 }
55
+ imgInfo: {
56
+ type: Object,
57
+ },
58
+ strokeSrc: {
59
+ type: String,
60
+ },
61
+ });
62
+ const showPreload = shallowRef(false);
63
+ const showComponent = shallowRef(false);
64
+
65
+ const preloadList = [];
66
+ const maskConfig = [];
67
+
68
+ function preloadDone() {
69
+ showComponent.value = true;
70
+ }
71
+
72
+ function prepareSrc() {
73
+ preloadList.push(buildPreloadInfo(props.imgInfo.src));
74
+ if (props.strokeSrc) {
75
+ preloadList.push(buildPreloadInfo(props.strokeSrc));
76
+ }
77
+ fetch(props.configUrl)
78
+ .then((res) => res.json())
79
+ .then((data) => {
80
+ const lastSlashIndex = props.configUrl.lastIndexOf("/");
81
+ const baseUrl = props.configUrl.substring(0, lastSlashIndex + 1);
82
+ for (let i = 0; i < data.pieces.length; i++) {
83
+ const url = baseUrl + data.pieces[i].file;
84
+ preloadList.push(buildPreloadInfo(url));
85
+ maskConfig.push({
86
+ src: url,
87
+ left: data.pieces[i].left,
88
+ top: data.pieces[i].top,
89
+ width: data.pieces[i].width,
90
+ height: data.pieces[i].height,
91
+ });
92
+ }
93
+ showPreload.value = true;
94
+ })
95
+ .catch((err) => {
96
+ console.log("fetch mask config failed", err);
97
+ });
98
+ }
99
+ prepareSrc();
100
+ </script>
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <JsvPreload
3
+ v-if="showPreload"
4
+ :preloadList="preloadList"
5
+ :onPreloadDone="preloadDone"
6
+ ></JsvPreload>
7
+
8
+ <div v-if="showComponent">
9
+ <jsv-mask-clip-div
10
+ :style="{
11
+ top: (maskConfig.top * size.width) / imgInfo.width,
12
+ left: (maskConfig.left * size.width) / imgInfo.width,
13
+ width: (maskConfig.width * size.width) / imgInfo.width,
14
+ height: (maskConfig.height * size.width) / imgInfo.width,
15
+ }"
16
+ :viewSrc="imgInfo.src"
17
+ :maskSrc="maskConfig.src"
18
+ :maskLeft="maskConfig.left / imgInfo.width"
19
+ :maskTop="maskConfig.top / imgInfo.height"
20
+ :maskWidth="maskConfig.width / imgInfo.width"
21
+ :maskHeight="maskConfig.height / imgInfo.height"
22
+ />
23
+ </div>
24
+ </template>
25
+
26
+ <script setup>
27
+ import { shallowRef } from "vue";
28
+ import { JsvMaskClipDiv, JsvPreload, buildPreloadInfo } from "jsview";
29
+
30
+ //只显示一片的demo
31
+ const props = defineProps({
32
+ configUrl: {
33
+ //每一片的配置, 格式 { pieces: [{file: "", left: 0, top: 0, width: 0, height: 0}]}
34
+ type: String,
35
+ },
36
+ pieceIndex: {
37
+ type: Number,
38
+ },
39
+ size: {
40
+ type: Object,
41
+ },
42
+ imgInfo: {
43
+ type: Object,
44
+ },
45
+ });
46
+ const showPreload = shallowRef(false);
47
+ const showComponent = shallowRef(false);
48
+
49
+ const preloadList = [];
50
+ let maskConfig = null;
51
+
52
+ function preloadDone() {
53
+ showComponent.value = true;
54
+ }
55
+
56
+ function prepareSrc() {
57
+ preloadList.push(buildPreloadInfo(props.imgInfo.src));
58
+ if (props.strokeSrc) {
59
+ preloadList.push(buildPreloadInfo(props.strokeSrc));
60
+ }
61
+ fetch(props.configUrl)
62
+ .then((res) => res.json())
63
+ .then((data) => {
64
+ const lastSlashIndex = props.configUrl.lastIndexOf("/");
65
+ const baseUrl = props.configUrl.substring(0, lastSlashIndex + 1);
66
+ if (data.pieces[props.pieceIndex]) {
67
+ const url = baseUrl + data.pieces[props.pieceIndex].file;
68
+ preloadList.push(buildPreloadInfo(url));
69
+ maskConfig = {
70
+ src: url,
71
+ left: data.pieces[props.pieceIndex].left,
72
+ top: data.pieces[props.pieceIndex].top,
73
+ width: data.pieces[props.pieceIndex].width,
74
+ height: data.pieces[props.pieceIndex].height,
75
+ };
76
+ showPreload.value = true;
77
+ } else {
78
+ console.error("pieceIndex out of range", data, props.pieceIndex);
79
+ }
80
+ })
81
+ .catch((err) => {
82
+ console.log("fetch mask config failed", err);
83
+ });
84
+ }
85
+ prepareSrc();
86
+ </script>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div
3
+ :style="{
4
+ width: 1280,
5
+ height: 720,
6
+ backgroundColor: '#000000aa',
7
+ }"
8
+ ></div>
9
+ <div
10
+ :style="{
11
+ top: 50,
12
+ width: 1280,
13
+ height: 100,
14
+ fontSize: 30,
15
+ color: '#ffffff',
16
+ textAlign: 'center',
17
+ }"
18
+ >
19
+ 按OK键爆炸效果
20
+ </div>
21
+ <jsv-focus-block
22
+ autoFocus
23
+ :onAction="{
24
+ onKeyDown,
25
+ }"
26
+ ></jsv-focus-block>
27
+ <DropParticle
28
+ :urlList="urlList"
29
+ :layout="{
30
+ width: 300,
31
+ height: 720,
32
+ }"
33
+ numLevel="high"
34
+ sprayLevel="middle"
35
+ />
36
+
37
+ <ExplodeParticle
38
+ ref="explodeRef"
39
+ :layout="{
40
+ left: 615,
41
+ top: 300,
42
+ width: 10,
43
+ height: 10,
44
+ }"
45
+ :urlList="urlList"
46
+ numLevel="high"
47
+ />
48
+ </template>
49
+
50
+ <script setup>
51
+ import DropParticle from "./Drop/DropParticle.vue";
52
+ import ExplodeParticle from "./Explode/ExplodeParticle.vue";
53
+ import { shallowRef } from "vue";
54
+
55
+ const star1 = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/redStar.png";
56
+ const star2 = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/yellowStar.png";
57
+ const star3 = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/purpleStar.png";
58
+ const urlList = [star1, star2, star3];
59
+
60
+ const explodeRef = shallowRef();
61
+
62
+ function onKeyDown(ev) {
63
+ if (ev.keyCode == 13) {
64
+ explodeRef.value?.start();
65
+ return true;
66
+ }
67
+ return false;
68
+ }
69
+ </script>