This commit is contained in:
zhw2590582 committed 2022-01-07 20:13:44 +08:00
1 parent 9bc87eb0e2
commit b70a804591
54 files changed
+357 -226

No files matched your search

+1 -4
View File
@@ -1,10 +1,7 @@
import { query, clamp, append, setStyle, setStyles, secondToTime, includeFromEvent } from '../utils';
export function getPosFromEvent(art, event) {
const {
template: { $progress },
} = art;
const { $progress } = art.template;
const { left } = $progress.getBoundingClientRect();
const width = clamp(event.pageX - left, 0, $progress.clientWidth);
const second = (width / $progress.clientWidth) * art.duration;