@jx3box/jx3box-vue3-ui 0.0.3

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 (284) hide show
  1. package/.editorconfig +13 -0
  2. package/.env +1 -0
  3. package/.eslintrc +9 -0
  4. package/.prettierrc +21 -0
  5. package/README.md +1 -0
  6. package/assets/css/admin.less +83 -0
  7. package/assets/css/author.less +86 -0
  8. package/assets/css/bottom.less +21 -0
  9. package/assets/css/box.less +180 -0
  10. package/assets/css/box2.less +150 -0
  11. package/assets/css/breadcrumb.less +155 -0
  12. package/assets/css/client-by.less +33 -0
  13. package/assets/css/cms-single.less +55 -0
  14. package/assets/css/crumb.less +17 -0
  15. package/assets/css/down.less +16 -0
  16. package/assets/css/footer.less +72 -0
  17. package/assets/css/github-repo.less +87 -0
  18. package/assets/css/header.less +532 -0
  19. package/assets/css/icon.less +10 -0
  20. package/assets/css/left-sidebar.less +137 -0
  21. package/assets/css/like.less +80 -0
  22. package/assets/css/like2.less +19 -0
  23. package/assets/css/main.less +67 -0
  24. package/assets/css/mark-by.less +97 -0
  25. package/assets/css/mark.less +34 -0
  26. package/assets/css/menu-by.less +9 -0
  27. package/assets/css/mixin.less +62 -0
  28. package/assets/css/order-by.less +86 -0
  29. package/assets/css/print.less +26 -0
  30. package/assets/css/qrcode.less +70 -0
  31. package/assets/css/right-msg.less +26 -0
  32. package/assets/css/right-sidebar.less +106 -0
  33. package/assets/css/share2.less +99 -0
  34. package/assets/css/sharing.less +26 -0
  35. package/assets/css/tag-by.less +86 -0
  36. package/assets/css/thx.less +213 -0
  37. package/assets/css/var.less +4 -0
  38. package/assets/css/wiki-comments.less +150 -0
  39. package/assets/css/wiki-panel.less +175 -0
  40. package/assets/css/wiki-revisions.less +62 -0
  41. package/assets/data/box.json +184 -0
  42. package/assets/data/box2.json +606 -0
  43. package/assets/data/game_font.json +242 -0
  44. package/assets/data/nav.json +12 -0
  45. package/assets/data/panel.json +27 -0
  46. package/assets/data/zlp.json +5 -0
  47. package/assets/img/author/bilibili.png +0 -0
  48. package/assets/img/author/bilibili.svg +1 -0
  49. package/assets/img/author/chat.png +0 -0
  50. package/assets/img/author/douyu.png +0 -0
  51. package/assets/img/author/douyu.svg +1 -0
  52. package/assets/img/author/github.svg +1 -0
  53. package/assets/img/author/huya.png +0 -0
  54. package/assets/img/author/huya.svg +1 -0
  55. package/assets/img/author/msg.svg +55 -0
  56. package/assets/img/author/tuilan.png +0 -0
  57. package/assets/img/author/weibo.svg +70 -0
  58. package/assets/img/bread/menu.svg +1 -0
  59. package/assets/img/footer/china.svg +1 -0
  60. package/assets/img/header/add.svg +1 -0
  61. package/assets/img/header/bell.svg +1 -0
  62. package/assets/img/header/coin.svg +15 -0
  63. package/assets/img/header/edit.svg +1 -0
  64. package/assets/img/header/logo.svg +5 -0
  65. package/assets/img/header/manage.svg +1 -0
  66. package/assets/img/header/msg.svg +1 -0
  67. package/assets/img/header/search-key-slash.svg +5 -0
  68. package/assets/img/header/send.svg +56 -0
  69. package/assets/img/header/vip.svg +1 -0
  70. package/assets/img/jx3.svg +11 -0
  71. package/assets/img/leftsidebar/arrow.svg +64 -0
  72. package/assets/img/leftsidebar/close.svg +49 -0
  73. package/assets/img/leftsidebar/fans.svg +1 -0
  74. package/assets/img/leftsidebar/medal.svg +1 -0
  75. package/assets/img/leftsidebar/more.svg +50 -0
  76. package/assets/img/leftsidebar/open.svg +51 -0
  77. package/assets/img/leftsidebar/post.svg +46 -0
  78. package/assets/img/leftsidebar/team.svg +1 -0
  79. package/assets/img/leftsidebar/united.svg +1 -0
  80. package/assets/img/list/post.svg +1 -0
  81. package/assets/img/price/jin.png +0 -0
  82. package/assets/img/price/tong.png +0 -0
  83. package/assets/img/price/yin.png +0 -0
  84. package/assets/img/price/zhuan.png +0 -0
  85. package/assets/img/rightsidebar/ac.svg +1 -0
  86. package/assets/img/rightsidebar/github.svg +1 -0
  87. package/assets/img/rightsidebar/repo.svg +1 -0
  88. package/assets/img/single/author.svg +1 -0
  89. package/assets/img/single/lock.svg +1 -0
  90. package/assets/img/single/modate.svg +24 -0
  91. package/assets/img/single/podate.svg +23 -0
  92. package/assets/img/widget/admin_gift.svg +10 -0
  93. package/assets/img/widget/gift.svg +1 -0
  94. package/assets/img/widget/heart.svg +17 -0
  95. package/assets/img/widget/heart1.svg +1 -0
  96. package/assets/img/widget/heart2.svg +11 -0
  97. package/assets/img/widget/heart3.svg +37 -0
  98. package/assets/img/widget/like.svg +1 -0
  99. package/assets/img/widget/like2.svg +1 -0
  100. package/assets/img/widget/like3.svg +14 -0
  101. package/assets/img/widget/qq.svg +1 -0
  102. package/assets/img/widget/qr-code.svg +1 -0
  103. package/assets/img/widget/qzone.svg +1 -0
  104. package/assets/img/widget/share-link.png +0 -0
  105. package/assets/img/widget/share.svg +13 -0
  106. package/assets/img/widget/share2.svg +19 -0
  107. package/assets/img/widget/star.svg +9 -0
  108. package/assets/img/widget/tieba.svg +1 -0
  109. package/assets/img/widget/unstar.svg +21 -0
  110. package/assets/img/widget/web_heart_animation.png +0 -0
  111. package/assets/img/widget/weibo.svg +1 -0
  112. package/assets/img/widget/weixin.svg +1 -0
  113. package/assets/js/app.js +7 -0
  114. package/babel.config.js +3 -0
  115. package/jsconfig.json +17 -0
  116. package/package.json +71 -0
  117. package/public/favicon.ico +0 -0
  118. package/public/image/box/bbs.svg +87 -0
  119. package/public/image/box/bbs__.svg +101 -0
  120. package/public/image/box/bbs_on.svg +88 -0
  121. package/public/image/box/bps.svg +10 -0
  122. package/public/image/box/bps_on.svg +10 -0
  123. package/public/image/box/cj.svg +1 -0
  124. package/public/image/box/cj_on.svg +1 -0
  125. package/public/image/box/collection.svg +1 -0
  126. package/public/image/box/collection_on.svg +1 -0
  127. package/public/image/box/database.svg +22 -0
  128. package/public/image/box/database_on.svg +22 -0
  129. package/public/image/box/dbm.svg +21 -0
  130. package/public/image/box/dbm_on.svg +21 -0
  131. package/public/image/box/exam.svg +35 -0
  132. package/public/image/box/exam_on.svg +35 -0
  133. package/public/image/box/facedata.svg +21 -0
  134. package/public/image/box/facedata_on.svg +21 -0
  135. package/public/image/box/fb.svg +18 -0
  136. package/public/image/box/fb_on.svg +18 -0
  137. package/public/image/box/fbdata.svg +15 -0
  138. package/public/image/box/fbdata_on.svg +15 -0
  139. package/public/image/box/fbdrop.svg +26 -0
  140. package/public/image/box/fbdrop_on.svg +26 -0
  141. package/public/image/box/fbgem.svg +39 -0
  142. package/public/image/box/fbgem_on.svg +39 -0
  143. package/public/image/box/flower.svg +28 -0
  144. package/public/image/box/flower_on.svg +28 -0
  145. package/public/image/box/furniture.svg +32 -0
  146. package/public/image/box/furniture_on.svg +32 -0
  147. package/public/image/box/haste.svg +8 -0
  148. package/public/image/box/haste_on.svg +8 -0
  149. package/public/image/box/home.svg +47 -0
  150. package/public/image/box/home_on.svg +47 -0
  151. package/public/image/box/house.svg +1 -0
  152. package/public/image/box/house_on.svg +1 -0
  153. package/public/image/box/icons.svg +15 -0
  154. package/public/image/box/icons_on.svg +15 -0
  155. package/public/image/box/item.svg +1 -0
  156. package/public/image/box/item_on.svg +1 -0
  157. package/public/image/box/j3dps.svg +28 -0
  158. package/public/image/box/j3dps_on.svg +28 -0
  159. package/public/image/box/j3pz.svg +36 -0
  160. package/public/image/box/j3pz_on.svg +36 -0
  161. package/public/image/box/jx3dat.svg +27 -0
  162. package/public/image/box/jx3dat_on.svg +27 -0
  163. package/public/image/box/keju.svg +30 -0
  164. package/public/image/box/keju_on.svg +30 -0
  165. package/public/image/box/knowledge.svg +52 -0
  166. package/public/image/box/knowledge_on.svg +52 -0
  167. package/public/image/box/macro.svg +15 -0
  168. package/public/image/box/macro_on.svg +18 -0
  169. package/public/image/box/macroeditor.svg +38 -0
  170. package/public/image/box/macroeditor_on.svg +38 -0
  171. package/public/image/box/png/100.png +0 -0
  172. package/public/image/box/png/bbs.png +0 -0
  173. package/public/image/box/png/bbs1.png +0 -0
  174. package/public/image/box/png/bbs2.png +0 -0
  175. package/public/image/box/png/bps.png +0 -0
  176. package/public/image/box/png/cj.png +0 -0
  177. package/public/image/box/png/database.png +0 -0
  178. package/public/image/box/png/drop.png +0 -0
  179. package/public/image/box/png/emotion.png +0 -0
  180. package/public/image/box/png/face.png +0 -0
  181. package/public/image/box/png/fb.png +0 -0
  182. package/public/image/box/png/flog.png +0 -0
  183. package/public/image/box/png/flower.png +0 -0
  184. package/public/image/box/png/furniture.png +0 -0
  185. package/public/image/box/png/gem.png +0 -0
  186. package/public/image/box/png/guishi.png +0 -0
  187. package/public/image/box/png/home.png +0 -0
  188. package/public/image/box/png/house.png +0 -0
  189. package/public/image/box/png/icons.png +0 -0
  190. package/public/image/box/png/item.png +0 -0
  191. package/public/image/box/png/j3pz.png +0 -0
  192. package/public/image/box/png/joker.png +0 -0
  193. package/public/image/box/png/jx3dat.png +0 -0
  194. package/public/image/box/png/jx3datbuilder.png +0 -0
  195. package/public/image/box/png/keju.png +0 -0
  196. package/public/image/box/png/macro.png +0 -0
  197. package/public/image/box/png/macroeditor.png +0 -0
  198. package/public/image/box/png/macroeditor2.png +0 -0
  199. package/public/image/box/png/minami.png +0 -0
  200. package/public/image/box/png/mirror.png +0 -0
  201. package/public/image/box/png/oa.png +0 -0
  202. package/public/image/box/png/pig.png +0 -0
  203. package/public/image/box/png/price.png +0 -0
  204. package/public/image/box/png/qiyu.png +0 -0
  205. package/public/image/box/png/rank2_on.png +0 -0
  206. package/public/image/box/png/role.png +0 -0
  207. package/public/image/box/png/servers.png +0 -0
  208. package/public/image/box/png/share.png +0 -0
  209. package/public/image/box/png/shop.png +0 -0
  210. package/public/image/box/png/skull.png +0 -0
  211. package/public/image/box/png/speed.png +0 -0
  212. package/public/image/box/png/talent.png +0 -0
  213. package/public/image/box/png/team.png +0 -0
  214. package/public/image/box/png/team_on.png +0 -0
  215. package/public/image/box/png/tool.png +0 -0
  216. package/public/image/box/png/translator.png +0 -0
  217. package/public/image/box/png/trophy.png +0 -0
  218. package/public/image/box/png/trophy2.png +0 -0
  219. package/public/image/box/png/wiki.png +0 -0
  220. package/public/image/box/price.svg +19 -0
  221. package/public/image/box/price_on.svg +19 -0
  222. package/public/image/box/qiyu.svg +1 -0
  223. package/public/image/box/qiyu_on.svg +1 -0
  224. package/public/image/box/quest.svg +52 -0
  225. package/public/image/box/quest_on.svg +57 -0
  226. package/public/image/box/rank.svg +36 -0
  227. package/public/image/box/rank_on.svg +36 -0
  228. package/public/image/box/servers.svg +31 -0
  229. package/public/image/box/servers_on.svg +31 -0
  230. package/public/image/box/share.svg +24 -0
  231. package/public/image/box/share_on.svg +24 -0
  232. package/public/image/box/shop.svg +52 -0
  233. package/public/image/box/talent.svg +19 -0
  234. package/public/image/box/talent_on.svg +19 -0
  235. package/public/image/box/team.svg +15 -0
  236. package/public/image/box/team_on.svg +18 -0
  237. package/public/image/box/tool.svg +23 -0
  238. package/public/image/box/tool_on.svg +31 -0
  239. package/public/image/box/translator.svg +55 -0
  240. package/public/image/box/translator_on.svg +55 -0
  241. package/public/image/box/wbl.png +0 -0
  242. package/public/image/box/wbl_on.png +0 -0
  243. package/public/image/box/xls.svg +74 -0
  244. package/public/image/box/xls_on.svg +74 -0
  245. package/public/index.html +24 -0
  246. package/service/admin.js +15 -0
  247. package/service/author.js +79 -0
  248. package/service/breadcrumb.js +13 -0
  249. package/service/cms.js +35 -0
  250. package/service/fav.js +17 -0
  251. package/service/follow.js +55 -0
  252. package/service/github.js +15 -0
  253. package/service/header.js +31 -0
  254. package/service/helper.js +7 -0
  255. package/service/thx.js +60 -0
  256. package/src/App.vue +52 -0
  257. package/src/Bottom.vue +23 -0
  258. package/src/Box.vue +149 -0
  259. package/src/Breadcrumb.vue +118 -0
  260. package/src/Footer.vue +45 -0
  261. package/src/Header.vue +95 -0
  262. package/src/LeftSideToggle.vue +64 -0
  263. package/src/LeftSidebar.vue +123 -0
  264. package/src/Main.vue +48 -0
  265. package/src/RightSidebar.vue +25 -0
  266. package/src/bread/Admin.vue +308 -0
  267. package/src/bread/AdminButton.vue +31 -0
  268. package/src/bread/Crumb.vue +27 -0
  269. package/src/header/Asset.vue +180 -0
  270. package/src/header/ClientSwitch.vue +115 -0
  271. package/src/header/GameSwitch.vue +210 -0
  272. package/src/header/Logo.vue +82 -0
  273. package/src/header/Manage.vue +125 -0
  274. package/src/header/Message.vue +89 -0
  275. package/src/header/Nav.vue +287 -0
  276. package/src/header/Publish.vue +21 -0
  277. package/src/header/Search.vue +81 -0
  278. package/src/header/User.vue +141 -0
  279. package/src/header/UserInfo.vue +175 -0
  280. package/src/header/Vip.vue +27 -0
  281. package/src/main.js +30 -0
  282. package/utils/bus.js +5 -0
  283. package/utils/index.js +31 -0
  284. package/vue.config.js +103 -0
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div class="c-crumb" v-html="html"></div>
3
+ </template>
4
+
5
+ <script>
6
+ import { getBreadcrumb } from "../../service/breadcrumb";
7
+
8
+ export default {
9
+ name: "BeardCrumb",
10
+ props: ["name"],
11
+ data: function () {
12
+ return {
13
+ html: "",
14
+ };
15
+ },
16
+ mounted() {
17
+ getBreadcrumb(this.name).then((res) => {
18
+ res = res.data;
19
+ this.html = res.data.breadcrumb?.html || "";
20
+ });
21
+ },
22
+ };
23
+ </script>
24
+
25
+ <style lang="less">
26
+ @import "../../assets/css/crumb.less";
27
+ </style>
@@ -0,0 +1,180 @@
1
+ <template>
2
+ <div class="c-header-panel c-header-assets">
3
+ <a class="u-asset" href="/dashboard/boxcoin">
4
+ <img class="u-coin" svg-inline src="../../assets/img/header/coin.svg" />
5
+ </a>
6
+
7
+ <div class="u-assets u-pop-content">
8
+ <div class="u-detail">
9
+ <span class="u-item">
10
+ <a class="u-item-primary" href="/about/incentives" target="_blank">
11
+ <span class="u-label"
12
+ ><el-icon><User /></el-icon> 等级</span
13
+ >
14
+ <span class="u-value u-level" :style="levelStyle">Lv.{{ level }}</span>
15
+ </a>
16
+ <!-- <span class="u-item-extend"><a href="/about/incentives" target="_blank">[权益]</a></span> -->
17
+ </span>
18
+ <span class="u-item">
19
+ <a class="u-item-primary" href="/dashboard/boxcoin" target="_blank"
20
+ ><span class="u-label"
21
+ ><el-icon><Coin /></el-icon> 盒币</span
22
+ >
23
+ <span class="u-value">{{ asset.box_coin }}</span></a
24
+ >
25
+ <span class="u-item-extend"><a href="/dashboard/boxcoin" target="_blank">[兑换通宝]</a></span>
26
+ </span>
27
+ <span class="u-item">
28
+ <a class="u-item-primary" href="/dashboard/cny" target="_blank"
29
+ ><span class="u-label"
30
+ ><el-icon><Wallet /></el-icon> 金箔</span
31
+ ><span class="u-value">{{ asset.cny }}</span></a
32
+ >
33
+ <span class="u-item-extend"
34
+ ><a href="/vip/cny" target="_blank">[充值]</a>
35
+ <a href="/dashboard/cny" target="_blank">[提现]</a></span
36
+ >
37
+ </span>
38
+ <span class="u-item">
39
+ <a class="u-item-primary" href="/dashboard/points" target="_blank"
40
+ ><span class="u-label"
41
+ ><el-icon><Sugar /></el-icon> 银铛</span
42
+ >
43
+ <span class="u-value">{{ asset.points }}</span></a
44
+ >
45
+ <span class="u-item-extend"
46
+ ><a href="/vip/mall" target="_blank">[兑礼]</a
47
+ ><a href="/vip/lottery" target="_blank">[抽奖]</a></span
48
+ >
49
+ </span>
50
+ <span class="u-item">
51
+ <a class="u-item-primary" href="/dashboard/card" target="_blank"
52
+ ><span class="u-label"
53
+ ><el-icon><Postcard /></el-icon> 卡密</span
54
+ >
55
+ <span class="u-value">{{ asset.ext_info ? asset.ext_info.keycode : 0 }}</span></a
56
+ >
57
+ <span class="u-item-extend"><a href="/dashboard/card" target="_blank">[查看]</a></span>
58
+ </span>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </template>
63
+
64
+ <script>
65
+ import User from "@jx3box/jx3box-common/js/user";
66
+ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
67
+ export default {
68
+ name: "HeaderAsset",
69
+ props: ["asset"],
70
+ data() {
71
+ return {
72
+ // VIP
73
+ };
74
+ },
75
+ computed: {
76
+ level: function () {
77
+ return User.getLevel(this.asset?.experience);
78
+ },
79
+ levelStyle: function () {
80
+ return {
81
+ background: JX3BOX.__userLevelColor[this.level],
82
+ color: "#fff",
83
+ padding: "2px 8px",
84
+ borderRadius: "2px",
85
+ };
86
+ },
87
+ },
88
+ };
89
+ </script>
90
+
91
+ <style lang="less">
92
+ @import "../../assets/css/mixin.less";
93
+ // 用户资产
94
+ .c-header-assets {
95
+ position: relative;
96
+ height: 100%;
97
+
98
+ .u-coin {
99
+ .db;
100
+ .size(15px);
101
+ * {
102
+ fill: #fff !important;
103
+ }
104
+ }
105
+ .u-asset {
106
+ padding: 0 10px;
107
+ height: 100%;
108
+ .flex;
109
+ align-items: center;
110
+ &:hover {
111
+ .tm(0.7);
112
+ }
113
+ }
114
+
115
+ .u-icon {
116
+ .size(16px);
117
+ // font-size: 15px;
118
+ display: block;
119
+ // height: 32px;
120
+ padding: 24px 10px 10px 10px;
121
+ .pointer;
122
+ }
123
+
124
+ .u-assets {
125
+ .u-delta;
126
+ width: 160px;
127
+ padding: 5px 0;
128
+ }
129
+
130
+ .u-detail {
131
+ .u-item {
132
+ .db;
133
+ color: #454545;
134
+ padding: 5px 15px;
135
+
136
+ &:hover {
137
+ background-color: @color-link;
138
+ .u-label {
139
+ color: #fff;
140
+ }
141
+ .u-value {
142
+ color: #fff;
143
+ }
144
+ }
145
+
146
+ .u-item-primary {
147
+ .flex;
148
+ align-items: center;
149
+ justify-content: space-between;
150
+ }
151
+
152
+ .u-label {
153
+ color: #454545;
154
+ .flex;
155
+ align-items: center;
156
+ gap: 5px;
157
+ }
158
+
159
+ .u-value {
160
+ font-weight: bold;
161
+ .ml(5px);
162
+ color: @color-link;
163
+ .fz(13px);
164
+ }
165
+ .u-level {
166
+ .fz(12px,14px);
167
+ }
168
+ .u-item-extend {
169
+ .none;
170
+ a {
171
+ .ml(5px);
172
+ &:hover {
173
+ color: @pink;
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ </style>
@@ -0,0 +1,115 @@
1
+ <template>
2
+ <div class="c-header-origin">
3
+ <i class="u-active" :class="{ isOffset }"></i>
4
+ <i class="u-div"></i>
5
+ <span
6
+ class="u-item"
7
+ v-for="(item, i) in clients"
8
+ :key="i"
9
+ :class="[clientCls(item), isActive(item)]"
10
+ @click="go(item)"
11
+ @mouseenter="changeClient(item)"
12
+ @mouseleave="resetClient"
13
+ >
14
+ {{ item.name }}
15
+ </span>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ name: "HeaderClientSwitch",
22
+ props: ["defaultValue"],
23
+ data: function () {
24
+ return {
25
+ clientThink: false,
26
+ clients: [
27
+ {
28
+ name: "重制",
29
+ client: "std",
30
+ from: "origin.jx3box.com",
31
+ to: "www.jx3box.com",
32
+ },
33
+ {
34
+ name: "缘起",
35
+ client: "origin",
36
+ to: "origin.jx3box.com",
37
+ from: "www.jx3box.com",
38
+ },
39
+ ],
40
+ client: this.defaultValue,
41
+ tempClient: this.defaultValue,
42
+ };
43
+ },
44
+ computed: {
45
+ isOffset: function () {
46
+ return this.tempClient == "origin";
47
+ },
48
+ },
49
+ methods: {
50
+ isActive: function (item) {
51
+ return this.client == item.client ? "on" : "";
52
+ },
53
+ clientCls: function (item) {
54
+ return "u-" + item.client;
55
+ },
56
+ changeClient: function (item) {
57
+ this.tempClient = item.client;
58
+ },
59
+ resetClient: function () {
60
+ this.tempClient = this.defaultValue;
61
+ },
62
+ go: function (item) {
63
+ // if(location.pathname.startsWith('/index') || location.pathname.startsWith('/origin')){
64
+ // location.href = 'https://' + item.to
65
+ // }else{
66
+ location.href = location.href.replace(item.from, item.to);
67
+ // }
68
+ },
69
+ },
70
+ mounted: function () {},
71
+ components: {},
72
+ };
73
+ </script>
74
+
75
+ <style lang="less">
76
+ //怀旧服
77
+ .c-header-origin {
78
+ .fl;
79
+ margin: 15px 0;
80
+ .mr(5px);
81
+ .pr;
82
+ background-color: #3a4248;
83
+ border: 2px solid @bg-black;
84
+ border-radius: 4px;
85
+ overflow: hidden;
86
+ .u-active {
87
+ .db;
88
+ .size(50%, 100%);
89
+ background: @color-link;
90
+ &:hover {
91
+ background-color: #3590f7;
92
+ }
93
+ .pa;
94
+ .lt(0);
95
+
96
+ transition: all 0.2s ease-in-out;
97
+ &.isOffset {
98
+ transform: translateX(100%);
99
+ }
100
+ }
101
+ .u-item {
102
+ .dbi;
103
+ .y(top);
104
+ font-size: 14px;
105
+ color: #fff;
106
+ .pointer;
107
+ padding: 5px 10px;
108
+ .pr;
109
+ .z(1);
110
+ }
111
+ .on {
112
+ cursor: default;
113
+ }
114
+ }
115
+ </style>
@@ -0,0 +1,210 @@
1
+ <template>
2
+ <div class="c-game-switch">
3
+ <div class="u-current on" @click.stop="onShow">
4
+ <span>{{ currentGame.name }}</span>
5
+ </div>
6
+
7
+ <div class="c-game-list" v-show="showMore">
8
+ <span
9
+ class="u-game-item"
10
+ v-for="item in games"
11
+ :key="item.key"
12
+ :class="{ active: current === item.key, disabled: item.disabled }"
13
+ @click.stop="handleClick(item)"
14
+ >
15
+ <img class="u-img" :src="item.img" alt="" />
16
+ <span>{{ item.name }}</span>
17
+ </span>
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
24
+ import { getGames } from "../../service/header";
25
+ export default {
26
+ name: "HeaderGameSwitch",
27
+ data() {
28
+ return {
29
+ games: [
30
+ {
31
+ name: "剑网3",
32
+ img: JX3BOX.__imgPath + "image/xsj/jx3czb.png",
33
+ key: "jx3",
34
+ path: "www.jx3box.com",
35
+ disabled: false,
36
+ },
37
+ {
38
+ name: "剑网3缘起",
39
+ img: JX3BOX.__imgPath + "image/xsj/jx3yq.png",
40
+ key: "jx3origin",
41
+ path: "origin.jx3box.com",
42
+ disabled: false,
43
+ },
44
+ ],
45
+ current: "jx3",
46
+
47
+ showMore: false,
48
+ };
49
+ },
50
+ computed: {
51
+ currentGame() {
52
+ return this.games.find((item) => item.key == this.current);
53
+ },
54
+ },
55
+ mounted() {
56
+ const _host = window.location.host;
57
+ const _game = this.games.find((item) => item.path.indexOf(_host) > -1);
58
+ if (_game) {
59
+ this.current = _game.key;
60
+ }
61
+ this.close();
62
+ this.loadGames();
63
+ },
64
+ methods: {
65
+ handleClick(item) {
66
+ if (item.disabled) {
67
+ return;
68
+ }
69
+ if (["jx3", "jx3origin"].includes(this.current) && ["jx3", "jx3origin"].includes(item.key)) {
70
+ const _current = this.games.find((game) => game.key == this.current);
71
+ const _next = this.games.find((game) => game.key == item.key);
72
+
73
+ location.href = location.href.replace(_current.path, _next.path);
74
+ } else {
75
+ location.href = item.path;
76
+ }
77
+ this.current = item.key;
78
+ },
79
+ // itemHref(item) {
80
+ // if (item.disabled) {
81
+ // return "javascript:;";
82
+ // }
83
+ // return item.path;
84
+ // },
85
+ onShow() {
86
+ this.showMore = !this.showMore;
87
+ },
88
+ close() {
89
+ document.addEventListener("click", () => {
90
+ this.showMore = false;
91
+ });
92
+ },
93
+ loadGames() {
94
+ getGames().then((res) => {
95
+ this.games = this.games.concat(res?.data);
96
+ });
97
+ },
98
+ },
99
+ };
100
+ </script>
101
+
102
+ <style lang="less">
103
+ .arrow(t,@width,@color,@x:50%) {
104
+ &:before {
105
+ bottom: 100%;
106
+ left: @x;
107
+ content: " ";
108
+ height: 0;
109
+ width: 0;
110
+ position: absolute;
111
+ pointer-events: none;
112
+ border-style: solid;
113
+ border-color: transparent;
114
+ border-bottom-color: @color;
115
+ border-width: unit(@width, px);
116
+ @margin: -@width;
117
+ margin-left: unit(@margin, px);
118
+ }
119
+ }
120
+ .c-game-switch {
121
+ display: inline-flex;
122
+ margin: 15px 0;
123
+ .mr(10px);
124
+ .pr;
125
+ .u-current {
126
+ .flex;
127
+ align-items: center;
128
+ .pointer;
129
+ .dbi;
130
+ .y(top);
131
+ font-size: 14px;
132
+ color: #fff;
133
+ padding: 5px 10px;
134
+ background-color: #7d7d7d;
135
+ border: 2px solid #303133;
136
+ border-radius: 4px;
137
+ .pr;
138
+ .z(1);
139
+ .u-img {
140
+ width: 20px;
141
+ height: 20px;
142
+ margin-right: 5px;
143
+ }
144
+
145
+ &.on {
146
+ background-color: @primary;
147
+ .pointer;
148
+ }
149
+
150
+ transition: 0.05s ease-in;
151
+ &:hover {
152
+ background-color: lighten(@primary, 2%);
153
+ color: #eee;
154
+ }
155
+ }
156
+ }
157
+ @media screen and (max-width: @phone) {
158
+ .c-game-switch {
159
+ margin-left: 2px;
160
+ }
161
+ }
162
+ .c-game-list {
163
+ .arrow(t,5px,@bg-black,12%);
164
+ position: absolute;
165
+ top: calc(100% + 14px);
166
+ left: -10px;
167
+ width: 300px;
168
+ background-color: #24292e;
169
+ padding: 10px;
170
+ border: 1px solid rgba(27, 31, 35, 0.15);
171
+ border-radius: 4px;
172
+ box-shadow: 0 3px 12px rgba(27, 31, 35, 0.15);
173
+ margin-top: 6px;
174
+ display: grid;
175
+ grid-template-columns: repeat(2, 1fr);
176
+ // gap:10px;
177
+ grid-row-gap: 8px;
178
+ grid-column-gap: 10px;
179
+ .u-game-item {
180
+ .flex;
181
+ align-items: center;
182
+ padding: 6px;
183
+ .pointer;
184
+ border-radius: 4px;
185
+ color: #fff;
186
+ font-size: 14px;
187
+ .u-img {
188
+ width: 24px;
189
+ height: 24px;
190
+ margin-right: 5px;
191
+ border-radius: 4px;
192
+ }
193
+ &.active {
194
+ background-color: @primary;
195
+ color: #fff;
196
+ }
197
+ &:not(.disabled) {
198
+ &:hover {
199
+ background-color: @primary;
200
+ color: #fff;
201
+ }
202
+ }
203
+ &.disabled {
204
+ filter: grayscale(100%);
205
+ color: #c0c4cc;
206
+ cursor: not-allowed;
207
+ }
208
+ }
209
+ }
210
+ </style>
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div class="c-header-logo" @click="toggleBox($event)" title="点击展开魔盒矩阵">
3
+ <i class="u-pic" id="c-header-logo"><img svg-inline src="../../assets/img/header/logo.svg" /></i>
4
+ <span class="u-txt" :class="{ on: isIndex }" href="/">魔盒</span>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import Bus from "../../utils/bus";
10
+ export default {
11
+ name: "HeaderLogo",
12
+ props: [],
13
+ data: function () {
14
+ return {
15
+ isIndex: /\/index\/?/.test(location.pathname),
16
+ };
17
+ },
18
+ computed: {},
19
+ methods: {
20
+ // 盒子
21
+ toggleBox: function (e) {
22
+ e.stopPropagation();
23
+ Bus.emit("toggleBox");
24
+ },
25
+ },
26
+ mounted: function () {},
27
+ components: {},
28
+ };
29
+ </script>
30
+
31
+ <style lang="less">
32
+ //logo
33
+ .c-header-logo {
34
+ .pointer;
35
+ user-select: none;
36
+ display: inline-flex;
37
+ flex-shrink: 0;
38
+ flex-grow: 0;
39
+ height: @header-height;
40
+
41
+ @padding: 15px;
42
+
43
+ .u-pic {
44
+ .db;
45
+ width: @logo-size;
46
+ height: @logo-size;
47
+ float: left;
48
+ padding: @padding 10px;
49
+ svg {
50
+ .size(100%);
51
+ fill: #fff;
52
+ }
53
+ transition: 0.3s ease-in-out;
54
+ &:hover {
55
+ transform: rotate(90deg);
56
+ .mt(-2px);
57
+ }
58
+ }
59
+ .u-txt {
60
+ .db;
61
+ color: #fff;
62
+ font-family: Consolas;
63
+ font-size: 20px;
64
+ line-height: @logo-size;
65
+ padding: @padding 0;
66
+ transition: 0.15s ease-in-out;
67
+ margin-right: 10px;
68
+ }
69
+ }
70
+ @media screen and (max-width: @phone) {
71
+ .c-header-logo {
72
+ padding-right: 0;
73
+ .u-pic {
74
+ margin: 0;
75
+ }
76
+ .u-txt {
77
+ display: none;
78
+ }
79
+ margin-right: 0;
80
+ }
81
+ }
82
+ </style>