Skip to content

Commit

Permalink
Merge pull request #97 from jiewenhuang/dev
Browse files Browse the repository at this point in the history
update:v1.1.1
  • Loading branch information
jiewenhuang committed Sep 21, 2023
2 parents ca394ef + 9f4f570 commit a7643c8
Show file tree
Hide file tree
Showing 27 changed files with 958 additions and 32 deletions.
437 changes: 437 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://halo.run" target="_blank">
<img src="https://img.shields.io/badge/dynamic/yaml?label=Halo&query=%24.spec.require&url=https://raw.githubusercontent.com/jiewenhuang/halo-theme-joe3.0/main/theme.yaml&color=113,195,71" alt="Halo"/>
</a>
<a href="https://github.com/jiewenhuang/halo-theme-joe3.0" target="_blank">
<a href="https://github.com/jiewenhuang/halo-theme-joe3.0/releases" target="_blank">
<img src="https://img.shields.io/github/v/release/jiewenhuang/halo-theme-joe3.0" alt="Release"/>
</a>
<a href="https://halo.run" target="_blank">
Expand Down Expand Up @@ -54,7 +54,7 @@
## 预览
WIP
## TODO
- [ ] 首页加载
- [ ] 优化图库
- [ ] ......


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "halo-theme-joe3.0",
"version": "1.1.0",
"version": "1.1.1",
"description": "Theme of Halo2",
"devDependencies": {
"uglify-js": "^3.17.4"
Expand Down
17 changes: 17 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ spec:
label: 浅色模式
- value: dark
label: 暗黑模式
- $formkit: radio
name: comment_option
id: comment_option
value: default
label: 开启浅色模式背景图
help: "需要配置好浅色模式背景图后才有效"
options:
- value: default
label: 默认
- value: waline
label: Waline
- $formkit: text
if: "$get(comment_option).value === 'waline'"
name: waline_serverURL
label: Waline 服务端地址
value: ""
help: "Waline 服务端地址,如 https://waline-server.herokuapp.com 不要加结尾反斜杠"

- $formkit: text
name: mode_color_light
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/css/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* 首页样式 */
.joe_index {
overflow-y: hidden;
overflow: hidden;

&__banner {
padding: 15px 15px 5px;
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/css/min/index.min.css

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

2 changes: 1 addition & 1 deletion templates/assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ document.addEventListener("DOMContentLoaded", () => {
this.options = {
id: this.getAttribute("id"),
color: this.getAttribute("color") || "#1989fa",
autoplay: this.getAttribute("autoplay") ? true : false,
autoplay: !!this.getAttribute("autoplay"),
};
this.render();
}
Expand Down
11 changes: 9 additions & 2 deletions templates/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,14 @@ const homeContext = {
return
}
// 在页面加载完成后执行
const $headerHeight =
ThemeConfig.enable_fixed_header || Joe.isMobile
? $(".joe_header").height()
: 0;
$(document).ready(() => {
const $domLoadContainer = $(".joe_load_container");
$domLoadContainer.on('click','.joe_load', async function () {
const lastItemTop = document.querySelector(".joe_list__item:last-child").offsetTop;
const $domLoad = $(".joe_load");
this.domNext = $domLoad.attr('data-next');
// console.log(this.domNext)
Expand Down Expand Up @@ -316,8 +321,10 @@ const homeContext = {
$domLoadContainer.remove();
}
// 向下滚动一段距离
const lastItemTop = postListElement.querySelector(".joe_list__item:last-child").offsetTop;
const scrollTop = lastItemTop - window.innerHeight; // Adjust the value as needed
// const lastItemTop = postListElement.querySelector(".joe_list__item:last-child").offsetTop;
// console.log(postListElement.querySelector(".joe_list__item:last-child"))
// console.log($headerHeight)
const scrollTop = lastItemTop - $headerHeight; // Adjust the value as needed
window.scrollTo({
top: scrollTop,
behavior: 'smooth'
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/js/min/index.min.js

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

2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<th:block th:replace="~{modules/macro/banner :: banner}" />
</th:block>

<th:block th:if="${theme.config.home.enable_hot_category} and (${not #lists.isEmpty(theme.config.home.category_data)} or ${not #lists.isEmpty(theme.config.home.custom_data)})">
<th:block th:if="${theme.config.home.enable_hot_category} and (${not #lists.isEmpty(theme.config.home.category_data) and theme.config.home.hot_category_source == 'category'} or ${not #lists.isEmpty(theme.config.home.custom_data) and theme.config.home.hot_category_source == 'custom'})">
<th:block th:replace="~{modules/macro/hot_category :: hot_category}" />
</th:block>

Expand Down
21 changes: 21 additions & 0 deletions templates/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,33 @@ <h3>申请格式</h3>
<div class="box_title">
<h2 >评论区</h2>
</div>
<th:block th:if="${theme.config.basic.comment_option == 'default'} or ${#strings.trim(theme.config.basic.waline_serverURL) ==''}">

<halo:comment
group="content.halo.run"
kind="SinglePage"
name="links"
colorScheme="document.documentElement.getAttribute('data-mode')"
/>
</th:block>
<th:block th:if="${theme.config.basic.comment_option == 'waline'} and ${#strings.trim(theme.config.basic.waline_serverURL) !=''}">
<div id="waline"></div>
<style>
#waline .wl-count{color:var(--routine);}
</style>

<script type="module" th:inline="javascript">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';

init({
el: '#waline',
dark: 'html[data-mode="dark"]',
serverURL: /*[[${theme.config.basic.waline_serverURL}]]*/'',
requiredMeta:['nick', 'mail'],

});
</script>
</th:block>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit a7643c8

Please sign in to comment.