mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +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) {
|
||||
const sequence = fn();
|
||||
if (CONFIG.motion.async) this.queue.push(sequence);
|
||||
else this.queue = this.queue.concat(sequence);
|
||||
this.queue.push(sequence);
|
||||
return this;
|
||||
},
|
||||
bootstrap() {
|
||||
if (!CONFIG.motion.async) this.queue = [this.queue];
|
||||
if (!CONFIG.motion.async) this.queue = [this.queue.flat()];
|
||||
this.queue.forEach(sequence => {
|
||||
const timeline = window.anime.timeline({
|
||||
duration: 200,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user