From d696ffb1316399d73e461a23cc19117db8ee287e Mon Sep 17 00:00:00 2001 From: D-Sketon <2055272094@qq.com> Date: Wed, 2 Oct 2024 17:35:57 +0800 Subject: [PATCH 1/5] refactor: remove wow --- _config.yml | 3 +- layout/_partial/after-footer.ejs | 19 +++ layout/_partial/archive.ejs | 6 +- layout/_partial/footer.ejs | 2 +- layout/_partial/head.ejs | 10 +- layout/_partial/post.ejs | 4 +- layout/_partial/post/category.ejs | 14 +- layout/_partial/post/date.ejs | 4 +- layout/_partial/post/nav.ejs | 2 +- layout/_partial/post/tag.ejs | 4 +- layout/_partial/sidebar.ejs | 2 +- layout/_widget/archive.ejs | 2 +- layout/_widget/category.ejs | 2 +- layout/_widget/recent_posts.ejs | 2 +- layout/_widget/tag.ejs | 2 +- layout/_widget/tagcloud.ejs | 2 +- scripts/helper/listCategories.js | 4 + scripts/helper/listTags.js | 4 + scripts/tag/friendLink.js | 2 +- source/css/_animation.styl | 8 +- source/css/_partial/article.styl | 2 + source/css/_partial/footer.styl | 1 + source/css/_partial/post.styl | 1 + source/js/aos.js | 256 ++++++++++++++++++++++++++++++ source/js/insert_highlight.js | 7 + source/js/pjax.js | 5 +- source/js/pjax_script.js | 12 +- source/js/script.js | 6 + 28 files changed, 347 insertions(+), 41 deletions(-) create mode 100644 scripts/helper/listCategories.js create mode 100644 scripts/helper/listTags.js create mode 100644 source/js/aos.js diff --git a/_config.yml b/_config.yml index 631c778..f433b16 100644 --- a/_config.yml +++ b/_config.yml @@ -307,7 +307,6 @@ vendor: instantsearch: webcache|instantsearch.js@4.56.1/dist/instantsearch.production.min.js pace: webcache|pace-js@1.2.4/pace.min.js mermaid: webcache|mermaid@9.4.3/dist/mermaid.min.js - wow: webcache|wowjs@1.1.3/dist/wow.min.js firework: webcache|mouse-firework@0.0.4/dist/index.umd.js pjax: webcache|theme-shokax-pjax@0.0.3/dist/index.umd.js live2d: @@ -328,4 +327,4 @@ vendor: - webcache|@fortawesome/fontawesome-free@6.5.1/css/brands.min.css - webcache|@fortawesome/fontawesome-free@6.5.1/css/v5-font-face.min.css - webcache|@fortawesome/fontawesome-free@6.5.1/css/v4-font-face.min.css - animate: webcache|wowjs@1.1.3/css/libs/animate.css + aos: webcache|aos@2.3.4/dist/aos.css diff --git a/layout/_partial/after-footer.ejs b/layout/_partial/after-footer.ejs index bb9eca1..0343a9b 100644 --- a/layout/_partial/after-footer.ejs +++ b/layout/_partial/after-footer.ejs @@ -3,6 +3,25 @@ <%- js('js/script.js') %> +<% if (theme.animation.enable) { %> + <%- js('js/aos.js') %> + +<% } %> + <%- js({src: 'js/pjax_script.js', 'data-pjax': true}) %> + <%- css(vendorCdn(theme.vendor.css.aos)) %> <% } %> diff --git a/layout/_partial/post.ejs b/layout/_partial/post.ejs index 09f302b..27aa158 100644 --- a/layout/_partial/post.ejs +++ b/layout/_partial/post.ejs @@ -1,5 +1,5 @@ <% if (even === true) { %> -
+
<% if (post.link) { %> <% } else { %> @@ -37,7 +37,7 @@
<% } else { %> -
+
<% if (post.link) { %> <% } else { %> diff --git a/layout/_partial/post/category.ejs b/layout/_partial/post/category.ejs index 85dfb37..942bfac 100644 --- a/layout/_partial/post/category.ejs +++ b/layout/_partial/post/category.ejs @@ -1,10 +1,10 @@ <% if (post.categories && post.categories.length) { %> -