@shijiu/jsview-vue 1.9.731 → 1.9.759

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 (217) hide show
  1. package/index.d.ts +4 -1
  2. package/index.js +4 -1
  3. package/package.json +5 -16
  4. package/samples/AnimPicture/App.vue +0 -207
  5. package/samples/AnimPicture/assets/animated_webp.webp +0 -0
  6. package/samples/AnimPicture/assets/ball_3.webp +0 -0
  7. package/samples/AnimPicture/assets/girl_run.gif +0 -0
  8. package/samples/AnimPicture/assets/quan.webp +0 -0
  9. package/samples/Basic/App.vue +0 -134
  10. package/samples/Basic/assets/border.png +0 -0
  11. package/samples/Basic/assets/border2.png +0 -0
  12. package/samples/Basic/assets/icon.png +0 -0
  13. package/samples/Basic/assets/test.jpg +0 -0
  14. package/samples/Basic/components/ContentBlock.vue +0 -38
  15. package/samples/Basic/components/FontStyle.css +0 -16
  16. package/samples/Basic/components/anim/AnimGroup.vue +0 -66
  17. package/samples/Basic/components/anim/AnimKeyframeBasic.vue +0 -119
  18. package/samples/Basic/components/anim/AnimKeyframeComposite.vue +0 -52
  19. package/samples/Basic/components/anim/AnimTransition.vue +0 -157
  20. package/samples/Basic/components/div/DivBackground.vue +0 -44
  21. package/samples/Basic/components/div/DivClip.vue +0 -159
  22. package/samples/Basic/components/div/DivCssScoped.vue +0 -20
  23. package/samples/Basic/components/div/DivCssVar.vue +0 -53
  24. package/samples/Basic/components/div/DivGroup1.vue +0 -47
  25. package/samples/Basic/components/div/DivGroup2.vue +0 -65
  26. package/samples/Basic/components/div/DivLayout.vue +0 -70
  27. package/samples/Basic/components/div/DivRadius.vue +0 -65
  28. package/samples/Basic/components/div/DivTransform.vue +0 -32
  29. package/samples/Basic/components/img/ImageGroup.vue +0 -31
  30. package/samples/Basic/components/img/ImgLayout.vue +0 -41
  31. package/samples/Basic/components/panel/Panel1.vue +0 -55
  32. package/samples/Basic/components/panel/Panel2.vue +0 -31
  33. package/samples/Basic/components/panel/TitleBar.vue +0 -29
  34. package/samples/Basic/components/text/TextAlign.vue +0 -66
  35. package/samples/Basic/components/text/TextEmoji.vue +0 -26
  36. package/samples/Basic/components/text/TextFontStyle.vue +0 -89
  37. package/samples/Basic/components/text/TextGroup1.vue +0 -49
  38. package/samples/Basic/components/text/TextGroup2.vue +0 -28
  39. package/samples/Basic/components/text/TextOverflow.vue +0 -110
  40. package/samples/BasicFocusControl/App.vue +0 -104
  41. package/samples/BasicFocusControl/components/BaseBlock.vue +0 -50
  42. package/samples/BasicFocusControl/components/MainArea.vue +0 -83
  43. package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +0 -17
  44. package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +0 -27
  45. package/samples/BasicFocusControl/components/SideBar.vue +0 -58
  46. package/samples/BasicFocusControl/components/SideBarBlock.vue +0 -27
  47. package/samples/Collision/App.vue +0 -452
  48. package/samples/ColorSpace/App.vue +0 -126
  49. package/samples/DemoHomepage/App.vue +0 -27
  50. package/samples/DemoHomepage/components/BodyFrame.vue +0 -95
  51. package/samples/DemoHomepage/components/Dialog.vue +0 -94
  52. package/samples/DemoHomepage/components/Item.vue +0 -77
  53. package/samples/DemoHomepage/components/TabFrame.vue +0 -85
  54. package/samples/DemoHomepage/router.js +0 -196
  55. package/samples/DemoHomepage/views/Homepage.vue +0 -195
  56. package/samples/FilterDemo/AnimatePic.vue +0 -58
  57. package/samples/FilterDemo/App.vue +0 -159
  58. package/samples/FilterDemo/VideoLayer.vue +0 -62
  59. package/samples/FlipCard/App.vue +0 -71
  60. package/samples/FlipCard/FlipCard.vue +0 -118
  61. package/samples/FlipCard/assets/blue_egg.png +0 -0
  62. package/samples/FlipCard/assets/red_egg.png +0 -0
  63. package/samples/FlipCard/data.js +0 -13
  64. package/samples/GridDemo/App.vue +0 -215
  65. package/samples/GridDemo/ButtonBlock.vue +0 -112
  66. package/samples/GridDemo/FocusItem.vue +0 -37
  67. package/samples/GridDemo/Item.vue +0 -93
  68. package/samples/HashHistory/App.vue +0 -115
  69. package/samples/HashHistory/components/HorizontalButtonList.vue +0 -91
  70. package/samples/HashHistory/components/Item.vue +0 -60
  71. package/samples/HashHistory/router.js +0 -41
  72. package/samples/HashHistory/views/MainPage.vue +0 -57
  73. package/samples/HashHistory/views/SubPage.vue +0 -66
  74. package/samples/ImpactStop/App.vue +0 -435
  75. package/samples/Input/App.vue +0 -164
  76. package/samples/Input/FullKeyboard.vue +0 -87
  77. package/samples/Input/InputPanel.vue +0 -131
  78. package/samples/Input/KeyboardItem.vue +0 -58
  79. package/samples/LongImage/App.vue +0 -80
  80. package/samples/LongImage/Button.vue +0 -58
  81. package/samples/LongImage/ButtonItem.vue +0 -44
  82. package/samples/LongImage/LongImageScroll.vue +0 -92
  83. package/samples/LongImage/Scroll.vue +0 -14
  84. package/samples/LongImage/assets/1280x7200.jpg +0 -0
  85. package/samples/LongText/App.vue +0 -96
  86. package/samples/LongText/Button.vue +0 -51
  87. package/samples/LongText/ButtonItem.vue +0 -44
  88. package/samples/LongText/LongTextScroll.vue +0 -192
  89. package/samples/LongText/Scroll.vue +0 -14
  90. package/samples/Marquee/App.vue +0 -247
  91. package/samples/Marquee/longText.js +0 -14
  92. package/samples/MaskClip/App.vue +0 -122
  93. package/samples/MaskClip/images/mask-025/config.json +0 -29
  94. package/samples/MaskClip/images/mask-025/res/1.png +0 -0
  95. package/samples/MaskClip/images/mask-025/res/2.png +0 -0
  96. package/samples/MaskClip/images/mask-025/res/3.png +0 -0
  97. package/samples/MaskClip/images/mask-025/res/4.png +0 -0
  98. package/samples/MaskClip/images/mask-025/res/icon.png +0 -0
  99. package/samples/MaskClip/images/mask-025/res/stroke.png +0 -0
  100. package/samples/MaskClip/images/php.jpg +0 -0
  101. package/samples/MetroWidgetDemos/Advanced/App.vue +0 -46
  102. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +0 -90
  103. package/samples/MetroWidgetDemos/Advanced/Buttons.vue +0 -70
  104. package/samples/MetroWidgetDemos/Advanced/Mixed.vue +0 -77
  105. package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +0 -83
  106. package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +0 -89
  107. package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +0 -116
  108. package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  109. package/samples/MetroWidgetDemos/Item.vue +0 -85
  110. package/samples/MetroWidgetDemos/PerformanceTest/App.vue +0 -210
  111. package/samples/MetroWidgetDemos/PerformanceTest/Item.vue +0 -90
  112. package/samples/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
  113. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
  114. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
  115. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
  116. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
  117. package/samples/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
  118. package/samples/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
  119. package/samples/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
  120. package/samples/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
  121. package/samples/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
  122. package/samples/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
  123. package/samples/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
  124. package/samples/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
  125. package/samples/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
  126. package/samples/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
  127. package/samples/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
  128. package/samples/MetroWidgetDemos/PerformanceTest/border.png +0 -0
  129. package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +0 -386
  130. package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +0 -129
  131. package/samples/MetroWidgetDemos/PerformanceTest/data.js +0 -45
  132. package/samples/MetroWidgetDemos/PingPong/App.vue +0 -135
  133. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +0 -73
  134. package/samples/MetroWidgetDemos/PingPong/AppTab.vue +0 -62
  135. package/samples/MetroWidgetDemos/PingPong/TabItem.vue +0 -84
  136. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +0 -214
  137. package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +0 -75
  138. package/samples/MetroWidgetDemos/Simple/App.vue +0 -45
  139. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +0 -111
  140. package/samples/MetroWidgetDemos/WidgetItem.vue +0 -89
  141. package/samples/MetroWidgetDemos/data.js +0 -205
  142. package/samples/NinePatchDemo/App.vue +0 -145
  143. package/samples/NinePatchDemo/Item.vue +0 -69
  144. package/samples/NinePatchDemo/assets/border.png +0 -0
  145. package/samples/Preload/App.vue +0 -135
  146. package/samples/Preload/Item.vue +0 -32
  147. package/samples/Preload/data.js +0 -23
  148. package/samples/Preload/images/awesomeface.png +0 -0
  149. package/samples/Preload/images/cat.jpg +0 -0
  150. package/samples/Preload/images/rank.png +0 -0
  151. package/samples/Preload/images/rank_focus.png +0 -0
  152. package/samples/Preload/images/rule.png +0 -0
  153. package/samples/Preload/images/rule_focus.png +0 -0
  154. package/samples/Preload/images/start.png +0 -0
  155. package/samples/Preload/images/start_focus.png +0 -0
  156. package/samples/QrcodeDemo/App.vue +0 -68
  157. package/samples/ScaleDownNeon/App.vue +0 -107
  158. package/samples/SoundPool/App.vue +0 -134
  159. package/samples/SoundPool/bgmusic.mp3 +0 -0
  160. package/samples/SoundPool/coin.mp3 +0 -0
  161. package/samples/SoundPool/jump.mp3 +0 -0
  162. package/samples/SoundPool/lose.mp3 +0 -0
  163. package/samples/SoundPool/run.mp3 +0 -0
  164. package/samples/SprayView/App.vue +0 -272
  165. package/samples/SprayView/assets/snow.png +0 -0
  166. package/samples/SpriteImage/App.vue +0 -173
  167. package/samples/SpriteImage/images/cat_run.png +0 -0
  168. package/samples/SpriteImage/images/egg_break.json +0 -116
  169. package/samples/SpriteImage/images/egg_break.png +0 -0
  170. package/samples/SpriteImage/images/sprite.png +0 -0
  171. package/samples/TextBox/App.vue +0 -91
  172. package/samples/TextBox/RenderCenter.vue +0 -133
  173. package/samples/TextBox/RenderLeft.vue +0 -138
  174. package/samples/TextBox/RenderOneLine.vue +0 -101
  175. package/samples/TextBox/RenderRight.vue +0 -131
  176. package/samples/TextShadowDemo/App.vue +0 -91
  177. package/samples/TextureAnimation/App.vue +0 -336
  178. package/samples/TextureAnimation/App2.vue +0 -111
  179. package/samples/TextureAnimation/assets/blackWhiteGrid.png +0 -0
  180. package/samples/TextureAnimation/assets/light.png +0 -0
  181. package/samples/TextureAnimation/assets/light2.png +0 -0
  182. package/samples/TextureAnimation/assets/mask.png +0 -0
  183. package/samples/TextureAnimation/assets/php.jpg +0 -0
  184. package/samples/TextureAnimation/assets/php2.png +0 -0
  185. package/samples/TextureAnimation/assets/swipLight.png +0 -0
  186. package/samples/TextureSize/App.vue +0 -132
  187. package/samples/TextureSize/bmpDemo.bmp +0 -0
  188. package/samples/TextureSize/jpegDemo.jpeg +0 -0
  189. package/samples/TextureSize/jpgDemo.jpg +0 -0
  190. package/samples/TextureSize/pngDemo.png +0 -0
  191. package/samples/TextureSize/pngNoAlphaDemo.png +0 -0
  192. package/samples/ThrowMoveDemo/AccelerateDemo.vue +0 -116
  193. package/samples/ThrowMoveDemo/App.vue +0 -114
  194. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +0 -115
  195. package/samples/ThrowMoveDemo/TargetDemo.vue +0 -116
  196. package/samples/ThrowMoveDemo/UDParabolicDemo.vue +0 -121
  197. package/samples/TouchSample/App.vue +0 -136
  198. package/samples/TouchSample/Item.vue +0 -103
  199. package/samples/TouchSample/MetroWidgetHorizontal.vue +0 -144
  200. package/samples/TouchSample/MetroWidgetVertical.vue +0 -144
  201. package/samples/TouchSample/TouchContainerHorizontal.vue +0 -160
  202. package/samples/TouchSample/TouchContainerVertical.vue +0 -160
  203. package/samples/TouchSample/data.js +0 -81
  204. package/samples/TransitPage/App.vue +0 -29
  205. package/samples/VideoDemo/App.vue +0 -121
  206. package/samples/VideoDemo/components/Button.vue +0 -58
  207. package/samples/VideoDemo/components/Controllor.vue +0 -197
  208. package/samples/VideoDemo/components/VideoFrame.vue +0 -140
  209. package/samples/VisibleSensorDemo/App.vue +0 -234
  210. package/samples/assets/bmpDemo.bmp +0 -0
  211. package/samples/assets/jpegDemo.jpeg +0 -0
  212. package/samples/assets/pngDemo.png +0 -0
  213. package/samples/assets/pngNoAlphaDemo.png +0 -0
  214. package/samples/assets/webpDemo.webp +0 -0
  215. package/tsconfig.json +0 -47
  216. package/utils/index.d.ts +0 -3
  217. package/utils/index.js +0 -10
