@shijiu/jsview-vue-samples 2.2.426-test.0 → 2.3.151-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.
Files changed (246) hide show
  1. package/BakeViewDemo/AnimatePic.vue +1 -1
  2. package/Basic/components/text/TextDirection.vue +7 -1
  3. package/BasicFocusControl/components/BaseBlock.vue +65 -18
  4. package/BreakRender/assets/imageList.json +235 -235
  5. package/ColorSpace/App.vue +2 -2
  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/CustomShader/App.vue +4 -4
  12. package/CustomShader/gaussianBlur.glsl +1 -1
  13. package/DashPath/App.vue +80 -0
  14. package/DashPath/AppForOperator.vue +33 -0
  15. package/DemoForOperator/AnimPic/AnimPic.vue +69 -0
  16. package/DemoForOperator/AnimPic/App.vue +28 -0
  17. package/DemoForOperator/Banger/App.vue +26 -0
  18. package/DemoForOperator/Banger/Banger/Banger.vue +316 -0
  19. package/DemoForOperator/Banger/Banger/Maroon.vue +123 -0
  20. package/DemoForOperator/Banger/Banger/MaroonLoader.vue +78 -0
  21. package/DemoForOperator/Banger/Banger/SpriteDeal.js +30 -0
  22. package/DemoForOperator/Blur/Blur.vue +146 -0
  23. package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +158 -0
  24. package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
  25. package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +113 -0
  26. package/DemoForOperator/BookFlip/App.vue +115 -0
  27. package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +179 -0
  28. package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +310 -0
  29. package/DemoForOperator/BookFlip/BookFlip/flip.glsl +135 -0
  30. package/DemoForOperator/BookFlip/BookPage.vue +82 -0
  31. package/DemoForOperator/Bounce/App.vue +43 -0
  32. package/DemoForOperator/Bounce/Bounce.vue +81 -0
  33. package/DemoForOperator/Bounce/FreeMoveBuilder.js +139 -0
  34. package/DemoForOperator/ChunLian/App.vue +47 -0
  35. package/DemoForOperator/ChunLian/Couplets.vue +291 -0
  36. package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
  37. package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
  38. package/DemoForOperator/DominantColor/App.vue +187 -0
  39. package/DemoForOperator/EpisodeList/App.vue +80 -0
  40. package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +110 -0
  41. package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +250 -0
  42. package/DemoForOperator/EpisodeList/GroupItem.vue +65 -0
  43. package/DemoForOperator/EpisodeList/ListItem.vue +48 -0
  44. package/DemoForOperator/Firework1/App.vue +25 -0
  45. package/DemoForOperator/Firework1/Fireworks.vue +397 -0
  46. package/DemoForOperator/Firework1/SpriteDeal.js +30 -0
  47. package/DemoForOperator/FlipPage/App.vue +75 -0
  48. package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +178 -0
  49. package/DemoForOperator/FlipPage/FlipPage/flipIn.glsl +41 -0
  50. package/DemoForOperator/FlipPage/FlipPage/flipOut.glsl +41 -0
  51. package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +95 -0
  52. package/DemoForOperator/Focus/Alpha/AlphaPage.vue +40 -0
  53. package/DemoForOperator/Focus/Alpha/Item.vue +64 -0
  54. package/DemoForOperator/Focus/App.vue +124 -0
  55. package/DemoForOperator/Focus/CommonPageSetting.js +30 -0
  56. package/DemoForOperator/Focus/Item.vue +46 -0
  57. package/DemoForOperator/Focus/Light/Item.vue +67 -0
  58. package/DemoForOperator/Focus/Light/LightFocusBox.vue +87 -0
  59. package/DemoForOperator/Focus/Light/LightPage.vue +43 -0
  60. package/DemoForOperator/Focus/Light/utils/FrameCanvasStore.ts +68 -0
  61. package/DemoForOperator/Focus/Light/utils/RotateFrame.vue +146 -0
  62. package/DemoForOperator/Focus/Light/utils/circleHaloMask.png +0 -0
  63. package/DemoForOperator/Focus/Normal/Item.vue +64 -0
  64. package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +65 -0
  65. package/DemoForOperator/Focus/Normal/NormalPage.vue +41 -0
  66. package/DemoForOperator/Focus/SwipeLight/Item.vue +73 -0
  67. package/DemoForOperator/Focus/SwipeLight/SwipeLightBox.vue +62 -0
  68. package/DemoForOperator/Focus/SwipeLight/SwipeLightPage.vue +44 -0
  69. package/DemoForOperator/FrameShadow/App.vue +193 -0
  70. package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
  71. package/DemoForOperator/FullscreenIn/App.vue +105 -0
  72. package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +56 -0
  73. package/DemoForOperator/FullscreenIn/Item.vue +50 -0
  74. package/DemoForOperator/Genie/App.vue +78 -0
  75. package/DemoForOperator/Genie/geniePakcer/Genie.vue +741 -0
  76. package/DemoForOperator/Genie/geniePakcer/genieBottom.glsl +49 -0
  77. package/DemoForOperator/Genie/geniePakcer/genieLeft.glsl +50 -0
  78. package/DemoForOperator/Genie/geniePakcer/genieRight.glsl +57 -0
  79. package/DemoForOperator/Genie/geniePakcer/genieTop.glsl +50 -0
  80. package/DemoForOperator/GrayFilter/App.vue +51 -0
  81. package/DemoForOperator/GrayFilter/GrayFilter.vue +59 -0
  82. package/DemoForOperator/Jigsaw/App.vue +45 -0
  83. package/DemoForOperator/Jigsaw/JigsawFull.vue +142 -0
  84. package/DemoForOperator/Jigsaw/JigsawSingle.vue +118 -0
  85. package/DemoForOperator/LongChatBox/App.vue +36 -0
  86. package/DemoForOperator/LongChatBox/Bubble.vue +104 -0
  87. package/DemoForOperator/LongChatBox/LongChat.vue +173 -0
  88. package/DemoForOperator/LongChatBox/TextManager.ts +147 -0
  89. package/DemoForOperator/LongChatBox/VirtualList.vue +298 -0
  90. package/DemoForOperator/LongChatBox/testData.js +51 -0
  91. package/DemoForOperator/LongChatBox/utile.js +331 -0
  92. package/DemoForOperator/Particle/App.vue +69 -0
  93. package/DemoForOperator/Particle/Drop/DropParticle.vue +208 -0
  94. package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +120 -0
  95. package/DemoForOperator/PosterAnim/App.vue +125 -0
  96. package/DemoForOperator/PosterAnim/Bounce/BouncePage.vue +54 -0
  97. package/DemoForOperator/PosterAnim/Bounce/Item.vue +85 -0
  98. package/DemoForOperator/PosterAnim/Breath/BreathPage.vue +47 -0
  99. package/DemoForOperator/PosterAnim/Breath/Item.vue +58 -0
  100. package/DemoForOperator/PosterAnim/CommonPageSetting.js +30 -0
  101. package/DemoForOperator/PosterAnim/Item.vue +46 -0
  102. package/DemoForOperator/PosterAnim/PosterAnim.js +79 -0
  103. package/DemoForOperator/PosterAnim/Scale/Item.vue +72 -0
  104. package/DemoForOperator/PosterAnim/Scale/ScalePage.vue +48 -0
  105. package/DemoForOperator/PosterAnim/Shake/Item.vue +85 -0
  106. package/DemoForOperator/PosterAnim/Shake/ShakePage.vue +53 -0
  107. package/DemoForOperator/PosterOverflow/App.vue +116 -0
  108. package/DemoForOperator/PosterOverflow/Item.vue +67 -0
  109. package/DemoForOperator/PosterOverflow/PosterOverflow.vue +39 -0
  110. package/DemoForOperator/Resize/App.vue +157 -0
  111. package/DemoForOperator/Resize/Resize/Item.vue +234 -0
  112. package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
  113. package/DemoForOperator/Ripple/App.vue +54 -0
  114. package/DemoForOperator/Ripple/Ripple.vue +65 -0
  115. package/DemoForOperator/ScreenShootScale/App.vue +96 -0
  116. package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
  117. package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
  118. package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
  119. package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
  120. package/DemoForOperator/SmoothSwiper/App.vue +50 -0
  121. package/DemoForOperator/Sound/Bounce/App.vue +56 -0
  122. package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
  123. package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
  124. package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
  125. package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
  126. package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
  127. package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
  128. package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
  129. package/DemoForOperator/Sound/Rain/App.vue +11 -0
  130. package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
  131. package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
  132. package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
  133. package/DemoForOperator/Sound/Sound/index.js +4 -0
  134. package/DemoForOperator/Sound/Sound/useSound.js +112 -0
  135. package/DemoForOperator/Sprite/App.vue +33 -0
  136. package/DemoForOperator/Sprite/Sprite.vue +147 -0
  137. package/DemoForOperator/Stretch/App.vue +103 -0
  138. package/DemoForOperator/Stretch/Stretch/Item.vue +192 -0
  139. package/DemoForOperator/Stretch/Stretch/Stretch.vue +218 -0
  140. package/DemoForOperator/Swiper/App.vue +101 -0
  141. package/DemoForOperator/Swiper/Item.vue +56 -0
  142. package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
  143. package/DemoForOperator/TabContent/App.vue +89 -0
  144. package/DemoForOperator/TabContent/ContentPage.vue +66 -0
  145. package/DemoForOperator/TabContent/Item.vue +85 -0
  146. package/DemoForOperator/TabContent/PageItem.vue +40 -0
  147. package/DemoForOperator/TabContent/TabContent/CreepFocus.vue +160 -0
  148. package/DemoForOperator/TabContent/TabContent/Item.vue +63 -0
  149. package/DemoForOperator/TabContent/TabContent/TabContent.vue +184 -0
  150. package/DemoForOperator/TabContent/TabContent/TabItem.vue +368 -0
  151. package/DemoForOperator/TabContent/TabContent/TabWidget.vue +243 -0
  152. package/DemoForOperator/TabContent/TabContent/Util.js +3 -0
  153. package/DemoForOperator/TabContent/TabContent/ViewSwiper.vue +110 -0
  154. package/DemoForOperator/TabContent/testData.js +241 -0
  155. package/DemoForOperator/TabContentVertical/App.vue +104 -0
  156. package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
  157. package/DemoForOperator/TabContentVertical/Item.vue +94 -0
  158. package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
  159. package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
  160. package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
  161. package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
  162. package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
  163. package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
  164. package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
  165. package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
  166. package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
  167. package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
  168. package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
  169. package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
  170. package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
  171. package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
  172. package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
  173. package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
  174. package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
  175. package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
  176. package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
  177. package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
  178. package/DemoForOperator/TabContentVertical/testData.js +76 -0
  179. package/DemoForOperator/Vortex/App.vue +78 -0
  180. package/DemoForOperator/Vortex/Vortex/Vortex.vue +180 -0
  181. package/DemoForOperator/Vortex/Vortex/vortexIn.glsl +38 -0
  182. package/DemoForOperator/Vortex/Vortex/vortexOut.glsl +38 -0
  183. package/DemoForOperator/index.js +6 -0
  184. package/DemoForOperator/routeList.js +259 -0
  185. package/DemoHomepage/App.vue +50 -30
  186. package/DemoHomepage/components/Dialog.vue +1 -0
  187. package/DemoHomepage/components/Item.vue +11 -0
  188. package/DemoHomepage/components/TabFrame.vue +7 -0
  189. package/DemoHomepage/router.js +178 -81
  190. package/DemoHomepage/views/Homepage.vue +7 -2
  191. package/DivMetroPerformance/data.js +3 -3
  192. package/DriftScopeTest/App.vue +1 -1
  193. package/FilterDemo/AnimatePic.vue +1 -1
  194. package/FilterDemo/VideoLayer.vue +2 -2
  195. package/FullScreenFlex/TestFrame2.vue +1 -1
  196. package/GiftRain/App.vue +12 -12
  197. package/GiftRain/components/SpriteTranslate.vue +68 -48
  198. package/HashHistory/App.vue +2 -2
  199. package/HashHistory/router.js +1 -1
  200. package/JsvPreDownloader/App.vue +4 -4
  201. package/MediaDemo/components/frames/AudioFrame.vue +1 -1
  202. package/MediaDemo/components/frames/VideoFrame.vue +1 -1
  203. package/MetroWidgetDemos/MassiveItems/ContentItem.vue +1 -1
  204. package/MetroWidgetDemos/MassiveItems/data.js +1 -1
  205. package/MetroWidgetDemos/PerformanceTest/data.js +3 -3
  206. package/MetroWidgetDemos/RefreshDemo/assets/imageList.json +235 -235
  207. package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.json +235 -235
  208. package/MetroWidgetDemos/TripleWidget/App.vue +7 -1
  209. package/MetroWidgetDemos/TripleWidget/Item.vue +16 -2
  210. package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +7 -1
  211. package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +8 -2
  212. package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +3 -1
  213. package/MetroWidgetDemos/routeList.js +34 -17
  214. package/Poster3d/App.vue +69 -0
  215. package/Poster3d/Poster3d.vue +92 -0
  216. package/PosterPacker/App.vue +5 -5
  217. package/PosterPacker/tools/vortexPacker/Vortex.vue +1 -1
  218. package/QrcodeDemo/App.vue +1 -1
  219. package/Ripple/App.vue +1 -1
  220. package/ScaleDownNeon/App.vue +4 -4
  221. package/SceneTransition/App.vue +2 -2
  222. package/SceneTransition/maskConfig/config2.js +12 -12
  223. package/SceneTransition/maskConfig/config3.js +14 -14
  224. package/SprayView/App.vue +96 -51
  225. package/SpringFestival/App.vue +73 -0
  226. package/SpringFestival/SpringFestivalScene/ChunLian.vue +211 -0
  227. package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +139 -0
  228. package/SpringFestival/SpringFestivalScene/LanternAnim.js +60 -0
  229. package/SpringFestival/SpringFestivalScene/Rain.vue +137 -0
  230. package/SpringFestival/SpringFestivalScene/Scene.vue +218 -0
  231. package/SpringFestival/SpringFestivalScene/imageConfig.js +87 -0
  232. package/SpringFestival/SpringFestivalScene/index.js +1 -0
  233. package/Swiper/App.vue +28 -29
  234. package/Swiper/Item.vue +19 -0
  235. package/SwiperTest/App.vue +9 -9
  236. package/TestNativeSharedView/AckEventDefine.ts +82 -0
  237. package/TestNativeSharedView/App.vue +4 -6
  238. package/TestNativeSharedView/JsvDemoTester.js +131 -0
  239. package/TextureAnimation/App.vue +16 -6
  240. package/TextureAnimation/App3.vue +100 -0
  241. package/TextureAnimation/utils/FrameCanvasStore.ts +68 -0
  242. package/TextureAnimation/utils/RotateFrame.vue +146 -0
  243. package/TextureAnimation/utils/circleHaloMask.png +0 -0
  244. package/TombSweepingDayTest/Raining/RainScene.vue +4 -4
  245. package/ViewOpacity/App.vue +21 -2
  246. package/package.json +1 -1
