mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
Use Array.flat in motion.js
This commit is contained in:
parent
5c024800e6
commit
783b6ffe8c
@ -10,12 +10,11 @@ NexT.motion.integrator = {
|
|||||||
},
|
},
|
||||||
add(fn) {
|
add(fn) {
|
||||||
const sequence = fn();
|
const sequence = fn();
|
||||||
if (CONFIG.motion.async) this.queue.push(sequence);
|
this.queue.push(sequence);
|
||||||
else this.queue = this.queue.concat(sequence);
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
bootstrap() {
|
bootstrap() {
|
||||||
if (!CONFIG.motion.async) this.queue = [this.queue];
|
if (!CONFIG.motion.async) this.queue = [this.queue.flat()];
|
||||||
this.queue.forEach(sequence => {
|
this.queue.forEach(sequence => {
|
||||||
const timeline = window.anime.timeline({
|
const timeline = window.anime.timeline({
|
||||||
duration: 200,
|
duration: 200,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user