Remove muse.js

This commit is contained in:
Mimi 2024-04-28 00:31:49 +08:00
parent 1b2b0040b4
commit 372940305c
4 changed files with 14 additions and 16 deletions

View File

@ -40,10 +40,6 @@ hexo.extend.filter.register('after_generate', () => {
hexo.route.remove('js/comments-buttons.js');
}
if (theme.scheme === 'Pisces' || theme.scheme === 'Gemini') {
hexo.route.remove('js/schemes/muse.js');
}
if (theme.sidebar.display === 'remove') {
hexo.route.remove('js/sidebar.js');
}

View File

@ -6,6 +6,7 @@ NexT.boot.registerEvents = function() {
NexT.utils.registerScrollPercent();
NexT.utils.registerCanIUseTag();
NexT.utils.updateFooterPosition();
// Mobile top menu bar.
document.querySelector('.site-nav-toggle .toggle').addEventListener('click', event => {

View File

@ -1,12 +0,0 @@
document.addEventListener('DOMContentLoaded', () => {
function updateFooterPosition() {
const footer = document.querySelector('.footer');
const containerHeight = document.querySelector('.main').offsetHeight + footer.offsetHeight;
footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight);
}
updateFooterPosition();
window.addEventListener('resize', updateFooterPosition);
window.addEventListener('scroll', updateFooterPosition, { passive: true });
});

View File

@ -415,6 +415,19 @@ NexT.utils = {
sidebar.classList.replace(activeClassNames[1 - index], activeClassNames[index]);
},
updateFooterPosition: function() {
if (CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') return;
function updateFooterPosition() {
const footer = document.querySelector('.footer');
const containerHeight = document.querySelector('.main').offsetHeight + footer.offsetHeight;
footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight);
}
updateFooterPosition();
window.addEventListener('resize', updateFooterPosition);
window.addEventListener('scroll', updateFooterPosition, { passive: true });
},
getScript: function(src, options = {}, legacyCondition) {
if (typeof options === 'function') {
return this.getScript(src, {