diff --git a/README.md b/README.md index ebfc847a..6c903017 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,17 @@ 本主题是根据 [Heo](https://blog.zhheo.com/) 的博客进行开发,其中部分功能暂未支持 +部分功能支持需要安装插件: +- [留言](https://github.com/halo-sigs/plugin-comment-widget) +- [代码高亮](https://github.com/liuzhihang/plugin-prismjs) +- [懒加载](https://github.com/liuzhihang/plugin-lazyload) +- [文章目录](https://github.com/liuzhihang/plugin-tocbot) + +图标 icon 来自于 [iconfont](https://www.iconfont.cn/): +- [Awesome常用免费开源图标](https://www.iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.dc64b3430&cid=11790) + + + ## 预览 ## 支持的功能 diff --git a/settings.yaml b/settings.yaml index d4a1a1d2..5b4858c9 100644 --- a/settings.yaml +++ b/settings.yaml @@ -5,13 +5,11 @@ metadata: spec: forms: - group: nav - label: 导航栏 + label: 导航 formSchema: - - $formkit: text + - $formkit: menuRadio name: left_menu label: 导航栏左侧相关链接 - placeholder: 请填写 metadata name - help: "需要通过开发者模式获取菜单对应的 metadata name" - $formkit: radio name: right_menu label: 右侧四个按钮 @@ -107,9 +105,9 @@ spec: label: 博客封面随机 API validation: "url" value: "https://source.unsplash.com/random/600x400/?blog,scenery,night,desert,sea" - help: 默认随机封面图 url 不能保证一直可用 + help: 二次元随机图地址:https://www.dmoe.cc/random.php 默认随机封面图 url 不能保证一直可用 - group: sidebar - label: 侧边栏 + label: 侧栏 formSchema: - $formkit: select name: location @@ -124,9 +122,26 @@ spec: label: "左侧" - $formkit: textarea name: widgets - label: 小部件(无效) - value: "profile,recent-posts,latest-comments,categories,tags" - help: "目前提供的小部件有:profile(站点资料), recent-posts(近期文章), latest-comments(最新评论), categories(文章分类), tags(文章标签)。你可以随意组合或排序,以逗号隔开。" + label: 小部件 + value: "profile,wechat,comments,recent-posts,categories,tags-stat" + help: "目前提供的小部件有:profile(站点资料), wechat(微信), recent-posts(近期文章), comments(最新评论), categories(文章分类), tags(文章标签), stat(统计), tags-stat(标签&统计)。你可以随意组合或排序,以逗号隔开。" + - $formkit: textarea + name: post_widgets + label: 文章页面小部件 + value: "profile,wechat,toc,comments,recent-posts,categories,tags-stat" + help: "post 可以支持设置 toc " + - $formkit: textarea + name: tag_widgets + label: 标签页面小部件 + value: "profile,wechat,comments,recent-posts,categories,tags-stat" + - $formkit: textarea + name: category_widgets + label: 分类页面小部件 + value: "profile,wechat,comments,recent-posts,categories,tags-stat" + - $formkit: textarea + name: page_widgets + label: 自定义页面小部件 + value: "" - $formkit: text name: profile_name label: 个人卡片名称 @@ -153,11 +168,9 @@ spec: label: 社交链接(无效) placeholder: 暂时不支持配置 help: "当前版本不支持配置" - - $formkit: text + - $formkit: menuRadio name: menu label: 底部相关链接 - placeholder: 请填写 metadata name - help: "需要通过开发者模式获取菜单对应的 metadata name" - $formkit: text name: copyright_start label: 开始时间 @@ -168,6 +181,28 @@ spec: label: ICP 备案 placeholder: 请输入 ICP 备案号 help: "京ICP备xxxxxxxx号" + - group: post + label: 文章 + formSchema: + - $formkit: radio + name: copyright + label: 版权声明 + value: true + options: + - label: 打开 + value: true + - label: 关闭 + value: false + help: "文章底部显示版权声明模块" + - $formkit: url + name: copyrightAgreement + label: 版权协议 + placeholder: "请输入版权协议地址" + - $formkit: textarea + name: copyrightInfo + label: 版权声明 + placeholder: '本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 程序员小航' + help: "版权声明内容,支持填入 HTML 标签" - group: right_menu label: 右键菜单 formSchema: diff --git a/templates/assets/images/404.gif b/templates/assets/images/404.gif new file mode 100644 index 00000000..22687faa Binary files /dev/null and b/templates/assets/images/404.gif differ diff --git a/templates/assets/js/main.js b/templates/assets/js/main.js index 9e3f7c8a..eb5ef58e 100644 --- a/templates/assets/js/main.js +++ b/templates/assets/js/main.js @@ -46,7 +46,6 @@ document.addEventListener("DOMContentLoaded", function () { let initTop = 0; let $header = document.getElementById("page-header"); - let $cookies = document.getElementById("cookies-window"); window.scrollCollect = btf.throttle(function () { @@ -66,7 +65,6 @@ document.addEventListener("DOMContentLoaded", function () { } } $header.classList.add("nav-fixed") - $cookies.classList.add("cw-hide") } else { if (0 === currentTop) { $header.classList.remove("nav-fixed", "nav-visible") @@ -79,63 +77,73 @@ document.addEventListener("DOMContentLoaded", function () { // 滚动处理 const scrollFnToDo = function () { - let $cardTocLayout = document.getElementById("card-toc"); - let $cardToc = $cardTocLayout.getElementsByClassName("toc-content")[0]; - let $tocLink = $cardToc.querySelectorAll(".toc-link"); - let $article = document.getElementById("article-container"); + + const isToc = GLOBAL_CONFIG.htmlType === 'post' && document.getElementById("card-toc"); + const $article = document.getElementById("article-container"); + + if (!($article && isToc)) return + + let $tocLink, $cardToc, scrollPercent, autoScrollToc, isExpand + + if (isToc) { + + const $cardTocLayout = document.getElementById("card-toc"); + $cardToc = $cardTocLayout.getElementsByClassName("toc-content")[0]; + $tocLink = $cardToc.querySelectorAll(".toc-link"); + + // const $tocPercentage = $cardTocLayout.querySelector(".toc-percentage"); + isExpand = $cardToc.classList.contains("is-expand"); + + scrollPercent = function (currentTop) { + const docHeight = $article.clientHeight; + const winHeight = document.documentElement.clientHeight; + const headerHeight = $article.offsetTop; + const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight); + const scrollPercent = (currentTop - headerHeight) / (contentMath); + const scrollPercentRounded = Math.round(scrollPercent * 100); + const percentage = (scrollPercentRounded > 100) ? 100 : (scrollPercentRounded <= 0) ? 0 : scrollPercentRounded; + // $tocPercentage.textContent = percentage + $cardToc.setAttribute("progress-percentage", percentage); + }; - const scrollPercent = function (currentTop) { - const docHeight = $article.clientHeight; - const winHeight = document.documentElement.clientHeight; - const headerHeight = $article.offsetTop; - const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight) - const scrollPercent = (currentTop - headerHeight) / (contentMath); - const scrollPercentRounded = Math.round(100 * scrollPercent); - const percentage = 100 < scrollPercentRounded ? 100 : scrollPercentRounded <= 0 ? 0 : scrollPercentRounded; - $cardToc.setAttribute("progress-percentage", percentage); - } + window.mobileToc = { + open: () => { + $cardTocLayout.style.cssText = "animation: toc-open .3s; opacity: 1; right: 45px"; + }, - document.getElementById("mobile-toc-button") - .addEventListener("click", function () { - if ("0" === window.getComputedStyle($cardTocLayout).getPropertyValue("opacity")) { - window.mobileToc.open(); - } else { - window.mobileToc.close(); + close: () => { + $cardTocLayout.style.animation = "toc-close .2s" + setTimeout(function () { + $cardTocLayout.style.cssText = "opacity:''; animation: ''; right: ''"; + }, 100); + } + } + + // toc 元素点击 + $cardToc.addEventListener("click", e => { + e.preventDefault(); + const target = e.target.classList; + if (target.contains('toc-content')) return; + const $target = e.target.classList.contains("toc-link") ? e.target : e.target.parentElement; + + btf.scrollToDest(btf.getEleTop(document.getElementById(decodeURI($target.getAttribute("href")).replace("#", ""))), 300); + if (window.innerWidth < 900) { + window.mobileToc.close() } }); - window.mobileToc = { - open: () => { - $cardTocLayout.style.cssText = "animation: toc-open .3s; opacity: 1; right: 45px"; - }, - - close: () => { - $cardTocLayout.style.animation = "toc-close .2s" - setTimeout(function () { - $cardTocLayout.style.cssText = "opacity:''; animation: ''; right: ''"; - }, 100); - } + autoScrollToc = item => { + const activePosition = item.getBoundingClientRect().top + const sidebarScrollTop = $cardToc.scrollTop + if (activePosition > (document.documentElement.clientHeight - 100)) { + $cardToc.scrollTop = sidebarScrollTop + 150 + } + if (activePosition < 100) { + $cardToc.scrollTop = sidebarScrollTop - 150 + } + }; } - - // toc 元素点击 - $cardToc.addEventListener("click", e => { - e.preventDefault(); - const target = e.target.classList.contains("toc-link") ? e.target : e.target.parentElement; - - btf.scrollToDest( - btf.getEleTop( - document.getElementById( - decodeURI(target.getAttribute("href")).replace("#", "") - ) - ), - 300 - ); - if (window.innerWidth < 900) { - window.mobileToc.close(); - } - }); - // find head position & add active class const list = $article.querySelectorAll("h1,h2,h3,h4,h5,h6"); let detectItem = ""; @@ -150,7 +158,8 @@ document.addEventListener("DOMContentLoaded", function () { list.forEach(function (ele, index) { if (top > btf.getEleTop(ele) - 80) { - currentId = "#" + encodeURI(ele.getAttribute("id")); + const id = ele.id + currentId = id ? "#" + encodeURI(id) : "" currentIndex = index } @@ -161,26 +170,28 @@ document.addEventListener("DOMContentLoaded", function () { detectItem = currentIndex - $cardToc.querySelectorAll(".active").forEach(i => { - i.classList.remove("active") - }) + if (isToc) { + $cardToc.querySelectorAll(".active").forEach(i => { + i.classList.remove("active") + }); + if (currentId === "") { + return; + } - if (currentId === "") { - return - } + const currentActive = $tocLink[currentIndex]; - const currentActive = $tocLink[currentIndex] - currentActive.classList.add("active") + currentActive.classList.add("active"); - setTimeout(() => { - autoScrollToc(currentActive) - }, 0) + setTimeout(() => { + autoScrollToc(currentActive) + }, 0); - if (isExpand) return - let parent = currentActive.parentNode + if (isExpand) return; + let parent = currentActive.parentNode; - for (; !parent.matches(".toc"); parent = parent.parentNode) { - if (parent.matches("li")) parent.classList.add("active") + for (; !parent.matches(".toc-list"); parent = parent.parentNode) { + if (parent.matches("li")) parent.classList.add("active") + } } } diff --git a/templates/assets/js/utils.js b/templates/assets/js/utils.js index 45d213fb..d3f6b701 100644 --- a/templates/assets/js/utils.js +++ b/templates/assets/js/utils.js @@ -167,10 +167,6 @@ const btf = { } }, - isJqueryLoad: function (e) { - "undefined" == typeof jQuery ? getScript(GLOBAL_CONFIG.source.jQuery).then(e) : e() - }, - isHidden: ele => ele.offsetHeight === 0 && ele.offsetWidth === 0, getEleTop: ele => { @@ -185,14 +181,4 @@ const btf = { return actualTop }, - updateAnchor: (anchor) => { - if (anchor !== window.location.hash) { - if (!anchor) anchor = location.pathname - const title = GLOBAL_CONFIG_SITE.title - window.history.replaceState({ - url: location.href, - title: title - }, title, anchor) - } - } }; \ No newline at end of file diff --git a/templates/assets/libs/color-thief/color-thief.umd.js b/templates/assets/libs/color-thief/color-thief.umd.js new file mode 100644 index 00000000..13ae4072 --- /dev/null +++ b/templates/assets/libs/color-thief/color-thief.umd.js @@ -0,0 +1 @@ +!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):t.ColorThief=r()}(this,function(){if(!t)var t={map:function(t,r){var n={};return r?t.map(function(t,o){return n.index=o,r.call(n,t)}):t.slice()},naturalOrder:function(t,r){return tr?1:0},sum:function(t,r){var n={};return t.reduce(r?function(t,o,e){return n.index=e,t+r.call(n,o)}:function(t,r){return t+r},0)},max:function(r,n){return Math.max.apply(null,n?t.map(r,n):r)}};var r=function(){var r=5,n=8-r,o=1e3;function e(t,n,o){return(t<<2*r)+(n<f/2){for(e=n.copy(),i=n.copy(),u=(r=a-n[s])<=(o=n[h]-a)?Math.min(n[h]-1,~~(a+o/2)):Math.max(n[s],~~(a-1-r/2));!v[u];)u++;for(c=l[u];!c&&v[u-1];)c=l[--u];return e[h]=u,i[s]=e[h]+1,[e,i]}}(u==o?"r":u==i?"g":"b")}}return u.prototype={volume:function(t){return this._volume&&!t||(this._volume=(this.r2-this.r1+1)*(this.g2-this.g1+1)*(this.b2-this.b1+1)),this._volume},count:function(t){var r=this.histo;if(!this._count_set||t){var n,o,i,u=0;for(n=this.r1;n<=this.r2;n++)for(o=this.g1;o<=this.g2;o++)for(i=this.b1;i<=this.b2;i++)u+=r[e(n,o,i)]||0;this._count=u,this._count_set=!0}return this._count},copy:function(){return new u(this.r1,this.r2,this.g1,this.g2,this.b1,this.b2,this.histo)},avg:function(t){var n=this.histo;if(!this._avg||t){var o,i,u,a,s=0,h=1<<8-r,c=0,f=0,v=0;for(i=this.r1;i<=this.r2;i++)for(u=this.g1;u<=this.g2;u++)for(a=this.b1;a<=this.b2;a++)s+=o=n[e(i,u,a)]||0,c+=o*(i+.5)*h,f+=o*(u+.5)*h,v+=o*(a+.5)*h;this._avg=s?[~~(c/s),~~(f/s),~~(v/s)]:[~~(h*(this.r1+this.r2+1)/2),~~(h*(this.g1+this.g2+1)/2),~~(h*(this.b1+this.b2+1)/2)]}return this._avg},contains:function(t){var r=t[0]>>n;return gval=t[1]>>n,bval=t[2]>>n,r>=this.r1&&r<=this.r2&&gval>=this.g1&&gval<=this.g2&&bval>=this.b1&&bval<=this.b2}},a.prototype={push:function(t){this.vboxes.push({vbox:t,color:t.avg()})},palette:function(){return this.vboxes.map(function(t){return t.color})},size:function(){return this.vboxes.size()},map:function(t){for(var r=this.vboxes,n=0;n251&&e[1]>251&&e[2]>251&&(r[o].color=[255,255,255])}},{quantize:function(h,c){if(!h.length||c<2||c>256)return!1;var f=function(t){var o,i=new Array(1<<3*r);return t.forEach(function(t){o=e(t[0]>>n,t[1]>>n,t[2]>>n),i[o]=(i[o]||0)+1}),i}(h);f.forEach(function(){});var v=function(t,r){var o,e,i,a=1e6,s=0,h=1e6,c=0,f=1e6,v=0;return t.forEach(function(t){(o=t[0]>>n)s&&(s=o),(e=t[1]>>n)c&&(c=e),(i=t[2]>>n)v&&(v=i)}),new u(a,s,h,c,f,v,r)}(h,f),l=new i(function(r,n){return t.naturalOrder(r.count(),n.count())});function g(t,r){for(var n,e=t.size(),i=0;i=r)return;if(i++>o)return;if((n=t.pop()).count()){var u=s(f,n),a=u[0],h=u[1];if(!a)return;t.push(a),h&&(t.push(h),e++)}else t.push(n),i++}}l.push(v),g(l,.75*c);for(var p=new i(function(r,n){return t.naturalOrder(r.count()*r.volume(),n.count()*n.volume())});l.size();)p.push(l.pop());g(p,c);for(var d=new a;p.size();)d.push(p.pop());return d}}}().quantize,n=function(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.width=this.canvas.width=t.naturalWidth,this.height=this.canvas.height=t.naturalHeight,this.context.drawImage(t,0,0,this.width,this.height)};n.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)};var o=function(){};return o.prototype.getColor=function(t,r){return void 0===r&&(r=10),this.getPalette(t,5,r)[0]},o.prototype.getPalette=function(t,o,e){var i=function(t){var r=t.colorCount,n=t.quality;if(void 0!==r&&Number.isInteger(r)){if(1===r)throw new Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()");r=Math.max(r,2),r=Math.min(r,20)}else r=10;return(void 0===n||!Number.isInteger(n)||n<1)&&(n=10),{colorCount:r,quality:n}}({colorCount:o,quality:e}),u=new n(t),a=function(t,r,n){for(var o=t,e=[],i=0,u=void 0,a=void 0,s=void 0,h=void 0,c=void 0;i=125)&&(a>250&&s>250&&h>250||e.push([a,s,h]));return e}(u.getImageData().data,u.width*u.height,i.quality),s=r(a,i.colorCount);return s?s.palette():null},o.prototype.getColorFromUrl=function(t,r,n){var o=this,e=document.createElement("img");e.addEventListener("load",function(){var i=o.getPalette(e,5,n);r(i[0],t)}),e.src=t},o.prototype.getImageData=function(t,r){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){if(200==this.status){var t=new Uint8Array(this.response);i=t.length;for(var n=new Array(i),o=0;o.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}")}catch(c){console&&console.log(c)}}i=function(){var c,l=document.createElement("div");l.innerHTML=o._iconfont_svg_string_3736806,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(c=document.body).firstChild?a(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),i()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(h=i,v=o.document,m=!1,e(),v.onreadystatechange=function(){"complete"==v.readyState&&(v.onreadystatechange=null,s())})}function s(){m||(m=!0,h())}function e(){try{v.documentElement.doScroll("left")}catch(c){return void setTimeout(e,50)}s()}}(window); \ No newline at end of file diff --git a/templates/assets/libs/iconfont/iconfont.json b/templates/assets/libs/iconfont/iconfont.json new file mode 100644 index 00000000..c9188bae --- /dev/null +++ b/templates/assets/libs/iconfont/iconfont.json @@ -0,0 +1,380 @@ +{ + "id": "3736806", + "name": "hao", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "20817029", + "name": "mail-line", + "font_class": "mail-line", + "unicode": "e668", + "unicode_decimal": 58984 + }, + { + "icon_id": "20818096", + "name": "github-line", + "font_class": "github-line", + "unicode": "e74c", + "unicode_decimal": 59212 + }, + { + "icon_id": "5634247", + "name": "moon", + "font_class": "moon", + "unicode": "f057", + "unicode_decimal": 61527 + }, + { + "icon_id": "5633944", + "name": "closed-captioning", + "font_class": "closed-captioning", + "unicode": "ef76", + "unicode_decimal": 61302 + }, + { + "icon_id": "5634114", + "name": "hand-holding", + "font_class": "hand-holding", + "unicode": "f000", + "unicode_decimal": 61440 + }, + { + "icon_id": "5633983", + "name": "dice", + "font_class": "dice", + "unicode": "ef94", + "unicode_decimal": 61332 + }, + { + "icon_id": "5634194", + "name": "list-ul", + "font_class": "list-ul", + "unicode": "f039", + "unicode_decimal": 61497 + }, + { + "icon_id": "386278", + "name": "baidu", + "font_class": "baidu", + "unicode": "e6b6", + "unicode_decimal": 59062 + }, + { + "icon_id": "5634346", + "name": "search", + "font_class": "search", + "unicode": "f0a8", + "unicode_decimal": 61608 + }, + { + "icon_id": "5634003", + "name": "download", + "font_class": "download", + "unicode": "efa5", + "unicode_decimal": 61349 + }, + { + "icon_id": "5634158", + "name": "image", + "font_class": "image", + "unicode": "f024", + "unicode_decimal": 61476 + }, + { + "icon_id": "5634542", + "name": "window-restore", + "font_class": "window-restore", + "unicode": "f159", + "unicode_decimal": 61785 + }, + { + "icon_id": "5634960", + "name": "comment-dots", + "font_class": "comment-dots1", + "unicode": "f288", + "unicode_decimal": 62088 + }, + { + "icon_id": "5633967", + "name": "copy", + "font_class": "copy", + "unicode": "ef86", + "unicode_decimal": 61318 + }, + { + "icon_id": "5633878", + "name": "bus", + "font_class": "bus", + "unicode": "ef58", + "unicode_decimal": 61272 + }, + { + "icon_id": "5634718", + "name": "hotjar", + "font_class": "hotjar", + "unicode": "f1cf", + "unicode_decimal": 61903 + }, + { + "icon_id": "5634903", + "name": "weibo", + "font_class": "weibo", + "unicode": "f261", + "unicode_decimal": 62049 + }, + { + "icon_id": "5634330", + "name": "robot", + "font_class": "robot", + "unicode": "f09a", + "unicode_decimal": 61594 + }, + { + "icon_id": "5634271", + "name": "paste", + "font_class": "paste", + "unicode": "f068", + "unicode_decimal": 61544 + }, + { + "icon_id": "5634192", + "name": "link", + "font_class": "link", + "unicode": "f037", + "unicode_decimal": 61495 + }, + { + "icon_id": "5634313", + "name": "qrcode", + "font_class": "qrcode", + "unicode": "f08d", + "unicode_decimal": 61581 + }, + { + "icon_id": "5633882", + "name": "calendar-alt", + "font_class": "calendar-alt", + "unicode": "ef5a", + "unicode_decimal": 61274 + }, + { + "icon_id": "5633943", + "name": "clock", + "font_class": "clock", + "unicode": "ef75", + "unicode_decimal": 61301 + }, + { + "icon_id": "5634058", + "name": "file-word", + "font_class": "file-word", + "unicode": "efd1", + "unicode_decimal": 61393 + }, + { + "icon_id": "5633931", + "name": "chevron-down", + "font_class": "chevron-down", + "unicode": "ef6d", + "unicode_decimal": 61293 + }, + { + "icon_id": "5634458", + "name": "times-circle", + "font_class": "times-circle", + "unicode": "f10a", + "unicode_decimal": 61706 + }, + { + "icon_id": "5634113", + "name": "grip-vertical", + "font_class": "grip-vertical", + "unicode": "efff", + "unicode_decimal": 61439 + }, + { + "icon_id": "5633858", + "name": "book", + "font_class": "book", + "unicode": "ef46", + "unicode_decimal": 61254 + }, + { + "icon_id": "5633877", + "name": "burn", + "font_class": "burn", + "unicode": "ef57", + "unicode_decimal": 61271 + }, + { + "icon_id": "5634002", + "name": "dove", + "font_class": "dove", + "unicode": "efa4", + "unicode_decimal": 61348 + }, + { + "icon_id": "5633812", + "name": "arrow-circle-right", + "font_class": "arrow-circle-right", + "unicode": "ef23", + "unicode_decimal": 61219 + }, + { + "icon_id": "5633958", + "name": "comment-dots", + "font_class": "comment-dots", + "unicode": "ef7e", + "unicode_decimal": 61310 + }, + { + "icon_id": "5634073", + "name": "folder-open", + "font_class": "folder-open", + "unicode": "efdc", + "unicode_decimal": 61404 + }, + { + "icon_id": "5634038", + "name": "file-alt", + "font_class": "file-alt", + "unicode": "efc1", + "unicode_decimal": 61377 + }, + { + "icon_id": "5633876", + "name": "bullseye", + "font_class": "bullseye", + "unicode": "ef56", + "unicode_decimal": 61270 + }, + { + "icon_id": "5634373", + "name": "sliders-h", + "font_class": "sliders", + "unicode": "f0bf", + "unicode_decimal": 61631 + }, + { + "icon_id": "5634433", + "name": "tags", + "font_class": "tags", + "unicode": "f0f3", + "unicode_decimal": 61683 + }, + { + "icon_id": "5634959", + "name": "comment-alt", + "font_class": "comment-alt", + "unicode": "f287", + "unicode_decimal": 62087 + }, + { + "icon_id": "5634971", + "name": "eye", + "font_class": "eye", + "unicode": "f28f", + "unicode_decimal": 62095 + }, + { + "icon_id": "5633815", + "name": "arrow-left", + "font_class": "arrow-left", + "unicode": "ef26", + "unicode_decimal": 61222 + }, + { + "icon_id": "5633816", + "name": "arrow-right", + "font_class": "arrow-right", + "unicode": "ef27", + "unicode_decimal": 61223 + }, + { + "icon_id": "5633820", + "name": "arrow-up", + "font_class": "arrow-up", + "unicode": "ef2a", + "unicode_decimal": 61226 + }, + { + "icon_id": "5633932", + "name": "chevron-left", + "font_class": "chevron-left", + "unicode": "ef6e", + "unicode_decimal": 61294 + }, + { + "icon_id": "5633933", + "name": "chevron-right", + "font_class": "chevron-right", + "unicode": "ef6f", + "unicode_decimal": 61295 + }, + { + "icon_id": "5634323", + "name": "redo-alt", + "font_class": "redo-alt", + "unicode": "f094", + "unicode_decimal": 61588 + }, + { + "icon_id": "836718", + "name": "list-ol", + "font_class": "listol", + "unicode": "e767", + "unicode_decimal": 59239 + }, + { + "icon_id": "348268", + "name": "bars", + "font_class": "bars", + "unicode": "e9ee", + "unicode_decimal": 59886 + }, + { + "icon_id": "433860", + "name": "arrow-up", + "font_class": "arrowup", + "unicode": "e64c", + "unicode_decimal": 58956 + }, + { + "icon_id": "5652805", + "name": "icon-side bar-scxmtj", + "font_class": "icon-sidebar-scxmtj", + "unicode": "e643", + "unicode_decimal": 58947 + }, + { + "icon_id": "21169476", + "name": "train-public-transport", + "font_class": "train-public-transport", + "unicode": "e600", + "unicode_decimal": 58880 + }, + { + "icon_id": "24342573", + "name": "the console-fill", + "font_class": "a-theconsole-fill", + "unicode": "ea32", + "unicode_decimal": 59954 + }, + { + "icon_id": "1251292", + "name": "shuffle", + "font_class": "shuffle", + "unicode": "e67e", + "unicode_decimal": 59006 + }, + { + "icon_id": "11102802", + "name": "md-train", + "font_class": "md-train", + "unicode": "e77d", + "unicode_decimal": 59261 + } + ] +} diff --git a/templates/assets/libs/iconfont/iconfont.ttf b/templates/assets/libs/iconfont/iconfont.ttf new file mode 100644 index 00000000..7f1ea13b Binary files /dev/null and b/templates/assets/libs/iconfont/iconfont.ttf differ diff --git a/templates/assets/libs/iconfont/iconfont.woff b/templates/assets/libs/iconfont/iconfont.woff new file mode 100644 index 00000000..60a46690 Binary files /dev/null and b/templates/assets/libs/iconfont/iconfont.woff differ diff --git a/templates/assets/libs/iconfont/iconfont.woff2 b/templates/assets/libs/iconfont/iconfont.woff2 new file mode 100644 index 00000000..d5d8103a Binary files /dev/null and b/templates/assets/libs/iconfont/iconfont.woff2 differ diff --git a/templates/assets/libs/translate/tw_cn.js b/templates/assets/libs/translate/tw_cn.js deleted file mode 100644 index d30cb55b..00000000 --- a/templates/assets/libs/translate/tw_cn.js +++ /dev/null @@ -1,121 +0,0 @@ -/* eslint-disable no-undef */ -document.addEventListener('DOMContentLoaded', function () { - const translate = GLOBAL_CONFIG.translate - const snackbarData = GLOBAL_CONFIG.Snackbar - const defaultEncoding = translate.defaultEncoding // 網站默認語言,1: 繁體中文, 2: 簡體中文 - const translateDelay = translate.translateDelay // 延遲時間,若不在前, 要設定延遲翻譯時間, 如100表示100ms,默認為0 - const msgToTraditionalChinese = '轉為繁體' // 此處可以更改為你想要顯示的文字 - const msgToSimplifiedChinese = '转为简体' // 同上,但兩處均不建議更改 - let currentEncoding = defaultEncoding - const targetEncodingCookie = 'translate-chn-cht' - let targetEncoding = - saveToLocal.get(targetEncodingCookie) === undefined - ? defaultEncoding - : Number(saveToLocal.get('translate-chn-cht')) - let translateButtonObject - const isSnackbar = GLOBAL_CONFIG.Snackbar !== undefined - - function translateText(txt) { - if (txt === '' || txt == null) return '' - if (currentEncoding === 1 && targetEncoding === 2) return Simplized(txt) - else if (currentEncoding === 2 && targetEncoding === 1) { - return Traditionalized(txt) - } else return txt - } - - function translateBody(fobj) { - let objs - if (typeof fobj === 'object') objs = fobj.childNodes - else objs = document.body.childNodes - for (let i = 0; i < objs.length; i++) { - const obj = objs.item(i) - if ( - '||BR|HR|'.indexOf('|' + obj.tagName + '|') > 0 || - obj === translateButtonObject - ) { - continue - } - if (obj.title !== '' && obj.title != null) { - obj.title = translateText(obj.title) - } - if (obj.alt !== '' && obj.alt != null) obj.alt = translateText(obj.alt) - if (obj.placeholder !== '' && obj.placeholder != null) obj.placeholder = translateText(obj.placeholder) - if ( - obj.tagName === 'INPUT' && - obj.value !== '' && - obj.type !== 'text' && - obj.type !== 'hidden' - ) { - obj.value = translateText(obj.value) - } - if (obj.nodeType === 3) obj.data = translateText(obj.data) - else translateBody(obj) - } - } - - function translatePage() { - if (targetEncoding === 1) { - currentEncoding = 1 - targetEncoding = 2 - translateButtonObject.innerHTML = msgToTraditionalChinese - saveToLocal.set(targetEncodingCookie, targetEncoding, 2) - translateBody() - if (isSnackbar) btf.snackbarShow(snackbarData.cht_to_chs) - } else if (targetEncoding === 2) { - currentEncoding = 2 - targetEncoding = 1 - translateButtonObject.innerHTML = msgToSimplifiedChinese - saveToLocal.set(targetEncodingCookie, targetEncoding, 2) - translateBody() - if (isSnackbar) btf.snackbarShow(snackbarData.chs_to_cht) - } - rm.hideRightMenu(); - } - - function JTPYStr() { - return '万与丑专业丛东丝丢两严丧个丬丰临为丽举么义乌乐乔习乡书买乱争于亏云亘亚产亩亲亵亸亿仅从仑仓仪们价众优伙会伛伞伟传伤伥伦伧伪伫体余佣佥侠侣侥侦侧侨侩侪侬俣俦俨俩俪俭债倾偬偻偾偿傥傧储傩儿兑兖党兰关兴兹养兽冁内冈册写军农冢冯冲决况冻净凄凉凌减凑凛几凤凫凭凯击凼凿刍划刘则刚创删别刬刭刽刿剀剂剐剑剥剧劝办务劢动励劲劳势勋勐勚匀匦匮区医华协单卖卢卤卧卫却卺厂厅历厉压厌厍厕厢厣厦厨厩厮县参叆叇双发变叙叠叶号叹叽吁后吓吕吗吣吨听启吴呒呓呕呖呗员呙呛呜咏咔咙咛咝咤咴咸哌响哑哒哓哔哕哗哙哜哝哟唛唝唠唡唢唣唤唿啧啬啭啮啰啴啸喷喽喾嗫呵嗳嘘嘤嘱噜噼嚣嚯团园囱围囵国图圆圣圹场坂坏块坚坛坜坝坞坟坠垄垅垆垒垦垧垩垫垭垯垱垲垴埘埙埚埝埯堑堕塆墙壮声壳壶壸处备复够头夸夹夺奁奂奋奖奥妆妇妈妩妪妫姗姜娄娅娆娇娈娱娲娴婳婴婵婶媪嫒嫔嫱嬷孙学孪宁宝实宠审宪宫宽宾寝对寻导寿将尔尘尧尴尸尽层屃屉届属屡屦屿岁岂岖岗岘岙岚岛岭岳岽岿峃峄峡峣峤峥峦崂崃崄崭嵘嵚嵛嵝嵴巅巩巯币帅师帏帐帘帜带帧帮帱帻帼幂幞干并广庄庆庐庑库应庙庞废庼廪开异弃张弥弪弯弹强归当录彟彦彻径徕御忆忏忧忾怀态怂怃怄怅怆怜总怼怿恋恳恶恸恹恺恻恼恽悦悫悬悭悯惊惧惨惩惫惬惭惮惯愍愠愤愦愿慑慭憷懑懒懔戆戋戏戗战戬户扎扑扦执扩扪扫扬扰抚抛抟抠抡抢护报担拟拢拣拥拦拧拨择挂挚挛挜挝挞挟挠挡挢挣挤挥挦捞损捡换捣据捻掳掴掷掸掺掼揸揽揿搀搁搂搅携摄摅摆摇摈摊撄撑撵撷撸撺擞攒敌敛数斋斓斗斩断无旧时旷旸昙昼昽显晋晒晓晔晕晖暂暧札术朴机杀杂权条来杨杩杰极构枞枢枣枥枧枨枪枫枭柜柠柽栀栅标栈栉栊栋栌栎栏树栖样栾桊桠桡桢档桤桥桦桧桨桩梦梼梾检棂椁椟椠椤椭楼榄榇榈榉槚槛槟槠横樯樱橥橱橹橼檐檩欢欤欧歼殁殇残殒殓殚殡殴毁毂毕毙毡毵氇气氢氩氲汇汉污汤汹沓沟没沣沤沥沦沧沨沩沪沵泞泪泶泷泸泺泻泼泽泾洁洒洼浃浅浆浇浈浉浊测浍济浏浐浑浒浓浔浕涂涌涛涝涞涟涠涡涢涣涤润涧涨涩淀渊渌渍渎渐渑渔渖渗温游湾湿溃溅溆溇滗滚滞滟滠满滢滤滥滦滨滩滪漤潆潇潋潍潜潴澜濑濒灏灭灯灵灾灿炀炉炖炜炝点炼炽烁烂烃烛烟烦烧烨烩烫烬热焕焖焘煅煳熘爱爷牍牦牵牺犊犟状犷犸犹狈狍狝狞独狭狮狯狰狱狲猃猎猕猡猪猫猬献獭玑玙玚玛玮环现玱玺珉珏珐珑珰珲琎琏琐琼瑶瑷璇璎瓒瓮瓯电画畅畲畴疖疗疟疠疡疬疮疯疱疴痈痉痒痖痨痪痫痴瘅瘆瘗瘘瘪瘫瘾瘿癞癣癫癯皑皱皲盏盐监盖盗盘眍眦眬着睁睐睑瞒瞩矫矶矾矿砀码砖砗砚砜砺砻砾础硁硅硕硖硗硙硚确硷碍碛碜碱碹磙礼祎祢祯祷祸禀禄禅离秃秆种积称秽秾稆税稣稳穑穷窃窍窑窜窝窥窦窭竖竞笃笋笔笕笺笼笾筑筚筛筜筝筹签简箓箦箧箨箩箪箫篑篓篮篱簖籁籴类籼粜粝粤粪粮糁糇紧絷纟纠纡红纣纤纥约级纨纩纪纫纬纭纮纯纰纱纲纳纴纵纶纷纸纹纺纻纼纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绖绗绘给绚绛络绝绞统绠绡绢绣绤绥绦继绨绩绪绫绬续绮绯绰绱绲绳维绵绶绷绸绹绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缊缋缌缍缎缏缐缑缒缓缔缕编缗缘缙缚缛缜缝缞缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵罂网罗罚罢罴羁羟羡翘翙翚耢耧耸耻聂聋职聍联聩聪肃肠肤肷肾肿胀胁胆胜胧胨胪胫胶脉脍脏脐脑脓脔脚脱脶脸腊腌腘腭腻腼腽腾膑臜舆舣舰舱舻艰艳艹艺节芈芗芜芦苁苇苈苋苌苍苎苏苘苹茎茏茑茔茕茧荆荐荙荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭荮药莅莜莱莲莳莴莶获莸莹莺莼萚萝萤营萦萧萨葱蒇蒉蒋蒌蓝蓟蓠蓣蓥蓦蔷蔹蔺蔼蕲蕴薮藁藓虏虑虚虫虬虮虽虾虿蚀蚁蚂蚕蚝蚬蛊蛎蛏蛮蛰蛱蛲蛳蛴蜕蜗蜡蝇蝈蝉蝎蝼蝾螀螨蟏衅衔补衬衮袄袅袆袜袭袯装裆裈裢裣裤裥褛褴襁襕见观觃规觅视觇览觉觊觋觌觍觎觏觐觑觞触觯詟誉誊讠计订讣认讥讦讧讨让讪讫训议讯记讱讲讳讴讵讶讷许讹论讻讼讽设访诀证诂诃评诅识诇诈诉诊诋诌词诎诏诐译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诪诫诬语诮误诰诱诲诳说诵诶请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谘谙谚谛谜谝谞谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豮贝贞负贠贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赑赒赓赔赕赖赗赘赙赚赛赜赝赞赟赠赡赢赣赪赵赶趋趱趸跃跄跖跞践跶跷跸跹跻踊踌踪踬踯蹑蹒蹰蹿躏躜躯车轧轨轩轪轫转轭轮软轰轱轲轳轴轵轶轷轸轹轺轻轼载轾轿辀辁辂较辄辅辆辇辈辉辊辋辌辍辎辏辐辑辒输辔辕辖辗辘辙辚辞辩辫边辽达迁过迈运还这进远违连迟迩迳迹适选逊递逦逻遗遥邓邝邬邮邹邺邻郁郄郏郐郑郓郦郧郸酝酦酱酽酾酿释里鉅鉴銮錾钆钇针钉钊钋钌钍钎钏钐钑钒钓钔钕钖钗钘钙钚钛钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钶钷钸钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铍铎铏铐铑铒铕铗铘铙铚铛铜铝铞铟铠铡铢铣铤铥铦铧铨铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铻铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锍锎锏锐锑锒锓锔锕锖锗错锚锜锞锟锠锡锢锣锤锥锦锨锩锫锬锭键锯锰锱锲锳锴锵锶锷锸锹锺锻锼锽锾锿镀镁镂镃镆镇镈镉镊镌镍镎镏镐镑镒镕镖镗镙镚镛镜镝镞镟镠镡镢镣镤镥镦镧镨镩镪镫镬镭镮镯镰镱镲镳镴镶长门闩闪闫闬闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾闿阀阁阂阃阄阅阆阇阈阉阊阋阌阍阎阏阐阑阒阓阔阕阖阗阘阙阚阛队阳阴阵阶际陆陇陈陉陕陧陨险随隐隶隽难雏雠雳雾霁霉霭靓静靥鞑鞒鞯鞴韦韧韨韩韪韫韬韵页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颋颌颍颎颏颐频颒颓颔颕颖颗题颙颚颛颜额颞颟颠颡颢颣颤颥颦颧风飏飐飑飒飓飔飕飖飗飘飙飚飞飨餍饤饥饦饧饨饩饪饫饬饭饮饯饰饱饲饳饴饵饶饷饸饹饺饻饼饽饾饿馀馁馂馃馄馅馆馇馈馉馊馋馌馍馎馏馐馑馒馓馔馕马驭驮驯驰驱驲驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骃骄骅骆骇骈骉骊骋验骍骎骏骐骑骒骓骔骕骖骗骘骙骚骛骜骝骞骟骠骡骢骣骤骥骦骧髅髋髌鬓魇魉鱼鱽鱾鱿鲀鲁鲂鲄鲅鲆鲇鲈鲉鲊鲋鲌鲍鲎鲏鲐鲑鲒鲓鲔鲕鲖鲗鲘鲙鲚鲛鲜鲝鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲪鲫鲬鲭鲮鲯鲰鲱鲲鲳鲴鲵鲶鲷鲸鲹鲺鲻鲼鲽鲾鲿鳀鳁鳂鳃鳄鳅鳆鳇鳈鳉鳊鳋鳌鳍鳎鳏鳐鳑鳒鳓鳔鳕鳖鳗鳘鳙鳛鳜鳝鳞鳟鳠鳡鳢鳣鸟鸠鸡鸢鸣鸤鸥鸦鸧鸨鸩鸪鸫鸬鸭鸮鸯鸰鸱鸲鸳鸴鸵鸶鸷鸸鸹鸺鸻鸼鸽鸾鸿鹀鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹍鹎鹏鹐鹑鹒鹓鹔鹕鹖鹗鹘鹚鹛鹜鹝鹞鹟鹠鹡鹢鹣鹤鹥鹦鹧鹨鹩鹪鹫鹬鹭鹯鹰鹱鹲鹳鹴鹾麦麸黄黉黡黩黪黾' - } - - function FTPYStr() { - return '萬與醜專業叢東絲丟兩嚴喪個爿豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農塚馮衝決況凍淨淒涼淩減湊凜幾鳳鳧憑凱擊氹鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳猛勩勻匭匱區醫華協單賣盧鹵臥衛卻巹廠廳曆厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號歎嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠哢嚨嚀噝吒噅鹹呱響啞噠嘵嗶噦嘩噲嚌噥喲嘜嗊嘮啢嗩唕喚呼嘖嗇囀齧囉嘽嘯噴嘍嚳囁嗬噯噓嚶囑嚕劈囂謔團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壟壚壘墾坰堊墊埡墶壋塏堖塒塤堝墊垵塹墮壪牆壯聲殼壺壼處備複夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍薑婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屭屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崠巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔崳嶁脊巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠禦憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣湣慍憤憒願懾憖怵懣懶懍戇戔戲戧戰戩戶紮撲扡執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據撚擄摑擲撣摻摜摣攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉曬曉曄暈暉暫曖劄術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒棬椏橈楨檔榿橋樺檜槳樁夢檮棶檢欞槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞簷檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳彙漢汙湯洶遝溝沒灃漚瀝淪滄渢溈滬濔濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣濕潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦濫瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煆糊溜愛爺牘犛牽犧犢強狀獷獁猶狽麅獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽瑉玨琺瓏璫琿璡璉瑣瓊瑤璦璿瓔瓚甕甌電畫暢佘疇癤療瘧癘瘍鬁瘡瘋皰屙癰痙癢瘂癆瘓癇癡癉瘮瘞瘺癟癱癮癭癩癬癲臒皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜矽碩硤磽磑礄確鹼礙磧磣堿镟滾禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌簽簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糸糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺絏紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽緔緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒韁繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚膁腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艸藝節羋薌蕪蘆蓯葦藶莧萇蒼苧蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞蓧萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪槁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襇褸襤繈襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖穀豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗讚贇贈贍贏贛赬趙趕趨趲躉躍蹌蹠躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郤郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裏钜鑒鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷缽鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐧銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦鍁錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閑閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉韝韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飆飛饗饜飣饑飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鯵鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鼇鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鴬鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鶤鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽' - } - - function Traditionalized(cc) { - let str = '' - const ss = JTPYStr() - const tt = FTPYStr() - for (let i = 0; i < cc.length; i++) { - if (cc.charCodeAt(i) > 10000 && ss.indexOf(cc.charAt(i)) !== -1) { - str += tt.charAt(ss.indexOf(cc.charAt(i))) - } else str += cc.charAt(i) - } - return str - } - - function Simplized(cc) { - let str = '' - const ss = JTPYStr() - const tt = FTPYStr() - for (let i = 0; i < cc.length; i++) { - if (cc.charCodeAt(i) > 10000 && tt.indexOf(cc.charAt(i)) !== -1) { - str += ss.charAt(tt.indexOf(cc.charAt(i))) - } else str += cc.charAt(i) - } - return str - } - - function translateInitialization() { - translateButtonObject = document.getElementById('menu-translate') - if (translateButtonObject) { - if (currentEncoding !== targetEncoding) { - setTimeout(translateBody, translateDelay) - if (targetEncoding === 1) translateButtonObject.innerHTML = msgToSimplifiedChinese - else translateButtonObject.innerHTML = msgToTraditionalChinese - } - translateButtonObject.addEventListener('click', translatePage, false) - } - } - - translateInitialization() - document.addEventListener('pjax:complete', translateInitialization) -}) \ No newline at end of file diff --git a/templates/assets/zhheo/blogex.js b/templates/assets/zhheo/blogex.js index f079ab97..9cd3ec34 100644 --- a/templates/assets/zhheo/blogex.js +++ b/templates/assets/zhheo/blogex.js @@ -63,16 +63,59 @@ function checkOpen() { // https://blog.zhheo.com/p/c86d8f1f.html // ?imageAve 使用 七牛云获取图片主色调,阿里云 oss 则是 @imageAve -// TODO 可以切换为使用本地 JS 获取色调 -// function coverColor() { -// var _document$getElementB, -// path = null === (_document$getElementB = document.getElementById("post-cover")) || void 0 === _document$getElementB ? void 0 : _document$getElementB.src, -// httpRequest; -// void 0 !== path ? (httpRequest = new XMLHttpRequest, httpRequest.open("GET", path + "?imageAve", !0), httpRequest.send(), httpRequest.onreadystatechange = function () { -// var json, obj, value, value; -// 4 == httpRequest.readyState && 200 == httpRequest.status && (json = httpRequest.responseText, obj = eval("(" + json + ")"), value = obj.RGB, value = "#" + value.slice(2), "light" == getContrastYIQ(value) && (value = LightenDarkenColor(colorHex(value), -40)), document.styleSheets[0].addRule(":root", "--heo-main:" + value + "!important"), document.styleSheets[0].addRule(":root", "--heo-main-op:" + value + "23!important"), document.styleSheets[0].addRule(":root", "--heo-main-none:" + value + "00!important"), heo.initThemeColor(), document.getElementById("coverdiv").classList.add("loaded")) -// }) : (document.styleSheets[0].addRule(":root", "--heo-main: var(--heo-theme)!important"), document.styleSheets[0].addRule(":root", "--heo-main-op: var(--heo-theme-op)!important"), document.styleSheets[0].addRule(":root", "--heo-main-none: var(--heo-theme-none)!important"), heo.initThemeColor()) -// } +// 效果比较低微,这块应该添加配置项 +// 用户选择是否开启主色调背景 +// 然后选择是使用图床的 API 获取主色还是选择使用 js 获取 +// https://lokeshdhakar.com/projects/color-thief/ +function coverColor() { + + let img = document.getElementById("post-cover"); + let path = img.src; + if (void 0 !== path) { + + const colorThief = new ColorThief(); + + // Make sure image is finished loading + if (img.complete) { + loadColor(colorThief.getColor(img)); + } else { + img.addEventListener('load', function () { + loadColor(colorThief.getColor(img)); + }); + } + + + function loadColor(rgbColor) { + + let hexColor = rgbToHex(rgbColor[0], rgbColor[1], rgbColor[2]); + + if ("light" === getContrastYIQ(hexColor)) { + hexColor = LightenDarkenColor(colorHex(hexColor), -40); + document.styleSheets[0].addRule(":root", "--heo-main:" + hexColor + "!important"); + document.styleSheets[0].addRule(":root", "--heo-main-op:" + hexColor + "23!important"); + document.styleSheets[0].addRule(":root", "--heo-main-none:" + hexColor + "00!important"); + heo.initThemeColor(); + document.getElementById("coverdiv").classList.add("loaded"); + } + + } + + + } else { + document.styleSheets[0].addRule(":root", "--heo-main: var(--heo-theme)!important"); + document.styleSheets[0].addRule(":root", "--heo-main-op: var(--heo-theme-op)!important"); + document.styleSheets[0].addRule(":root", "--heo-main-none: var(--heo-theme-none)!important"); + heo.initThemeColor(); + } +} + +function rgbToHex(r, g, b) { + return '#' + [r, g, b].map(x => { + const hex = x.toString(16) + return hex.length === 1 ? '0' + hex : hex + }).join(''); +} + function colorHex(e) { var t = e; @@ -161,6 +204,7 @@ var navFn = { function RemoveRewardMask() { $(".reward-main").attr("style", "display: none"), $("#quit-box").attr("style", "display: none") } + // 移除加载动画 function removeLoading() { setTimeout(function () { @@ -246,21 +290,7 @@ document.getElementById("post-comment") && owoBig(), document.addEventListener(" var e, t = window.scrollY + document.documentElement.clientHeight, o = (window.scrollY, document.getElementById("pagination")), n = document.getElementById("post-tools"); n && o && (e = n.offsetTop + n.offsetHeight / 2, 1300 < document.body.clientWidth && (e < t ? o.classList.add("show-window") : o.classList.remove("show-window"))) -}, 200)), "false" !== localStorage.getItem("keyboardToggle") ? document.querySelector("#consoleKeyboard").classList.add("on") : document.querySelector("#consoleKeyboard").classList.remove("on"), $(window).on("keydown", function (e) { - if (27 == e.keyCode && (heo.hideLoading(), heo.hideConsole(), rm.hideRightMenu()), heo_keyboard && e.shiftKey) { - if (16 == e.keyCode && document.querySelector("#keyboard-tips").classList.add("show"), 75 == e.keyCode) return heo.keyboardToggle(), !1; - if (65 == e.keyCode) return heo.showConsole(), !1; - if (77 == e.keyCode) return heo.musicToggle(), !1; - if (82 == e.keyCode) return toRandomPost(), !1; - if (66 == e.keyCode) return pjax.loadUrl("/"), !1; - if (68 == e.keyCode) return rm.switchDarkMode(), !1; - if (70 == e.keyCode) return pjax.loadUrl("/moments/"), !1 - } -}); - -$(window).on("keyup", function (e) { - 16 == e.keyCode && document.querySelector("#keyboard-tips").classList.remove("show") -}); +}, 200)); document.addEventListener("pjax:send", function () { heo.showLoading() diff --git a/templates/assets/zhheo/rightmenu.js b/templates/assets/zhheo/rightmenu.js index 2cc1ba58..22f75cf2 100644 --- a/templates/assets/zhheo/rightmenu.js +++ b/templates/assets/zhheo/rightmenu.js @@ -252,17 +252,14 @@ function addRightMenuClickEvent() { $("#menu-home").on("click", function () { window.location.href = window.location.origin; }), - $("#menu-randomPost").on("click", function () { - toRandomPost(); - }), + // $("#menu-randomPost").on("click", function () { + // toRandomPost(); + // }), $("#menu-commentBarrage").on("click", heo.switchCommentBarrage), $("#rightmenu-mask").on("click", rm.hideRightMenu), $("#rightmenu-mask").contextmenu(function () { return rm.hideRightMenu(), !1; }), - $("#menu-translate").on("click", function () { - rm.hideRightMenu(), translateInitialization(); - }), $("#menu-copy").on("click", rm.copyPageUrl), $("#menu-pastetext").on("click", rm.pasteText), $("#menu-copytext").on("click", function () { diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css index 9fd56d1d..03233b3f 100644 --- a/templates/assets/zhheo/zhheoblog.css +++ b/templates/assets/zhheo/zhheoblog.css @@ -4653,7 +4653,8 @@ html { .fal, .far, .fas, -.fat { +.fat +.iconfont { line-height: 1; } @@ -13061,47 +13062,6 @@ span.hexo-douban-pagenum { transform: rotate(20deg); } -#about-page .myInfoAndSayHello { - display: flex; - flex-direction: column; - justify-content: center; - color: var(--heo-white); - background: linear-gradient(120deg, rgb(91, 39, 255) 0px, rgb(0, 212, 255) 100%) 0% 0% / 200%; - animation: 15s ease 0s infinite normal none running gradient; - width: 59%; -} - -#about-page .myInfoAndSayHello .title1 { - opacity: 0.8; - line-height: 1.3; -} - -#about-page .myInfoAndSayHello .title2 { - font-size: 36px; - font-weight: 700; - line-height: 1.1; - margin: 0.5rem 0px; -} - -.author-content-item-group.column.mapAndInfo { - width: 59%; -} - -.author-content-item.map { - background: url(../images/404.gif) center center / 100% no-repeat; - min-height: 160px; - max-height: 400px; - position: relative; - overflow: hidden; - margin-bottom: 0.5rem; - height: 60%; - transition: all 1s ease-in-out 0s; -} - -[data-theme="dark"] .author-content-item.map { - background: url(../images/404.gif) center center / 100% no-repeat; -} - .author-content-item.map:hover { background-size: 120%; transition: all 4s ease-in-out 0s; @@ -13481,7 +13441,6 @@ span.hexo-douban-pagenum { #about-page .about-statistic { min-height: 380px; width: 39%; - background: url(../images/404.gif) center top / cover no-repeat; color: var(--heo-white); overflow: hidden; } @@ -13658,14 +13617,6 @@ span.hexo-douban-pagenum { display: none; } -.author-content-item.game-lol { - background: url(../images/404.gif) center top / cover no-repeat; - min-height: 300px; - overflow: hidden; - color: var(--heo-white); - width: 59%; -} - .author-content-item .card-content { position: absolute; width: 100%; @@ -13684,16 +13635,6 @@ span.hexo-douban-pagenum { } } -.author-content-item.game-lol::after { - box-shadow: rgb(4, 18, 15) 0px -69px 203px 11px inset; - position: absolute; - content: ""; - width: 100%; - height: 100%; - top: 0px; - left: 0px; -} - .author-content-item .content-bottom { margin-top: auto; display: flex; @@ -13712,55 +13653,6 @@ span.hexo-douban-pagenum { margin-right: 0.5rem; } -.icon-pos-sup { - background: url(../images/404.gif); -} - -.icon-pos-mid { - background: url(../images/404.gif); -} - -.author-content-item.game-wolf { - width: 39%; - background: url(../images/404.gif) center top / cover no-repeat; - min-height: 300px; - overflow: hidden; - color: var(--heo-white); -} - -.author-content-item.game-wolf::after { - box-shadow: rgb(65, 93, 201) 0px -69px 203px 11px inset; - position: absolute; - content: ""; - width: 100%; - height: 100%; - top: 0px; - left: 0px; -} - -.author-content-item.like-technology { - background: url(../images/404.gif) 0% 0% / cover no-repeat; - min-height: 230px; - color: var(--heo-white); -} - -.author-content-item.like-music { - background: url(../images/404.gif) center top / cover no-repeat; - min-height: 400px; - color: var(--heo-white); - overflow: hidden; -} - -.author-content-item.like-music::after { - box-shadow: rgb(115, 104, 150) 0px -69px 203px 11px inset; - position: absolute; - content: ""; - width: 100%; - height: 100%; - top: 0px; - left: 0px; -} - .author-content-item .card-content .author-content-item-title { margin-bottom: 0.5rem; } @@ -13819,92 +13711,6 @@ span.hexo-douban-pagenum { } } -.author-content-item.single.like-movie { - height: 19rem; - background: url(../images/404.gif) center top / cover no-repeat; - color: var(--heo-white); - overflow: hidden; -} - -.author-content-item.single.like-movie::after { - box-shadow: rgb(28, 28, 28) 0px 21px 133px 81px inset; - position: absolute; - content: ""; - width: 100%; - height: 100%; - top: 0px; - left: 0px; -} - -#article-container .author-content-item.single.like-movie .banner-button-group .banner-button { - padding: 8px 12px; - background: var(--heo-white); - border-radius: 12px; - color: var(--heo-black); - display: flex; - align-items: center; - z-index: 1; - transition: all 0.3s ease 0s; - cursor: pointer; - border: none; -} - -#article-container .author-content-item.single.like-movie .banner-button-group .banner-button:hover { - background: rgb(208, 178, 71); - color: var(--heo-white); -} - -#article-container .author-content-item.single.like-movie .banner-button-group .banner-button i { - margin-right: 8px; - font-size: 1rem; -} - -@media screen and (max-width: 768px) { - #article-container .author-content-item.single.like-movie .banner-button-group { - right: 1rem; - bottom: 1rem; - } - - #article-container .author-content-item.single.like-movie .banner-button-group .banner-button { - background: 0px 0px; - color: var(--heo-white); - padding: 0px; - } - - #article-container .author-content-item.single.like-movie .banner-button-group .banner-button i { - margin-right: 0px; - font-size: 1.5rem; - } - - #article-container .author-content-item.single.like-movie .banner-button-group .banner-button-text { - display: none; - } -} - -.author-content.author-content-item.toolPage { - height: 19rem; - background: url(../images/404.gif) center top / cover no-repeat; - color: var(--heo-white); - overflow: hidden; - margin-top: 0px; -} - -.author-content.author-content-item.momentsPage { - height: 19rem; - background: url(../images/404.gif) center top / cover no-repeat; - color: var(--heo-white); - overflow: hidden; - margin-top: 0px; -} - -.author-content.author-content-item.essayPage { - height: 19rem; - background: url(../images/404.gif) center center / cover no-repeat; - color: var(--heo-white); - overflow: hidden; - margin-top: 0px; -} - #console { display: flex; position: fixed; diff --git a/templates/category.html b/templates/category.html index 65ff86f1..1cbe0e82 100644 --- a/templates/category.html +++ b/templates/category.html @@ -1,5 +1,5 @@ - + @@ -20,7 +20,7 @@ th:classappend="${category.metadata.name == categoryItem.metadata.name} ? 'select'" th:each="categoryItem : ${categoryFinder.listAll()}" th:id="${categoryItem.spec.displayName}"> - @@ -34,7 +34,7 @@
- @@ -48,11 +48,11 @@
@@ -66,7 +66,7 @@
-
+
diff --git a/templates/index.html b/templates/index.html index f9268dd2..dd572ef2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,5 @@ - + @@ -24,7 +24,7 @@ -
+
diff --git a/templates/modules/aside.html b/templates/modules/aside.html index 321e5ae7..7e2694d8 100644 --- a/templates/modules/aside.html +++ b/templates/modules/aside.html @@ -1,12 +1,33 @@ +
- - - + + + + + + + + + + + + + + + + +
+ + + + + +
diff --git a/templates/modules/category-bar.html b/templates/modules/category-bar.html index c899d01c..cd4a58ed 100644 --- a/templates/modules/category-bar.html +++ b/templates/modules/category-bar.html @@ -12,7 +12,7 @@
- +
diff --git a/templates/modules/footer.html b/templates/modules/footer.html index ab3f5155..888d2c42 100644 --- a/templates/modules/footer.html +++ b/templates/modules/footer.html @@ -13,14 +13,15 @@ - @@ -141,20 +141,20 @@ diff --git a/templates/modules/widgets/console.html b/templates/modules/widgets/console.html index 2519c872..17d61375 100644 --- a/templates/modules/widgets/console.html +++ b/templates/modules/widgets/console.html @@ -3,7 +3,7 @@
- +
@@ -26,7 +26,7 @@
diff --git a/templates/modules/widgets/nav-left.html b/templates/modules/widgets/nav-left.html index 66ea12e1..92df7170 100644 --- a/templates/modules/widgets/nav-left.html +++ b/templates/modules/widgets/nav-left.html @@ -5,21 +5,21 @@
+ th:with="leftMenu = ${menuFinder.getByName(theme.config.nav.left_menu)}">
+ th:if="${not #lists.isEmpty(leftMenu)}"> - +
-
+
+ target="_blank" th:href="@{${childMenu.status.href}}"> diff --git a/templates/modules/widgets/nav-menu.html b/templates/modules/widgets/nav-menu.html index f62a206b..d7d69349 100644 --- a/templates/modules/widgets/nav-menu.html +++ b/templates/modules/widgets/nav-menu.html @@ -9,9 +9,8 @@ diff --git a/templates/modules/widgets/top-group.html b/templates/modules/widgets/top-group.html index 608b41fc..61b58d01 100644 --- a/templates/modules/widgets/top-group.html +++ b/templates/modules/widgets/top-group.html @@ -5,7 +5,7 @@
- +