@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,110 @@
1
+ <script setup>
2
+ import { onMounted, inject, ref, watch } from "vue";
3
+
4
+ const props = defineProps({
5
+ onEdge: Function,
6
+ name: String,
7
+ layout: Object,
8
+ dataLoader: Function, // (tabId) => Promise
9
+ animDuration: { type: Number, default: 200 },
10
+ onFocus: Function,
11
+ onBlur: Function,
12
+ });
13
+
14
+ const globalInfo = inject("globalInfo");
15
+ const animState = inject("animState");
16
+
17
+ const page0Show = ref(false);
18
+ let page0Data = null;
19
+ const page0Anim = ref({ anim: null, onend: null });
20
+ const appSwiper_onFocus = () => {
21
+ console.log("testtest swiper on focus")
22
+ props.onFocus();
23
+ };
24
+ const appSwiper_onBlur = () => {
25
+ console.log("testtest swiper on blur")
26
+ props.onBlur();
27
+ };
28
+
29
+ const appSwiper_tabIdWatcher = (newValue, oldValue) => {
30
+ let direction = newValue > oldValue ? "left" : "right";
31
+ page0Show.value = false;
32
+ page0Data = null;
33
+ page0Anim.value = ref({ anim: null, onend: null });
34
+ props.dataLoader(newValue).then((data) => {
35
+ console.log("testtest swiper data", data);
36
+ if (oldValue > -1) {
37
+ animState.value = 1;
38
+ }
39
+ page0Anim.value = {
40
+ anim:
41
+ oldValue != -1
42
+ ? `app-swiper-${direction}-slide-in ${
43
+ props.animDuration / 1000
44
+ }s cubic-bezier(0.05, 0.55, 0.13, 0.78) 1`
45
+ : null,
46
+ onend: () => {
47
+ animState.value = 0;
48
+ },
49
+ };
50
+ page0Data = data;
51
+ page0Show.value = true;
52
+ });
53
+ };
54
+
55
+ watch(
56
+ () => globalInfo.updateTabId,
57
+ (newValue, oldValue) => {
58
+ console.log("ccht updateTabId changed", globalInfo.updateTabId);
59
+ appSwiper_tabIdWatcher(newValue, oldValue);
60
+ }
61
+ );
62
+ </script>
63
+
64
+ <template>
65
+ <jsv-focus-block
66
+ :name="name"
67
+ ref="focusNode"
68
+ :onAction="{
69
+ onFocus: appSwiper_onFocus,
70
+ onBlur: appSwiper_onBlur,
71
+ }"
72
+ >
73
+ <div
74
+ id="page0"
75
+ :style="{
76
+ left: layout.left,
77
+ top: layout.top,
78
+ width: layout.width,
79
+ height: layout.height,
80
+ animation: page0Anim.anim,
81
+ animationFillMode: 'forwards',
82
+ }"
83
+ @animationend="page0Anim.onend"
84
+ >
85
+ <slot v-if="page0Show" :data="page0Data" :onEdge="onEdge"></slot>
86
+ </div>
87
+ </jsv-focus-block>
88
+ </template>
89
+
90
+ <style>
91
+ @keyframes app-swiper-left-slide-in {
92
+ from {
93
+ transform: translate3d(0px, 180px, 0px);
94
+ }
95
+ to {
96
+ transform: translate3d(0px, 0px, 0px);
97
+ /* animation-timing-function: cubic-bezier(0.05, 0.55, 0.13, 0.78); */
98
+ }
99
+ }
100
+
101
+ @keyframes app-swiper-right-slide-in {
102
+ from {
103
+ transform: translate3d(0px, -180px, 0px);
104
+ }
105
+ to {
106
+ transform: translate3d(0px, 0px, 0px);
107
+ /* animation-timing-function: cubic-bezier(0.05, 0.55, 0.13, 0.78); */
108
+ }
109
+ }
110
+ </style>
@@ -0,0 +1,76 @@
1
+ // 导入所有图片
2
+ import movieTicket from './assets/movie_ticket.png';
3
+ import varietyShow from './assets/variety_show.png';
4
+ import childrenScience from './assets/children_science.png';
5
+ import tvDrama from './assets/tv_drama.png';
6
+ import documentary from './assets/documentary.png';
7
+ import myAccount from './assets/my_account.png';
8
+ import free from './assets/free.png';
9
+ import opera from './assets/opera.png';
10
+ import vip from './assets/vip.png';
11
+ import sports from './assets/sports.png';
12
+ import homeSelected from './assets/home_selected.png';
13
+ import game from './assets/game.png';
14
+
15
+ export const testData = [
16
+ {
17
+ "indexId": 0,
18
+ "itemTitle": "电影票",
19
+ "icon": movieTicket
20
+ },
21
+ {
22
+ "indexId": 1,
23
+ "itemTitle": "综艺",
24
+ "icon": varietyShow
25
+ },
26
+ {
27
+ "indexId": 2,
28
+ "itemTitle": "少儿科普",
29
+ "icon": childrenScience
30
+ },
31
+ {
32
+ "indexId": 3,
33
+ "itemTitle": "电视剧",
34
+ "icon": tvDrama
35
+ },
36
+ {
37
+ "indexId": 4,
38
+ "itemTitle": "纪录片",
39
+ "icon": documentary
40
+ },
41
+ {
42
+ "indexId": 5,
43
+ "itemTitle": "我的",
44
+ "icon": myAccount,
45
+ },
46
+ {
47
+ "indexId": 6,
48
+ "itemTitle": "免费",
49
+ "icon": free,
50
+ },
51
+ {
52
+ "indexId": 7,
53
+ "itemTitle": "戏曲",
54
+ "icon": opera,
55
+ },
56
+ {
57
+ "indexId": 8,
58
+ "itemTitle": "VIP",
59
+ "icon": vip,
60
+ },
61
+ {
62
+ "indexId": 9,
63
+ "itemTitle": "体育",
64
+ "icon": sports,
65
+ },
66
+ {
67
+ "indexId": 10,
68
+ "itemTitle": "首页",
69
+ "icon": homeSelected,
70
+ },
71
+ {
72
+ "indexId": 11,
73
+ "itemTitle": "游戏",
74
+ "icon": game,
75
+ },
76
+ ];
@@ -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
+ <Vortex
10
+ ref="cGenieRef"
11
+ :layout="{
12
+ left: 120,
13
+ top: 50,
14
+ width: width,
15
+ height: height,
16
+ }"
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
+ </Vortex>
48
+ </jsv-focus-block>
49
+ </template>
50
+ <script setup>
51
+ import Vortex from "./Vortex/Vortex.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.switch();
73
+ }
74
+ return true;
75
+ }
76
+ return false;
77
+ }
78
+ </script>
@@ -0,0 +1,180 @@
1
+ <template>
2
+ <div
3
+ :style="{
4
+ left: layout.left,
5
+ top: layout.top,
6
+ }"
7
+ >
8
+ <jsv-frag-shader-view
9
+ v-if="showFbo"
10
+ :key="keyCount"
11
+ ref="shaderViewRef"
12
+ :style="{
13
+ width: layout.width,
14
+ height: layout.height,
15
+ }"
16
+ :duration="shaderSetting.duration"
17
+ :shaderStr="shaderSetting.shader"
18
+ :autoplay="true"
19
+ :textures="shaderSetting.textures"
20
+ :onEnd="onAnimEnd"
21
+ ></jsv-frag-shader-view>
22
+
23
+ <div
24
+ v-if="!showOrigin"
25
+ :style="{
26
+ width: 1,
27
+ height: 1,
28
+ overflow: 'hidden',
29
+ }"
30
+ >
31
+ <div
32
+ ref="slotRootRef"
33
+ :style="{
34
+ width: layout.width,
35
+ height: layout.height,
36
+ }"
37
+ >
38
+ <slot></slot>
39
+ </div>
40
+ </div>
41
+ <div
42
+ v-else
43
+ ref="slotRootRef"
44
+ :style="{
45
+ width: layout.width,
46
+ height: layout.height,
47
+ }"
48
+ >
49
+ <slot></slot>
50
+ </div>
51
+ </div>
52
+ </template>
53
+
54
+ <script setup>
55
+ /**
56
+ * @slot 默认插槽 - 用于放置需要进行漩涡动画的内容
57
+ */
58
+ import vortexOutShader from "./vortexOut.glsl?raw";
59
+ import vortexInShader from "./vortexIn.glsl?raw";
60
+
61
+ import { onMounted, onUnmounted, shallowRef, ref, computed } from "vue";
62
+ import {
63
+ JsvFragShaderView,
64
+ getKeyFramesGroup,
65
+ JsvTextureStoreApi,
66
+ } from "jsview";
67
+
68
+ const props = defineProps({
69
+ /**
70
+ * @type {Object} 布局配置对象
71
+ * @property {string} left - 组件左侧定位(如 '10px')
72
+ * @property {string} top - 组件顶部定位(如 '20px')
73
+ * @property {string} width - 组件宽度(如 '300px')
74
+ * @property {string} height - 组件高度(如 '200px')
75
+ */
76
+ layout: {
77
+ type: Object,
78
+ required: true,
79
+ },
80
+ /**
81
+ * @type {number} 动画持续时间(单位:秒)
82
+ * @default 1
83
+ */
84
+ duration: {
85
+ type: Number,
86
+ default: 1,
87
+ },
88
+ /**
89
+ * @type {boolean} 初始显示状态
90
+ * @default true
91
+ */
92
+ initShow: {
93
+ type: Boolean,
94
+ default: true,
95
+ },
96
+ /**
97
+ * @type {Function} 动画结束回调函数
98
+ */
99
+ onAnimEnd: {
100
+ type: Function,
101
+ }
102
+ });
103
+
104
+ const showOrigin = shallowRef(props.initShow);
105
+ const showFbo = shallowRef(false);
106
+ const slotRootRef = shallowRef();
107
+ const keyCount = ref(0);
108
+ const shaderViewRef = ref();
109
+ let state = props.initShow ? 1 : 0;
110
+
111
+ let shaderSetting = {
112
+ name: "vortex",
113
+ shader: "",
114
+ uniforms: [],
115
+ textures: [
116
+ {
117
+ name: "iChannel0",
118
+ resource: "",
119
+ },
120
+ ],
121
+ duration: Math.round(props.duration * 1000),
122
+ };
123
+ let _onEnd = null;
124
+
125
+ function animOut() {
126
+ shaderSetting.shader = vortexOutShader;
127
+ _onEnd = () => {
128
+ showOrigin.value = false;
129
+ };
130
+ capture();
131
+ }
132
+
133
+ function animIn() {
134
+ shaderSetting.shader = vortexInShader;
135
+ _onEnd = () => {
136
+ showOrigin.value = true;
137
+ };
138
+ capture();
139
+ }
140
+
141
+ function onAnimEnd() {
142
+ showFbo.value = false;
143
+ _onEnd();
144
+ props.onAnimEnd?.();
145
+ }
146
+
147
+ function capture() {
148
+ JsvTextureStoreApi.capture2Texture(
149
+ slotRootRef.value,
150
+ (textureName, autoRecycle, w, h) => {
151
+ shaderSetting.textures[0].resource = `jsvtexturestore://${textureName}`;
152
+
153
+ if (autoRecycle) {
154
+ // 已经是设置了texture的自动回收,所以不再需要主动调用 JsvTextureStoreApi.deleteTexture 来释放内存
155
+ }
156
+ showOrigin.value = false;
157
+ ++keyCount.value;
158
+ showFbo.value = true;
159
+ },
160
+ true // 自动回收, 不填也行,默认为true
161
+ );
162
+ }
163
+
164
+ defineExpose({
165
+ /**
166
+ * 切换动画状态
167
+ * @example
168
+ * componentRef.value.switch();
169
+ */
170
+ switch() {
171
+ if (state == 0) {
172
+ state = 1;
173
+ animIn();
174
+ } else {
175
+ state = 0;
176
+ animOut();
177
+ }
178
+ },
179
+ });
180
+ </script>
@@ -0,0 +1,38 @@
1
+ #define RANGE 6.
2
+ #define SPEED .5
3
+ #define STRENGTH 6.
4
+
5
+ mat2 rotate(float a) {
6
+ float s = sin(a);
7
+ float c = cos(a);
8
+ return mat2(c, -s, s, c);
9
+ }
10
+
11
+ void mainImage(out vec4 fragColor, vec2 coord) {
12
+ /** mediump精度10bit, 直接使用0-1的uv, 小值的normalize()会有精度问题, 导致异常大的结果; 但乘1920x1080又会有大值的问题, 所以选取16x9 */
13
+ vec2 aspect = (iResolution.xy / iResolution.y) * 9.;
14
+ vec2 center = 0.5 * aspect;
15
+
16
+ vec2 uv = coord / iResolution.xy * aspect;
17
+ uv -= center;
18
+
19
+ float d = length(uv);
20
+ float progress = 1. - iTime / iDuration;
21
+
22
+ //vortex
23
+ float cTime = STRENGTH * progress;
24
+ d = smoothstep(0., RANGE, RANGE - d) * cTime;
25
+ uv *= rotate(d);
26
+
27
+ //shrink
28
+ float edge = aspect.y * abs(progress);
29
+ uv = uv + normalize(uv) * edge;
30
+
31
+ uv += center;
32
+ uv /= aspect;
33
+ if(uv.x > 1. || uv.y > 1. || uv.x < 0. || uv.y < 0.) {
34
+ fragColor = vec4(0.0);
35
+ } else {
36
+ fragColor = jsvTexture2D(iChannel0, uv);
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ #define RANGE 6.
2
+ #define SPEED .5
3
+ #define STRENGTH 6.
4
+
5
+ mat2 rotate(float a) {
6
+ float s = sin(a);
7
+ float c = cos(a);
8
+ return mat2(c, -s, s, c);
9
+ }
10
+
11
+ void mainImage(out vec4 fragColor, vec2 coord) {
12
+ /** mediump精度10bit, 直接使用0-1的uv, 小值的normalize()会有精度问题, 导致异常大的结果; 但乘1920x1080又会有大值的问题, 所以选取16x9 */
13
+ vec2 aspect = (iResolution.xy / iResolution.y) * 9.;
14
+ vec2 center = 0.5 * aspect;
15
+
16
+ vec2 uv = coord / iResolution.xy * aspect;
17
+ uv -= center;
18
+
19
+ float d = length(uv);
20
+ float progress = iTime / iDuration;
21
+
22
+ //vortex
23
+ float cTime = STRENGTH * progress;
24
+ d = smoothstep(0., RANGE, RANGE - d) * cTime;
25
+ uv *= rotate(d);
26
+
27
+ //shrink
28
+ float edge = aspect.y * abs(progress);
29
+ uv = uv + normalize(uv) * edge;
30
+
31
+ uv += center;
32
+ uv /= aspect;
33
+ if(uv.x > 1. || uv.y > 1. || uv.x < 0. || uv.y < 0.) {
34
+ fragColor = vec4(0.0);
35
+ } else {
36
+ fragColor = jsvTexture2D(iChannel0, uv);
37
+ }
38
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-03-09 14:03:58
4
+ * @Description: file content
5
+ */
6
+ export { default as demoForOperatorRouteList } from "./routeList"