mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
add bar
This commit is contained in:
1 parent
f58684991f
commit
e988f00cf8
15 files changed
+538
-140
No files matched your search
+13
-2
@@ -15,6 +15,10 @@ export function getExt(url) {
|
||||
return getExt(url.split('?')[0]);
|
||||
}
|
||||
|
||||
if (url.includes('#')) {
|
||||
return getExt(url.split('#')[0]);
|
||||
}
|
||||
|
||||
return url
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
@@ -22,12 +26,11 @@ export function getExt(url) {
|
||||
.pop();
|
||||
}
|
||||
|
||||
|
||||
export function append(parent, child) {
|
||||
if (child instanceof Element) {
|
||||
parent.appendChild(child);
|
||||
} else {
|
||||
parent.innerHTML = child;
|
||||
parent.insertAdjacentHTML('beforeend', child);
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
@@ -38,3 +41,11 @@ export function setStyle(element, styles) {
|
||||
});
|
||||
return element;
|
||||
}
|
||||
|
||||
export function secondToTime(second) {
|
||||
const add0 = num => num < 10 ? `0${num}` : String(num);
|
||||
const hour = Math.floor(second / 3600);
|
||||
const min = Math.floor((second - hour * 3600) / 60);
|
||||
const sec = Math.floor(second - hour * 3600 - min * 60);
|
||||
return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':');
|
||||
}
|
||||
Reference in new issue
Block a user