@shijiu/jsview-vue-samples 1.9.747

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 (213) hide show
  1. package/AnimPicture/App.vue +207 -0
  2. package/AnimPicture/assets/animated_webp.webp +0 -0
  3. package/AnimPicture/assets/ball_3.webp +0 -0
  4. package/AnimPicture/assets/girl_run.gif +0 -0
  5. package/AnimPicture/assets/quan.webp +0 -0
  6. package/Basic/App.vue +134 -0
  7. package/Basic/assets/border.png +0 -0
  8. package/Basic/assets/border2.png +0 -0
  9. package/Basic/assets/icon.png +0 -0
  10. package/Basic/assets/test.jpg +0 -0
  11. package/Basic/components/ContentBlock.vue +38 -0
  12. package/Basic/components/FontStyle.css +16 -0
  13. package/Basic/components/anim/AnimGroup.vue +66 -0
  14. package/Basic/components/anim/AnimKeyframeBasic.vue +119 -0
  15. package/Basic/components/anim/AnimKeyframeComposite.vue +52 -0
  16. package/Basic/components/anim/AnimTransition.vue +157 -0
  17. package/Basic/components/div/DivBackground.vue +44 -0
  18. package/Basic/components/div/DivClip.vue +159 -0
  19. package/Basic/components/div/DivCssScoped.vue +20 -0
  20. package/Basic/components/div/DivCssVar.vue +53 -0
  21. package/Basic/components/div/DivGroup1.vue +47 -0
  22. package/Basic/components/div/DivGroup2.vue +65 -0
  23. package/Basic/components/div/DivLayout.vue +70 -0
  24. package/Basic/components/div/DivRadius.vue +65 -0
  25. package/Basic/components/div/DivTransform.vue +32 -0
  26. package/Basic/components/img/ImageGroup.vue +31 -0
  27. package/Basic/components/img/ImgLayout.vue +41 -0
  28. package/Basic/components/panel/Panel1.vue +55 -0
  29. package/Basic/components/panel/Panel2.vue +31 -0
  30. package/Basic/components/panel/TitleBar.vue +29 -0
  31. package/Basic/components/text/TextAlign.vue +66 -0
  32. package/Basic/components/text/TextEmoji.vue +26 -0
  33. package/Basic/components/text/TextFontStyle.vue +89 -0
  34. package/Basic/components/text/TextGroup1.vue +49 -0
  35. package/Basic/components/text/TextGroup2.vue +28 -0
  36. package/Basic/components/text/TextOverflow.vue +110 -0
  37. package/BasicFocusControl/App.vue +104 -0
  38. package/BasicFocusControl/components/BaseBlock.vue +50 -0
  39. package/BasicFocusControl/components/MainArea.vue +83 -0
  40. package/BasicFocusControl/components/MainAreaLeftBlock.vue +17 -0
  41. package/BasicFocusControl/components/MainAreaRightBlock.vue +27 -0
  42. package/BasicFocusControl/components/SideBar.vue +58 -0
  43. package/BasicFocusControl/components/SideBarBlock.vue +27 -0
  44. package/Collision/App.vue +452 -0
  45. package/ColorSpace/App.vue +126 -0
  46. package/ColorSpace/bmpDemo.bmp +0 -0
  47. package/ColorSpace/jpegDemo.jpeg +0 -0
  48. package/ColorSpace/pngDemo.png +0 -0
  49. package/ColorSpace/pngNoAlphaDemo.png +0 -0
  50. package/DemoHomepage/App.vue +27 -0
  51. package/DemoHomepage/components/BodyFrame.vue +95 -0
  52. package/DemoHomepage/components/Dialog.vue +94 -0
  53. package/DemoHomepage/components/Item.vue +77 -0
  54. package/DemoHomepage/components/TabFrame.vue +85 -0
  55. package/DemoHomepage/router.js +196 -0
  56. package/DemoHomepage/views/Homepage.vue +195 -0
  57. package/FilterDemo/AnimatePic.vue +58 -0
  58. package/FilterDemo/App.vue +159 -0
  59. package/FilterDemo/VideoLayer.vue +62 -0
  60. package/FilterDemo/jpegDemo.jpeg +0 -0
  61. package/FilterDemo/webpDemo.webp +0 -0
  62. package/FlipCard/App.vue +71 -0
  63. package/FlipCard/FlipCard.vue +118 -0
  64. package/FlipCard/assets/blue_egg.png +0 -0
  65. package/FlipCard/assets/red_egg.png +0 -0
  66. package/FlipCard/data.js +13 -0
  67. package/GridDemo/App.vue +215 -0
  68. package/GridDemo/ButtonBlock.vue +112 -0
  69. package/GridDemo/FocusItem.vue +37 -0
  70. package/GridDemo/Item.vue +93 -0
  71. package/HashHistory/App.vue +115 -0
  72. package/HashHistory/components/HorizontalButtonList.vue +91 -0
  73. package/HashHistory/components/Item.vue +60 -0
  74. package/HashHistory/router.js +41 -0
  75. package/HashHistory/views/MainPage.vue +57 -0
  76. package/HashHistory/views/SubPage.vue +66 -0
  77. package/ImpactStop/App.vue +435 -0
  78. package/Input/App.vue +164 -0
  79. package/Input/FullKeyboard.vue +87 -0
  80. package/Input/InputPanel.vue +131 -0
  81. package/Input/KeyboardItem.vue +58 -0
  82. package/LongImage/App.vue +80 -0
  83. package/LongImage/Button.vue +58 -0
  84. package/LongImage/ButtonItem.vue +44 -0
  85. package/LongImage/LongImageScroll.vue +92 -0
  86. package/LongImage/Scroll.vue +14 -0
  87. package/LongImage/assets/1280x7200.jpg +0 -0
  88. package/LongText/App.vue +96 -0
  89. package/LongText/Button.vue +51 -0
  90. package/LongText/ButtonItem.vue +44 -0
  91. package/LongText/LongTextScroll.vue +192 -0
  92. package/LongText/Scroll.vue +14 -0
  93. package/Marquee/App.vue +247 -0
  94. package/Marquee/longText.js +14 -0
  95. package/MaskClip/App.vue +122 -0
  96. package/MaskClip/images/mask-025/config.json +29 -0
  97. package/MaskClip/images/mask-025/res/1.png +0 -0
  98. package/MaskClip/images/mask-025/res/2.png +0 -0
  99. package/MaskClip/images/mask-025/res/3.png +0 -0
  100. package/MaskClip/images/mask-025/res/4.png +0 -0
  101. package/MaskClip/images/mask-025/res/icon.png +0 -0
  102. package/MaskClip/images/mask-025/res/stroke.png +0 -0
  103. package/MaskClip/images/php.jpg +0 -0
  104. package/MetroWidgetDemos/Advanced/App.vue +46 -0
  105. package/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
  106. package/MetroWidgetDemos/Advanced/Buttons.vue +70 -0
  107. package/MetroWidgetDemos/Advanced/Mixed.vue +77 -0
  108. package/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
  109. package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
  110. package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +116 -0
  111. package/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  112. package/MetroWidgetDemos/Item.vue +85 -0
  113. package/MetroWidgetDemos/PerformanceTest/App.vue +210 -0
  114. package/MetroWidgetDemos/PerformanceTest/Item.vue +90 -0
  115. package/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
  116. package/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
  117. package/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
  118. package/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
  119. package/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
  120. package/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
  121. package/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
  122. package/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
  123. package/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
  124. package/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
  125. package/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
  126. package/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
  127. package/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
  128. package/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
  129. package/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
  130. package/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
  131. package/MetroWidgetDemos/PerformanceTest/border.png +0 -0
  132. package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +386 -0
  133. package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +129 -0
  134. package/MetroWidgetDemos/PerformanceTest/data.js +45 -0
  135. package/MetroWidgetDemos/PingPong/App.vue +135 -0
  136. package/MetroWidgetDemos/PingPong/AppPage.vue +73 -0
  137. package/MetroWidgetDemos/PingPong/AppTab.vue +62 -0
  138. package/MetroWidgetDemos/PingPong/TabItem.vue +84 -0
  139. package/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
  140. package/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
  141. package/MetroWidgetDemos/Simple/App.vue +45 -0
  142. package/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -0
  143. package/MetroWidgetDemos/WidgetItem.vue +89 -0
  144. package/MetroWidgetDemos/data.js +205 -0
  145. package/NinePatchDemo/App.vue +145 -0
  146. package/NinePatchDemo/Item.vue +69 -0
  147. package/NinePatchDemo/assets/border.png +0 -0
  148. package/Preload/App.vue +135 -0
  149. package/Preload/Item.vue +32 -0
  150. package/Preload/data.js +23 -0
  151. package/Preload/images/awesomeface.png +0 -0
  152. package/Preload/images/cat.jpg +0 -0
  153. package/Preload/images/rank.png +0 -0
  154. package/Preload/images/rank_focus.png +0 -0
  155. package/Preload/images/rule.png +0 -0
  156. package/Preload/images/rule_focus.png +0 -0
  157. package/Preload/images/start.png +0 -0
  158. package/Preload/images/start_focus.png +0 -0
  159. package/QrcodeDemo/App.vue +68 -0
  160. package/ScaleDownNeon/App.vue +107 -0
  161. package/SoundPool/App.vue +134 -0
  162. package/SoundPool/bgmusic.mp3 +0 -0
  163. package/SoundPool/coin.mp3 +0 -0
  164. package/SoundPool/jump.mp3 +0 -0
  165. package/SoundPool/lose.mp3 +0 -0
  166. package/SoundPool/run.mp3 +0 -0
  167. package/SprayView/App.vue +272 -0
  168. package/SprayView/assets/snow.png +0 -0
  169. package/SpriteImage/App.vue +173 -0
  170. package/SpriteImage/images/cat_run.png +0 -0
  171. package/SpriteImage/images/egg_break.json +116 -0
  172. package/SpriteImage/images/egg_break.png +0 -0
  173. package/SpriteImage/images/sprite.png +0 -0
  174. package/TextBox/App.vue +91 -0
  175. package/TextBox/RenderCenter.vue +133 -0
  176. package/TextBox/RenderLeft.vue +138 -0
  177. package/TextBox/RenderOneLine.vue +101 -0
  178. package/TextBox/RenderRight.vue +131 -0
  179. package/TextShadowDemo/App.vue +91 -0
  180. package/TextureAnimation/App.vue +336 -0
  181. package/TextureAnimation/App2.vue +111 -0
  182. package/TextureAnimation/assets/blackWhiteGrid.png +0 -0
  183. package/TextureAnimation/assets/light.png +0 -0
  184. package/TextureAnimation/assets/light2.png +0 -0
  185. package/TextureAnimation/assets/mask.png +0 -0
  186. package/TextureAnimation/assets/php.jpg +0 -0
  187. package/TextureAnimation/assets/php2.png +0 -0
  188. package/TextureAnimation/assets/swipLight.png +0 -0
  189. package/TextureSize/App.vue +132 -0
  190. package/TextureSize/bmpDemo.bmp +0 -0
  191. package/TextureSize/jpegDemo.jpeg +0 -0
  192. package/TextureSize/jpgDemo.jpg +0 -0
  193. package/TextureSize/pngDemo.png +0 -0
  194. package/TextureSize/pngNoAlphaDemo.png +0 -0
  195. package/ThrowMoveDemo/AccelerateDemo.vue +116 -0
  196. package/ThrowMoveDemo/App.vue +114 -0
  197. package/ThrowMoveDemo/LRParabolicDemo.vue +115 -0
  198. package/ThrowMoveDemo/TargetDemo.vue +116 -0
  199. package/ThrowMoveDemo/UDParabolicDemo.vue +121 -0
  200. package/TouchSample/App.vue +136 -0
  201. package/TouchSample/Item.vue +103 -0
  202. package/TouchSample/MetroWidgetHorizontal.vue +144 -0
  203. package/TouchSample/MetroWidgetVertical.vue +144 -0
  204. package/TouchSample/TouchContainerHorizontal.vue +160 -0
  205. package/TouchSample/TouchContainerVertical.vue +160 -0
  206. package/TouchSample/data.js +81 -0
  207. package/TransitPage/App.vue +29 -0
  208. package/VideoDemo/App.vue +121 -0
  209. package/VideoDemo/components/Button.vue +58 -0
  210. package/VideoDemo/components/Controllor.vue +197 -0
  211. package/VideoDemo/components/VideoFrame.vue +140 -0
  212. package/VisibleSensorDemo/App.vue +234 -0
  213. package/package.json +17 -0
