Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2b673db39 | ||
|
|
d116c75a09 | ||
|
|
a5cc501f3b | ||
|
|
96b49d2734 | ||
|
|
9f9ded6e1e | ||
|
|
12fc04957d | ||
|
|
c5776b2a78 | ||
|
|
548faa4bf3 | ||
|
|
91566de67a | ||
|
|
7b8ad10c04 | ||
|
|
47270238cb | ||
|
|
04e950b1eb | ||
|
|
54f9d5dcf9 | ||
|
|
2b6ba28167 | ||
|
|
10ad8cd38d | ||
|
|
adb2cd4ed8 | ||
|
|
f1bc748330 |
@@ -0,0 +1,37 @@
|
|||||||
|
The Star And Thank Author License (SATA)
|
||||||
|
|
||||||
|
Copyright (c) 2016 DIYgod(i@html.love)
|
||||||
|
|
||||||
|
Project Url: https://github.com/DIYgod/APlayer
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
And wait, the most important, you shall star/+1/like the project(s) in project url
|
||||||
|
section above first, and then thank the author(s) in Copyright section.
|
||||||
|
|
||||||
|
Here are some suggested ways:
|
||||||
|
|
||||||
|
- Email the authors a thank-you letter, and make friends with him/her/them.
|
||||||
|
- Report bugs or issues.
|
||||||
|
- Tell friends what a wonderful project this is.
|
||||||
|
- And, sure, you can just express thanks in your mind without telling the world.
|
||||||
|
|
||||||
|
Contributors of this project by forking have the option to add his/her name and
|
||||||
|
forked project url at copyright and project url sections, but shall not delete
|
||||||
|
or modify anything else in these two sections.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
@@ -7,13 +7,13 @@
|
|||||||
[](https://travis-ci.org/DIYgod/APlayer)
|
[](https://travis-ci.org/DIYgod/APlayer)
|
||||||
[](https://www.anotherhome.net/)
|
[](https://www.anotherhome.net/)
|
||||||
|
|
||||||
Wow, such a beautiful html5 music player
|
> Wow, such a beautiful html5 music player
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
UI 参考网易云音乐外链播放器
|
UI 参考网易云音乐外链播放器
|
||||||
|
|
||||||
[Demo](http://diygod.github.io/APlayer/demo)
|
[Demo](http://aplayer.js.org)
|
||||||
|
|
||||||
Screenshot
|
Screenshot
|
||||||

|

|
||||||
@@ -58,6 +58,7 @@ var option = {
|
|||||||
mutex: true, // Optional, pause other players when this player playing
|
mutex: true, // Optional, pause other players when this player playing
|
||||||
theme: '#e6d0b2', // Optional, theme color, default: #b7daff
|
theme: '#e6d0b2', // Optional, theme color, default: #b7daff
|
||||||
loop: true, // Optional, loop play music, default: true
|
loop: true, // Optional, loop play music, default: true
|
||||||
|
preload: 'metadata', // Optional, the way to load music, can be 'none' 'metadata' 'auto', default: 'metadata' in Desktop, 'none' in mobile
|
||||||
music: { // Required, music info, see: ###With playlist
|
music: { // Required, music info, see: ###With playlist
|
||||||
title: 'Preparation', // Required, music title
|
title: 'Preparation', // Required, music title
|
||||||
author: 'Hans Zimmer/Richard Harvey', // Required, music author
|
author: 'Hans Zimmer/Richard Harvey', // Required, music author
|
||||||
@@ -71,8 +72,12 @@ var option = {
|
|||||||
#### API
|
#### API
|
||||||
|
|
||||||
+ `ap.init()`
|
+ `ap.init()`
|
||||||
+ `ap.play()`
|
+ `ap.play()` // Resume play
|
||||||
+ `ap.pause()`
|
+ `ap.play(time)` // Set currentTime
|
||||||
|
+ `ap.pause()` // Pause
|
||||||
|
+ `ap.toggle()` // Toggle between play and pause
|
||||||
|
+ `ap.volume(percentage)` // Set volume
|
||||||
|
+ `ap.on(event, handler)` // Event binding
|
||||||
|
|
||||||
#### Event binding
|
#### Event binding
|
||||||
|
|
||||||
@@ -191,11 +196,13 @@ $ npm run build
|
|||||||
|
|
||||||
## Related Projects
|
## Related Projects
|
||||||
|
|
||||||
+ [APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin)
|
- [APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin)
|
||||||
|
|
||||||
+ [hexo-tag-aplayer](https://github.com/grzhan/hexo-tag-aplayer)
|
- [hexo-tag-aplayer](https://github.com/grzhan/hexo-tag-aplayer)
|
||||||
|
|
||||||
|
- [163music-APlayer-you-get-docker](https://github.com/YUX-IO/163music-APlayer-you-get-docker)
|
||||||
|
|
||||||
|
|
||||||
## LICENSE
|
## LICENSE
|
||||||
|
|
||||||
MIT © [DIYgod](http://github.com/DIYgod)
|
[The Star And Thank Author License (SATA)](https://github.com/DIYgod/APlayer/blob/master/LICENSE)
|
||||||
+19
-18
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
BIN
Binary file not shown.
Vendored
-20
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
|
|
||||||
<defs>
|
|
||||||
<font id="fontello" horiz-adv-x="1000" >
|
|
||||||
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
|
||||||
<missing-glyph horiz-adv-x="1000" />
|
|
||||||
<glyph glyph-name="volume-off" unicode="" d="m429 654v-608q0-14-11-25t-25-10-25 10l-186 186h-146q-15 0-25 11t-11 25v214q0 15 11 25t25 11h146l186 186q10 10 25 10t25-10 11-25z" horiz-adv-x="428.6" />
|
|
||||||
<glyph glyph-name="volume-down" unicode="" d="m429 654v-608q0-14-11-25t-25-10-25 10l-186 186h-146q-15 0-25 11t-11 25v214q0 15 11 25t25 11h146l186 186q10 10 25 10t25-10 11-25z m214-304q0-42-24-79t-63-52q-5-3-14-3-14 0-25 10t-10 26q0 12 6 20t17 14 19 12 16 20 6 32-6 32-16 20-19 12-17 14-6 20q0 15 10 26t25 10q9 0 14-3 39-15 63-52t24-79z" horiz-adv-x="642.9" />
|
|
||||||
<glyph glyph-name="volume-up" unicode="" d="m429 654v-608q0-14-11-25t-25-10-25 10l-186 186h-146q-15 0-25 11t-11 25v214q0 15 11 25t25 11h146l186 186q10 10 25 10t25-10 11-25z m214-304q0-42-24-79t-63-52q-5-3-14-3-14 0-25 10t-10 26q0 12 6 20t17 14 19 12 16 20 6 32-6 32-16 20-19 12-17 14-6 20q0 15 10 26t25 10q9 0 14-3 39-15 63-52t24-79z m143 0q0-85-48-158t-125-105q-8-3-14-3-15 0-26 11t-10 25q0 22 21 33 32 16 43 25 41 30 64 75t23 97-23 97-64 75q-11 9-43 25-21 11-21 33 0 14 10 25t25 11q7 0 15-3 78-33 125-105t48-158z m143 0q0-128-71-236t-189-158q-7-3-14-3-15 0-26 11t-10 25q0 20 22 33 4 2 12 6t13 6q25 14 45 28 69 51 108 127t38 161-38 161-108 127q-20 14-45 28-4 3-13 6t-12 6q-22 13-22 33 0 14 10 25t26 11q7 0 14-3 118-51 189-158t71-236z" horiz-adv-x="928.6" />
|
|
||||||
<glyph glyph-name="loop" unicode="" d="m800 540q42 0 71-29t29-71l0-290q0-40-29-70t-71-30l-700 0q-40 0-70 30t-30 70l0 290q0 42 30 71t70 29l250 0 0 110 200-180-200-180 0 110-210 0 0-210 620 0 0 210-150 0 0 140 190 0z" horiz-adv-x="900" />
|
|
||||||
<glyph glyph-name="play" unicode="" d="m486 376q14-10 14-26 0-14-14-24l-428-266q-24-16-41-6t-17 40l0 514q0 30 17 40t41-6z" horiz-adv-x="500" />
|
|
||||||
<glyph glyph-name="pause" unicode="" d="m440 700q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z m-350 0q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z" horiz-adv-x="530" />
|
|
||||||
<glyph glyph-name="to-start" unicode="" d="m174 350q0 14 14 24l364 228q20 14 34 5t14-35l0-442q0-26-14-35t-34 5l-364 228q-14 10-14 22z m-174 234q0 58 76 58 74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466z" horiz-adv-x="600" />
|
|
||||||
<glyph glyph-name="to-end" unicode="" d="m412 374q14-10 14-24 0-12-14-22l-362-228q-22-14-36-5t-14 35l0 442q0 26 14 35t36-5z m114 268q74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466q0 58 76 58z" horiz-adv-x="600" />
|
|
||||||
<glyph glyph-name="menu" unicode="" d="m650 400q22 0 36-15t14-35-15-35-35-15l-600 0q-20 0-35 15t-15 35 14 35 36 15l600 0z m-600 100q-20 0-35 15t-15 35 14 35 36 15l600 0q22 0 36-15t14-35-15-35-35-15l-600 0z m600-300q22 0 36-15t14-35-15-35-35-15l-600 0q-20 0-35 15t-15 35 14 35 36 15l600 0z" horiz-adv-x="700" />
|
|
||||||
</font>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 3.1 KiB |
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aplayer",
|
"name": "aplayer",
|
||||||
"version": "1.4.3",
|
"version": "1.4.8",
|
||||||
"description": "Wow, such a beautiful html5 music player",
|
"description": "Wow, such a beautiful html5 music player",
|
||||||
"main": "dist/APlayer.min.js",
|
"main": "dist/APlayer.min.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"html5"
|
"html5"
|
||||||
],
|
],
|
||||||
"author": "DIYgod",
|
"author": "DIYgod",
|
||||||
"license": "MIT",
|
"license": "SATA",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/DIYgod/APlayer/issues"
|
"url": "https://github.com/DIYgod/APlayer/issues"
|
||||||
},
|
},
|
||||||
|
|||||||
+139
-44
@@ -8,8 +8,25 @@
|
|||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
constructor(option) {
|
constructor(option) {
|
||||||
|
this.svg = {
|
||||||
|
'play': ['0 0 16 31', 'M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z'],
|
||||||
|
'pause': ['0 0 17 32', 'M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z'],
|
||||||
|
'volume-up': ['0 0 28 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z'],
|
||||||
|
'volume-down': ['0 0 28 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z'],
|
||||||
|
'volume-off': ['0 0 28 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z'],
|
||||||
|
'loop': ['0 0 29 32', 'M25.6 9.92q1.344 0 2.272 0.928t0.928 2.272v9.28q0 1.28-0.928 2.24t-2.272 0.96h-22.4q-1.28 0-2.24-0.96t-0.96-2.24v-9.28q0-1.344 0.96-2.272t2.24-0.928h8v-3.52l6.4 5.76-6.4 5.76v-3.52h-6.72v6.72h19.84v-6.72h-4.8v-4.48h6.080z'],
|
||||||
|
'menu': ['0 0 22 32', 'M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z']
|
||||||
|
};
|
||||||
|
this.getSVG = (type) => {
|
||||||
|
return `
|
||||||
|
<svg xmlns:xlink="http://www.w3.org/1999/xlink" height="100%" version="1.1" viewBox="${this.svg[type][0]}" width="100%">
|
||||||
|
<use xlink:href="#aplayer-${type}"></use>
|
||||||
|
<path class="aplayer-fill" d="${this.svg[type][1]}" id="aplayer-${type}"></path>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
this.isMobile = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i);
|
this.isMobile = /mobile/i.test(window.navigator.userAgent);
|
||||||
// compatibility: some mobile browsers don't suppose autoplay
|
// compatibility: some mobile browsers don't suppose autoplay
|
||||||
if (this.isMobile) {
|
if (this.isMobile) {
|
||||||
option.autoplay = false;
|
option.autoplay = false;
|
||||||
@@ -127,12 +144,12 @@
|
|||||||
// define APlayer events
|
// define APlayer events
|
||||||
this.eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];
|
this.eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];
|
||||||
this.event = {};
|
this.event = {};
|
||||||
for (let type of this.eventTypes) {
|
for (let i = 0; i < this.eventTypes.length; i++) {
|
||||||
this.event[type] = [];
|
this.event[this.eventTypes[i]] = [];
|
||||||
}
|
}
|
||||||
this.trigger = (type) => {
|
this.trigger = (type) => {
|
||||||
for (let func of this.event[type]) {
|
for (let i = 0; i < this.event[type].length; i++) {
|
||||||
func();
|
this.event[type][i]();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,9 +192,11 @@
|
|||||||
|
|
||||||
// fill in HTML
|
// fill in HTML
|
||||||
let eleHTML = `
|
let eleHTML = `
|
||||||
<div class="aplayer-pic" ${(this.music.pic ? (`style="background-image: url("${encodeURI(this.music.pic)}");"`) : ``)}>
|
<div class="aplayer-pic" ${(this.music.pic ? (`style="background-image: url('${this.music.pic}');"`) : ``)}>
|
||||||
<div class="aplayer-button aplayer-play">
|
<div class="aplayer-button aplayer-play">
|
||||||
<i class="demo-icon aplayer-icon-play"></i>
|
<button class="aplayer-icon aplayer-icon-play">`
|
||||||
|
+ this.getSVG('play')
|
||||||
|
+ ` </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="aplayer-info">
|
<div class="aplayer-info">
|
||||||
@@ -198,16 +217,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="aplayer-time">
|
<div class="aplayer-time">
|
||||||
- <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>
|
<span class="aplayer-time-inner">
|
||||||
|
- <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>
|
||||||
|
</span>
|
||||||
<div class="aplayer-volume-wrap">
|
<div class="aplayer-volume-wrap">
|
||||||
<i class="demo-icon aplayer-icon-volume-down"></i>
|
<button class="aplayer-icon aplayer-icon-volume-down">`
|
||||||
|
+ this.getSVG('volume-down')
|
||||||
|
+ ` </button>
|
||||||
<div class="aplayer-volume-bar-wrap">
|
<div class="aplayer-volume-bar-wrap">
|
||||||
<div class="aplayer-volume-bar">
|
<div class="aplayer-volume-bar">
|
||||||
<div class="aplayer-volume" style="height: 80%; background: ${this.option.theme};"></div>
|
<div class="aplayer-volume" style="height: 80%; background: ${this.option.theme};"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<i class="demo-icon aplayer-icon-loop${(this.loop ? `` : ` aplayer-noloop`)}"></i>${(this.multiple ? `<i class="demo-icon aplayer-icon-menu"></i>` : ``)}
|
<button class="aplayer-icon aplayer-icon-loop${(this.loop ? `` : ` aplayer-noloop`)}">`
|
||||||
|
+ this.getSVG('loop')
|
||||||
|
+ ` </button>
|
||||||
|
${(this.multiple ? `<button class="aplayer-icon aplayer-icon-menu">`
|
||||||
|
+ this.getSVG('menu')
|
||||||
|
+ ` </button>` : ``)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
@@ -230,11 +258,19 @@
|
|||||||
}
|
}
|
||||||
this.element.innerHTML = eleHTML;
|
this.element.innerHTML = eleHTML;
|
||||||
|
|
||||||
|
// hide loop button in arrow container
|
||||||
|
if (this.element.offsetWidth < 300) {
|
||||||
|
this.element.getElementsByClassName('aplayer-icon-loop')[0].style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ptime = this.element.getElementsByClassName('aplayer-ptime')[0];
|
||||||
|
|
||||||
if (this.element.getElementsByClassName('aplayer-info')[0].offsetWidth < 200) {
|
if (this.element.getElementsByClassName('aplayer-info')[0].offsetWidth < 200) {
|
||||||
this.element.getElementsByClassName('aplayer-time')[0].classList.add('aplayer-time-narrow');
|
this.element.getElementsByClassName('aplayer-time')[0].classList.add('aplayer-time-narrow');
|
||||||
}
|
}
|
||||||
// fix the width of aplayer bar
|
// fix the width of aplayer bar
|
||||||
this.element.getElementsByClassName('aplayer-bar-wrap')[0].style.marginRight = this.element.getElementsByClassName('aplayer-time')[0].offsetWidth + 5 + 'px';
|
this.bar = this.element.getElementsByClassName('aplayer-bar-wrap')[0];
|
||||||
|
this.bar.style.marginRight = this.element.getElementsByClassName('aplayer-time')[0].offsetWidth + 5 + 'px';
|
||||||
|
|
||||||
// switch to narrow style
|
// switch to narrow style
|
||||||
if (this.option.narrow) {
|
if (this.option.narrow) {
|
||||||
@@ -260,8 +296,16 @@
|
|||||||
const musicIndex = parseInt(listItem[i].getElementsByClassName('aplayer-list-index')[0].innerHTML) - 1;
|
const musicIndex = parseInt(listItem[i].getElementsByClassName('aplayer-list-index')[0].innerHTML) - 1;
|
||||||
if (musicIndex !== this.playIndex) {
|
if (musicIndex !== this.playIndex) {
|
||||||
this.setMusic(musicIndex);
|
this.setMusic(musicIndex);
|
||||||
|
if (this.isMobile) {
|
||||||
|
this.pause();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.toggle();
|
||||||
}
|
}
|
||||||
this.play();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -270,7 +314,6 @@
|
|||||||
this.playedBar = this.element.getElementsByClassName('aplayer-played')[0];
|
this.playedBar = this.element.getElementsByClassName('aplayer-played')[0];
|
||||||
this.loadedBar = this.element.getElementsByClassName('aplayer-loaded')[0];
|
this.loadedBar = this.element.getElementsByClassName('aplayer-loaded')[0];
|
||||||
this.thumb = this.element.getElementsByClassName('aplayer-thumb')[0];
|
this.thumb = this.element.getElementsByClassName('aplayer-thumb')[0];
|
||||||
this.bar = this.element.getElementsByClassName('aplayer-bar')[0];
|
|
||||||
let barWidth;
|
let barWidth;
|
||||||
this.bar.addEventListener('click', (event) => {
|
this.bar.addEventListener('click', (event) => {
|
||||||
const e = event || window.event;
|
const e = event || window.event;
|
||||||
@@ -324,34 +367,33 @@
|
|||||||
// control volume
|
// control volume
|
||||||
this.volumeBar = this.element.getElementsByClassName('aplayer-volume')[0];
|
this.volumeBar = this.element.getElementsByClassName('aplayer-volume')[0];
|
||||||
const volumeBarWrap = this.element.getElementsByClassName('aplayer-volume-bar')[0];
|
const volumeBarWrap = this.element.getElementsByClassName('aplayer-volume-bar')[0];
|
||||||
const volumeicon = this.element.getElementsByClassName('aplayer-time')[0].getElementsByTagName('i')[0];
|
this.volumeicon = this.element.getElementsByClassName('aplayer-time')[0].getElementsByTagName('button')[0];
|
||||||
const barHeight = 35;
|
const barHeight = 35;
|
||||||
this.element.getElementsByClassName('aplayer-volume-bar-wrap')[0].addEventListener('click', (event) => {
|
this.element.getElementsByClassName('aplayer-volume-bar-wrap')[0].addEventListener('click', (event) => {
|
||||||
const e = event || window.event;
|
const e = event || window.event;
|
||||||
let percentage = (barHeight - e.clientY + getElementViewTop(volumeBarWrap)) / barHeight;
|
let percentage = (barHeight - e.clientY + getElementViewTop(volumeBarWrap)) / barHeight;
|
||||||
percentage = percentage > 0 ? percentage : 0;
|
percentage = percentage > 0 ? percentage : 0;
|
||||||
percentage = percentage < 1 ? percentage : 1;
|
percentage = percentage < 1 ? percentage : 1;
|
||||||
this.updateBar('volume', percentage, 'height');
|
this.volume(percentage);
|
||||||
this.audio.volume = percentage;
|
|
||||||
if (this.audio.muted) {
|
|
||||||
this.audio.muted = false;
|
|
||||||
}
|
|
||||||
if (percentage === 1) {
|
|
||||||
volumeicon.className = 'demo-icon aplayer-icon-volume-up';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
volumeicon.className = 'demo-icon aplayer-icon-volume-down';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
volumeicon.addEventListener('click', () => {
|
this.volumeicon.addEventListener('click', () => {
|
||||||
if (this.audio.muted) {
|
if (this.audio.muted) {
|
||||||
this.audio.muted = false;
|
this.audio.muted = false;
|
||||||
volumeicon.className = this.audio.volume === 1 ? 'demo-icon aplayer-icon-volume-up' : 'demo-icon aplayer-icon-volume-down';
|
this.volumeicon.className = this.audio.volume === 1 ? 'aplayer-icon aplayer-icon-volume-up' : 'aplayer-icon aplayer-icon-volume-down';
|
||||||
|
if (this.audio.volume === 1) {
|
||||||
|
this.volumeicon.className = 'aplayer-icon aplayer-icon-volume-up';
|
||||||
|
this.volumeicon.innerHTML = this.getSVG('volume-up');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.volumeicon.className = 'aplayer-icon aplayer-icon-volume-down';
|
||||||
|
this.volumeicon.innerHTML = this.getSVG('volume-down');
|
||||||
|
}
|
||||||
this.updateBar('volume', this.audio.volume, 'height');
|
this.updateBar('volume', this.audio.volume, 'height');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.audio.muted = true;
|
this.audio.muted = true;
|
||||||
volumeicon.className = 'demo-icon aplayer-icon-volume-off';
|
this.volumeicon.className = 'aplayer-icon aplayer-icon-volume-off';
|
||||||
|
this.volumeicon.innerHTML = this.getSVG('volume-off');
|
||||||
this.updateBar('volume', 0, 'height');
|
this.updateBar('volume', 0, 'height');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -398,8 +440,9 @@
|
|||||||
|
|
||||||
// toggle menu control
|
// toggle menu control
|
||||||
if (this.multiple) {
|
if (this.multiple) {
|
||||||
|
const list = this.element.getElementsByClassName('aplayer-list')[0];
|
||||||
|
list.style.height = list.offsetHeight + 'px';
|
||||||
this.element.getElementsByClassName('aplayer-icon-menu')[0].addEventListener('click', () => {
|
this.element.getElementsByClassName('aplayer-icon-menu')[0].addEventListener('click', () => {
|
||||||
const list = this.element.getElementsByClassName('aplayer-list')[0];
|
|
||||||
if (!list.classList.contains('aplayer-list-hide')) {
|
if (!list.classList.contains('aplayer-list-hide')) {
|
||||||
list.classList.add('aplayer-list-hide');
|
list.classList.add('aplayer-list-hide');
|
||||||
}
|
}
|
||||||
@@ -427,7 +470,7 @@
|
|||||||
|
|
||||||
// set html
|
// set html
|
||||||
if (this.music.pic) {
|
if (this.music.pic) {
|
||||||
this.element.getElementsByClassName('aplayer-pic')[0].style.backgroundImage = `url(${encodeURI(this.music.pic)})`;
|
this.element.getElementsByClassName('aplayer-pic')[0].style.backgroundImage = `url('${this.music.pic}')`;
|
||||||
}
|
}
|
||||||
this.element.getElementsByClassName('aplayer-title')[0].innerHTML = this.music.title;
|
this.element.getElementsByClassName('aplayer-title')[0].innerHTML = this.music.title;
|
||||||
this.element.getElementsByClassName('aplayer-author')[0].innerHTML = ` - ${this.music.author}`;
|
this.element.getElementsByClassName('aplayer-author')[0].innerHTML = ` - ${this.music.author}`;
|
||||||
@@ -448,7 +491,12 @@
|
|||||||
if ((this.multiple && !this.audios[indexMusic]) || this.playIndex === -1) {
|
if ((this.multiple && !this.audios[indexMusic]) || this.playIndex === -1) {
|
||||||
this.audio = document.createElement("audio");
|
this.audio = document.createElement("audio");
|
||||||
this.audio.src = this.music.url;
|
this.audio.src = this.music.url;
|
||||||
this.audio.preload = this.isMobile ? 'none' : 'metadata';
|
if (this.option.preload) {
|
||||||
|
this.audio.preload = this.option.preload;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.audio.preload = this.isMobile ? 'none' : 'metadata';
|
||||||
|
}
|
||||||
|
|
||||||
// show audio time: the metadata has loaded or changed
|
// show audio time: the metadata has loaded or changed
|
||||||
this.audio.addEventListener('durationchange', () => {
|
this.audio.addEventListener('durationchange', () => {
|
||||||
@@ -478,16 +526,23 @@
|
|||||||
this.ended = false;
|
this.ended = false;
|
||||||
if (this.multiple) {
|
if (this.multiple) {
|
||||||
this.audio.addEventListener('ended', () => {
|
this.audio.addEventListener('ended', () => {
|
||||||
if (this.playIndex < this.option.music.length - 1) {
|
if (this.isMobile) {
|
||||||
this.setMusic(++this.playIndex);
|
|
||||||
}
|
|
||||||
else if (this.loop) {
|
|
||||||
this.setMusic(0);
|
|
||||||
}
|
|
||||||
else if (!this.loop) {
|
|
||||||
this.ended = true;
|
this.ended = true;
|
||||||
this.pause();
|
this.pause();
|
||||||
this.trigger('ended');
|
return;
|
||||||
|
}
|
||||||
|
if (this.audio.currentTime !== 0) {
|
||||||
|
if (this.playIndex < this.option.music.length - 1) {
|
||||||
|
this.setMusic(++this.playIndex);
|
||||||
|
}
|
||||||
|
else if (this.loop) {
|
||||||
|
this.setMusic(0);
|
||||||
|
}
|
||||||
|
else if (!this.loop) {
|
||||||
|
this.ended = true;
|
||||||
|
this.pause();
|
||||||
|
this.trigger('ended');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -553,13 +608,19 @@
|
|||||||
/**
|
/**
|
||||||
* Play music
|
* Play music
|
||||||
*/
|
*/
|
||||||
play() {
|
play(time) {
|
||||||
|
if (Object.prototype.toString.call(time) === '[object Number]') {
|
||||||
|
this.audio.currentTime = time;
|
||||||
|
}
|
||||||
if (this.audio.paused) {
|
if (this.audio.paused) {
|
||||||
this.button.classList.remove('aplayer-play');
|
this.button.classList.remove('aplayer-play');
|
||||||
this.button.classList.add('aplayer-pause');
|
this.button.classList.add('aplayer-pause');
|
||||||
this.button.innerHTML = '';
|
this.button.innerHTML = '';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.button.innerHTML = '<i class="demo-icon aplayer-icon-pause"></i>';
|
this.button.innerHTML = `
|
||||||
|
<button class="aplayer-icon aplayer-icon-pause">`
|
||||||
|
+ this.getSVG('pause')
|
||||||
|
+ ` </button>`;
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
// pause other players (Thanks @Aprikyblue)
|
// pause other players (Thanks @Aprikyblue)
|
||||||
@@ -579,7 +640,7 @@
|
|||||||
if (this.option.showlrc) {
|
if (this.option.showlrc) {
|
||||||
this.updateLrc();
|
this.updateLrc();
|
||||||
}
|
}
|
||||||
this.element.getElementsByClassName('aplayer-ptime')[0].innerHTML = this.secondToTime(this.audio.currentTime);
|
this.ptime.innerHTML = this.secondToTime(this.audio.currentTime);
|
||||||
this.trigger('playing');
|
this.trigger('playing');
|
||||||
}, 100);
|
}, 100);
|
||||||
this.trigger('play');
|
this.trigger('play');
|
||||||
@@ -596,7 +657,10 @@
|
|||||||
this.button.classList.add('aplayer-play');
|
this.button.classList.add('aplayer-play');
|
||||||
this.button.innerHTML = '';
|
this.button.innerHTML = '';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.button.innerHTML = '<i class="demo-icon aplayer-icon-play"></i>';
|
this.button.innerHTML = `
|
||||||
|
<button class="aplayer-icon aplayer-icon-play">`
|
||||||
|
+ this.getSVG('play')
|
||||||
|
+ ` </button>`;
|
||||||
}, 100);
|
}, 100);
|
||||||
this.audio.pause();
|
this.audio.pause();
|
||||||
clearInterval(this.playedTime);
|
clearInterval(this.playedTime);
|
||||||
@@ -604,6 +668,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set volume
|
||||||
|
*/
|
||||||
|
volume(percentage) {
|
||||||
|
this.updateBar('volume', percentage, 'height');
|
||||||
|
this.audio.volume = percentage;
|
||||||
|
if (this.audio.muted) {
|
||||||
|
this.audio.muted = false;
|
||||||
|
}
|
||||||
|
if (percentage === 1) {
|
||||||
|
this.volumeicon.className = 'aplayer-icon aplayer-icon-volume-up';
|
||||||
|
this.volumeicon.innerHTML = this.getSVG('volume-up');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.volumeicon.className = 'aplayer-icon aplayer-icon-volume-down';
|
||||||
|
this.volumeicon.innerHTML = this.getSVG('volume-down');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* attach event
|
* attach event
|
||||||
*/
|
*/
|
||||||
@@ -612,10 +695,22 @@
|
|||||||
this.event[name].push(func);
|
this.event[name].push(func);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* toggle between play and pause
|
||||||
|
*/
|
||||||
|
toggle() {
|
||||||
|
if (this.audio.paused) {
|
||||||
|
this.play();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.pause();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
||||||
module.exports = APlayer
|
module.exports = APlayer;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
window.APlayer = APlayer;
|
window.APlayer = APlayer;
|
||||||
|
|||||||
+49
-77
@@ -2,17 +2,6 @@ $aplayer-height: 66px;
|
|||||||
$lrc-height: 40px;
|
$lrc-height: 40px;
|
||||||
$aplayer-height-lrc: $aplayer-height + $lrc-height;
|
$aplayer-height-lrc: $aplayer-height + $lrc-height;
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'aplayer-fontello';
|
|
||||||
src: url('font/aplayer-fontello.eot?72550380');
|
|
||||||
src: url('font/aplayer-fontello.eot?72550380#iefix') format('embedded-opentype'),
|
|
||||||
url('font/aplayer-fontello.woff?72550380') format('woff'),
|
|
||||||
url('font/aplayer-fontello.ttf?72550380') format('truetype'),
|
|
||||||
url('font/aplayer-fontello.svg?72550380#fontello') format('svg');
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-narrow {
|
.aplayer-narrow {
|
||||||
width: $aplayer-height;
|
width: $aplayer-height;
|
||||||
.aplayer-info {
|
.aplayer-info {
|
||||||
@@ -50,53 +39,20 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
[class^="aplayer-icon-"]:before, [class*=" aplayer-icon-"]:before {
|
.aplayer-icon {
|
||||||
font-family: "aplayer-fontello";
|
width: 15px;
|
||||||
font-style: normal;
|
height: 15px;
|
||||||
font-weight: normal;
|
border: none;
|
||||||
display: inline-block;
|
background-color: transparent;
|
||||||
text-decoration: inherit;
|
outline: none;
|
||||||
width: 1em;
|
cursor: pointer;
|
||||||
text-align: center;
|
opacity: .8;
|
||||||
font-variant: normal;
|
vertical-align: middle;
|
||||||
text-transform: none;
|
padding: 0;
|
||||||
line-height: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-play:before {
|
.aplayer-fill {
|
||||||
content: '\e806';
|
transition: all .2s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aplayer-icon-pause:before {
|
|
||||||
content: '\e807';
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-to-start:before {
|
|
||||||
content: '\e808';
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-to-end:before {
|
|
||||||
content: '\e809';
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-loop:before {
|
|
||||||
content: '\e803';
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-menu:before {
|
|
||||||
content: '\e80b';
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-volume-off:before {
|
|
||||||
content: '\e800';
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-volume-down:before {
|
|
||||||
content: '\e801';
|
|
||||||
}
|
|
||||||
|
|
||||||
.aplayer-icon-volume-up:before {
|
|
||||||
content: '\e802';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.aplayer-lrc-content {
|
.aplayer-lrc-content {
|
||||||
@@ -114,7 +70,6 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
|
|
||||||
.aplayer-button {
|
.aplayer-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
color: #fff;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -125,6 +80,10 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
&:hover {
|
&:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aplayer-fill {
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.aplayer-hide {
|
.aplayer-hide {
|
||||||
@@ -140,10 +99,10 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
margin: 0 -15px -15px 0;
|
margin: 0 -15px -15px 0;
|
||||||
.aplayer-icon-play {
|
.aplayer-icon-play {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 2px;
|
top: 3px;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
font-size: 20px;
|
height: 20px;
|
||||||
line-height: 23px;
|
width: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,10 +114,10 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
right: 4px;
|
right: 4px;
|
||||||
.aplayer-icon-pause {
|
.aplayer-icon-pause {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 1px;
|
top: 2px;
|
||||||
left: 2px;
|
left: 2px;
|
||||||
font-size: 12px;
|
height: 12px;
|
||||||
line-height: 14px;
|
width: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,7 +132,7 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
margin-bottom: 17px;
|
margin-bottom: 13px;
|
||||||
|
|
||||||
.aplayer-title {
|
.aplayer-title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -190,13 +149,14 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
|
|
||||||
.aplayer-bar-wrap {
|
.aplayer-bar-wrap {
|
||||||
margin: 0 140px 0 5px;
|
margin: 0 140px 0 5px;
|
||||||
|
padding: 4px 0;
|
||||||
|
cursor: pointer !important;
|
||||||
|
|
||||||
.aplayer-bar {
|
.aplayer-bar {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #cdcdcd;
|
background: #cdcdcd;
|
||||||
cursor: pointer !important;
|
|
||||||
|
|
||||||
.aplayer-loaded {
|
.aplayer-loaded {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -234,29 +194,41 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
.aplayer-time {
|
.aplayer-time {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: -5px;
|
bottom: -3px;
|
||||||
height: 17px;
|
height: 17px;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
|
|
||||||
i {
|
.aplayer-time-inner {
|
||||||
color: #666;
|
vertical-align: middle;
|
||||||
font-size: 15px;
|
}
|
||||||
|
|
||||||
|
.aplayer-icon {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
|
|
||||||
|
.aplayer-fill {
|
||||||
|
fill: #666;
|
||||||
|
}
|
||||||
|
|
||||||
&.aplayer-icon-loop {
|
&.aplayer-icon-loop {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
&.aplayer-noloop {
|
&.aplayer-noloop {
|
||||||
color: #ddd;
|
.aplayer-fill {
|
||||||
|
fill: #ddd;
|
||||||
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #bbb;
|
.aplayer-fill {
|
||||||
|
fill: #bbb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #000;
|
.aplayer-fill {
|
||||||
|
fill: #000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,8 +256,8 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
.aplayer-volume-bar-wrap {
|
.aplayer-volume-bar-wrap {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 17px;
|
bottom: 15px;
|
||||||
right: -5px;
|
right: -3px;
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
@@ -373,12 +345,11 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.aplayer-list {
|
.aplayer-list {
|
||||||
max-height: 300px;
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
transition: all 0.5s ease;
|
transition: all 0.5s ease;
|
||||||
|
|
||||||
&.aplayer-list-hide {
|
&.aplayer-list-hide {
|
||||||
max-height: 0;
|
height: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
ol {
|
ol {
|
||||||
@@ -395,6 +366,7 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
|||||||
border-top: 1px solid #e9e9e9;
|
border-top: 1px solid #e9e9e9;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #efefef;
|
background: #efefef;
|
||||||
|
|||||||
Binary file not shown.
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
|
|
||||||
<defs>
|
|
||||||
<font id="fontello" horiz-adv-x="1000" >
|
|
||||||
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
|
||||||
<missing-glyph horiz-adv-x="1000" />
|
|
||||||
<glyph glyph-name="volume-off" unicode="" d="m429 654v-608q0-14-11-25t-25-10-25 10l-186 186h-146q-15 0-25 11t-11 25v214q0 15 11 25t25 11h146l186 186q10 10 25 10t25-10 11-25z" horiz-adv-x="428.6" />
|
|
||||||
<glyph glyph-name="volume-down" unicode="" d="m429 654v-608q0-14-11-25t-25-10-25 10l-186 186h-146q-15 0-25 11t-11 25v214q0 15 11 25t25 11h146l186 186q10 10 25 10t25-10 11-25z m214-304q0-42-24-79t-63-52q-5-3-14-3-14 0-25 10t-10 26q0 12 6 20t17 14 19 12 16 20 6 32-6 32-16 20-19 12-17 14-6 20q0 15 10 26t25 10q9 0 14-3 39-15 63-52t24-79z" horiz-adv-x="642.9" />
|
|
||||||
<glyph glyph-name="volume-up" unicode="" d="m429 654v-608q0-14-11-25t-25-10-25 10l-186 186h-146q-15 0-25 11t-11 25v214q0 15 11 25t25 11h146l186 186q10 10 25 10t25-10 11-25z m214-304q0-42-24-79t-63-52q-5-3-14-3-14 0-25 10t-10 26q0 12 6 20t17 14 19 12 16 20 6 32-6 32-16 20-19 12-17 14-6 20q0 15 10 26t25 10q9 0 14-3 39-15 63-52t24-79z m143 0q0-85-48-158t-125-105q-8-3-14-3-15 0-26 11t-10 25q0 22 21 33 32 16 43 25 41 30 64 75t23 97-23 97-64 75q-11 9-43 25-21 11-21 33 0 14 10 25t25 11q7 0 15-3 78-33 125-105t48-158z m143 0q0-128-71-236t-189-158q-7-3-14-3-15 0-26 11t-10 25q0 20 22 33 4 2 12 6t13 6q25 14 45 28 69 51 108 127t38 161-38 161-108 127q-20 14-45 28-4 3-13 6t-12 6q-22 13-22 33 0 14 10 25t26 11q7 0 14-3 118-51 189-158t71-236z" horiz-adv-x="928.6" />
|
|
||||||
<glyph glyph-name="loop" unicode="" d="m800 540q42 0 71-29t29-71l0-290q0-40-29-70t-71-30l-700 0q-40 0-70 30t-30 70l0 290q0 42 30 71t70 29l250 0 0 110 200-180-200-180 0 110-210 0 0-210 620 0 0 210-150 0 0 140 190 0z" horiz-adv-x="900" />
|
|
||||||
<glyph glyph-name="play" unicode="" d="m486 376q14-10 14-26 0-14-14-24l-428-266q-24-16-41-6t-17 40l0 514q0 30 17 40t41-6z" horiz-adv-x="500" />
|
|
||||||
<glyph glyph-name="pause" unicode="" d="m440 700q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z m-350 0q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z" horiz-adv-x="530" />
|
|
||||||
<glyph glyph-name="to-start" unicode="" d="m174 350q0 14 14 24l364 228q20 14 34 5t14-35l0-442q0-26-14-35t-34 5l-364 228q-14 10-14 22z m-174 234q0 58 76 58 74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466z" horiz-adv-x="600" />
|
|
||||||
<glyph glyph-name="to-end" unicode="" d="m412 374q14-10 14-24 0-12-14-22l-362-228q-22-14-36-5t-14 35l0 442q0 26 14 35t36-5z m114 268q74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466q0 58 76 58z" horiz-adv-x="600" />
|
|
||||||
<glyph glyph-name="menu" unicode="" d="m650 400q22 0 36-15t14-35-15-35-35-15l-600 0q-20 0-35 15t-15 35 14 35 36 15l600 0z m-600 100q-20 0-35 15t-15 35 14 35 36 15l600 0q22 0 36-15t14-35-15-35-35-15l-600 0z m600-300q22 0 36-15t14-35-15-35-35-15l-600 0q-20 0-35 15t-15 35 14 35 36 15l600 0z" horiz-adv-x="700" />
|
|
||||||
</font>
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user