-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Close sidebar when click any blank part (#607)
* Fix #606 * Add sidebar.dimmer option
- Loading branch information
1 parent
716f593
commit f4b967e
Showing
4 changed files
with
16 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
.sidebar-active #sidebar-dimmer { | ||
opacity: .7; | ||
-webkit-transform: translateX(-150%); | ||
transform: translateX(-150%); | ||
transition: opacity .2s; | ||
.sidebar-active + #sidebar-dimmer { | ||
+mobile() { | ||
opacity: .7; | ||
transition: opacity .5s; | ||
} | ||
transform: translateX(-100%); | ||
} | ||
|
||
#sidebar-dimmer { | ||
display: none; | ||
position: absolute; | ||
display: block; | ||
position: fixed; | ||
top: 0; | ||
left: 100%; | ||
width: 200%; | ||
width: 100%; | ||
height: 100%; | ||
background: #000; | ||
opacity: 0; | ||
transition: opacity .2s,transform 0s .2s; | ||
+mobile() { | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f4b967e
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.
but with
dimmer
, when i want to click into the menu or other external url, one more clicking is needed.Can it be avoided?
f4b967e
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 rewrite some js script, I think. Listening to the
click
event ofbody
, and judge if the user clicked the blank part or the menuf4b967e
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.
Another issue about sidebar: iissnan/hexo-theme-next#442