@@ -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>
@@ -0,0 +1,193 @@
1
+ <template>
2
+ <div>
3
+ <div :style="{ width: 1280, height: 720, backgroundColor: '#FFF0F0' }" />
4
+ <div :style="{ left: 100, top: 100 }">
5
+ <FrameShadow
6
+ :width="vTargetRectWidth"
7
+ :height="vTargetRectHeight"
8
+ :borderRadius="vTargetRectRaidus"
9
+ />
10
+ <JsvFlexDiv
11
+ :style="{
12
+ width: vTargetRectWidth,
13
+ height: vTargetRectHeight,
14
+ alignItems: 'center',
15
+ backgroundColor: 'rgba(128, 128, 0, 0.5)',
16
+ borderRadius: vTargetRectRaidus,
17
+ }"
18
+ >
19
+ <div
20
+ :style="{
21
+ width: vTargetRectWidth,
22
+ textAlign: 'center',
23
+ fontSize: 10,
24
+ lineHeight: 12,
25
+ }"
26
+ >
27
+ {{ `圆角为${vTargetRectRaidus}的矩形` }}
28
+ </div>
29
+ </JsvFlexDiv>
30
+ </div>
31
+ <div :style="{ left: 450, top: 100 }">
32
+ <FrameShadow
33
+ :width="vTargetRectWidth1"
34
+ :height="vTargetRectHeight1"
35
+ :borderRadius="vTargetRectRaidus1"
36
+ />
37
+ <JsvFlexDiv
38
+ :style="{
39
+ width: vTargetRectWidth1,
40
+ height: vTargetRectHeight1,
41
+ alignItems: 'center',
42
+ backgroundColor: 'rgba(128, 128, 0, 0.5)',
43
+ borderRadius: vTargetRectRaidus1,
44
+ }"
45
+ >
46
+ <div
47
+ :style="{
48
+ width: vTargetRectWidth1,
49
+ textAlign: 'center',
50
+ fontSize: 10,
51
+ lineHeight: 12,
52
+ }"
53
+ >
54
+ {{ `圆角为${vTargetRectRaidus1}的矩形` }}
55
+ </div>
56
+ </JsvFlexDiv>
57
+ </div>
58
+ <div :style="{ left: 800, top: 100 }">
59
+ <FrameShadow
60
+ :width="vTargetRectWidth2"
61
+ :height="vTargetRectHeight2"
62
+ :borderRadius="vTargetRectRaidus2"
63
+ />
64
+ <JsvFlexDiv
65
+ :style="{
66
+ width: vTargetRectWidth2,
67
+ height: vTargetRectHeight2,
68
+ alignItems: 'center',
69
+ backgroundColor: 'rgba(128, 128, 0, 0.5)',
70
+ borderRadius: vTargetRectRaidus2,
71
+ }"
72
+ >
73
+ <div
74
+ :style="{
75
+ width: vTargetRectWidth2,
76
+ textAlign: 'center',
77
+ fontSize: 10,
78
+ lineHeight: 12,
79
+ }"
80
+ >
81
+ {{ `圆角为${vTargetRectRaidus2}的矩形` }}
82
+ </div>
83
+ </JsvFlexDiv>
84
+ </div>
85
+
86
+ <div :style="{ left: 100, top: 400 }">
87
+ <FrameShadow
88
+ :width="vTargetRectWidth"
89
+ :height="vTargetRectHeight"
90
+ :borderRadius="vTargetRectRaidus"
91
+ type="down"
92
+ />
93
+ <JsvFlexDiv
94
+ :style="{
95
+ width: vTargetRectWidth,
96
+ height: vTargetRectHeight,
97
+ alignItems: 'center',
98
+ backgroundColor: 'rgba(128, 128, 0, 0.5)',
99
+ borderRadius: vTargetRectRaidus,
100
+ }"
101
+ >
102
+ <div
103
+ :style="{
104
+ width: vTargetRectWidth,
105
+ textAlign: 'center',
106
+ fontSize: 10,
107
+ lineHeight: 12,
108
+ }"
109
+ >
110
+ {{ `圆角为${vTargetRectRaidus}的矩形` }}
111
+ </div>
112
+ </JsvFlexDiv>
113
+ </div>
114
+
115
+ <div :style="{ left: 450, top: 400 }">
116
+ <FrameShadow
117
+ :width="vTargetRectWidth1"
118
+ :height="vTargetRectHeight1"
119
+ :borderRadius="vTargetRectRaidus1"
120
+ type="down"
121
+ />
122
+ <JsvFlexDiv
123
+ :style="{
124
+ width: vTargetRectWidth1,
125
+ height: vTargetRectHeight1,
126
+ alignItems: 'center',
127
+ backgroundColor: 'rgba(128, 128, 0, 0.5)',
128
+ borderRadius: vTargetRectRaidus1,
129
+ }"
130
+ >
131
+ <div
132
+ :style="{
133
+ width: vTargetRectWidth1,
134
+ textAlign: 'center',
135
+ fontSize: 10,
136
+ lineHeight: 12,
137
+ }"
138
+ >
139
+ {{ `圆角为${vTargetRectRaidus1}的矩形` }}
140
+ </div>
141
+ </JsvFlexDiv>
142
+ </div>
143
+
144
+ <div :style="{ left: 800, top: 400 }">
145
+ <FrameShadow
146
+ :width="vTargetRectWidth2"
147
+ :height="vTargetRectHeight2"
148
+ :borderRadius="vTargetRectRaidus2"
149
+ type="down"
150
+ />
151
+ <JsvFlexDiv
152
+ :style="{
153
+ width: vTargetRectWidth2,
154
+ height: vTargetRectHeight2,
155
+ alignItems: 'center',
156
+ backgroundColor: 'rgba(128, 128, 0, 0.5)',
157
+ borderRadius: vTargetRectRaidus2,
158
+ }"
159
+ >
160
+ <div
161
+ :style="{
162
+ width: vTargetRectWidth2,
163
+ textAlign: 'center',
164
+ fontSize: 10,
165
+ lineHeight: 12,
166
+ }"
167
+ >
168
+ {{ `圆角为${vTargetRectRaidus2}的矩形` }}
169
+ </div>
170
+ </JsvFlexDiv>
171
+ </div>
172
+ </div>
173
+ </template>
174
+
175
+ <script setup>
176
+ import { JsvFlexDiv } from "jsview";
177
+ import FrameShadow from "./FrameShadow.vue";
178
+
179
+ // 圆角为45的矩形样例
180
+ const vTargetRectWidth = 250; // 需要对齐区域的矩形宽
181
+ const vTargetRectHeight = 150; // 需要对齐区域的矩形高
182
+ const vTargetRectRaidus = 45; // 需要对齐区域的圆角半径,请和圆环内径对应的半径一致才能套齐
183
+
184
+ // 圆角为13的矩形样例
185
+ const vTargetRectWidth1 = 250; // 需要对齐区域的矩形宽
186
+ const vTargetRectHeight1 = 150; // 需要对齐区域的矩形高
187
+ const vTargetRectRaidus1 = 13; // 需要对齐区域的圆角半径,请和圆环内径对应的半径一致才能套齐
188
+
189
+ // 最小圆角尺寸样例,在此框架下不能低于4
190
+ const vTargetRectWidth2 = 250; // 需要对齐区域的矩形宽
191
+ const vTargetRectHeight2 = 150; // 需要对齐区域的矩形高
192
+ const vTargetRectRaidus2 = 4; // 需要对齐区域的圆角半径,请和圆环内径对应的半径一致才能套齐
193
+ </script>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <div>
3
+ <JsvNinePatch
4
+ :style="{
5
+ width: props.width,
6
+ height: props.height,
7
+ }"
8
+ :imageUrl="vImageUrl"
9
+ :imageWidth="vImageWidth"
10
+ :centerWidth="cCenterWidth"
11
+ :imageDspWidth="vImageDspWidth"
12
+ :borderOutset="vBorderOutset"
13
+ />
14
+ </div>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { JsvNinePatch } from "jsview";
19
+
20
+ // 接收宽高作为props
21
+ const props = defineProps({
22
+ width: {
23
+ type: Number,
24
+ required: true,
25
+ },
26
+ height: {
27
+ type: Number,
28
+ required: true,
29
+ },
30
+ borderRadius: {
31
+ type: Number,
32
+ required: true,
33
+ },
34
+ type: {
35
+ type: String,
36
+ default: "surround",
37
+ },
38
+ });
39
+
40
+ // 图片资源映射
41
+ const cImageMaps = {
42
+ surround:
43
+ "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources-2/DemoForOperator/FrameShadow/FrameShadow.png",
44
+ down: "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources-2/DemoForOperator/FrameShadow/FrameShadow-down.png",
45
+ };
46
+ const vImageUrl = cImageMaps[props.type];
47
+ if (vImageUrl === undefined) {
48
+ vImageUrl = cImageMaps["surround"];
49
+ }
50
+
51
+ // 图片固定属性
52
+ const cInnerRadius2 = 92; // 原始图片的内直径(也是右边图矩形的边长值)
53
+ const cCenterWidth = 2; // 图片的中心repeat宽度
54
+ const cInnerRadius = (cInnerRadius2 - cCenterWidth) / 2; // 原始图片圆角半径
55
+ const cSampleImageWidth = 200; // 原始图形的画布尺寸,画布为正方形
56
+
57
+ // 计算后的对应NinePatch参数
58
+ let vBorderOutset = (cSampleImageWidth - cInnerRadius2) / 2; // 设置值为图片长度减去内直径除以2
59
+ let vImageWidth = cSampleImageWidth; // 原图尺寸设置
60
+ let vImageDspWidth = (props.borderRadius / cInnerRadius) * cSampleImageWidth; // 显示图尺寸,当想复用目标图片,但是半径又不想等时才和原图不一样
61
+ </script>
@@ -0,0 +1,105 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-03-08 14:52:08
4
+ * @Description: file content
5
+ -->
6
+ <script setup>
7
+ import { MetroWidget, HORIZONTAL, useFocusHub } from "jsview";
8
+ import Item from "./Item.vue";
9
+ import { onMounted, ref } from "vue";
10
+ import FullscreenPoster from "./FullscreenPoster.vue";
11
+ import { provide } from "vue";
12
+
13
+ const focusHub = useFocusHub();
14
+
15
+ const imageUrl =
16
+ "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/FullscreenPoster/App/element_228475_icon2_20230608194600.png";
17
+
18
+ const fullScreenVisibility = ref(false);
19
+ provide("fullScreenVisibility", fullScreenVisibility)
20
+
21
+ const data = [
22
+ {
23
+ width: 100,
24
+ height: 190,
25
+ marginRight: 10,
26
+ marginBottom: 10,
27
+ color: "#AABB33",
28
+ content: 0,
29
+ showFull: false,
30
+ },
31
+ {
32
+ width: 200,
33
+ height: 190,
34
+ marginRight: 10,
35
+ marginBottom: 10,
36
+ color: "#0077AA",
37
+ content: "显示霸屏",
38
+ showFull: true,
39
+ },
40
+ {
41
+ width: 100,
42
+ height: 190,
43
+ marginRight: 10,
44
+ marginBottom: 10,
45
+ color: "#BB00AA",
46
+ showFull: false,
47
+ content: 2,
48
+ },
49
+ ];
50
+ const provideData = () => {
51
+ return data;
52
+ };
53
+
54
+ const measures = (data) => {
55
+ return {
56
+ width: data.width,
57
+ height: data.height,
58
+ marginRight: data.marginRight,
59
+ marginBottom: data.marginBottom,
60
+ };
61
+ };
62
+
63
+ const widgetLayout = {
64
+ left: 400,
65
+ top: 50,
66
+ width: 500,
67
+ height: 300,
68
+ };
69
+
70
+ onMounted(() => {
71
+ //组件mount后设置焦点
72
+ focusHub.setFocus("mainMw");
73
+ });
74
+ </script>
75
+
76
+ <template>
77
+ <div
78
+ :style="{
79
+ width: 1280,
80
+ height: 720,
81
+ backgroundColor: '#007788',
82
+ }"
83
+ />
84
+ <metro-widget
85
+ name="mainMw"
86
+ :left="widgetLayout.left"
87
+ :top="widgetLayout.top"
88
+ :width="widgetLayout.width"
89
+ :height="widgetLayout.height"
90
+ :provideData="provideData"
91
+ :direction="HORIZONTAL"
92
+ :measures="measures"
93
+ >
94
+ <template #renderItem="{ data, onAction }">
95
+ <item :data="data" :onAction="onAction" />
96
+ </template>
97
+ </metro-widget>
98
+
99
+ <fullscreen-poster
100
+ v-if="fullScreenVisibility"
101
+ :src="imageUrl"
102
+ :width="1280"
103
+ :duration="0.8"
104
+ ></fullscreen-poster>
105
+ </template>
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <img
3
+ :src="src"
4
+ :style="{
5
+ width: width,
6
+ animation: animStr,
7
+ }"
8
+ />
9
+ </template>
10
+
11
+ <script setup>
12
+ const props = defineProps({
13
+ /**
14
+ * 图片资源地址
15
+ * @type {String}
16
+ * @required
17
+ */
18
+ src: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ /**
23
+ * 动画持续时间(单位:秒)
24
+ * @type {Number}
25
+ * @default 0.8
26
+ */
27
+ duration: {
28
+ type: Number,
29
+ default: 0.8,
30
+ },
31
+ /**
32
+ * 图片显示宽度(单位:像素)
33
+ * @type {Number}
34
+ * @required
35
+ */
36
+ width: {
37
+ type: Number,
38
+ required: true,
39
+ },
40
+ });
41
+
42
+ const animStr = `fade-in ${props.duration}s`;
43
+ </script>
44
+
45
+ <style scoped>
46
+ @keyframes fade-in {
47
+ from {
48
+ opacity: 0;
49
+ top: -150;
50
+ }
51
+ to {
52
+ opacity: 1;
53
+ top: 0
54
+ }
55
+ }
56
+ </style>
@@ -0,0 +1,50 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-03-08 14:52:17
4
+ * @Description: file content
5
+ -->
6
+ <script setup>
7
+ import { inject, ref } from "vue";
8
+
9
+ const props = defineProps({
10
+ data: Object,
11
+ onAction: Object,
12
+ });
13
+
14
+ const focused = ref(false);
15
+ const fullScreenVisibility = inject("fullScreenVisibility");
16
+
17
+ // 注册回调
18
+ const onFocus = () => {
19
+ focused.value = true;
20
+ if (props.data.showFull) {
21
+ fullScreenVisibility.value = true;
22
+ }
23
+ };
24
+ const onBlur = () => {
25
+ focused.value = false;
26
+ if (props.data.showFull) {
27
+ fullScreenVisibility.value = false;
28
+ }
29
+ };
30
+ const onClick = () => {
31
+ console.log("item onclick ", props.data);
32
+ };
33
+ props.onAction.register("onFocus", onFocus);
34
+ props.onAction.register("onBlur", onBlur);
35
+ props.onAction.register("onClick", onClick);
36
+ </script>
37
+
38
+ <template>
39
+ <div
40
+ :style="{
41
+ width: data.width,
42
+ height: data.height,
43
+ fontSize: 30,
44
+ color: focused ? '#FF0000' : '#FFFFFF',
45
+ backgroundColor: data.color,
46
+ }"
47
+ >
48
+ {{ data.content }}
49
+ </div>
50
+ </template>
@@ -0,0 +1,78 @@
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
+ <Genie
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="true"
20
+ >
21
+ <img
22
+ :src="`url(${imageUrl})`"
23
+ :style="{
24
+ width: width,
25
+ height: height,
26
+ }"
27
+ @load="onImgLoaded"
28
+ />
29
+ <div
30
+ :style="{
31
+ width: 1024,
32
+ height: 100,
33
+ backgroundColor: '#ffffff44',
34
+ }"
35
+ ></div>
36
+ <div
37
+ :style="{
38
+ width: width,
39
+ height: height,
40
+ fontSize: 50,
41
+ color: '#fff',
42
+ textAlign: 'center',
43
+ }"
44
+ >
45
+ 按OK键进场/出场
46
+ </div>
47
+ </Genie>
48
+ </jsv-focus-block>
49
+ </template>
50
+ <script setup>
51
+ import Genie from "./geniePakcer/Genie.vue";
52
+ import { shallowRef } from "vue";
53
+
54
+ const cGenieRef = shallowRef();
55
+ const position = { x: -80, y: 600 };
56
+ const width = 1024;
57
+ const height = 576;
58
+ const imageUrl =
59
+ "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Genie/App/element_228542_icon_20230610184253.jpg";
60
+
61
+ let imgLoaded = false;
62
+ function onImgLoaded() {
63
+ imgLoaded = true;
64
+ }
65
+ const onAnimEnd = () => {
66
+ console.log("anim end");
67
+ };
68
+
69
+ function onKeyDown(ev) {
70
+ if (ev.keyCode == 13) {
71
+ if (imgLoaded) {
72
+ cGenieRef.value.switcher();
73
+ }
74
+ return true;
75
+ }
76
+ return false;
77
+ }
78
+ </script>