diff --git a/src/theme/book.css b/src/theme/book.css index f151660c..6404b59c 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -3,50 +3,55 @@ html, body { color: #333; } -@media only screen { - .sidebar { - position: absolute; - left: 0; - top: 0; - bottom: 0; - width: 300px; - overflow-y: auto; - border-right: 1px solid rgba(0, 0, 0, 0.07); - padding: 10px 10px; - font-size: 14px; - box-sizing: border-box; - -webkit-overflow-scrolling: touch; - background-color: #fafafa; - color: #364149; - } - .page-wrapper { - position: absolute; - overflow-y: auto; - left: 310px; - right: 0; - top: 0; - bottom: 0; - box-sizing: border-box; - background: none repeat scroll 0 0 #FFF; - -webkit-overflow-scrolling: touch; - } +.sidebar { + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 300px; + overflow-y: auto; + border-right: 1px solid rgba(0, 0, 0, 0.07); + padding: 10px 10px; + font-size: 14px; + box-sizing: border-box; + -webkit-overflow-scrolling: touch; + background-color: #fafafa; + color: #364149; + + /* Animation: slide away */ + -webkit-transition: left 0.5s; /* Safari */ + -o-transition: left 0.5s; /* Opera */ + -moz-transition: left 0.5s; /* Mozilla Firefox */ + transition: left 0.5s; +} + +.page-wrapper { + position: absolute; + overflow-y: auto; + left: 315px; + right: 0; + top: 0; + bottom: 0; + box-sizing: border-box; + background: none repeat scroll 0 0 #FFF; + -webkit-overflow-scrolling: touch; + + /* Animation: slide away */ + -webkit-transition: left 0.5s; /* Safari */ + -o-transition: left 0.5s; /* Opera */ + -moz-transition: left 0.5s; /* Mozilla Firefox */ + transition: left 0.5s; } @media only screen and (max-width: 1060px) { .sidebar { - width: 100%; - margin-right: 0; - top: 40px; + left: -300px; } .page-wrapper { - top: 40px; left: 15px; padding-right: 15px; } - .mobile-hidden { - display: none; - } } .page { diff --git a/src/theme/book.js b/src/theme/book.js index e69de29b..643755e5 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -0,0 +1,17 @@ +$( document ).ready(function() { + + // Interesting DOM Elements + var sidebar = $("#sidebar"); + var page_wrapper = $("#page-wrapper"); + + $("#sidebar-toggle").click(function(event){ + if(sidebar.position().left === 0){ + sidebar.css({left: "-300px"}); + page_wrapper.css({left: "15px"}); + } else { + sidebar.css({left: "0"}); + page_wrapper.css({left: "315px"}); + } + }); + +}); diff --git a/src/theme/index.hbs b/src/theme/index.hbs index d01d9374..607644fb 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -20,7 +20,7 @@
@@ -30,6 +30,7 @@
+