efront 4.19.6 → 4.20.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 (53) hide show
  1. package/apps/kugou/singer/keywords.less +5 -1
  2. package/apps/kugou/song/list.jsp +14 -0
  3. package/apps/kugou/song//347/233/227/345/260/206/350/241/214 - /350/212/261/347/262/245,/351/251/254/351/233/250/351/230/263.krc +0 -0
  4. package/coms/basic/Table.js +4 -3
  5. package/coms/basic/data.js +19 -7
  6. package/coms/basic/isSubpath.js +33 -0
  7. package/coms/basic/mark.js +47 -14
  8. package/coms/basic/mark_test.js +8 -0
  9. package/coms/basic/spaces.js +8 -0
  10. package/coms/compile/Html.js +32 -1
  11. package/coms/compile/Html_test.js +3 -1
  12. package/coms/compile/common.js +8 -3
  13. package/coms/explorer/edit.js +1 -1
  14. package/coms/kugou/bg.less +2 -2
  15. package/coms/kugou/dance.js +1 -1
  16. package/coms/kugou/krc.js +61 -34
  17. package/coms/kugou/krc.less +1 -0
  18. package/coms/kugou/krc_parse.js +56 -0
  19. package/coms/kugou/krc_stringify.js +16 -0
  20. package/coms/kugou/musicList.js +1 -1
  21. package/coms/kugou/parseSongsList.js +1 -1
  22. package/coms/kugou/playList.html +3 -2
  23. package/coms/kugou/playList.less +5 -0
  24. package/coms/kugou/player.html +1 -0
  25. package/coms/kugou/player.js +40 -32
  26. package/coms/kugou/player.less +125 -34
  27. package/coms/kugou/song.html +4 -4
  28. package/coms/kugou/song.js +1 -0
  29. package/coms/kugou/song.less +77 -26
  30. package/coms/kugou/titlebar.less +3 -0
  31. package/coms/kugou//346/255/214/350/257/215/347/274/226/350/276/221/345/231/250.xht +153 -0
  32. package/coms/zimoli/button.js +3 -76
  33. package/coms/zimoli/button.less +1 -3
  34. package/coms/zimoli/confirm.js +4 -3
  35. package/coms/zimoli/img.less +1 -0
  36. package/coms/zimoli/menu.less +0 -4
  37. package/coms/zimoli/menuItem.html +1 -1
  38. package/coms/zimoli/on.js +18 -0
  39. package/coms/zimoli/once.js +7 -1
  40. package/coms/zimoli/onmounted.js +1 -13
  41. package/coms/zimoli/patchHover.js +74 -0
  42. package/coms/zimoli/popup.js +16 -0
  43. package/coms/zimoli/prompt.js +8 -2
  44. package/coms/zimoli/render.js +6 -2
  45. package/coms/zimoli/slider.js +1 -0
  46. package/coms/zimoli/textarea.less +1 -0
  47. package/coms/zimoli/touchList.js +1 -0
  48. package/coms/zimoli/view.js +0 -6
  49. package/coms/zimoli/vscroll.js +2 -1
  50. package/coms/zimoli/zimoli.js +11 -10
  51. package/package.json +2 -2
  52. package/public/efront.js +1 -1
  53. package/readme.md +1 -1
@@ -3,11 +3,14 @@ var playState = kugou$playState;
3
3
  var playModes = kugou$playModes;
4
4
  var playModeData = data.getInstance("play-mode");
5
5
  var playList = kugou$playList();
6
+ playList.initialStyle = 'marginLeft:-360px';
6
7
  var patchMusicInfo = async function (info) {
7
8
  var res = null, krc;
8
9
  switch (info.type) {
9
10
  case "qqjt":
10
- info.lrc = (await cross("get", info.lyric)).response;
11
+ try {
12
+ info.lrc = (await cross("get", info.lyric)).response;
13
+ } catch { }
11
14
  res = await data.from("qqjt-url", qqjc({
12
15
  TSID: info.id
13
16
  }))
@@ -19,19 +22,23 @@ var patchMusicInfo = async function (info) {
19
22
  level: "standard",
20
23
  encodeType: "aac"
21
24
  }));
