Skip to content

Commit

Permalink
1.2.3
Browse files Browse the repository at this point in the history
#### 优化:
- 优化**侧边栏内容**输入窗口高度,现在可显示8行;
- 优化**3D标签云**的js加载时机,避免**开启3D风格但未添加标签云模块**时的js引入。
#### 修复:
- 修复引用文本下的部分内容下边距不一致的问题。
#### 移除:
- 移除广告模式**图片+链接**相关配置,广告改为由**侧边栏内容**配置,支持加载多广告,使用**图片+链接**配置磕查看**本站使用的侧边栏模块**中的**广告**部分。
  • Loading branch information
mjsoftking authored May 30, 2024
2 parents b871f79 + fde9ee0 commit ccba5f1
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 101 deletions.
28 changes: 5 additions & 23 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
value: false
help: 固定标题栏时不会随着页面滚动而隐藏,始终显示标题栏。
options:
- label: 不固定
- label: 默认
value: false
- label: 固定
value: true
Expand Down Expand Up @@ -695,10 +695,10 @@ spec:
- $formkit: code
name: content
language: html
height: 100px
height: 150px
label: 侧边栏内容
placeholder: 请输入 HTML 内容
help: '非必填,仅在侧边栏类型为公告、广告(自定义广告代码)、自定义时生效。'
help: '非必填,仅在侧边栏类型为公告、广告、自定义时生效。'
- $formkit: radio
name: enable_color_character
label: 侧边栏信息-开启彩字切换
Expand Down Expand Up @@ -871,6 +871,7 @@ spec:
- $formkit: radio
name: show_ad_tag
label: 侧边栏广告-显示“广告”标签
help: '控制所有“广告模块”的显示广告标签功能。'
value: true
options:
- value: true
Expand All @@ -880,32 +881,13 @@ spec:
- $formkit: radio
name: ad_tag_close
label: 侧边栏广告-点击“广告”标签可关闭广告
help: '控制所有“广告模块”的关闭广告功能。'
value: true
options:
- value: true
label:
- value: false
label:
- $formkit: radio
name: ad_mode
label: 侧边栏广告-广告展示方法
help: '选择“自定义广告代码”时,必须在“侧边栏内容”中填写广告代码。'
value: true
options:
- value: true
label: 图片+链接
- value: false
label: 自定义广告代码
- $formkit: text
name: ad_target_url
label: 侧边栏广告-广告目标地址
placeholder: '请输入链接地址'
help: '填写广告跳转的目标路径。'
- $formkit: attachment
name: ad_image
label: 侧边栏广告-广告图片链接
placeholder: '请输入/选择图片路径'
help: '图片+链接模式时不能为空。'
- $formkit: number
name: recent_posts_num
label: 侧边栏最近文章-展示文章数量
Expand Down
43 changes: 5 additions & 38 deletions src/css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -3458,49 +3458,16 @@ button.swiper-pagination-bullet {
border-left: 5px solid var(--theme);
border-radius: var(--radius-inner);

& > :not(:last-child) {
& :not(:last-child) {
margin-bottom: 4px !important;
}

& > figure {
margin-top: 0 !important;
}

& > :last-child {
margin: 0 !important;

& > li:last-child {
margin-bottom: 0 !important;

& > p:last-child {
margin-bottom: 0 !important;
}
}
& :last-child {
margin-bottom: 0 !important;
}

ol,
ul {

li {

ol, ul {
&:not(:last-child) {
margin-bottom: 4px !important;
}

&:last-child {
margin-bottom: 0 !important;
}
}

p:not(:last-child) {
margin-bottom: 4px !important;
}

p:last-child {
margin-bottom: 0 !important;
}
}
& > figure {
margin-top: 0 !important;
}

}
Expand Down
16 changes: 0 additions & 16 deletions src/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/css/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/assets/js/common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions templates/common/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;'
: ''})]
}

Expand Down Expand Up @@ -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}]];
/** 安全链接配置 */
Expand Down
1 change: 0 additions & 1 deletion templates/common/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<script th:src="@{/assets/js/btoc.min.js(mew=${theme.spec.version})}"></script>
<script th:if="${isFirstIndex == true && !#lists.isEmpty(theme.config.basic_style.carousel_options)}" data-pjax
th:src="@{/assets/lib/[email protected]/swiper-bundle.min.js}"></script>
<script th:if="${theme.config.sidebar.show_tagcloud_style}" th:src="@{/assets/js/tagcloud.min.js(mew=${theme.spec.version})}"></script>
<script th:src="@{/assets/js/common.min.js(mew=${theme.spec.version})}"></script>

<th:block th:if="${isPost}">
Expand Down
5 changes: 1 addition & 4 deletions templates/widget/ad_piece.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (sidebar)"
th:class="'card widget ' + ${sidebar.hide}">
<a th:if="${theme.config.sidebar.ad_mode}" target="_blank" th:href="${theme.config.sidebar.ad_target_url}">
<img width="100%" th:src="${theme.config.sidebar.ad_image}" alt="广告"/>
</a>
<th:block th:unless="${theme.config.sidebar.ad_mode}" th:utext="${sidebar.content}"/>
<th:block th:utext="${sidebar.content}"/>
<span th:if="${theme.config.sidebar.show_ad_tag}" class="ad-tag">广告
<svg th:if="${theme.config.sidebar.ad_tag_close}" class="click-close" data-close=".widget"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path
Expand Down
31 changes: 24 additions & 7 deletions templates/widget/tagcloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,33 @@
enableTagsColor = ${theme.config.sidebar.enable_tagcloud_color}">

<div class="card-title">
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-cloud-line') + ' card-title-label'}"></i><span th:text="${#strings.defaultString(sidebar.title, '标签云')}"></span>
<a th:if="${theme.config.sidebar.tagcloud_more}" class="card-more" th:href="@{/tags}">更多<i class="ri-arrow-right-double-line"></i></a>
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-cloud-line') + ' card-title-label'}"></i><span
th:text="${#strings.defaultString(sidebar.title, '标签云')}"></span>
<a th:if="${theme.config.sidebar.tagcloud_more}" class="card-more" th:href="@{/tags}">更多<i
class="ri-arrow-right-double-line"></i></a>
</div>
<div th:if="${isEmpty}" class="card-empty">暂无标签</div>
<div th:unless="${isEmpty}" class="card-content">
<a
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 +';' : ''}"></a>
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 +';' : ''}"></a>
</div>

<th:block th:if="${theme.config.sidebar.show_tagcloud_style}">
<script th:src="@{/assets/js/tagcloud.min.js(mew=${theme.spec.version})}"></script>
<script>
$(function(){ tagcloud({
selector: '.tagcloud .card-content',
fontsize: 18,
radius: 75,
mspeed: 'slow',
ispeed: 'slow',
direction: 45,
keep: false
}) })
</script>
</th:block>
</div>
2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.2.2.000004
version: 0.0.0.1
# 最低支持的 Halo 版本
require: ">=2.12.0"
# 许可
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.2
1.2.3

0 comments on commit ccba5f1

Please sign in to comment.