-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable sidebar on mobile移动设备上开启侧栏 #1717
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.sidebar-active #sidebar-dimmer { | ||
opacity: .7; | ||
-webkit-transform: translateX(-150%); | ||
transform: translateX(-150%); | ||
transition: opacity .2s; | ||
} | ||
|
||
#sidebar-dimmer { | ||
display: none; | ||
position: absolute; | ||
top: 0; | ||
left: 100%; | ||
width: 200%; | ||
height: 100%; | ||
background: #000; | ||
opacity: 0; | ||
transition: opacity .2s,transform 0s .2s; | ||
+mobile() { | ||
display: block; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,12 @@ | |
} | ||
|
||
+tablet() { | ||
display: none !important; | ||
hide() if not hexo-config('sidebar.onmobile'); | ||
} | ||
+mobile() { | ||
display: none !important; | ||
hide() if not hexo-config('sidebar.onmobile'); | ||
} | ||
|
||
} | ||
|
||
.sidebar-inner { | ||
|
@@ -36,7 +37,7 @@ | |
@import "site-state"; | ||
@import "sidebar-feed-link"; | ||
@import "sidebar-author-links"; | ||
@import "sidebar-blogroll.styl"; | ||
@import "sidebar-blogroll"; | ||
@import "sidebar-nav"; | ||
@import "sidebar-toc"; | ||
|
||
@import "sidebar-dimmer"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to add conditional import there: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not necessary consist with the context There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,10 +82,12 @@ $(document).ready(function () { | |
|
||
var sidebarToggleMotion = { | ||
toggleEl: $('.sidebar-toggle'), | ||
dimmerEl: $('#sidebar-dimmer'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to add conditional import there:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no harmful I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, right. |
||
sidebarEl: $('.sidebar'), | ||
isSidebarVisible: false, | ||
init: function () { | ||
this.toggleEl.on('click', this.clickHandler.bind(this)); | ||
this.dimmerEl.on('click', this.clickHandler.bind(this)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to add conditional import there:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DITTO There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. |
||
this.toggleEl.on('mouseenter', this.mouseEnterHandler.bind(this)); | ||
this.toggleEl.on('mouseleave', this.mouseLeaveHandler.bind(this)); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add conditional import there:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for one line I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
812c73a