From bd5e8be2153d28b601848caf14c53c77c2aa9db9 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 27 Nov 2019 17:08:54 +0800 Subject: [PATCH] Hide ToC when scrolling to bottom. --- _includes/panel.html | 4 +--- _layouts/post.html | 24 +++++++++++++++--------- assets/css/main.scss | 12 ++++++------ assets/css/post.scss | 12 ++++++------ 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/_includes/panel.html b/_includes/panel.html index 0b48774..6788a25 100644 --- a/_includes/panel.html +++ b/_includes/panel.html @@ -69,13 +69,11 @@ {% endfor %} - - {% if page.layout == 'post' and site.toc and page.toc %} -
+

{{- site.data.label.panel.toc -}}

diff --git a/_layouts/post.html b/_layouts/post.html index 27f7a6f..8b8cae9 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -75,6 +75,17 @@ layout: default {% endif %}
+
+ + + {% include panel.html %} + + + +
+
+ +
{% include related-posts.html %}
@@ -97,18 +108,13 @@ layout: default
-
-
- - {% include panel.html %} - -
-
{% if site.disqus.comments and page.comments %} {% include disqus.html %} {% endif %} -
-
+ +
+ + diff --git a/assets/css/main.scss b/assets/css/main.scss index 4b85f81..b1712b5 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -352,12 +352,12 @@ body { -webkit-transition: transform 0.4s ease; } -#main>div.row>div:nth-child(1), -#main>div.row>div:nth-child(2) { +#main>div.row:first-child>div:nth-child(1), +#main>div.row:first-child>div:nth-child(2) { margin-top: 3rem; /* same as the height of topbar */ } -#main>div.row>div:first-child { +#main>div.row:first-child>div:first-child { min-height: calc(100vh - 3rem - 6rem); /* 3rem for topbar, 6rem for footer */ } @@ -806,7 +806,7 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */ @media all and (max-width: 576px) { - #main>div.row>div:first-child { + #main>div.row:first-child>div:first-child { min-height: calc(100vh - 3rem - 10rem); /* topbar is 3rem and footer is 10rem */ } @@ -969,8 +969,8 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */ top: 0 !important; } - #main>div.row>div:nth-child(1), - #main>div.row>div:nth-child(2) { + #main>div.row:first-child>div:nth-child(1), + #main>div.row:first-child>div:nth-child(2) { margin-top: 0; } diff --git a/assets/css/post.scss b/assets/css/post.scss index 59fe4ae..c1f330f 100644 --- a/assets/css/post.scss +++ b/assets/css/post.scss @@ -108,33 +108,33 @@ right: 1rem; } -#comment-wrap { +#post-extend-wrap { min-height: 2rem; } /* - The following resposive design aim to make #comment-wrap margin-right same as pannel's width + The following resposive design aim to make #post-extend-wrap margin-right same as pannel's width */ @media all and (min-width: 1201px) { - #comment-wrap { + #post-extend-wrap { margin-right: 25%; } } @media all and (min-width: 1460px) { - #comment-wrap { + #post-extend-wrap { margin-right: 300px; } } @media all and (min-width: 1650px) { - #comment-wrap { + #post-extend-wrap { margin-right: calc((100% - 1150px) / 10 + 300px); } } @media all and (min-width: 1700px) { - #comment-wrap { + #post-extend-wrap { margin-right: calc((100% - 1150px) / 8 + 300px); } } \ No newline at end of file