eplayer 1.6.8 → 1.6.9
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.
- package/docs/eplayer.js +72 -12
- package/package.json +1 -1
package/docs/eplayer.js
CHANGED
|
@@ -90,14 +90,17 @@ class Eplayer extends HTMLElement {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
play() {
|
|
93
|
+
console.log(this.$('.img-container'))
|
|
93
94
|
if (this.video.paused) {
|
|
94
95
|
this.video.play()
|
|
95
96
|
this.danmaku.resume()
|
|
97
|
+
this.$('.img-container').classList.add('is-playing');
|
|
96
98
|
this.$('.is-play').setAttribute('icon-id', 'pause')
|
|
97
99
|
this.emit('play')
|
|
98
100
|
} else {
|
|
99
101
|
this.video.pause()
|
|
100
102
|
this.danmaku.pause()
|
|
103
|
+
this.$('.img-container').classList.remove('is-playing');
|
|
101
104
|
this.$('.is-play').setAttribute('icon-id', 'play')
|
|
102
105
|
this.emit('pause')
|
|
103
106
|
}
|
|
@@ -352,16 +355,7 @@ class Eplayer extends HTMLElement {
|
|
|
352
355
|
background:url(${this.cover || ''}) center/cover no-repeat #fff;
|
|
353
356
|
filter:blur(8px);
|
|
354
357
|
}
|
|
355
|
-
|
|
356
|
-
position: absolute;
|
|
357
|
-
z-index: 1;
|
|
358
|
-
width:250px;
|
|
359
|
-
height:250px;
|
|
360
|
-
border-radius:125px;
|
|
361
|
-
left:50%;
|
|
362
|
-
top:50%;
|
|
363
|
-
transform:translate(-50%,-50%);
|
|
364
|
-
}
|
|
358
|
+
|
|
365
359
|
.eplayer{
|
|
366
360
|
user-select:none;
|
|
367
361
|
position: relative;
|
|
@@ -543,14 +537,79 @@ class Eplayer extends HTMLElement {
|
|
|
543
537
|
margin:0 10px 0 8px;
|
|
544
538
|
cursor: pointer;
|
|
545
539
|
}
|
|
546
|
-
|
|
540
|
+
|
|
541
|
+
.eplayer .img-container{
|
|
542
|
+
position: absolute;
|
|
543
|
+
z-index: 1;
|
|
544
|
+
width:250px;
|
|
545
|
+
height:250px;
|
|
546
|
+
border-radius:125px;
|
|
547
|
+
left:50%;
|
|
548
|
+
top:50%;
|
|
549
|
+
transform:translate(-50%,-50%);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.rotate-img {
|
|
553
|
+
width: 250px;
|
|
554
|
+
height: 250px;
|
|
555
|
+
border-radius: 50%;
|
|
556
|
+
animation: rotate 10s linear infinite;
|
|
557
|
+
object-fit: cover;
|
|
558
|
+
animation-play-state: paused; /* 默认暂停 */
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.img-container::after,
|
|
562
|
+
.img-container::before {
|
|
563
|
+
content: '';
|
|
564
|
+
position: absolute;
|
|
565
|
+
top: 50%;
|
|
566
|
+
left: 50%;
|
|
567
|
+
width: 100%;
|
|
568
|
+
height: 100%;
|
|
569
|
+
border-radius: 50%;
|
|
570
|
+
transform: translate(-50%, -50%) scale(0);
|
|
571
|
+
animation: wave 2s infinite;
|
|
572
|
+
animation-play-state: paused; /* 默认暂停 */
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.img-container::after {
|
|
576
|
+
background: rgba(255, 255, 255, 0.3);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.img-container::before {
|
|
580
|
+
background: rgba(255, 255, 255, 0.2);
|
|
581
|
+
animation-delay: 1s;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/* 播放状态 */
|
|
585
|
+
.is-playing .rotate-img,
|
|
586
|
+
.is-playing::after,
|
|
587
|
+
.is-playing::before {
|
|
588
|
+
animation-play-state: running;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
@keyframes rotate {
|
|
592
|
+
from { transform: rotate(0deg); }
|
|
593
|
+
to { transform: rotate(360deg); }
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
@keyframes wave {
|
|
597
|
+
0% {
|
|
598
|
+
transform: translate(-50%, -50%) scale(0);
|
|
599
|
+
opacity: 1;
|
|
600
|
+
}
|
|
601
|
+
100% {
|
|
602
|
+
transform: translate(-50%, -50%) scale(2);
|
|
603
|
+
opacity: 0;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
547
606
|
</style>
|
|
548
607
|
|
|
549
608
|
<div class="eplayer hover">
|
|
550
609
|
<div class="danmaku"></div>
|
|
551
610
|
<video id="video" class="video" src="${this.src || ''}"></video>
|
|
552
611
|
<div class="cover"></div>
|
|
553
|
-
<img src="${this.cover || ''}" class="
|
|
612
|
+
<div class="img-container"><img src="${this.cover || ''}" class="rotate-img"/></div>
|
|
554
613
|
<div class="mark loading"></div>
|
|
555
614
|
<div class="speed-indicator">倍速中</div>
|
|
556
615
|
<div class="controls">
|
|
@@ -587,6 +646,7 @@ class Eplayer extends HTMLElement {
|
|
|
587
646
|
}).appendChild(template.content.cloneNode(true))
|
|
588
647
|
|
|
589
648
|
const doms = [
|
|
649
|
+
'.img-container',
|
|
590
650
|
'.video',
|
|
591
651
|
'.mark',
|
|
592
652
|
'.playing',
|