22
- info.lrc = await data.from('yyyy-lrc', yyyc.encode({
23
- id: info.id,
24
- lv: 0,
25
- // tv: 0,
26
- }));
25
+ try {
26
+ info.lrc = await data.from('yyyy-lrc', yyyc.encode({
27
+ id: info.id,
28
+ lv: 0,
29
+ // tv: 0,
30
+ }));
31
+ } catch { }
27
32
  info.singerName = info.singername;
28
33
  info.songName = info.songname;
29
34
  break;
30
35
  case "kuwo":
31
36
  res = await data.from("play-url", info);
32
- info.lrc = await data.from("kuwo-lrc", info, function (lrc) {
33
- return lrc.map(l => `[${l.time}]${l.lineLyric}`).join('\r\n');
34
- });
37
+ try {
38
+ info.lrc = await data.from("kuwo-lrc", info, function (lrc) {
39
+ return lrc.map(l => `[${l.time}]${l.lineLyric}`).join('\r\n');
40
+ });
41
+ } catch { }
35
42
  info.avatar = info.pic;
36
43
  info.singerName = info.singername;
37
44
  info.songName = info.songname;
@@ -40,14 +47,29 @@ var patchMusicInfo = async function (info) {
40
47
  default:
41
48
  if (info.hash) {
42
49
  res = await data.from("song-info", info);
43
- krc = await data.from("search-krc", res);
44
- krc = await data.from("download-krc", krc);
45
- info.krc = fromBase64(krc);
50
+ try {
51
+ krc = await data.from("search-krc", res);
52
+ krc = await data.from("download-krc", krc);
53
+ info.krc = fromBase64(krc);
54
+ } catch { }
46
55
  if (res.fail_process === 12) res.priced = true;
47
56
  if (res.imgUrl) {
48
57
  res.avatar = res.imgUrl.replace(/\{size\}/ig, 200);
49
58
  }
50
59
  }
60
+ else if (/\.\w+\#[klg]rc$/i.test(info.url)) {
61
+ var Uint8Array = window.Uint8Array;
62
+ if (!Uint8Array) break;
63
+ try {
64
+ var krl = info.url.replace(/\.\w+#(\w+)$/i, '.$1');
65
+ var ext = /\.(\w+)$/.exec(krl);
66
+ var xhr = cross("get", krl);
67
+ if (/krc$/i.test(krl)) xhr.responseType = 'arraybuffer';
68
+ await xhr;
69
+ var krc = xhr.response;
70
+ info[ext[1].toLowerCase()] = krc instanceof ArrayBuffer ? new Uint8Array(krc) : krc;
71
+ } catch { }
72
+ }
51
73
  break;
52
74
  }
53
75
  Object.assign(info, res);
@@ -71,6 +93,7 @@ on("keydown")(window, function (event) {
71
93
  case 32:
72
94
  case 179:
73
95
  if (event.repeat) break;
96
+ event.preventDefault();
74
97
  if ($scope.playing) $scope.pause();
75
98
  else $scope.play();
76
99
  break;
@@ -141,6 +164,7 @@ var $scope = {
141
164
  canvas: kugou$dance,
142
165
  activeList: playList,
143
166
  index: 0,
167
+ container,
144
168
  getSongName() {
145
169
  return this.info.songname || this.info.songName;
146
170
  },
@@ -355,7 +379,7 @@ if (hasContext) {
355
379
  }
356
380
 
357
381
  playList.play = index => $scope.play(index);
358
- var touching = false;
382
+ var touching = false, touched = 0;
359
383
  var createControls = function () {
360
384
  var player = document.createElement("music-player");
361
385
  player.setAttribute("ng-class", "{play:playing===true,pause:playing===false,page:page,effect:effect}");
@@ -366,6 +390,7 @@ var createControls = function () {
366
390
  var x = event.clientX - getScreenPosition(player).left;
367
391
  let _audio = $scope.audio
368
392
  css(progress, { width: x });
393
+ touched = x;
369
394
  $scope.process(x / player.offsetWidth * _audio.duration, _audio.duration);
370
395
  }, "x");
371
396
  bindtouch(player, function (value) {
@@ -389,9 +414,8 @@ var createControls = function () {
389
414
  }
390
415
  return { y: getScreenPosition(player).top };
391
416
  }, 'y');
417
+
392
418
  moveupon(player, {
393
- start() {
394
- },
395
419
  end() {
396
420
  var currentHeight = calcPixel(this.offsetHeight), windowHeight = calcPixel(window.innerHeight);
397
421
  var $scope = this.$scope;
@@ -429,7 +453,7 @@ var createControls = function () {
429
453
  });
430
454
  if (!touching) return;
431
455
  let _audio = $scope.audio;
432
- _audio.currentTime = progress.offsetWidth * _audio.duration / player.offsetWidth;
456
+ _audio.currentTime = touched * _audio.duration / player.offsetWidth;
433
457
  touching = false;
434
458
  }
435
459
  });
@@ -437,13 +461,6 @@ var createControls = function () {
437
461
  };
438
462
 
439
463
  var player = function (player) {
440
- var savatar = player.querySelector('canvas');
441
- var switchPlayList = function () {
442
- if (onclick.preventClick) return;
443
- onclick.preventClick = true;
444
- if (playList.parentNode) remove(playList);
445
- else popup(playList, savatar);
446
- }
447
464
  render(player, $scope);
448
465
  player.play = function (hash) {
449
466
  $scope.play(hash);
@@ -457,14 +474,5 @@ var player = function (player) {
457
474
  if ($scope.playing) $scope.pause();
458
475
  else $scope.play();
459
476
  });
460
- var timeout = 0;
461
- moveupon(player, {
462
- start() {
463
- timeout = setTimeout(switchPlayList, 560);
464
- },
465
- end() {
466
- clearTimeout(timeout);
467
- }
468
- })
469
477
  return player;
470
478
  }(createControls());
@@ -1,8 +1,10 @@
1
1
  @avatar-left: 36px;
2
2
  @avatar-top: -12px;
3
3
  @avatar-size: 72px;
4
-
5
- @main-color: #021c;
4
+ @shade-color: #acb;
5
+ @main-color: #000c;
6
+ @list-width: 320px;
7
+ @list-only-width: 640px;
6
8
 
7
9
  &.pause .play:before {
8
10
  content: "";
@@ -15,9 +17,6 @@
15
17
  vertical-align: middle;
16
18
  }
17
19
 
18
- krc {
19
- pointer-events: none;
20
- }
21
20
 
22
21
  &.play .play:before {
23
22
  display: none;
@@ -33,6 +32,7 @@ krc {
33
32
  left: @avatar-left;
34
33
  position: absolute;
35
34
  background-size: cover;
35
+ background-position: center;
36
36
  border: 3px solid #000;
37
37
  background-clip: content-box;
38
38
  }
@@ -63,12 +63,6 @@ krc {
63
63
  // -webkit-animation-play-state: paused;
64
64
  }
65
65
 
66
- &:after {
67
- content: "";
68
- display: block;
69
- box-sizing: border-box;
70
- }
71
-
72
66
  &.play,
73
67
  &.pause {
74
68
  height: 60px;
@@ -94,10 +88,9 @@ krc {
94
88
  content: "";
95
89
  left: @avatar-left+@border-width + 72px;
96
90
  position: absolute;
97
- min-width: 100px;
98
91
  width: auto;
99
92
  height: auto;
100
- border-radius: 60px 0 0 0;
93
+ border-radius: 60px 0 60px 0;
101
94
  right: 0;
102
95
  top: 0;
103
96
  bottom: 0;
@@ -133,7 +126,7 @@ krc {
133
126
 
134
127
  >.track:after,
135
128
  >.avatar {
136
- border-color: @main-color;
129
+ transition: border-color .2s ease-out;
137
130
  box-shadow: 0 0 6px -3px @main-color;
138
131
  }
139
132
 
@@ -141,6 +134,10 @@ krc {
141
134
  opacity: .7;
142
135
  transition: height .3s, opacity .3s;
143
136
  top: -@avatar-top;
137
+
138
+ &:before {
139
+ transition: background-color .2s ease-out;
140
+ }
144
141
  }
145
142
 
146
143
  >.avatar {
@@ -175,15 +172,18 @@ krc {
175
172
 
176
173
  >btn,
177
174
  >sbtn {
175
+ color: @shade-color;
178
176
  @btn-width: 42px;
179
177
  text-align: center;
180
178
  line-height: 60px;
181
179
  width: @btn-width;
182
180
  height: 60px;
183
181
  vertical-align: top;
182
+ box-shadow: none;
184
183
  position: absolute;
185
184
  background: transparent;
186
185
  z-index: 2;
186
+ font-size: 14px;
187
187
 
188
188
  &.play {
189
189
  top: @avatar-top/2;
@@ -193,16 +193,20 @@ krc {
193
193
 
194
194
  &.next {
195
195
  right: 0;
196
+ padding-right: 12px;
197
+ text-align: right;
196
198
  }
197
199
 
198
200
  &.prev {
201
+ text-align: left;
202
+ padding-left: 12px;
199
203
  top: 0;
200
204
  left: @avatar-left - @btn-width+6px;
201
205
  }
202
206
 
203
207
  }
204
208
 
205
- .time {
209
+ >.time {
206
210
  left: 6px;
207
211
  text-align: center;
208
212
  top: 46px;
@@ -212,7 +216,7 @@ krc {
212
216
  font-size: 12px;
213
217
  }
214
218
 
215
- .total {
219
+ >.total {
216
220
  z-index: 2;
217
221
  right: 6px;
218
222
  top: 46px;
@@ -221,7 +225,7 @@ krc {
221
225
  font-size: 12px;
222
226
  }
223
227
 
224
- .singer {
228
+ >.singer {
225
229
  color: #fffc;
226
230
  font-size: 8px;
227
231
  display: block;
@@ -232,7 +236,7 @@ krc {
232
236
  }
233
237
 
234
238
 
235
- .song {
239
+ >.song {
236
240
  left: @avatar-left + @avatar-size + 6px;
237
241
  line-height: 1;
238
242
  top: 22px;
@@ -259,8 +263,21 @@ krc {
259
263
  opacity: 1;
260
264
  @ptop: -@avatar-top;
261
265
 
266
+ >div.progress>.avatar {
267
+ border-color: @shade-color;
268
+ }
269
+
262
270
  >div.progress>.track {
263
271
  height: 3px;
272
+
273
+ &:after {
274
+ border-color: @shade-color;
275
+ }
276
+
277
+ &:before {
278
+ background-color: @shade-color;
279
+ }
280
+
264
281
  opacity: 1;
265
282
  top: @ptop;
266
283
 
@@ -285,8 +302,7 @@ krc {
285
302
  z-index: 1;
286
303
  }
287
304
 
288
-
289
- &:not(.page)>.krc {
305
+ .nkrc() {
290
306
  top: 0;
291
307
  height: 16px;
292
308
  font-size: 8px;
@@ -303,19 +319,31 @@ krc {
303
319
  .after-active+.after {
304
320
  clear: both;
305
321
  }
322
+ }
306
323
 
324
+ &:not(.page)>.krc {
325
+ .nkrc();
307
326
  }
308
327
 
309
328
  &.page>.krc {
310
- text-align: center;
311
- line-height: 2.2;
312
- margin-bottom: -80px;
313
- bottom: 50%;
314
- height: 180px;
315
- max-height: 60%;
316
- top: auto;
317
- padding: 0;
318
- font-size: 16px;
329
+ @media all and (min-width:@list-only-width) {
330
+ text-align: center;
331
+ line-height: 2.2;
332
+ margin-bottom: -80px;
333
+ bottom: 50%;
334
+ height: 180px;
335
+ max-height: 60%;
336
+ top: auto;
337
+ left: @list-width;
338
+ padding: 0;
339
+ font-size: 16px;
340
+ }
341
+
342
+ @list-only-width1: @list-only-width - 1px;
343
+
344
+ @media all and (max-width:@list-only-width1) {
345
+ .nkrc();
346
+ }
319
347
  }
320
348
 
321
349
 
@@ -336,19 +364,18 @@ krc {
336
364
  background-repeat: no-repeat;
337
365
  background-position: center;
338
366
 
339
- &:before {
367
+ &:after {
340
368
  content: "";
341
369
  display: block;
342
370
  position: absolute;
343
- background: inherit;
344
371
  left: 0;
345
372
  right: 0;
346
- top: 0;
373
+ top: 60px;
347
374
  bottom: 0;
348
- filter: blur(15px);
375
+ backdrop-filter: blur(60px);
349
376
  }
350
377
 
351
- &:after {
378
+ &:before {
352
379
  background-color: #000;
353
380
  opacity: .6;
354
381
  content: "";
@@ -477,4 +504,68 @@ krc {
477
504
  >.background {
478
505
  opacity: 1 !important;
479
506
  }
507
+ }
508
+
509
+
510
+ >.playList {
511
+ position: absolute;
512
+ max-width: 100%;
513
+ background: transparent;
514
+
515
+ @media all and (min-width: @list-only-width) {
516
+ >.body {
517
+ padding-right: calc(100% - @list-width);
518
+ }
519
+ }
520
+
521
+ z-index: 0;
522
+
523
+ left: 0;
524
+ top: 0;
525
+ height: 100%;
526
+ bottom: 0;
527
+ min-height: 240px;
528
+ border-left: none;
529
+ border-radius: 0;
530
+ text-align: left;
531
+ border-color: #000;
532
+ background: inherit;
533
+ box-shadow: none;
534
+
535
+ >.foot {
536
+ height: 0;
537
+ border: none;
538
+ overflow: visible;
539
+ padding: 0;
540
+
541
+ a {
542
+ color: #fff;
543
+ margin: -60px 20px 0 0;
544
+ }
545
+ }
546
+
547
+ >.head {
548
+ // text-align: right;
549
+ border: none;
550
+ height: 60px;
551
+ background: inherit;
552
+ backdrop-filter: none;
553
+
554
+ &:before {
555
+ left: 0;
556
+ top: 0;
557
+ bottom: 0;
558
+ right: 0;
559
+ width: auto;
560
+ height: auto;
561
+ position: absolute;
562
+ backdrop-filter: blur(10px);
563
+ }
564
+ }
565
+
566
+ >.body {
567
+ border-radius: inherit;
568
+ border-bottom: none;
569
+ }
570
+
480
571
  }
@@ -1,4 +1,7 @@
1
1
  <bg></bg>
2
+ <div refresh class="play-state" -if="isActived()" ng-class={error:playState.error}>
3
+ <div ng-style="{width:playState.width}"></div>
4
+ </div>
2
5
  <png class="logo" ng-if="song.imgurl" ng-src=song.imgurl></png>
3
6
  <div class="singer" ng-if="song.singer" ng-html=song.singerMarked></div>
4
7
  <div class="song" style:="{whiteSpace:song.items?'normal':'nowrap'}">
@@ -7,7 +10,4 @@
7
10
  <i type_="s.type" ng-class="{actived:musicList.isActived(s)}" priced_="!!s.priced" @click="event.stopPropagation(),play(s)" -repeat="s in song.items"></i>
8
11
  </span>
9
12
  </div>
10
- <div class="filterTime(song.timeLength)"></div>
11
- <div refresh class="play-state" -if="isActived()" ng-class={error:playState.error}>
12
- <div ng-style="{width:playState.width}"></div>
13
- </div>
13
+ <div -bind="filterTime(song.timeLength)"></div>
@@ -50,5 +50,6 @@ function main(elem) {
50
50
  render(elem.children, $scope, 0);
51
51
  });
52
52
  onclick(elem, dplay);
53
+ patchHover(elem);
53
54
  return block(elem);
54
55
  }
@@ -1,33 +1,43 @@
1
1
  & {
2
2
  height: auto;
3
- line-height: 40px;
4
- padding: 10px 10px 0 10px;
3
+ line-height: 28px;
4
+ padding: 10px 10px 0 20px;
5
5
  font-size: 16px;
6
6
  white-space: nowrap;
7
7
  overflow: hidden;
8
8
  text-overflow: ellipsis;
9
9
  background: #202226;
10
10
  color: #fffc;
11
+ border-radius: 30px;
11
12
 
12
13
  border: 2px solid transparent;
13
14
 
14
- &:hover {
15
- border-color: #acb;
15
+ .bg:after {
16
+ border: 1px solid transparent;
16
17
  }
17
18
 
18
- &:active {
19
- border-color: #ccc;
19
+ &.hover {
20
+ .bg:after {
21
+ border-color: #fff9;
22
+ }
20
23
  }
24
+
21
25
  }
22
26
 
23
27
  >.logo {
24
- height: 40px;
25
- width: 40px;
26
- margin: -4px -2px;
28
+ width: 52px;
29
+ height: 52px;
30
+ font-size: 0;
31
+ margin: -10px -2px -10px -20px;
32
+ border-radius: 50%;
33
+ border: 6px double #323336;
34
+ position: relative;
35
+ transition: border-width .2s;
36
+ background-clip: border-box;
27
37
 
28
38
  &+.singer+.song,
29
39
  &+.song {
30
- margin-left: -38px;
40
+ margin-left: -32px;
31
41
  padding-left: 46px;
32
42
  display: inline-block;
33
43
  vertical-align: top;
@@ -35,25 +45,52 @@
35
45
  }
36
46
 
37
47
  &+.singer {
38
- padding-left: 46px;
48
+ padding-left: 28px;
39
49
  }
40
50
 
41
51
  }
42
52
 
53
+ &.activate {
54
+ >.logo {
55
+ // border-color: #acb;
56
+ border-width: 3.6px;
57
+ background-clip: content-box;
58
+ outline: 1.2px solid #acb;
59
+ outline-offset: -1.2px;
60
+ }
61
+
62
+ png {
63
+ filter: none;
64
+ }
65
+
66
+ &.error {
67
+ >.logo {
68
+ border-color: #c26;
69
+ }
70
+ }
71
+ }
72
+
43
73
  &.imgonly {
44
74
  padding: 0;
45
75
  line-height: 0;
46
76
  font-size: 0;
47
- padding-bottom: 76%;
48
77
  height: auto;
49
78
 
50
- >:not(png) {
79
+ >:not(png, bg) {
51
80
  display: none;
52
81
  }
53
82
 
83
+ >.bg:after {
84
+ right: -10px;
85
+ bottom: -30px;
86
+ }
87
+
54
88
  >.logo {
55
- position: absolute;
56
- height: 100%;
89
+ border: none;
90
+ padding-bottom: 100%;
91
+ height: 0;
92
+ font-size: 0;
93
+ line-height: 0;
57
94
  width: 100%;
58
95
  margin: 0;
59
96
  }
@@ -138,7 +175,7 @@ b {
138
175
 
139
176
  >.singer {
140
177
  position: absolute;
141
- left: 8px;
178
+ left: 26px;
142
179
  top: 6px;
143
180
  // right: 10px;
144
181
  text-align: center;
@@ -148,7 +185,7 @@ b {
148
185
 
149
186
  &+.song {
150
187
  padding-top: 12px;
151
- padding-bottom: 6px;
188
+ padding-bottom: 2px;
152
189
  }
153
190
  }
154
191
 
@@ -159,22 +196,36 @@ png {
159
196
  >.play-state {
160
197
  position: absolute;
161
198
  bottom: 0;
162
- right: 2px;
163
- left: 2px;
199
+ right: 0;
200
+ left: 0;
164
201
  display: block;
165
- background: #2c7bb522;
166
- height: 2px;
167
- border-radius: 2px 0 2px 0;
168
- overflow: hidden;
202
+ border-bottom: 1.2px solid #323336;
203
+ height: 30px;
204
+ border-radius: 0px 0 26px 26px;
205
+ overflow: visible;
206
+ padding: 0 16px 0 26px;
169
207
 
170
208
  >div {
171
209
  width: 100%;
172
210
  height: 100%;
173
- border-radius: inherit;
174
- background: #2c7bb5;
211
+ box-sizing: content-box;
212
+ border-bottom: 1.2px solid #acb;
213
+ margin-bottom: -1.2px;
214
+
175
215
  }
176
216
 
177
217
  &.error {
178
- background-color: #c26;
218
+
219
+ &+.logo {
220
+ outline-color: #c26;
221
+ }
222
+
223
+ & {
224
+ border-color: #c26;
225
+ }
226
+
227
+ >div {
228
+ display: none;
229
+ }
179
230
  }
180
231
  }
@@ -1,7 +1,10 @@
1
1
  & {
2
2
  height: 44px;
3
3
  line-height: 42px;
4
+ border: none;
5
+ background-color: transparent;
4
6
  font-size: 16px;
7
+
5
8
  >.button {
6
9
  height: 44px;
7
10
  line-height: 44px;