diff --git a/package/hexo-theme-async/_config.yml b/package/hexo-theme-async/_config.yml index 4943abda..522d729f 100644 --- a/package/hexo-theme-async/_config.yml +++ b/package/hexo-theme-async/_config.yml @@ -75,6 +75,7 @@ icons: back_top: fas fa-arrow-up close: fas fa-times search: fas fa-search + reward: fas fa-hand-holding-usd # Top navigation menu top_bars: @@ -169,6 +170,14 @@ footer: # custom_text: +# Reward (Donate) +# If enable true, reward would be displayed in every posts and pages by default. +# You can show or hide reward in a specific page throuth `reward: true | false` in Front Matter. +reward: + enable: false + comment: reward.comment + # url: + methods: # img loading="lazy" lazyload: diff --git a/package/hexo-theme-async/languages/en.yml b/package/hexo-theme-async/languages/en.yml index 0c0229d6..b4664bf1 100644 --- a/package/hexo-theme-async/languages/en.yml +++ b/package/hexo-theme-async/languages/en.yml @@ -49,4 +49,7 @@ search: hits: '${hits} results found' hits_time: '${hits} results found in ${time} ms' +reward: + comment: I'm so cute. Please give me money. + ieTips: For a better experience, use a browser other than Internet Explorer \ No newline at end of file diff --git a/package/hexo-theme-async/languages/zh-Hans.yml b/package/hexo-theme-async/languages/zh-Hans.yml index 7b265192..0d6be928 100644 --- a/package/hexo-theme-async/languages/zh-Hans.yml +++ b/package/hexo-theme-async/languages/zh-Hans.yml @@ -49,4 +49,7 @@ search: hits: '找到 ${hits} 条结果' hits_time: '找到 ${hits} 条结果(用时 ${time} 毫秒)' +reward: + comment: 我很可爱,请给我钱 + ieTips: 为了更好的体验,请使用非IE浏览器 \ No newline at end of file diff --git a/package/hexo-theme-async/layout/_partial/post/post-content.ejs b/package/hexo-theme-async/layout/_partial/post/post-content.ejs index cb8e6d90..50fd72fa 100644 --- a/package/hexo-theme-async/layout/_partial/post/post-content.ejs +++ b/package/hexo-theme-async/layout/_partial/post/post-content.ejs @@ -1,3 +1,3 @@ -
+
<%- page.content %>
\ No newline at end of file diff --git a/package/hexo-theme-async/layout/_partial/post/reward.ejs b/package/hexo-theme-async/layout/_partial/post/reward.ejs new file mode 100644 index 00000000..6010607d --- /dev/null +++ b/package/hexo-theme-async/layout/_partial/post/reward.ejs @@ -0,0 +1,25 @@ +<% if(theme.reward.enable || page.reward){ %> +
+ <% if(theme.reward.url){ %> + + <%- icon(theme.icons.reward) %> + + <% } else { %> + + <%- icon(theme.icons.reward) %> + + <% } %> +

<%- __(theme.reward.comment) %>

+ +
+<% } %> \ No newline at end of file diff --git a/package/hexo-theme-async/layout/post.ejs b/package/hexo-theme-async/layout/post.ejs index 2dc482e8..7da43b75 100644 --- a/package/hexo-theme-async/layout/post.ejs +++ b/package/hexo-theme-async/layout/post.ejs @@ -25,7 +25,10 @@
<%- partial('./_partial/post/post-info') %> - <%- partial('./_partial/post/post-content') %> +
+ <%- partial('./_partial/post/post-content') %> + <%- partial('./_partial/post/reward') %> +
<%- partial('./_partial/post/post-next-prev') %> <%- partial('./_widget/comment',{ titleHide: false }) %> diff --git a/package/hexo-theme-async/source/css/_components/base.less b/package/hexo-theme-async/source/css/_components/base.less index 0125439e..08d80ed4 100644 --- a/package/hexo-theme-async/source/css/_components/base.less +++ b/package/hexo-theme-async/source/css/_components/base.less @@ -214,6 +214,23 @@ html { border-radius: 5px } +.trm-glow { + animation-duration : 2s; + animation-iteration-count: infinite; + animation-name : glowing; + animation-direction : alternate; +} + +@keyframes glowing { + 0% { + box-shadow: 0 0 0 transparent; + } + + 100% { + box-shadow: 0 0 20px fade(@primary, 30%); + } +} + // trm-scroll-container .trm-scroll-container { transition: opacity .6s; diff --git a/package/hexo-theme-async/source/css/_components/index.less b/package/hexo-theme-async/source/css/_components/index.less index d6ac919c..3a5f7683 100644 --- a/package/hexo-theme-async/source/css/_components/index.less +++ b/package/hexo-theme-async/source/css/_components/index.less @@ -19,4 +19,5 @@ @import './fancybox.less'; @import './publication.less'; @import './toc.less'; -@import './search.less'; \ No newline at end of file +@import './search.less'; +@import './reward.less'; \ No newline at end of file diff --git a/package/hexo-theme-async/source/css/_components/reward.less b/package/hexo-theme-async/source/css/_components/reward.less new file mode 100644 index 00000000..98b457a4 --- /dev/null +++ b/package/hexo-theme-async/source/css/_components/reward.less @@ -0,0 +1,35 @@ +.trm-reward { + padding : 2rem 0 0 0; + text-align: center; + margin : auto; + + .trm-reward-btn { + border-radius : 50%; + display : inline-flex; + justify-content: center; + align-items : center; + width : 2.5rem; + height : 2.5rem; + color : @primary; + border-radius : 100%; + cursor : pointer; + } + + .trm-reward-comment { + margin-top: 1rem; + color : @theme-color ; + } + + #qr img { + width : 10rem; + height : 10rem; + display : inline-block; + margin : 1rem 1rem 0 1rem; + padding : 5px; + border-radius : 5px; + transition-property: all; + transition-duration: .3s; + transition-delay : 0s; + box-shadow : @box-shadow; + } +} \ No newline at end of file