Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ toc:
#creative_commons:

sidebar:
# Sidebar Position, available value: left | right (only for Pisces | Gemini).
# Sidebar Position, available value: left | right .
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for Pisces | Gemini | Mist. unavailable for Muse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i forgot it, and i just fix Scheme.Mist.

Copy link
Member

@ivan-nginx ivan-nginx Mar 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muse scheme tested? Worked? If not worked, can be added maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, tonight update.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhuzhuyule take in attention: in Mist scheme temporairly removed float: right style to compatability with sub-menu feature. See here: https://github.com/theme-next/hexo-theme-next/pull/156/files#diff-90c3d2a8522cb0e6c0ac99af79e65607R9

position: left
#position: right

Expand Down
1 change: 1 addition & 0 deletions source/css/_schemes/Mist/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@import "_menu";
@import "_search.styl";
@import "_posts-expanded";
@import "sidebar/_sidebar";
@import "sidebar/sidebar-blogroll";
// Import _posts if want to justify text-align on mobile.
// @import "../Pisces/_posts";
Expand Down
10 changes: 10 additions & 0 deletions source/css/_schemes/Mist/sidebar/_sidebar.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if (hexo-config('sidebar.position') == 'left' ) {
.sidebar {
right: auto;
left: 0;
}
.sidebar-toggle {
right: auto;
left: 50px;
}
}
1 change: 1 addition & 0 deletions source/css/_schemes/Muse/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import "_logo.styl";
@import "_menu.styl";
@import "_search.styl";
@import "sidebar/_sidebar";
@import "sidebar/sidebar-blogroll";
// Import _posts if want to justify text-align on mobile.
// @import "../Pisces/_posts";
10 changes: 10 additions & 0 deletions source/css/_schemes/Muse/sidebar/_sidebar.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if (hexo-config('sidebar.position') == 'left' ) {
.sidebar {
right: auto;
left: 0;
}
.sidebar-toggle {
right: auto;
left: 50px;
}
}
74 changes: 51 additions & 23 deletions source/js/src/motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,55 @@ $(document).ready(function () {
this.el.velocity('stop').velocity(this.status[status]);
};

var sidebarToggleLine1st = new SidebarToggleLine({
el: '.sidebar-toggle-line-first',
status: {
arrow: {width: '50%', rotateZ: '-45deg', top: '2px'},
close: {width: '100%', rotateZ: '-45deg', top: '5px'}
}
});
var sidebarToggleLine2nd = new SidebarToggleLine({
el: '.sidebar-toggle-line-middle',
status: {
arrow: {width: '90%'},
close: {opacity: 0}
}
});
var sidebarToggleLine3rd = new SidebarToggleLine({
el: '.sidebar-toggle-line-last',
status: {
arrow: {width: '50%', rotateZ: '45deg', top: '-2px'},
close: {width: '100%', rotateZ: '45deg', top: '-5px'}
}
});
var sidebarToggleLine1st;
var sidebarToggleLine2nd;
var sidebarToggleLine3rd;
var isRight = ((NexT.utils.isMist() || NexT.utils.isMuse()) && (CONFIG.sidebar.position != 'left'));
if (isRight){
sidebarToggleLine1st = new SidebarToggleLine({
el: '.sidebar-toggle-line-first',
status: {
arrow: {width: '50%', rotateZ: '-45deg', top: '2px'},
close: {width: '100%', rotateZ: '-45deg', top: '5px'}
}
});
sidebarToggleLine2nd = new SidebarToggleLine({
el: '.sidebar-toggle-line-middle',
status: {
arrow: {width: '90%'},
close: {opacity: 0}
}
});
sidebarToggleLine3rd = new SidebarToggleLine({
el: '.sidebar-toggle-line-last',
status: {
arrow: {width: '50%', rotateZ: '45deg', top: '-2px'},
close: {width: '100%', rotateZ: '45deg', top: '-5px'}
}
});
} else {
sidebarToggleLine1st = new SidebarToggleLine({
el: '.sidebar-toggle-line-first',
status: {
arrow: {width: '50%', rotateZ: '45deg', top: '2px', left: '50%'},
close: {width: '100%', rotateZ: '-45deg', top: '5px', left: '0px'}
}
});
sidebarToggleLine2nd = new SidebarToggleLine({
el: '.sidebar-toggle-line-middle',
status: {
arrow: {width: '90%', left: '2px'},
close: {opacity: 0, left: '0px'}
}
});
sidebarToggleLine3rd = new SidebarToggleLine({
el: '.sidebar-toggle-line-last',
status: {
arrow: {width: '50%', rotateZ: '-45deg', top: '-2px', left: '50%'},
close: {width: '100%', rotateZ: '45deg', top: '-5px', left: '0px'}
}
});
}

sidebarToggleLines.push(sidebarToggleLine1st);
sidebarToggleLines.push(sidebarToggleLine2nd);
Expand All @@ -98,7 +126,7 @@ $(document).ready(function () {
$(document)
.on('sidebar.isShowing', function () {
NexT.utils.isDesktop() && $('body').velocity('stop').velocity(
{paddingRight: SIDEBAR_WIDTH},
isRight ? {paddingRight: SIDEBAR_WIDTH} : {paddingLeft: SIDEBAR_WIDTH},
SIDEBAR_DISPLAY_DURATION
);
})
Expand Down Expand Up @@ -164,7 +192,7 @@ $(document).ready(function () {
this.sidebarEl.trigger('sidebar.isShowing');
},
hideSidebar: function () {
NexT.utils.isDesktop() && $('body').velocity('stop').velocity({paddingRight: 0});
NexT.utils.isDesktop() && $('body').velocity('stop').velocity(isRight?{paddingRight: 0}:{paddingLeft: 0});
this.sidebarEl.find('.motion-element').velocity('stop').css('display', 'none');
this.sidebarEl.velocity('stop').velocity({width: 0}, {display: 'none'});

Expand Down
4 changes: 4 additions & 0 deletions source/js/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ NexT.utils = NexT.$u = {
$('.sidebar-toggle').trigger('click');
},

isMuse: function () {
return CONFIG.scheme === 'Muse';
},

isMist: function () {
return CONFIG.scheme === 'Mist';
},
Expand Down