Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0291185

Browse files
committed
feat: added events
1 parentd4e2464 commit0291185

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

‎src/CursorFx/CursorFx.vue‎

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@
213213
214214
this.$cursor&&this.$cursor.leaveHidden();
215215
216+
},
217+
cursorMixBlendMode(
218+
el
219+
) {
220+
221+
this.$cursor&&this.$cursor.mixBlendMode(
222+
el?.target?.dataset?.cursorMixBlendMode??null
223+
);
224+
216225
},
217226
initEvents() {
218227
@@ -273,14 +282,12 @@
273282
274283
link.addEventListener(
275284
'mouseenter',
276-
el=>this.$cursor&&this.$cursor.mixBlendMode(
277-
el.target.dataset.cursorMixBlendMode,
278-
),
285+
this.cursorMixBlendMode,
279286
false,
280287
);
281288
link.addEventListener(
282289
'mouseleave',
283-
()=>this.$cursor&&this.$cursor.mixBlendMode(),
290+
this.cursorMixBlendMode,
284291
false,
285292
);
286293
@@ -305,22 +312,30 @@
305312
306313
events&&this.initEvents();
307314
315+
this.loaded=true;
316+
308317
this.$emit(
309318
'ready',
310319
this.$cursor,
311320
);
312321
313-
this.loaded=true;
314-
315322
document.documentElement.classList.add(
316323
'is-cursor-fx-active',
317324
);
318325
326+
this.$emit(
327+
'after-start'
328+
);
329+
319330
},
320331
asyncdestroy(
321332
refresh=false
322333
) {
323334
335+
this.$emit(
336+
'before-destroy'
337+
);
338+
324339
this.destroyTimeout();
325340
326341
document.documentElement.classList.remove(
@@ -386,12 +401,12 @@
386401
387402
link.removeEventListener(
388403
'mouseenter',
389-
()=>this.$cursor&&this.$cursor.mixBlendMode(),
404+
this.cursorMixBlendMode,
390405
false,
391406
);
392407
link.removeEventListener(
393408
'mouseleave',
394-
()=>this.$cursor&&this.$cursor.mixBlendMode(),
409+
this.cursorMixBlendMode,
395410
false,
396411
);
397412
@@ -405,6 +420,10 @@
405420
this.$cursor=null;
406421
this.destroyed=true;
407422
423+
this.$emit(
424+
'after-destroy'
425+
);
426+
408427
// Refresh after destroy
409428
refresh&&this.start();
410429
@@ -420,6 +439,10 @@
420439
421440
awaitthis.$nextTick();
422441
442+
this.$emit(
443+
'before-start'
444+
);
445+
423446
this.$timeout=setTimeout(
424447
()=>this.init(),
425448
parseInt(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp