From 37c0d69f08fc14c17325d815ef3f1b14ab533cc8 Mon Sep 17 00:00:00 2001 From: ppoffice Date: Tue, 30 Oct 2018 23:57:31 -0400 Subject: [PATCH] chore(plugin): clean back to top code and name major columns --- layout/common/widget.ejs | 5 +- layout/layout.ejs | 4 +- layout/plugin/animejs.ejs | 8 +- layout/plugin/back-to-top.ejs | 79 +------------------- layout/widget/links.ejs | 2 +- source/js/back-to-top.js | 134 ++++++++++++++++++++++++++++++++++ 6 files changed, 148 insertions(+), 84 deletions(-) create mode 100644 source/js/back-to-top.js diff --git a/layout/common/widget.ejs b/layout/common/widget.ejs index 4e18996..4b891e2 100644 --- a/layout/common/widget.ejs +++ b/layout/common/widget.ejs @@ -14,7 +14,10 @@ } return ''; } %> -
+<% function order_class() { + return position === 'left' ? 'has-order-1' : 'has-order-3'; +} %> +
<% get_widgets(position).forEach(widget => {%> <%- partial('widget/' + widget.type, { widget, post: page }) %> <% }) %> diff --git a/layout/layout.ejs b/layout/layout.ejs index 03ebe4c..cf7be87 100644 --- a/layout/layout.ejs +++ b/layout/layout.ejs @@ -18,8 +18,8 @@ } %>
-
-
<%- body %>
+
+
<%- body %>
<%- partial('common/widget', { position: 'left' }) %> <%- partial('common/widget', { position: 'right' }) %>
diff --git a/layout/plugin/animejs.ejs b/layout/plugin/animejs.ejs index fc34780..58ba780 100644 --- a/layout/plugin/animejs.ejs +++ b/layout/plugin/animejs.ejs @@ -14,9 +14,9 @@ $(document).ready(function () { $('body').css('opacity', 1); if (!isIE()) { - ['.main > .column:first-child .card', - '.main > .column:nth-child(2) .card', - '.main > .column:last-child .card'].map(function(target) { + ['.column-main > .card', + '.column-left > .card', + '.column-right > .card'].map(function(target) { anime({ targets: target, scale: [0.8, 1], @@ -28,7 +28,7 @@ } }) }); - + anime({ targets: '.navbar-main', translateY: [-100, 0], diff --git a/layout/plugin/back-to-top.ejs b/layout/plugin/back-to-top.ejs index 615406d..55a065a 100644 --- a/layout/plugin/back-to-top.ejs +++ b/layout/plugin/back-to-top.ejs @@ -1,17 +1,16 @@ <% if (plugin !== false) { %> <% if (!head) { %> - + keyboard_arrow_up - +<%- js('js/back-to-top') %> <% } %> <% } %> \ No newline at end of file diff --git a/layout/widget/links.ejs b/layout/widget/links.ejs index a94b67b..c87c605 100644 --- a/layout/widget/links.ejs +++ b/layout/widget/links.ejs @@ -9,7 +9,7 @@