From 53e3a69f5144f51b3ba46ffebf79156afdd82bc0 Mon Sep 17 00:00:00 2001 From: j m <1406993111@qq.com> Date: Thu, 30 May 2024 07:46:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B43D=E6=A0=87=E7=AD=BE=E4=BA=91?= =?UTF-8?q?js=E5=8A=A0=E8=BD=BD=E6=97=B6=E6=9C=BA=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=BC=A0=E6=A0=87=E9=A3=8E=E6=A0=BC=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- settings.yaml | 2 +- src/js/common.js | 16 ---------------- templates/assets/js/common.min.js | 2 +- templates/common/config.html | 14 ++++++-------- templates/common/scripts.html | 1 - templates/widget/tagcloud.html | 31 ++++++++++++++++++++++++------- theme.yaml | 2 +- 7 files changed, 33 insertions(+), 35 deletions(-) diff --git a/settings.yaml b/settings.yaml index f63adf6..14a3a39 100644 --- a/settings.yaml +++ b/settings.yaml @@ -64,7 +64,7 @@ spec: value: false help: 固定标题栏时不会随着页面滚动而隐藏,始终显示标题栏。 options: - - label: 不固定 + - label: 默认 value: false - label: 固定 value: true diff --git a/src/js/common.js b/src/js/common.js index a6d4de4..9233b3e 100644 --- a/src/js/common.js +++ b/src/js/common.js @@ -578,22 +578,6 @@ const commonContext = { DreamConfig.effects_universe_mode && Utils.cachedScript(`${DreamConfig.theme_base}/js/effects/universe.min.js?mew=${DreamConfig.theme_version}`) DreamConfig.effects_circle_magic_mode && Utils.cachedScript(`${DreamConfig.theme_base}/js/effects/circleMagic.min.js?mew=${DreamConfig.theme_version}`) }, - /*初始化标签云滚动样式*/ - initTagCloud() { - if (!$('.tagcloud').length || !DreamConfig.show_tagcloud_style) { - return - } - - tagcloud({ - selector: '.tagcloud .card-content', //元素选择器 - fontsize: 18, //基本字体大小, 单位px - radius: 75, //滚动半径, 单位px - mspeed: 'slow', //滚动最大速度, 取值: slow, normal(默认), fast - ispeed: 'slow', //滚动初速度, 取值: slow, normal(默认), fast - direction: 45, //初始滚动方向, 取值角度(顺时针360): 0对应top, 90对应left, 135对应right-bottom(默认)... - keep: false //鼠标移出组件后是否继续随鼠标滚动, 取值: false, true(默认) 对应 减速至初速度滚动, 随鼠标滚动 - }) - }, /* 显示主题版本信息 */ showThemeVersion() { if (!DreamConfig.enable_console_version_info) { diff --git a/templates/assets/js/common.min.js b/templates/assets/js/common.min.js index 2707e9e..ac79f95 100644 --- a/templates/assets/js/common.min.js +++ b/templates/assets/js/common.min.js @@ -11,4 +11,4 @@
${e.percent}
- `}),$(".aside-timelife").html(n)}},initSecurityLink(){DreamConfig.enable_security_link&&DreamConfig.security_link_url&&0!==DreamConfig.security_link_url.length&&$(document).on("click","a[target=_blank]",e=>{e.preventDefault();var t,e=$(e.currentTarget).attr("href"),n=window.location.hostname;window.open("_blank").location=(n=n,t=(t=e).toLowerCase().trim(),n=n.toLowerCase().trim(),t.startsWith("//")?t=window.location.protocol+t:t.startsWith("/")&&(t=window.location.origin+t),(t=t.startsWith("http://")||t.startsWith("https://")?t.replace(/\/$/,""):t).includes(n)?e:DreamConfig.security_link_url+"?target="+encodeURIComponent(e))})},initGrayMode(){var e,t,n;(!0===DreamConfig.gray_mode||"custom"===DreamConfig.gray_mode&&(e=Date.now(),t=new Date(DreamConfig.gray_mode_start_time).getTime(),n=new Date(DreamConfig.gray_mode_end_time).getTime(),t<=e)&&e<=n)&&$("html").addClass("gray-mode")},initEffects(){Utils.isMobile()||(DreamConfig.cursor_move&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/move/${DreamConfig.cursor_move}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.cursor_click&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/click/${DreamConfig.cursor_click}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.enable_live2d&&Utils.cachedScript(DreamConfig.theme_base+"/js/autoload.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_lantern_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/lantern.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_sakura_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/sakura.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_snowflake_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/snowflake.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_universe_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/universe.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_circle_magic_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/circleMagic.min.js?mew="+DreamConfig.theme_version))},initTagCloud(){$(".tagcloud").length&&DreamConfig.show_tagcloud_style&&tagcloud({selector:".tagcloud .card-content",fontsize:18,radius:75,mspeed:"slow",ispeed:"slow",direction:45,keep:!1})},showThemeVersion(){DreamConfig.enable_console_version_info&&window.logger(`%c页面加载耗时:${Math.round(performance.now())}ms | Theme By Dream2 Plus `+DreamConfig.theme_version,"color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px")}};window.commonContext=t;let o=-1;{const n=["initCarousel","sparkInput","websiteTime"],i=["initEffects","showThemeVersion"];Object.keys(t).forEach(e=>!n.includes(e)&&!i.includes(e)&&t[e]()),document.addEventListener("DOMContentLoaded",function(){$("html").addClass("loaded"),n.forEach(e=>t[e]&&t[e]())}),window.addEventListener("load",function(){i.forEach(e=>t[e]&&t[e]()),$("html").addClass("ready")})}})(); \ No newline at end of file + `}),$(".aside-timelife").html(n)}},initSecurityLink(){DreamConfig.enable_security_link&&DreamConfig.security_link_url&&0!==DreamConfig.security_link_url.length&&$(document).on("click","a[target=_blank]",e=>{e.preventDefault();var t,e=$(e.currentTarget).attr("href"),n=window.location.hostname;window.open("_blank").location=(n=n,t=(t=e).toLowerCase().trim(),n=n.toLowerCase().trim(),t.startsWith("//")?t=window.location.protocol+t:t.startsWith("/")&&(t=window.location.origin+t),(t=t.startsWith("http://")||t.startsWith("https://")?t.replace(/\/$/,""):t).includes(n)?e:DreamConfig.security_link_url+"?target="+encodeURIComponent(e))})},initGrayMode(){var e,t,n;(!0===DreamConfig.gray_mode||"custom"===DreamConfig.gray_mode&&(e=Date.now(),t=new Date(DreamConfig.gray_mode_start_time).getTime(),n=new Date(DreamConfig.gray_mode_end_time).getTime(),t<=e)&&e<=n)&&$("html").addClass("gray-mode")},initEffects(){Utils.isMobile()||(DreamConfig.cursor_move&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/move/${DreamConfig.cursor_move}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.cursor_click&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/click/${DreamConfig.cursor_click}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.enable_live2d&&Utils.cachedScript(DreamConfig.theme_base+"/js/autoload.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_lantern_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/lantern.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_sakura_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/sakura.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_snowflake_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/snowflake.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_universe_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/universe.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_circle_magic_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/circleMagic.min.js?mew="+DreamConfig.theme_version))},showThemeVersion(){DreamConfig.enable_console_version_info&&window.logger(`%c页面加载耗时:${Math.round(performance.now())}ms | Theme By Dream2 Plus `+DreamConfig.theme_version,"color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px")}};window.commonContext=t;let o=-1;{const n=["initCarousel","sparkInput","websiteTime"],i=["initEffects","showThemeVersion"];Object.keys(t).forEach(e=>!n.includes(e)&&!i.includes(e)&&t[e]()),document.addEventListener("DOMContentLoaded",function(){$("html").addClass("loaded"),n.forEach(e=>t[e]&&t[e]())}),window.addEventListener("load",function(){i.forEach(e=>t[e]&&t[e]()),$("html").addClass("ready")})}})(); \ No newline at end of file diff --git a/templates/common/config.html b/templates/common/config.html index 61ce217..4d80ee5 100644 --- a/templates/common/config.html +++ b/templates/common/config.html @@ -12,12 +12,12 @@ html { --theme: [(${theme.config.basic_style.theme_color})]; - [(${theme.config.enhance.cursor_style == 'breeze' ? '--cursor-default:url(/themes/theme-dream2-plus/assets/cursor/breeze/Arrow.cur),auto;--cursor-pointer:url(/themes/theme-dream2-plus/assets/cursor/breeze/Hand.cur),pointer;--cursor-text:url(/themes/theme-dream2-plus/assets/cursor/breeze/IBeam.cur),auto;--cursor-zoom-in:url(/themes/theme-dream2-plus/assets/cursor/breeze/Cross.cur),zoom-in;' - : theme.config.enhance.cursor_style == 'black_cat' ? '--cursor-default:url(/themes/theme-dream2-plus/assets/cursor/black_cat/normal.cur),auto;--cursor-pointer:url(/themes/theme-dream2-plus/assets/cursor/black_cat/ayuda.cur),pointer;--cursor-text:url(/themes/theme-dream2-plus/assets/cursor/black_cat/texto.cur),auto;--cursor-zoom-in:url(/themes/theme-dream2-plus/assets/cursor/black_cat/precision.cur),zoom-in;' - : theme.config.enhance.cursor_style == 'overwatch' ? '--cursor-default:url(/themes/theme-dream2-plus/assets/cursor/overwatch/pointer.cur),auto;--cursor-pointer:url(/themes/theme-dream2-plus/assets/cursor/overwatch/link.cur),pointer;--cursor-text:url(/themes/theme-dream2-plus/assets/cursor/overwatch/text.cur),auto;--cursor-zoom-in:url(/themes/theme-dream2-plus/assets/cursor/overwatch/cross.cur),zoom-in;' - : theme.config.enhance.cursor_style == 'rainbow_rain' ? '--cursor-default:url(/themes/theme-dream2-plus/assets/cursor/rainbow_rain/normal.cur),auto;--cursor-pointer:url(/themes/theme-dream2-plus/assets/cursor/rainbow_rain/link.cur),pointer;--cursor-text:url(/themes/theme-dream2-plus/assets/cursor/rainbow_rain/texto.cur),auto;--cursor-zoom-in:url(/themes/theme-dream2-plus/assets/cursor/rainbow_rain/precision.cur),zoom-in;' - : theme.config.enhance.cursor_style == 'marry' ? '--cursor-default:url(/themes/theme-dream2-plus/assets/cursor/marry/arrow.cur),auto;--cursor-pointer:url(/themes/theme-dream2-plus/assets/cursor/marry/arrow.cur),pointer;--cursor-text:url(/themes/theme-dream2-plus/assets/cursor/marry/beam.cur),auto;--cursor-zoom-in:url(/themes/theme-dream2-plus/assets/cursor/marry/move.cur),zoom-in;' - : theme.config.enhance.cursor_style != 'none' ? '--cursor-default: url(/themes/theme-dream2-plus/assets/cursor/' + theme.config.enhance.cursor_style + '/arrow.cur), auto;--cursor-pointer: url(/themes/theme-dream2-plus/assets/cursor/' + theme.config.enhance.cursor_style + '/hand.cur), pointer;--cursor-text: url(/themes/theme-dream2-plus/assets/cursor/' + theme.config.enhance.cursor_style + '/arrow.cur), auto;--cursor-zoom-in: url(/themes/theme-dream2-plus/assets/cursor/' + theme.config.enhance.cursor_style + '/arrow.cur), zoom-in;' + [(${theme.config.enhance.cursor_style == 'breeze' ? '--cursor-default:url('+#theme.assets('/')+'/cursor/breeze/Arrow.cur),auto;--cursor-pointer:url('+#theme.assets('/')+'/cursor/breeze/Hand.cur),pointer;--cursor-text:url('+#theme.assets('/')+'/cursor/breeze/IBeam.cur),auto;--cursor-zoom-in:url('+#theme.assets('/')+'/cursor/breeze/Cross.cur),zoom-in;' + : theme.config.enhance.cursor_style == 'black_cat' ? '--cursor-default:url('+#theme.assets('/')+'/cursor/black_cat/normal.cur),auto;--cursor-pointer:url('+#theme.assets('/')+'/cursor/black_cat/ayuda.cur),pointer;--cursor-text:url('+#theme.assets('/')+'/cursor/black_cat/texto.cur),auto;--cursor-zoom-in:url('+#theme.assets('/')+'/cursor/black_cat/precision.cur),zoom-in;' + : theme.config.enhance.cursor_style == 'overwatch' ? '--cursor-default:url('+#theme.assets('/')+'/cursor/overwatch/pointer.cur),auto;--cursor-pointer:url('+#theme.assets('/')+'/cursor/overwatch/link.cur),pointer;--cursor-text:url('+#theme.assets('/')+'/cursor/overwatch/text.cur),auto;--cursor-zoom-in:url('+#theme.assets('/')+'/cursor/overwatch/cross.cur),zoom-in;' + : theme.config.enhance.cursor_style == 'rainbow_rain' ? '--cursor-default:url('+#theme.assets('/')+'/cursor/rainbow_rain/normal.cur),auto;--cursor-pointer:url('+#theme.assets('/')+'/cursor/rainbow_rain/link.cur),pointer;--cursor-text:url('+#theme.assets('/')+'/cursor/rainbow_rain/texto.cur),auto;--cursor-zoom-in:url('+#theme.assets('/')+'/cursor/rainbow_rain/precision.cur),zoom-in;' + : theme.config.enhance.cursor_style == 'marry' ? '--cursor-default:url('+#theme.assets('/')+'/cursor/marry/arrow.cur),auto;--cursor-pointer:url('+#theme.assets('/')+'/cursor/marry/arrow.cur),pointer;--cursor-text:url('+#theme.assets('/')+'/cursor/marry/beam.cur),auto;--cursor-zoom-in:url('+#theme.assets('/')+'/cursor/marry/move.cur),zoom-in;' + : theme.config.enhance.cursor_style != 'none' ? '--cursor-default: url('+#theme.assets('/')+'/cursor/' + theme.config.enhance.cursor_style + '/arrow.cur), auto;--cursor-pointer: url('+#theme.assets('/')+'/cursor/' + theme.config.enhance.cursor_style + '/hand.cur), pointer;--cursor-text: url('+#theme.assets('/')+'/cursor/' + theme.config.enhance.cursor_style + '/arrow.cur), auto;--cursor-zoom-in: url('+#theme.assets('/')+'/cursor/' + theme.config.enhance.cursor_style + '/arrow.cur), zoom-in;' : ''})] } @@ -99,8 +99,6 @@ DreamConfig["effects_lantern_left"] = effects_lantern_left; DreamConfig["effects_lantern_right"] = effects_lantern_right; - /** 启用标签云的风格 */ - DreamConfig["show_tagcloud_style"] = [[${theme.config.sidebar.show_tagcloud_style}]]; /** 控制台主题信息 */ DreamConfig["enable_console_version_info"] = [[${theme.config.enhance.enable_console_version_info}]]; /** 安全链接配置 */ diff --git a/templates/common/scripts.html b/templates/common/scripts.html index 44e451d..165f3d3 100644 --- a/templates/common/scripts.html +++ b/templates/common/scripts.html @@ -3,7 +3,6 @@ - diff --git a/templates/widget/tagcloud.html b/templates/widget/tagcloud.html index cf3c81e..e443f3f 100644 --- a/templates/widget/tagcloud.html +++ b/templates/widget/tagcloud.html @@ -7,16 +7,33 @@ enableTagsColor = ${theme.config.sidebar.enable_tagcloud_color}">
- - 更多 + + 更多
暂无标签
+ th:each="tag : ${tags}" + th:href="@{${tag.status.permalink}}" + th:text="${tag.spec.displayName}" + th:with="size = ${#strings.length(tag.spec.displayName) + #strings.length(tag.spec.slug) + (tag.postCount != null ? tag.postCount : 0)}" + th:style="'font-size: ' + ${size < 14 ? 14 : size > 32 ? 32 : size} + 'px;' + ${(enableTagsColor && tag.spec.color != '#ffffff')? 'color: ' + tag.spec.color +';' : ''}">
+ + + + + diff --git a/theme.yaml b/theme.yaml index 0ea0596..3af79cb 100644 --- a/theme.yaml +++ b/theme.yaml @@ -30,7 +30,7 @@ spec: settingName: theme-dream2-plus-setting configMapName: theme-dream2-plus-configMap # 版本号 - version: 1.2.2.1 + version: 0.0.0.1 # 最低支持的 Halo 版本 require: ">=2.12.0" # 许可