This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 94b6ef1  doc menu for mobile (#233)
94b6ef1 is described below

commit 94b6ef1f57aacf5cb5ec163cb5d08d6e3b935f3c
Author: Juntao Zhang <[email protected]>
AuthorDate: Sun Feb 28 00:30:43 2021 +0800

    doc menu for mobile (#233)
---
 themes/docsy/assets/scss/_custom_project_doc.scss | 39 ++++++++++++++++++++---
 themes/docsy/assets/scss/_custom_slider.scss      |  6 ++--
 themes/docsy/assets/scss/sidebar-menu.scss        |  5 +--
 themes/docsy/layouts/projectDoc/baseof.html       |  9 ++++--
 4 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/themes/docsy/assets/scss/_custom_project_doc.scss 
b/themes/docsy/assets/scss/_custom_project_doc.scss
index f456f9e..d23de3f 100644
--- a/themes/docsy/assets/scss/_custom_project_doc.scss
+++ b/themes/docsy/assets/scss/_custom_project_doc.scss
@@ -11,14 +11,14 @@
     font-weight: 300;
     padding-top: 5.5rem;
     padding-right: 0px;
-    padding-left: 2px;
+    padding-left: 0px;
     height: 100vh;
     overflow-y: scroll;
+    overflow-y: overlay;
     position: sticky;
     position: -webkit-sticky;
     top: 0px;
     background-color: #fff;
-
     &::-webkit-scrollbar {
       width: 4px;
     }
@@ -45,13 +45,44 @@
     text-indent: 8px;
     color: #888;
   }
-
+  main{
+    word-break: break-word;
+    p code {
+      word-break: break-word !important;
+    }
+  }
+  .doc-menu-button{
+    position: fixed;
+    right: 15px;
+    bottom: 15px;
+    border: 1px solid #cccccc;
+    border-radius: 3px;
+    padding:8px;
+    color: #999;
+    z-index: 9999;
+    display: none;
+  }
 }
 
 @media (max-width: 768px) {
   .project-doc {
     .td-sidebar {
-      display: none;
+      height: 0;
+      padding: 0;
+      z-index: 8;
+      transform: translate(-100%,0);
+      transition: transform 0.2s linear;
+      &.active{
+        height: 100vh;
+        transform: translate(0,0);
+        display: block;
+        padding-top: 5.5rem;
+        padding-bottom: 1rem;
+      }
+    }
+    .doc-menu-button{
+      display: block;
+      cursor: pointer;
     }
   }
 }
diff --git a/themes/docsy/assets/scss/_custom_slider.scss 
b/themes/docsy/assets/scss/_custom_slider.scss
index ef902de..ce93e12 100644
--- a/themes/docsy/assets/scss/_custom_slider.scss
+++ b/themes/docsy/assets/scss/_custom_slider.scss
@@ -1,12 +1,14 @@
 
 .sidebar-mask {
-    z-index: 9;
+    z-index: 9999;
     width: 100vw;
     height: 100vh;
     position: fixed;
     top: 0;
     left: 0;
     display: none;
+    background-color: #0a0a0c;
+    opacity: 0.1;
 }
 
 .sidebar {
@@ -14,7 +16,7 @@
     background-color: #fff;
     width: 20rem;
     position: fixed;
-    z-index: 10;
+    z-index: 9999;
     margin: 0;
     top: 3.6rem;
     left: 0;
diff --git a/themes/docsy/assets/scss/sidebar-menu.scss 
b/themes/docsy/assets/scss/sidebar-menu.scss
index 16b9e0c..bc30412 100644
--- a/themes/docsy/assets/scss/sidebar-menu.scss
+++ b/themes/docsy/assets/scss/sidebar-menu.scss
@@ -54,9 +54,11 @@
 
   .sidebar-menu > li > a {
     padding: 12px 5px 12px 5px;
-    display: block;
     border-left: 3px solid transparent;
     color: #2c3e50;
+    display: flex;
+    align-items: flex-start;
+    justify-content: space-between;
   }
 
   .sidebar-menu > li > a > .fa {
@@ -247,7 +249,6 @@
     color: #999;
   }
   .fa {
-    display: inline-block;
     font-weight: 100;
   }
 
diff --git a/themes/docsy/layouts/projectDoc/baseof.html 
b/themes/docsy/layouts/projectDoc/baseof.html
index f0e5ccf..385b303 100644
--- a/themes/docsy/layouts/projectDoc/baseof.html
+++ b/themes/docsy/layouts/projectDoc/baseof.html
@@ -19,8 +19,8 @@
             {{ partial "toc.html" . }}
           </div>
           <main class="col-12 col-md-9 col-xl-8 pl-md-5 pr-md-4" role="main">
-            <br>
-            {{ block "main" . }}{{ end }}
+              <i class="fa fa-bars doc-menu-button"></i>
+              {{ block "main" . }}{{ end }}
           </main>
         </div>
       </div>
@@ -31,4 +31,9 @@
     {{ partial "sidebar-skywalking.html" . }}
     {{ partial "scripts.html" . }}
   </body>
+  <script>
+    $('.doc-menu-button').on('click',function (){
+      $('.td-sidebar').toggleClass('active')
+    })
+  </script>
 </html>

Reply via email to