add Artplayer.LOG_VERSION

This commit is contained in:
Harvey Zack committed 2023-08-22 20:51:39 +08:00
1 parent 3179d1241e
commit 894a9db1d7
34 files changed
+182 -136

No files matched your search

+3 -3
View File
@@ -26,7 +26,7 @@ export function append(parent, child) {
} else {
parent.insertAdjacentHTML('beforeend', String(child));
}
return parent.lastElementChild || parent.lastChild;
return parent.lastElementChild ?? parent.lastChild;
}
export function remove(child) {
@@ -68,8 +68,8 @@ export function tooltip(target, msg, pos = 'top') {
export function isInViewport(el, offset = 0) {
const rect = el.getBoundingClientRect();
const windowHeight = window.innerHeight || document.documentElement.clientHeight;
const windowWidth = window.innerWidth || document.documentElement.clientWidth;
const windowHeight = window.innerHeight ?? document.documentElement.clientHeight;
const windowWidth = window.innerWidth ?? document.documentElement.clientWidth;
const vertInView = rect.top - offset <= windowHeight && rect.top + rect.height + offset >= 0;
const horInView = rect.left - offset <= windowWidth + offset && rect.left + rect.width + offset >= 0;
return vertInView && horInView;