Skip to content

Commit

Permalink
Remove muse.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Apr 27, 2024
1 parent 1b2b004 commit 3729403
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
4 changes: 0 additions & 4 deletions scripts/filters/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
1 change: 1 addition & 0 deletions source/js/next-boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
12 changes: 0 additions & 12 deletions source/js/schemes/muse.js

This file was deleted.

13 changes: 13 additions & 0 deletions source/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 3729403

Please sign in to comment.