mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Add motion.transition.menu_item
* See: https://github.com/next-theme/hexo-theme-next/issues/412
This commit is contained in:
parent
aa6da25f89
commit
705201bde3
@ -619,6 +619,7 @@ motion:
|
|||||||
async: false
|
async: false
|
||||||
transition:
|
transition:
|
||||||
# All available transition variants: https://theme-next.js.org/animate/
|
# All available transition variants: https://theme-next.js.org/animate/
|
||||||
|
menu_item: fadeInDown
|
||||||
post_block: fadeIn
|
post_block: fadeIn
|
||||||
post_header: fadeInDown
|
post_header: fadeInDown
|
||||||
post_body: fadeInDown
|
post_body: fadeInDown
|
||||||
|
|||||||
@ -51,6 +51,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.use-motion .menu-item {
|
if (hexo-config('motion.transition.menu_item')) {
|
||||||
|
.use-motion .menu-item {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,13 +59,16 @@ NexT.motion.middleWares = {
|
|||||||
pushToSequence('.site-subtitle');
|
pushToSequence('.site-subtitle');
|
||||||
(CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') && pushToSequence('.custom-logo-image');
|
(CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') && pushToSequence('.custom-logo-image');
|
||||||
|
|
||||||
|
const menuItemTransition = CONFIG.motion.transition.menu_item;
|
||||||
|
if (menuItemTransition) {
|
||||||
document.querySelectorAll('.menu-item').forEach(targets => {
|
document.querySelectorAll('.menu-item').forEach(targets => {
|
||||||
sequence.push({
|
sequence.push({
|
||||||
targets,
|
targets,
|
||||||
complete: () => targets.classList.add('animated', 'fadeInDown'),
|
complete: () => targets.classList.add('animated', menuItemTransition),
|
||||||
deltaT : '-=200'
|
deltaT : '-=200'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return sequence;
|
return sequence;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user