@@ -0,0 +1,94 @@
1
+ <script>
2
+ export default {
3
+ props: {
4
+ name: String,
5
+ onAction: Function,
6
+ },
7
+ data() {
8
+ return {
9
+ focusId: 0,
10
+ };
11
+ },
12
+ methods: {
13
+ onKeyDown(ev) {
14
+ switch (ev.keyCode) {
15
+ case 37:
16
+ if (this.focusId == 1) {
17
+ this.focusId = 0;
18
+ }
19
+ break;
20
+ case 39:
21
+ if (this.focusId == 0) {
22
+ this.focusId = 1;
23
+ }
24
+ break;
25
+ case 10000:
26
+ case 27:
27
+ this.onAction("back");
28
+ break;
29
+ case 13:
30
+ this.onAction(this.focusId == 0 ? "ok" : "cancel");
31
+ break;
32
+ default:
33
+ }
34
+ return true;
35
+ },
36
+ },
37
+ };
38
+ </script>
39
+
40
+ <template>
41
+ <jsv-focus-block
42
+ autoFocus
43
+ :name="name"
44
+ :onAction="{
45
+ onKeyDown: onKeyDown,
46
+ }"
47
+ >
48
+ <div :style="{ top: 200, left: 465 }">
49
+ <div class="background"></div>
50
+ <div class="message">是否退出</div>
51
+ <div :style="{ top: 120, left: 30 }">
52
+ <div v-if="focusId == 0" class="focus"></div>
53
+ <div class="normal">确定</div>
54
+ </div>
55
+ <div :style="{ top: 120, left: 220 }">
56
+ <div v-if="focusId == 1" class="focus"></div>
57
+ <div class="normal">取消</div>
58
+ </div>
59
+ </div>
60
+ </jsv-focus-block>
61
+ </template>
62
+
63
+ <style scoped>
64
+ .focus {
65
+ top: -5px;
66
+ left: -5px;
67
+ width: 100px;
68
+ height: 50px;
69
+ background-color: #0000ff;
70
+ }
71
+
72
+ .normal {
73
+ width: 90px;
74
+ height: 40px;
75
+ color: #ffffff;
76
+ text-align: center;
77
+ font-size: 30px;
78
+ }
79
+ .background {
80
+ left: 0px;
81
+ top: 0px;
82
+ width: 350px;
83
+ height: 200px;
84
+ background-color: rgba(0, 0, 0, 0.7);
85
+ }
86
+ .message {
87
+ top: 20px;
88
+ width: 350px;
89
+ height: 50px;
90
+ color: #ffffff;
91
+ font-size: 40px;
92
+ text-align: center;
93
+ }
94
+ </style>
@@ -0,0 +1,77 @@
1
+ <script>
2
+ export default {
3
+ props: {
4
+ style: Object,
5
+ itemClick: Function,
6
+ itemFocus: Function,
7
+ data: Object,
8
+ query: Object,
9
+ onEdge: Function,
10
+ onAction: Object,
11
+ },
12
+ data() {
13
+ return {
14
+ focused: false,
15
+ anim: "flip 1s",
16
+ };
17
+ },
18
+ computed: {
19
+ foucsStyle() {
20
+ return {
21
+ width: this.style.width,
22
+ height: this.style.height,
23
+ };
24
+ },
25
+ itemStyle() {
26
+ return {
27
+ width: this.style.width - 10,
28
+ height: this.style.height - 10,
29
+ backgroundColor: this.style.backgroundColor,
30
+ color: this.style.color,
31
+ };
32
+ },
33
+ },
34
+ methods: {
35
+ onFocus() {
36
+ this.focused = true;
37
+ if (this.itemFocus) {
38
+ this.itemFocus(this.data);
39
+ }
40
+ },
41
+ onBlur() {
42
+ this.focused = false;
43
+ },
44
+ onClick() {
45
+ if (this.itemClick) {
46
+ this?.itemClick(this.query.id, this.data);
47
+ }
48
+ },
49
+ },
50
+ created() {
51
+ this.onAction.register("onFocus", this.onFocus);
52
+ this.onAction.register("onBlur", this.onBlur);
53
+ this.onAction.register("onClick", this.onClick);
54
+ },
55
+ };
56
+ </script>
57
+
58
+ <template>
59
+ <div>
60
+ <div class="focus" :style="foucsStyle" v-if="focused" />
61
+ <div class="item" :style="itemStyle">
62
+ <slot></slot>
63
+ </div>
64
+ </div>
65
+ </template>
66
+
67
+ <style scoped>
68
+ .focus {
69
+ top: -5;
70
+ left: -5;
71
+ background-color: #0000ff;
72
+ }
73
+ .item {
74
+ text-align: center;
75
+ font-size: 30;
76
+ }
77
+ </style>
@@ -0,0 +1,85 @@
1
+ <script>
2
+ import { MetroWidget, VERTICAL } from "jsview";
3
+ import Item from "./Item.vue";
4
+
5
+ const measures = (item) => {
6
+ return {
7
+ width: item.width,
8
+ height: item.height,
9
+ focusable: item.focusable,
10
+ };
11
+ };
12
+
13
+ export default {
14
+ components: {
15
+ MetroWidget,
16
+ Item,
17
+ },
18
+ props: {
19
+ name: String,
20
+ itemFocus: Function,
21
+ onEdge: Function,
22
+ initId: Number,
23
+ },
24
+ setup() {
25
+ const width = 1280;
26
+ const height = 100;
27
+ const data = [
28
+ {
29
+ width: 200,
30
+ height: 50,
31
+ name: "功能实例",
32
+ focusable: true,
33
+ id: 0,
34
+ },
35
+ {
36
+ width: 200,
37
+ height: 50,
38
+ name: "MetroWidget",
39
+ focusable: true,
40
+ id: 1,
41
+ },
42
+ ];
43
+ const direction = VERTICAL;
44
+ return {
45
+ width,
46
+ height,
47
+ data,
48
+ direction,
49
+ measures,
50
+ };
51
+ },
52
+ };
53
+ </script>
54
+
55
+ <template>
56
+ <metro-widget
57
+ :name="name"
58
+ :width="width"
59
+ :height="height"
60
+ :direction="direction"
61
+ :data="data"
62
+ :measures="measures"
63
+ :padding="{ left: 10, top: 10, right: 10, bottom: 10 }"
64
+ :onEdge="onEdge"
65
+ :initFocusId="initId"
66
+ >
67
+ <template #renderItem="{ data, query, onEdge, onAction }">
68
+ <Item
69
+ :style="{
70
+ width: data.width,
71
+ height: data.height,
72
+ backgroundColor: '#00AA00',
73
+ color: '#FFFFFF',
74
+ }"
75
+ :data="data"
76
+ :query="query"
77
+ :onEdge="onEdge"
78
+ :onAction="onAction"
79
+ :itemFocus="itemFocus"
80
+ >
81
+ {{ data.name }}
82
+ </Item>
83
+ </template>
84
+ </metro-widget>
85
+ </template>
@@ -0,0 +1,196 @@
1
+ import { createRouter } from 'vue-router';
2
+ import { jsvCreateHashHistory } from 'jsview';
3
+
4
+ const routeList = [
5
+ // 功能实例
6
+ {
7
+ name: 'Home',
8
+ path: '/',
9
+ component: () => import('./views/Homepage.vue'),
10
+ },
11
+ {
12
+ name: '基础示例合集',
13
+ path: '/feature/Basic',
14
+ component: () => import('jsview-vue-samples/Basic/App.vue'),
15
+ },
16
+ {
17
+ name: '可视化变化通知',
18
+ path: '/feature/VisibleSensorDemo',
19
+ component: () => import('jsview-vue-samples/VisibleSensorDemo/App.vue'),
20
+ },
21
+ {
22
+ name: '快速刷新的表格布局组件',
23
+ path: '/feature/GridDemo',
24
+ component: () => import('jsview-vue-samples/GridDemo/App.vue'),
25
+ },
26
+ {
27
+ name: '.9图焦点框漂移',
28
+ path: '/feature/NinePatchDemo',
29
+ component: () => import('jsview-vue-samples/NinePatchDemo/App.vue'),
30
+ },
31
+ {
32
+ name: '视频',
33
+ path: '/feature/VideoDemo',
34
+ component: () => import('jsview-vue-samples/VideoDemo/App.vue'),
35
+ },
36
+ {
37
+ name: '焦点切换demo',
38
+ path: '/feature/BasicFocusControl',
39
+ component: () => import('jsview-vue-samples/BasicFocusControl/App.vue'),
40
+ },
41
+ {
42
+ name: 'Hash方式路由切换',
43
+ path: '/feature/HashHistory',
44
+ props: { routePath: '/feature/HashHistory' },
45
+ component: () => import('jsview-vue-samples/HashHistory/App.vue'),
46
+ },
47
+ {
48
+ name: '翻牌游戏',
49
+ path: '/feature/FlipCard',
50
+ component: () => import('jsview-vue-samples/FlipCard/App.vue'),
51
+ },
52
+ {
53
+ name: '设置颜色空间',
54
+ path: '/feature/ColorSpace',
55
+ component: () => import('jsview-vue-samples/ColorSpace/App.vue'),
56
+ },
57
+ {
58
+ name: '制定Texture尺寸',
59
+ path: '/feature/TextureSize',
60
+ component: () => import('jsview-vue-samples/TextureSize/App.vue'),
61
+ },
62
+ {
63
+ name: '动图',
64
+ path: '/feature/AnimPicture',
65
+ component: () => import('jsview-vue-samples/AnimPicture/App.vue'),
66
+ },
67
+ {
68
+ name: '粒子效果',
69
+ path: '/feature/SprayView',
70
+ component: () => import('jsview-vue-samples/SprayView/App.vue'),
71
+ },
72
+ {
73
+ name: '长文字',
74
+ path: '/feature/LongText',
75
+ component: () => import('jsview-vue-samples/LongText/App.vue'),
76
+ },
77
+ {
78
+ name: '长图片',
79
+ path: '/feature/LongImage',
80
+ component: () => import('jsview-vue-samples/LongImage/App.vue'),
81
+ },
82
+ {
83
+ name: '二维码',
84
+ path: '/feature/QrcodeDemo',
85
+ component: () => import('jsview-vue-samples/QrcodeDemo/App.vue'),
86
+ },
87
+ {
88
+ name: '文字阴影',
89
+ path: '/feature/TextShadowDemo',
90
+ component: () => import('jsview-vue-samples/TextShadowDemo/App.vue'),
91
+ },
92
+ {
93
+ name: '多行文字区域内对齐',
94
+ path: '/feature/TextBox',
95
+ component: () => import('jsview-vue-samples/TextBox/App.vue'),
96
+ },
97
+ {
98
+ name: '抛物运动写法样例',
99
+ path: '/feature/ThrowMoveDemo',
100
+ component: () => import('jsview-vue-samples/ThrowMoveDemo/App.vue'),
101
+ },
102
+ {
103
+ name: '精灵图',
104
+ path: '/feature/SpriteImage',
105
+ component: () => import('jsview-vue-samples/SpriteImage/App.vue'),
106
+ },
107
+ {
108
+ name: '文字滚动(标题跑马灯)',
109
+ path: '/feature/Marquee',
110
+ component: () => import('jsview-vue-samples/Marquee/App.vue'),
111
+ },
112
+ {
113
+ name: '文字输入',
114
+ path: '/feature/Input',
115
+ component: () => import('jsview-vue-samples/Input/App.vue'),
116
+ },
117
+ {
118
+ name: '拼图demo',
119
+ path: '/feature/MaskClip',
120
+ component: () => import('jsview-vue-samples/MaskClip/App.vue'),
121
+ },
122
+ {
123
+ name: 'SoundPool',
124
+ path: '/feature/SoundPool',
125
+ component: () => import('jsview-vue-samples/SoundPool/App.vue'),
126
+ },
127
+ {
128
+ name: 'TextureAnimation',
129
+ path: '/feature/TextureAnimation',
130
+ component: () => import('jsview-vue-samples/TextureAnimation/App.vue'),
131
+ },
132
+ {
133
+ name: '焦点框旋转光效果',
134
+ path: '/feature/TextureAnimation2',
135
+ component: () => import('jsview-vue-samples/TextureAnimation/App2.vue'),
136
+ },
137
+ {
138
+ name: '公祭日黑白效果',
139
+ path: '/feature/FilterDemo',
140
+ component: () => import('jsview-vue-samples/FilterDemo/App.vue'),
141
+ },
142
+ {
143
+ name: '预加载',
144
+ path: '/feature/Preload',
145
+ component: () => import('jsview-vue-samples/Preload/App.vue'),
146
+ },
147
+ {
148
+ name: '图片缩小算法',
149
+ path: '/feature/ScaleDownNeon',
150
+ component: () => import('jsview-vue-samples/ScaleDownNeon/App.vue'),
151
+ },
152
+ // {
153
+ // name: '碰撞检测',
154
+ // path: '/feature/Collision',
155
+ // component: () => import('jsview-vue-samples/Collision/App'),
156
+ // },
157
+ // {
158
+ // name: '碰撞即停',
159
+ // path: '/feature/ImpactStop',
160
+ // component: () => import('jsview-vue-samples/ImpactStop/App'),
161
+ // },
162
+
163
+ // MetroWidget示例
164
+ {
165
+ name: '简单示例',
166
+ path: '/metroWidget/Simple',
167
+ component: () => import('jsview-vue-samples/MetroWidgetDemos/Simple/App.vue'),
168
+ },
169
+ {
170
+ name: '嵌套示例',
171
+ path: '/metroWidget/Advanced',
172
+ component: () => import('jsview-vue-samples/MetroWidgetDemos/Advanced/App.vue'),
173
+ },
174
+ {
175
+ name: '性能测试',
176
+ path: '/metroWidget/PerformanceTest',
177
+ component: () =>
178
+ import('jsview-vue-samples/MetroWidgetDemos/PerformanceTest/App.vue'),
179
+ },
180
+ {
181
+ name: '乒乓模式',
182
+ path: '/metroWidget/PingPong',
183
+ component: () =>
184
+ import('jsview-vue-samples/MetroWidgetDemos/PingPong/App.vue'),
185
+ },
186
+ ];
187
+
188
+ const router = createRouter({
189
+ // 浏览器调试和盒子上都可以使用类WebHashHistory的jsvCreateHashHistory(推荐)
190
+ // 或 createMemoryHistory;
191
+ // createWebHashHistory只能用于浏览器调试,盒子不支持
192
+ history: jsvCreateHashHistory(),
193
+ routes: routeList,
194
+ });
195
+
196
+ export { router, routeList };
@@ -0,0 +1,195 @@
1
+ <script>
2
+ import { jJsvRuntimeBridge, EdgeDirection } from "jsview";
3
+ import TabFrame from "../components/TabFrame.vue";
4
+ import BodyFrame from "../components/BodyFrame.vue";
5
+ import Dialog from "../components/Dialog.vue";
6
+ import { routeList } from "../router.js";
7
+
8
+ const colorTemplete = ["#89BEB2", "#C9BA83", "#DED38C", "#DE9C53"];
9
+
10
+ const featureData = [];
11
+ const metroWidgetData = [];
12
+ for (let item of routeList) {
13
+ let obj = {
14
+ name: item.name,
15
+ path: item.path,
16
+ width: 300,
17
+ height: 100,
18
+ focusable: true,
19
+ };
20
+ if (item.path.indexOf("feature") >= 0) {
21
+ obj.backgroundColor = colorTemplete[featureData.length % 4];
22
+ featureData.push(obj);
23
+ } else if (item.path.indexOf("metroWidget") >= 0) {
24
+ obj.backgroundColor = colorTemplete[metroWidgetData.length % 4];
25
+ metroWidgetData.push(obj);
26
+ }
27
+ }
28
+ const dataList = [featureData, metroWidgetData];
29
+
30
+ export default {
31
+ components: {
32
+ TabFrame,
33
+ Dialog,
34
+ BodyFrame,
35
+ },
36
+ data() {
37
+ return {
38
+ showExitDialog: false,
39
+ contentData: dataList[0],
40
+ tabId: 0,
41
+ preFocusName: "",
42
+ curFocusName: "",
43
+ };
44
+ },
45
+ setup() {
46
+ return {
47
+ name: "/home",
48
+ };
49
+ },
50
+ computed: {
51
+ address() {
52
+ return window.localStorage.href;
53
+ },
54
+ },
55
+ methods: {
56
+ onFocus() {
57
+ this.changeFocus(this.name + "/bodyFrame");
58
+ },
59
+ onKeyDown(ev) {
60
+ // 处理返回键
61
+ if (
62
+ ev.keyCode == 8 || // Backspace
63
+ ev.keyCode == 27 || // Escape
64
+ ev.keyCode == 10000 // 盒子返回键
65
+ ) {
66
+ this.showExitDialog = !this.showExitDialog;
67
+ if (!this.showExitDialog) {
68
+ this.changeFocus(this.preFocusName);
69
+ } else {
70
+ this.preFocusName = this.curFocusName;
71
+ this.curFocusName = this.name + "/exitDialog";
72
+ }
73
+ }
74
+ return true;
75
+ },
76
+ changeFocus(name) {
77
+ this.preFocusName = this.curFocusName;
78
+ this.curFocusName = name;
79
+ this.$refs.rootNode.findBlockByName(name).requestFocus();
80
+ },
81
+ onTabEdge(edgeInfo) {
82
+ if (edgeInfo.direction === EdgeDirection.bottom) {
83
+ this.changeFocus(this.name + "/bodyFrame");
84
+ }
85
+ },
86
+ onContentEdge(edgeInfo) {
87
+ if (edgeInfo.direction === EdgeDirection.top) {
88
+ this.changeFocus(this.name + "/tabFrame");
89
+ }
90
+ },
91
+ tabItemFocus(data) {
92
+ if (data.id != this.tabId) {
93
+ this.tabId = data.id;
94
+ this.contentData = dataList[this.tabId];
95
+ }
96
+ },
97
+ onDialogAction(msg) {
98
+ this.showExitDialog = false;
99
+ this.changeFocus(this.preFocusName);
100
+ switch (msg) {
101
+ case "ok":
102
+ jJsvRuntimeBridge.closePage();
103
+ // if (!window.JsView) {
104
+ // // 浏览器调试
105
+ // window.location.href = "about:blank";
106
+ // }
107
+ break;
108
+ case "back":
109
+ case "cancel":
110
+ break;
111
+ }
112
+ },
113
+ },
114
+ created() {
115
+ if (typeof localStorage.curTab !== "undefined") {
116
+ this.tabId = parseInt(localStorage.curTab);
117
+ }
118
+ localStorage.curTab = 0;
119
+ this.contentData = dataList[this.tabId];
120
+ },
121
+ mounted() {},
122
+ beforeUnmount() {},
123
+ };
124
+ </script>
125
+
126
+ <template>
127
+ <div class="rootSize">
128
+ <div class="address">
129
+ {{ address }}
130
+ </div>
131
+ <div class="logo">JsView-Vue3(Vite3)</div>
132
+
133
+ <jsv-focus-block
134
+ autoFocus
135
+ ref="rootNode"
136
+ :onAction="{
137
+ onKeyDown: onKeyDown,
138
+ onFocus: onFocus,
139
+ }"
140
+ >
141
+ <div :style="{ left: 10 }">
142
+ <tab-frame
143
+ :name="name + '/tabFrame'"
144
+ :onEdge="onTabEdge"
145
+ :itemFocus="tabItemFocus"
146
+ :initId="tabId"
147
+ />
148
+ </div>
149
+
150
+ <div
151
+ :style="{
152
+ left: 10,
153
+ top: 100,
154
+ }"
155
+ >
156
+ <body-frame
157
+ :data="contentData"
158
+ :name="name + '/bodyFrame'"
159
+ :onEdge="onContentEdge"
160
+ :tabId="tabId"
161
+ />
162
+ </div>
163
+
164
+ <Dialog
165
+ v-if="showExitDialog"
166
+ :name="name + '/exitDialog'"
167
+ :onAction="onDialogAction"
168
+ ></Dialog>
169
+ </jsv-focus-block>
170
+ </div>
171
+ </template>
172
+
173
+ <style scoped>
174
+ .rootSize {
175
+ width: 1280;
176
+ height: 720;
177
+ background-color: #334c4c;
178
+ }
179
+
180
+ .address {
181
+ width: 1280;
182
+ height: 30;
183
+ color: #ffffff;
184
+ font-size: 20px;
185
+ }
186
+
187
+ .logo {
188
+ width: 1280;
189
+ height: 30;
190
+ color: #00ff00;
191
+ font-size: 20px;
192
+ font-weight: bold;
193
+ text-align: right;
194
+ }
195
+ </style>
@@ -0,0 +1,58 @@
1
+ <script setup>
2
+ const item_url =
3
+ "http://oss.image.51vtv.cn/homepage/20210209/27bda620942566673ab449a3ef765321.png";
4
+ </script>
5
+
6
+ <template>
7
+ <div
8
+ className="blockStyle"
9
+ :style="{
10
+ backgroundColor: '#0000FF',
11
+ animation: 'opacityDemo_CompositeNoOpacity 3s infinite',
12
+ }"
13
+ />
14
+ <img
15
+ className="blockStyle"
16
+ :style="{
17
+ objectFit: 'contain',
18
+ animation: 'opacityDemo_CompositeOpacity 3s infinite',
19
+ }"
20
+ :src="item_url"
21
+ />
22
+ </template>
23
+
24
+ <style scoped>
25
+ .blockStyle {
26
+ top: 50;
27
+ left: 50;
28
+ width: 150;
29
+ height: 150;
30
+ }
31
+
32
+ .picTitleTextClass {
33
+ font-size: 25;
34
+ height: 68;
35
+ line-height: 34;
36
+ color: "#000000";
37
+ text-align: "center";
38
+ }
39
+
40
+ @keyframes opacityDemo_CompositeOpacity {
41
+ from {
42
+ transform: translate3d(50%, 30px, 0) scale3d(1.5, 1.5, 1)
43
+ rotate3d(1.5, 1, 0, 90deg) skew(30deg, 45deg);
44
+ opacity: 0.1;
45
+ }
46
+ to {
47
+ }
48
+ }
49
+
50
+ @keyframes opacityDemo_CompositeNoOpacity {
51
+ from {
52
+ transform: translate3d(50%, 30px, 0) scale3d(1.5, 1.5, 1)
53
+ rotate3d(1.5, 1, 0, 90deg) skew(30deg, 45deg);
54
+ }
55
+ to {
56
+ }
57
+ }
58
+ </style>