@@ -1,94 +0,0 @@
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>
@@ -1,77 +0,0 @@
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>
@@ -1,85 +0,0 @@
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>
@@ -1,196 +0,0 @@
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/samples/Basic/App.vue"),
15
- },
16
- {
17
- name: "可视化变化通知",
18
- path: "/feature/VisibleSensorDemo",
19
- component: () => import("jsview/samples/VisibleSensorDemo/App.vue"),
20
- },
21
- {
22
- name: "快速刷新的表格布局组件",
23
- path: "/feature/GridDemo",
24
- component: () => import("jsview/samples/GridDemo/App.vue"),
25
- },
26
- {
27
- name: ".9图焦点框漂移",
28
- path: "/feature/NinePatchDemo",
29
- component: () => import("jsview/samples/NinePatchDemo/App.vue"),
30
- },
31
- {
32
- name: "视频",
33
- path: "/feature/VideoDemo",
34
- component: () => import("jsview/samples/VideoDemo/App.vue"),
35
- },
36
- {
37
- name: "焦点切换demo",
38
- path: "/feature/BasicFocusControl",
39
- component: () => import("jsview/samples/BasicFocusControl/App.vue"),
40
- },
41
- {
42
- name: "Hash方式路由切换",
43
- path: "/feature/HashHistory",
44
- props: { routePath: "/feature/HashHistory" },
45
- component: () => import("jsview/samples/HashHistory/App.vue"),
46
- },
47
- {
48
- name: "翻牌游戏",
49
- path: "/feature/FlipCard",
50
- component: () => import("jsview/samples/FlipCard/App.vue"),
51
- },
52
- {
53
- name: "设置颜色空间",
54
- path: "/feature/ColorSpace",
55
- component: () => import("jsview/samples/ColorSpace/App.vue"),
56
- },
57
- {
58
- name: "制定Texture尺寸",
59
- path: "/feature/TextureSize",
60
- component: () => import("jsview/samples/TextureSize/App.vue"),
61
- },
62
- {
63
- name: "动图",
64
- path: "/feature/AnimPicture",
65
- component: () => import("jsview/samples/AnimPicture/App.vue"),
66
- },
67
- {
68
- name: "粒子效果",
69
- path: "/feature/SprayView",
70
- component: () => import("jsview/samples/SprayView/App.vue"),
71
- },
72
- {
73
- name: "长文字",
74
- path: "/feature/LongText",
75
- component: () => import("jsview/samples/LongText/App.vue"),
76
- },
77
- {
78
- name: "长图片",
79
- path: "/feature/LongImage",
80
- component: () => import("jsview/samples/LongImage/App.vue"),
81
- },
82
- {
83
- name: "二维码",
84
- path: "/feature/QrcodeDemo",
85
- component: () => import("jsview/samples/QrcodeDemo/App.vue"),
86
- },
87
- {
88
- name: "文字阴影",
89
- path: "/feature/TextShadowDemo",
90
- component: () => import("jsview/samples/TextShadowDemo/App.vue"),
91
- },
92
- {
93
- name: "多行文字区域内对齐",
94
- path: "/feature/TextBox",
95
- component: () => import("jsview/samples/TextBox/App.vue"),
96
- },
97
- {
98
- name: "抛物运动写法样例",
99
- path: "/feature/ThrowMoveDemo",
100
- component: () => import("jsview/samples/ThrowMoveDemo/App.vue"),
101
- },
102
- {
103
- name: "精灵图",
104
- path: "/feature/SpriteImage",
105
- component: () => import("jsview/samples/SpriteImage/App.vue"),
106
- },
107
- {
108
- name: "文字滚动(标题跑马灯)",
109
- path: "/feature/Marquee",
110
- component: () => import("jsview/samples/Marquee/App.vue"),
111
- },
112
- {
113
- name: "文字输入",
114
- path: "/feature/Input",
115
- component: () => import("jsview/samples/Input/App.vue"),
116
- },
117
- {
118
- name: "拼图demo",
119
- path: "/feature/MaskClip",
120
- component: () => import("jsview/samples/MaskClip/App.vue"),
121
- },
122
- {
123
- name: "SoundPool",
124
- path: "/feature/SoundPool",
125
- component: () => import("jsview/samples/SoundPool/App.vue"),
126
- },
127
- {
128
- name: "TextureAnimation",
129
- path: "/feature/TextureAnimation",
130
- component: () => import("jsview/samples/TextureAnimation/App.vue"),
131
- },
132
- {
133
- name: "焦点框旋转光效果",
134
- path: "/feature/TextureAnimation2",
135
- component: () => import("jsview/samples/TextureAnimation/App2.vue"),
136
- },
137
- {
138
- name: "公祭日黑白效果",
139
- path: "/feature/FilterDemo",
140
- component: () => import("jsview/samples/FilterDemo/App.vue"),
141
- },
142
- {
143
- name: "预加载",
144
- path: "/feature/Preload",
145
- component: () => import("jsview/samples/Preload/App.vue"),
146
- },
147
- {
148
- name: "图片缩小算法",
149
- path: "/feature/ScaleDownNeon",
150
- component: () => import("jsview/samples/ScaleDownNeon/App.vue"),
151
- },
152
- // {
153
- // name: "碰撞检测",
154
- // path: "/feature/Collision",
155
- // component: () => import("jsview/samples/Collision/App"),
156
- // },
157
- // {
158
- // name: "碰撞即停",
159
- // path: "/feature/ImpactStop",
160
- // component: () => import("jsview/samples/ImpactStop/App"),
161
- // },
162
-
163
- // MetroWidget示例
164
- {
165
- name: "简单示例",
166
- path: "/metroWidget/Simple",
167
- component: () => import("jsview/samples/MetroWidgetDemos/Simple/App.vue"),
168
- },
169
- {
170
- name: "嵌套示例",
171
- path: "/metroWidget/Advanced",
172
- component: () => import("jsview/samples/MetroWidgetDemos/Advanced/App.vue"),
173
- },
174
- {
175
- name: "性能测试",
176
- path: "/metroWidget/PerformanceTest",
177
- component: () =>
178
- import("jsview/samples/MetroWidgetDemos/PerformanceTest/App.vue"),
179
- },
180
- {
181
- name: "乒乓模式",
182
- path: "/metroWidget/PingPong",
183
- component: () =>
184
- import("jsview/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 };
@@ -1,195 +0,0 @@
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>
@@ -1,58 +0,0 @@
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>