From f62107c7fbe9853469f7d184de17442081a9742b Mon Sep 17 00:00:00 2001 From: XPoet Date: Sun, 25 Oct 2020 10:48:07 +0800 Subject: [PATCH] perf: optimize UI and enhance user experience --- layout/_partial/comments/comment.ejs | 3 +- layout/_partial/scripts.ejs | 7 +- layout/_partial/tools.ejs | 25 +++-- layout/_partial/tools2.ejs | 32 ++++++ layout/page.ejs | 5 + .../css/layout/_partial/comments/comment.styl | 14 +++ source/css/layout/_partial/tools.styl | 35 +------ source/css/layout/_partial/tools2.styl | 99 +++++++++++++++++++ source/css/layout/common/variables.styl | 38 +++---- source/css/layout/page.styl | 21 ++++ source/css/style.styl | 4 +- source/js/back2top.js | 23 +++++ source/js/left-side-toggle.js | 8 ++ source/js/main.js | 7 +- source/js/utils.js | 68 +++++++++++-- 15 files changed, 314 insertions(+), 75 deletions(-) create mode 100644 layout/_partial/tools2.ejs create mode 100644 source/css/layout/_partial/comments/comment.styl create mode 100644 source/css/layout/_partial/tools2.styl diff --git a/layout/_partial/comments/comment.ejs b/layout/_partial/comments/comment.ejs index d364d57..3856c31 100644 --- a/layout/_partial/comments/comment.ejs +++ b/layout/_partial/comments/comment.ejs @@ -1,4 +1,5 @@
+
<% if (theme.comments.valine.enable && theme.comments.gitalk.enable) { %> <%- partial('valine') %> <% } else if (theme.comments.valine.enable) { %> @@ -6,4 +7,4 @@ <% } else if (theme.comments.gitalk.enable) { %> <%- partial('gitalk') %> <% } %> -
\ No newline at end of file + diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index f7cb5fe..e02da4e 100644 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -5,6 +5,10 @@ 'js/main.js' ]) %> +<% if (theme.local_search.enable && config.search) { %> + <%- js('js/local-search.js') %> +<% } %> + <% if (theme.back2top.enable) { %> <%- js('js/back2top.js') %> <% } %> @@ -13,7 +17,7 @@ <%- js('js/left-side-toggle.js') %> - <% if (theme.code_copy.enable) { %> + <% if (theme.code_copy.enable ) { %> <%- js('js/code-copy.js') %> <% } %> @@ -21,4 +25,3 @@ <%- js(['lib/anime.min.js', 'js/toc.js']) %> <% } %> <% } %> - diff --git a/layout/_partial/tools.ejs b/layout/_partial/tools.ejs index a59ccfe..b0bffde 100644 --- a/layout/_partial/tools.ejs +++ b/layout/_partial/tools.ejs @@ -1,26 +1,23 @@
diff --git a/layout/_partial/tools2.ejs b/layout/_partial/tools2.ejs new file mode 100644 index 0000000..2bed3d1 --- /dev/null +++ b/layout/_partial/tools2.ejs @@ -0,0 +1,32 @@ +
+ + + + +
diff --git a/layout/page.ejs b/layout/page.ejs index 7009b42..b4d8198 100644 --- a/layout/page.ejs +++ b/layout/page.ejs @@ -59,6 +59,11 @@ <%- partial('_partial/tools') %> + + +