mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-11 06:16:10 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e48518b42a | ||
|
|
4d56be2f10 | ||
|
|
19bf043cf8 |
+1
-1
@@ -8,5 +8,5 @@
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
<script src="/lib/docsify.js" data-repo="https://qingwei-li/docsify" data-sidebar-toggle></script>
|
||||
<script src="/lib/docsify.js" data-repo="qingwei-li/docsify" data-sidebar-toggle data-load-navbar></script>
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
## 0.6.1
|
||||
### Bug fixes
|
||||
- In the mobile, it should collapse the sidebar when toggle is clicked.
|
||||
- Fix the dropdown list style.
|
||||
- Fix sidebar animation.
|
||||
|
||||
## 0.6.0
|
||||
### Features
|
||||
- Navbar support dropdown list, #6
|
||||
|
||||
+7
-2
@@ -2295,9 +2295,14 @@ function activeLink (dom, activeParent) {
|
||||
function bindToggle (dom) {
|
||||
dom = typeof dom === 'object' ? dom : document.querySelector(dom);
|
||||
if (!dom) { return }
|
||||
var main = document.querySelector('main');
|
||||
var body = document.body;
|
||||
|
||||
dom.addEventListener('click', function () { return main.classList.toggle('close'); });
|
||||
dom.addEventListener('click', function () { return body.classList.toggle('close'); });
|
||||
|
||||
if (!/mobile/i.test(navigator.userAgent)) { return }
|
||||
document.querySelector('aside').addEventListener('click', function (event) {
|
||||
body.classList.toggle('close');
|
||||
});
|
||||
}
|
||||
|
||||
var renderTo = function (dom, content) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
*{box-sizing:border-box;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;-webkit-font-smoothing:antialiased}nav{position:absolute;right:0;left:0;z-index:2;margin:25px 60px 0 0;text-align:right}nav li,nav ul{list-style:none;display:inline-block}nav li{position:relative}nav li ul{padding:0;max-height:0;position:absolute;top:24px;background-color:hsla(0,0%,100%,.6);border:1px solid #000;right:0;overflow:hidden;opacity:0;overflow-y:auto;transition:opacity .3s ease,max-height .5s ease}nav li:hover ul{opacity:1;max-height:100px}nav li ul a,nav li ul li{display:block}nav li ul a{font-size:14px;margin:0;padding:4px 10px;white-space:nowrap}nav li ul a.active{border-bottom:0}nav a{margin:0 1em;padding:5px 0;font-size:16px;text-decoration:none;color:inherit;transition:color .3s}.github-corner{position:absolute;top:0;right:0;z-index:2}.github-corner svg{color:#fff;height:80px;width:80px}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0}main{height:100%;position:relative;width:100%}.sidebar{border-right:1px solid rgba(0,0,0,.07);bottom:0;overflow-y:auto;position:absolute;top:0;width:300px;z-index:1;padding-top:40px;left:0;transition:left .25s ease-out}.sidebar ul{margin:0;padding:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{display:block;border-bottom:none}.sidebar ul li ul{padding-left:20px}.sidebar-toggle{background-color:transparent;border:0;bottom:10px;left:10px;position:absolute;text-align:center;transition:opacity .3s;width:30px;z-index:2;outline:none}.sidebar-toggle:hover{opacity:.4}.sidebar-toggle span{background-color:#000;display:block;height:2px;margin-bottom:4px;width:16px}.content{bottom:0;left:300px;overflow-y:auto;position:absolute;right:0;top:0;overflow-x:hidden;padding-top:20px;transition:left .25s ease}main.close .sidebar{left:-300px}main.close .content{left:0}@media screen and (max-width:600px){nav{margin-top:16px}nav li ul{top:30px}.sidebar{left:-300px;transition:left .25s ease}.content{left:0;min-width:100vw;transition:left .25s ease-out}main.close .sidebar{left:0}main.close .content{left:300px}}.markdown-section{position:relative;margin:0 auto;max-width:800px;padding:20px 15px 40px}.markdown-section *{box-sizing:border-box;-webkit-box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}
|
||||
*{box-sizing:border-box;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;-webkit-font-smoothing:antialiased}nav{position:absolute;right:0;left:0;z-index:2;margin:15px 60px 0 0;text-align:right}nav li,nav ul{list-style:none;display:inline-block}nav li{position:relative}nav li ul{background-color:hsla(0,0%,100%,.6);border:1px solid #000;opacity:0;overflow:hidden;padding:0;position:absolute;right:0;top:26px;transform-origin:100% 0;transform:scaleY(0);transition:opacity .4s ease-out,transform .2s ease;transition-delay:.3s}nav li:hover ul{opacity:1;transform:scale(1);transition:opacity .4s ease,transform .2s ease-out;transition-delay:0}nav li ul li{display:block;font-size:14px;margin:0;padding:4px 10px;white-space:nowrap}nav li ul a{display:block;margin:0;padding:0}nav li ul a.active{border-bottom:0}nav a{margin:0 1em;padding:5px 0;font-size:16px;text-decoration:none;color:inherit;transition:color .3s}.github-corner{position:absolute;top:0;right:0;z-index:1}.github-corner svg{color:#fff;height:80px;width:80px}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}main{height:100%;position:relative;width:100%}.sidebar{border-right:1px solid rgba(0,0,0,.07);bottom:0;overflow-y:auto;position:absolute;top:0;width:300px;z-index:1;padding-top:40px;left:0;transition:transform .25s ease-out}.sidebar ul{margin:0;padding:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{display:block;border-bottom:none}.sidebar ul li ul{padding-left:20px}.sidebar-toggle{background-color:transparent;border:0;bottom:10px;left:10px;position:absolute;text-align:center;transition:opacity .3s;width:30px;z-index:2;outline:none}.sidebar-toggle:hover{opacity:.4}.sidebar-toggle span{background-color:#000;display:block;height:2px;margin-bottom:4px;width:16px}.content{bottom:0;left:300px;overflow-y:auto;position:absolute;right:0;top:0;overflow-x:hidden;padding-top:20px;transition:left .25s ease}body.close .sidebar{left:-300px}body.close .content{left:0}@media screen and (max-width:600px){nav{margin-top:16px}nav li ul{top:30px}.sidebar{left:-300px;transition:transform .25s ease}.content{left:0;min-width:100vw;transition:transform .25s ease-out}body.close .content,body.close .sidebar{transform:translateX(300px)}.github-corner,nav{transition:transform .25s ease-out}body.close .github-corner,body.close nav{transform:translateX(300px)}}.markdown-section{position:relative;margin:0 auto;max-width:800px;padding:20px 15px 40px}.markdown-section *{box-sizing:border-box;-webkit-box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"description": "A magical documentation generator.",
|
||||
"main": "lib/docsify.js",
|
||||
"files": [
|
||||
|
||||
+7
-2
@@ -77,7 +77,12 @@ export function activeLink (dom, activeParent) {
|
||||
export function bindToggle (dom) {
|
||||
dom = typeof dom === 'object' ? dom : document.querySelector(dom)
|
||||
if (!dom) return
|
||||
const main = document.querySelector('main')
|
||||
const body = document.body
|
||||
|
||||
dom.addEventListener('click', () => main.classList.toggle('close'))
|
||||
dom.addEventListener('click', () => body.classList.toggle('close'))
|
||||
|
||||
if (!/mobile/i.test(navigator.userAgent)) return
|
||||
document.querySelector('aside').addEventListener('click', event => {
|
||||
body.classList.toggle('close')
|
||||
})
|
||||
}
|
||||
|
||||
+39
-26
@@ -17,7 +17,7 @@ nav {
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
margin: 25px 60px 0 0;
|
||||
margin: 15px 60px 0 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -32,36 +32,41 @@ nav li {
|
||||
}
|
||||
|
||||
nav li ul {
|
||||
padding: 0;
|
||||
max-height: 0;
|
||||
position: absolute;
|
||||
top: 24px;
|
||||
background-color: rgba(255, 255, 255, .6);
|
||||
border: 1px solid #0074D9;
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
overflow-y: auto;
|
||||
transition: opacity .3s ease, max-height .5s ease;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 26px;
|
||||
transform-origin: 100% 0%;
|
||||
transform: scale(1, 0);
|
||||
transition: opacity .4s ease-out, transform .2s ease;
|
||||
transition-delay: .3s;
|
||||
}
|
||||
|
||||
nav li:hover ul {
|
||||
opacity: 1;
|
||||
max-height: 100px;
|
||||
transform: scale(1, 1);
|
||||
transition: opacity .4s ease, transform .2s ease-out;
|
||||
transition-delay: 0;
|
||||
}
|
||||
|
||||
nav li ul li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
nav li ul a {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
padding: 4px 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
nav li ul a {
|
||||
display: block;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
nav li ul a.active {
|
||||
border-bottom: 0;
|
||||
}
|
||||
@@ -89,7 +94,7 @@ nav a.active {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.github-corner svg {
|
||||
@@ -132,6 +137,7 @@ body {
|
||||
font-size: 15px;
|
||||
letter-spacing: 0;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* main */
|
||||
@@ -154,7 +160,7 @@ main {
|
||||
z-index: 1;
|
||||
padding-top: 40px;
|
||||
left: 0;
|
||||
transition: left 250ms ease-out;
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
.sidebar ul {
|
||||
@@ -221,14 +227,13 @@ main {
|
||||
top: 0;
|
||||
overflow-x: hidden;
|
||||
padding-top: 20px;
|
||||
transition: left 250ms ease;
|
||||
}
|
||||
|
||||
main.close .sidebar {
|
||||
left: -16em;
|
||||
body.close .sidebar {
|
||||
transform: translateX(-16em);
|
||||
}
|
||||
|
||||
main.close .content {
|
||||
body.close .content {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
@@ -243,21 +248,29 @@ main.close .content {
|
||||
|
||||
.sidebar {
|
||||
left: -16em;
|
||||
transition: left 250ms ease;
|
||||
transition: transform 250ms ease;
|
||||
}
|
||||
|
||||
.content {
|
||||
left: 0;
|
||||
min-width: 100vw;
|
||||
transition: left 250ms ease-out;
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
main.close .sidebar {
|
||||
left: 0;
|
||||
body.close .sidebar {
|
||||
transform: translateX(16em);
|
||||
}
|
||||
|
||||
main.close .content {
|
||||
left: 16em;
|
||||
body.close .content {
|
||||
transform: translateX(16em);
|
||||
}
|
||||
nav, .github-corner {
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
body.close nav,
|
||||
body.close .github-corner {
|
||||
transform: translateX(16em);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+38
-24
@@ -15,7 +15,7 @@ nav {
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
margin: 25px 60px 0 0;
|
||||
margin: 15px 60px 0 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -30,36 +30,41 @@ nav li {
|
||||
}
|
||||
|
||||
nav li ul {
|
||||
padding: 0;
|
||||
max-height: 0;
|
||||
position: absolute;
|
||||
top: 24px;
|
||||
background-color: rgba(255, 255, 255, .6);
|
||||
border: 1px solid #000;
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
overflow-y: auto;
|
||||
transition: opacity .3s ease, max-height .5s ease;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 26px;
|
||||
transform-origin: 100% 0%;
|
||||
transform: scale(1, 0);
|
||||
transition: opacity .4s ease-out, transform .2s ease;
|
||||
transition-delay: .3s;
|
||||
}
|
||||
|
||||
nav li:hover ul {
|
||||
opacity: 1;
|
||||
max-height: 100px;
|
||||
transform: scale(1, 1);
|
||||
transition: opacity .4s ease, transform .2s ease-out;
|
||||
transition-delay: 0;
|
||||
}
|
||||
|
||||
nav li ul li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
nav li ul a {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
padding: 4px 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
nav li ul a {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
nav li ul a.active {
|
||||
border-bottom: 0;
|
||||
}
|
||||
@@ -78,7 +83,7 @@ nav a {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.github-corner svg {
|
||||
@@ -117,6 +122,7 @@ body {
|
||||
font-size: 15px;
|
||||
letter-spacing: 0;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* main */
|
||||
@@ -137,7 +143,7 @@ main {
|
||||
z-index: 1;
|
||||
padding-top: 40px;
|
||||
left: 0;
|
||||
transition: left 250ms ease-out;
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
.sidebar ul {
|
||||
@@ -197,11 +203,11 @@ main {
|
||||
transition: left 250ms ease;
|
||||
}
|
||||
|
||||
main.close .sidebar {
|
||||
body.close .sidebar {
|
||||
left: -300px;
|
||||
}
|
||||
|
||||
main.close .content {
|
||||
body.close .content {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
@@ -216,21 +222,29 @@ main.close .content {
|
||||
|
||||
.sidebar {
|
||||
left: -300px;
|
||||
transition: left 250ms ease;
|
||||
transition: transform 250ms ease;
|
||||
}
|
||||
|
||||
.content {
|
||||
left: 0;
|
||||
min-width: 100vw;
|
||||
transition: left 250ms ease-out;
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
main.close .sidebar {
|
||||
left: 0;
|
||||
body.close .sidebar {
|
||||
transform: translateX(300px);
|
||||
}
|
||||
|
||||
main.close .content {
|
||||
left: 300px;
|
||||
body.close .content {
|
||||
transform: translateX(300px);
|
||||
}
|
||||
nav, .github-corner {
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
body.close nav,
|
||||
body.close .github-corner {
|
||||
transform: translateX(300px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+41
-27
@@ -17,7 +17,7 @@ nav {
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
margin: 25px 60px 0 0;
|
||||
margin: 15px 60px 0 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -29,39 +29,45 @@ nav ul, nav li {
|
||||
/* navbar dropdown */
|
||||
nav li {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
nav li ul {
|
||||
padding: 0;
|
||||
max-height: 0;
|
||||
position: absolute;
|
||||
top: 24px;
|
||||
background-color: rgba(255, 255, 255, .6);
|
||||
border: 1px solid #42b983;
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
overflow-y: auto;
|
||||
transition: opacity .3s ease, max-height .5s ease;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 26px;
|
||||
transform-origin: 100% 0%;
|
||||
transform: scale(1, 0);
|
||||
transition: opacity .4s ease-out, transform .2s ease;
|
||||
transition-delay: .3s;
|
||||
}
|
||||
|
||||
nav li:hover ul {
|
||||
opacity: 1;
|
||||
max-height: 100px;
|
||||
transform: scale(1, 1);
|
||||
transition: opacity .4s ease, transform .2s ease-out;
|
||||
transition-delay: 0;
|
||||
}
|
||||
|
||||
nav li ul li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
nav li ul a {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
padding: 4px 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
nav li ul a {
|
||||
display: block;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
nav li ul a.active {
|
||||
border-bottom: 0;
|
||||
}
|
||||
@@ -89,7 +95,7 @@ nav a.active {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.github-corner svg {
|
||||
@@ -131,6 +137,7 @@ body {
|
||||
font-size: 15px;
|
||||
letter-spacing: 0;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* main */
|
||||
@@ -153,7 +160,7 @@ main {
|
||||
z-index: 1;
|
||||
padding-top: 40px;
|
||||
left: 0;
|
||||
transition: left 250ms ease-out;
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
.sidebar ul {
|
||||
@@ -217,21 +224,20 @@ main {
|
||||
/* main content */
|
||||
.content {
|
||||
bottom: 0;
|
||||
left: 300px;
|
||||
overflow-y: auto;
|
||||
left: 300px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
overflow-x: hidden;
|
||||
padding-top: 20px;
|
||||
transition: left 250ms ease;
|
||||
}
|
||||
|
||||
main.close .sidebar {
|
||||
left: -300px;
|
||||
body.close .sidebar {
|
||||
transform: translateX(-300px);
|
||||
}
|
||||
|
||||
main.close .content {
|
||||
body.close .content {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
@@ -246,21 +252,29 @@ main.close .content {
|
||||
|
||||
.sidebar {
|
||||
left: -300px;
|
||||
transition: left 250ms ease;
|
||||
transition: transform 250ms ease;
|
||||
}
|
||||
|
||||
.content {
|
||||
left: 0;
|
||||
min-width: 100vw;
|
||||
transition: left 250ms ease-out;
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
main.close .sidebar {
|
||||
left: 0;
|
||||
body.close .sidebar {
|
||||
transform: translateX(300px);
|
||||
}
|
||||
|
||||
main.close .content {
|
||||
left: 300px;
|
||||
body.close .content {
|
||||
transform: translateX(300px);
|
||||
}
|
||||
nav, .github-corner {
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
body.close nav,
|
||||
body.close .github-corner {
|
||||
transform: translateX(300px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user