mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -08:00
add themeMix
This commit is contained in:
1 parent
59400eb3bf
commit
1438ce5e82
16 files changed
+428
-410
No files matched your search
@@ -1,12 +1,12 @@
|
||||
import { setStyle } from '../utils';
|
||||
import { getPosFromEvent } from './progress';
|
||||
|
||||
export default function thumbnails(option) {
|
||||
return art => ({
|
||||
...option,
|
||||
mounted: $control => {
|
||||
export default function thumbnails(options) {
|
||||
return (art) => ({
|
||||
...options,
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
option: { thumbnails },
|
||||
option,
|
||||
template: { $progress },
|
||||
events: { proxy, loadImg },
|
||||
} = art;
|
||||
@@ -16,7 +16,7 @@ export default function thumbnails(option) {
|
||||
|
||||
function showThumbnails(event) {
|
||||
const { width: posWidth } = getPosFromEvent(art, event);
|
||||
const { url, height, width, number, column } = thumbnails;
|
||||
const { url, height, width, number, column } = option.thumbnails;
|
||||
const perWidth = $progress.clientWidth / number;
|
||||
const perIndex = Math.floor(posWidth / perWidth);
|
||||
const yIndex = Math.ceil(perIndex / column) - 1;
|
||||
@@ -34,10 +34,10 @@ export default function thumbnails(option) {
|
||||
}
|
||||
}
|
||||
|
||||
proxy($progress, 'mousemove', event => {
|
||||
proxy($progress, 'mousemove', (event) => {
|
||||
if (!loading) {
|
||||
loading = true;
|
||||
loadImg(thumbnails.url).then(() => {
|
||||
loadImg(option.thumbnails.url).then(() => {
|
||||
isLoad = true;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user