优化阅读体验、前台编辑、播放器等
This commit is contained in:
@@ -4,11 +4,16 @@
|
||||
|
||||
#### v1.2.5-7补丁
|
||||
1. 重写作文目录、置顶样式
|
||||
2. 更换域名(修正通知书错误链接)
|
||||
2. 更换(通知书等)域名
|
||||
3. 修复搜索结果无法PJAX跳转(依赖搜索插件v1.7.1-1)
|
||||
4. 修复日记过多时无法搜索(依赖瞬间插件v1.13.1-1,基于源仓库)
|
||||
5. 朋友圈内容支持搜索与跳转(依赖朋友圈插件v1.4.3-5)
|
||||
6. 压缩、更换图片
|
||||
7. 模板端全面支持page与tag参数(常驻显示,同步新增向上翻阅功能)
|
||||
8. 取消自动恢复源内容功能
|
||||
9. 前台编辑、发布日记将采用PJAX更新
|
||||
10. 手机端播放器新增进度条
|
||||
11. 清除无效代码
|
||||
|
||||
#### v1.2.5-7
|
||||
1. 适配新接口(基于新版API-Python)
|
||||
|
||||
+20
-13
@@ -2,90 +2,97 @@
|
||||
<div class="anian-feed-grid">
|
||||
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-theme-pix/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-theme-pix/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">日记簿更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-friends/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-friends/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">朋友圈功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-comment/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-comment/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">评论功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-photos/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-photos/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">图库功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-douban/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-douban/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">课外书功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-dever/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-dever/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">插件开发容器更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/api-python/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/api-python/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">应用接口更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/anian-tool/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/anian-tool/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">小工具更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/memos/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/memos/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">备忘录更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-moments/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-moments/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">日记功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-search/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-search/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">搜索功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/weibo-rss/releases.rss">
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/weibo-rss/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">RSS功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="anian-feed-card" data-rss-url="https://git.anian.net/anian/halo-plugin-equipments/rss/branch/master">
|
||||
<h3 class="anian-feed-caption">奇遇功能更新</h3>
|
||||
<div class="anian-feed-list-box">
|
||||
<div class="anian-loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -335,7 +342,7 @@
|
||||
|
||||
listBox.innerHTML = htmlContent || '<div style="color:#999;">暂无更新内容</div>';
|
||||
} catch (error) {
|
||||
listBox.innerHTML = `<div style="color:#f56c6c;font-size:14px;">请求失败: ${error.message}</div>`;
|
||||
listBox.innerHTML = `<div style="color:#f56c6c;font-size:14px;">失败:超时或发生错误</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-2
@@ -8,9 +8,20 @@
|
||||
|
||||
<th:block th:replace="~{modules/header}"/>
|
||||
|
||||
<div id="pjax-container" th:with="page = ${#strings.isEmpty(param.page) ? 1 : param.page}">
|
||||
<div id="pjax-container" th:with="
|
||||
page = ${#lists.isEmpty(param.page) or #strings.isEmpty(param.page[0]) ? 1 : param.page[0]},
|
||||
tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]}
|
||||
">
|
||||
|
||||
<th:block th:replace="~{macro/home-blog :: home-blog(${postFinder.list(page,site.post.postPageSize)},'/archives')}"></th:block>
|
||||
<th:block th:if="${#strings.isEmpty(tag)}">
|
||||
<th:block th:replace="~{macro/home-blog :: home-blog(${postFinder.list(page,site.post.postPageSize)},'/archives',null,null)}"></th:block>
|
||||
</th:block>
|
||||
|
||||
<th:block th:unless="${#strings.isEmpty(tag)}" th:each="categoryItem : ${categoryFinder.listAll()}">
|
||||
<th:block th:if="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(tag, categoryItem.metadata.name)}">
|
||||
<th:block th:replace="~{macro/home-blog :: home-blog(${postFinder.listByCategory(page,site.post.postPageSize,categoryItem.metadata.name)},'/archives',${categoryItem.spec.displayName},${categoryItem.metadata.name})}"></th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1444,7 +1444,8 @@ a.close_local {
|
||||
|
||||
#t_pagination,
|
||||
#pagination,
|
||||
#p_pagination {
|
||||
#p_pagination,
|
||||
#prev_pagination {
|
||||
padding: 30px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
@@ -1454,7 +1455,8 @@ a.close_local {
|
||||
|
||||
#t_pagination a,
|
||||
#pagination a,
|
||||
#p_pagination a {
|
||||
#p_pagination a,
|
||||
#prev_pagination a {
|
||||
padding: 10px 15px;
|
||||
background: var(--pix-theme);
|
||||
color: #fff;
|
||||
@@ -1462,6 +1464,28 @@ a.close_local {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#prev_pagination {
|
||||
overflow: hidden;
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
transform: translateY(-12px);
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
border-top: 0;
|
||||
border-bottom: 0;
|
||||
pointer-events: none;
|
||||
transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.35s ease, padding 0.35s ease, border-color 0.35s ease;
|
||||
}
|
||||
|
||||
#prev_pagination.is-visible {
|
||||
max-height: 140px;
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
padding: 30px;
|
||||
border-bottom: 1px solid var(--pix-background);
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.p_item {
|
||||
padding: 40px 0;
|
||||
border-bottom: 1px solid var(--pix-background);
|
||||
@@ -3837,7 +3861,7 @@ a.play_btn i {
|
||||
}
|
||||
|
||||
.player_bar {
|
||||
height: 3px;
|
||||
height: 6px;
|
||||
width: 100%;
|
||||
background: #ddd;
|
||||
position: relative;
|
||||
@@ -3847,7 +3871,7 @@ a.play_btn i {
|
||||
|
||||
.player_bar .progress {
|
||||
position: absolute;
|
||||
height: 3px;
|
||||
height: 6px;
|
||||
background: linear-gradient(90deg, #00b34a, #00e0c7);
|
||||
left: 0;
|
||||
top: 0;
|
||||
@@ -5269,7 +5293,7 @@ a.read-less-btn:hover {
|
||||
}
|
||||
|
||||
a.m_play i {
|
||||
font-size: 32px;
|
||||
font-size: 28px;
|
||||
color: var(--pix-theme);
|
||||
}
|
||||
|
||||
@@ -5763,8 +5787,7 @@ span.edit_post a {
|
||||
background: rgba(235, 242, 237, 0.8);
|
||||
border-top: 1px solid #eaeaea;
|
||||
align-items: center;
|
||||
border-top-left-radius: 20px;
|
||||
border-top-right-radius: 20px;
|
||||
border-radius: 0;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
@@ -5985,11 +6008,6 @@ a.change i.ri-refresh-line {
|
||||
.not_mobile {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.footer_nav_box {
|
||||
border-radius: 50px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.single_wrap .comments-area,
|
||||
|
||||
@@ -481,7 +481,7 @@
|
||||
backdrop-filter: blur(0.5rem);
|
||||
-webkit-backdrop-filter: blur(0.5rem);
|
||||
background: rgb(235 242 237 / 80%);
|
||||
border-radius: 0 0 20px 20px;
|
||||
border-radius: 0;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
@@ -655,7 +655,6 @@
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.player_mod .tool,
|
||||
a.m_prev,
|
||||
a.m_next,
|
||||
.timer,
|
||||
@@ -664,6 +663,59 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.player_mod .tool {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 4px 0;
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.player_mod .top {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.player_mod .player_bar {
|
||||
height: 20px;
|
||||
background: transparent;
|
||||
overflow: visible;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.player_mod .player_bar::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 6px;
|
||||
background: #ddd;
|
||||
border-radius: 6px;
|
||||
transform: translateY(-50%);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dark .player_mod .player_bar::before {
|
||||
background: #585858;
|
||||
}
|
||||
|
||||
.player_mod .player_bar .progress {
|
||||
height: 6px;
|
||||
top: 50%;
|
||||
z-index: 2;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.player_mod .player_dot {
|
||||
display: block;
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
margin-right: -9px;
|
||||
z-index: 9;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
|
||||
}
|
||||
|
||||
.player_mod .m_cover {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
@@ -704,7 +756,7 @@
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 100px;
|
||||
max-width: 90px;
|
||||
}
|
||||
|
||||
.single_music_header .mu_img {
|
||||
|
||||
@@ -9,22 +9,6 @@ function modify_m_bottom_music_button_link() {
|
||||
});
|
||||
}
|
||||
|
||||
// 视频默认正方形,播放恢复比例(接入灯箱后已无用)
|
||||
// function modify_moment_video_size() {
|
||||
// const videos = document.querySelectorAll('.pix_video');
|
||||
// videos.forEach(video => {
|
||||
// if (!video.hasAttribute('data-video-events-bound')) {
|
||||
// video.addEventListener('play', () => {
|
||||
// video.classList.add('is-playing');
|
||||
// });
|
||||
// video.addEventListener('ended', () => {
|
||||
// video.classList.remove('is-playing');
|
||||
// });
|
||||
// video.setAttribute('data-video-events-bound', 'true');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 登录逻辑
|
||||
let csrfToken = '';
|
||||
let publicKey = '';
|
||||
@@ -160,9 +144,6 @@ login_loginBtn.addEventListener('click', async () => {
|
||||
cocoMessage.success('署名成功,正在跳转...');
|
||||
login_loginBtn.textContent = '跳转中...';
|
||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
// $.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||
// $.cookie('load_type', 'login', { path: '/', domain: 'anian.cc' });
|
||||
$.cookie('scrollParam', currentScrollTop, { path: '/' });
|
||||
$.cookie('load_type', 'login', { path: '/' });
|
||||
window.location.reload();
|
||||
} else if (finalUrl.includes('error=invalid-credential')) {
|
||||
@@ -236,9 +217,6 @@ async function customLogout() {
|
||||
closeLoading();
|
||||
cocoMessage.success('您已成功退出登录');
|
||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
// $.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||
// $.cookie('load_type', 'logout', { path: '/', domain: 'anian.cc' });
|
||||
$.cookie('scrollParam', currentScrollTop, { path: '/' });
|
||||
$.cookie('load_type', 'logout', { path: '/' });
|
||||
window.location.reload();
|
||||
} else {
|
||||
|
||||
+448
-338
File diff suppressed because it is too large
Load Diff
@@ -384,20 +384,52 @@ $(document).on('mouseleave', '.footer_nav_box .right_inner', function (event) {
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
//音乐进度条跳转
|
||||
function getMousePosition(e) {
|
||||
var e = e || window.event;
|
||||
var x = e.pageX;
|
||||
var y = e.pageY;
|
||||
return { 'left': x, 'top': y }
|
||||
//音乐进度条跳转/拖动
|
||||
var draggingPlayerBar = null;
|
||||
|
||||
function getProgressPointerX(event) {
|
||||
var originalEvent = event.originalEvent || event;
|
||||
if (originalEvent.touches && originalEvent.touches.length > 0) {
|
||||
return originalEvent.touches[0].pageX;
|
||||
}
|
||||
if (originalEvent.changedTouches && originalEvent.changedTouches.length > 0) {
|
||||
return originalEvent.changedTouches[0].pageX;
|
||||
}
|
||||
return event.pageX || originalEvent.pageX || 0;
|
||||
}
|
||||
|
||||
$(document).on('click', '.player_bar', function () {
|
||||
var long = (getMousePosition().left) - ($('.progress').offset().left);
|
||||
$('.progress').width(long);
|
||||
allTime = parseInt(audiobox[0].duration);
|
||||
var nowtime = (long / $('.player_bar').width()) * allTime;
|
||||
audiobox[0].currentTime = nowtime;
|
||||
function seekPlayerByEvent(event, playerBar) {
|
||||
var duration = audiobox[0].duration;
|
||||
if (!duration || !isFinite(duration)) return;
|
||||
|
||||
var $playerBar = $(playerBar);
|
||||
var barWidth = $playerBar.width();
|
||||
if (!barWidth) return;
|
||||
|
||||
var long = getProgressPointerX(event) - $playerBar.offset().left;
|
||||
long = Math.max(0, Math.min(long, barWidth));
|
||||
|
||||
$playerBar.find('.progress').width(long);
|
||||
audiobox[0].currentTime = (long / barWidth) * duration;
|
||||
}
|
||||
|
||||
$(document).on('mousedown touchstart', '.player_bar', function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
draggingPlayerBar = this;
|
||||
seekPlayerByEvent(event, draggingPlayerBar);
|
||||
});
|
||||
|
||||
$(document).on('mousemove touchmove', function (event) {
|
||||
if (!draggingPlayerBar) return;
|
||||
event.preventDefault();
|
||||
seekPlayerByEvent(event, draggingPlayerBar);
|
||||
});
|
||||
|
||||
$(document).on('mouseup touchend touchcancel', function (event) {
|
||||
if (!draggingPlayerBar) return;
|
||||
event.preventDefault();
|
||||
draggingPlayerBar = null;
|
||||
});
|
||||
|
||||
//音量调节 m_volume
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layouts/layout :: layout(_head = null,_content = ~{::content},_title = ${title + ' - ' + site.title})}">
|
||||
|
||||
<th:block th:fragment="content">
|
||||
|
||||
<div class="page_main uk-width-2-3@m">
|
||||
|
||||
<th:block th:replace="~{modules/header}" />
|
||||
|
||||
<div id="pjax-container">
|
||||
|
||||
<div class="blog_list">
|
||||
<div class="blog_list_inner" uk-height-viewport="offset-top: true">
|
||||
|
||||
<div id="post_item" class="moment_list">
|
||||
<!-- 作者姓名不为空才渲染朋友圈动态 -->
|
||||
<div th:id="${'post-'+friend.metadata.name}"
|
||||
class="loop_content p_item moment_item uk-animation-slide-bottom-small"
|
||||
th:if="${friend.spec != null and not #strings.isEmpty(friend.spec.author)}"
|
||||
th:with="postInfo = ${friend}, spec = ${friend.spec}">
|
||||
|
||||
<div class="p_item_inner">
|
||||
|
||||
<div class="list_user_meta">
|
||||
<div class="avatar">
|
||||
<img th:src="@{${spec.logo}}">
|
||||
</div>
|
||||
|
||||
<div class="name">
|
||||
<div class="avatar_title">
|
||||
<a target="_blank" th:href="${spec.authorUrl}">
|
||||
[[${spec.author}]]
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<time itemprop="datePublished"
|
||||
th:datetime="${#dates.format(spec.pubDate, 'yyyy-MM-dd HH:mm')}">
|
||||
<th:block th:replace="~{modules/widgets/time :: time(${spec.pubDate})}">
|
||||
</th:block>
|
||||
</time>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="blog_content">
|
||||
<div class="entry-content">
|
||||
<div class="p_title moment-collapse-container">
|
||||
<a th:if="${not #strings.isEmpty(spec.postLink)}"
|
||||
target="_blank" th:href="${spec.postLink}">
|
||||
<div th:utext="${spec.description ?: '无内容'}"></div>
|
||||
</a>
|
||||
<div th:unless="${not #strings.isEmpty(spec.postLink)}"
|
||||
th:utext="${spec.description ?: '无内容'}"></div>
|
||||
</div>
|
||||
<div class="img_list img-dynamic-container">
|
||||
<div class="list_inner"
|
||||
th:with="imgRaw=${spec.imageFiles},isImgList=${not #strings.isEmpty(imgRaw)}"
|
||||
th:attr="num=${isImgList ? #arrays.length(imgRaw.split(',')) : 0}">
|
||||
<th:block th:if="${isImgList}">
|
||||
<th:block th:with="imgArray=${imgRaw.split(',')}">
|
||||
<th:block th:each="url : ${imgArray}"
|
||||
th:with="cleanUrl=${#strings.trim(url)}">
|
||||
<span class="fancybox mo_img"
|
||||
th:if="${not #strings.isEmpty(cleanUrl)}"
|
||||
th:href="|/upload/image-host/${cleanUrl}|"
|
||||
th:data-fancybox="${'post-' + postInfo.metadata.name}">
|
||||
<img class="lazy"
|
||||
src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
||||
th:data-src="|/upload/image-host/${cleanUrl}|"
|
||||
alt="">
|
||||
</span>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 作者姓名为空:只展示404图片 -->
|
||||
<div th:if="${friend.spec == null or #strings.isEmpty(friend.spec.author)}" style="text-align:center;padding:80px 0;">
|
||||
<img src="/themes/theme-pix/assets/img/no-data.webp"style="max-width:400px;width:100%;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="comment_form_reset"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<th:block th:replace="~{modules/footer-main}" />
|
||||
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
+20
-10
@@ -8,7 +8,11 @@
|
||||
|
||||
<th:block th:replace="~{modules/header}" />
|
||||
|
||||
<div id="pjax-container">
|
||||
<div id="pjax-container" th:with="
|
||||
page = ${#lists.isEmpty(param.page) ? 1 : param.page[0]},
|
||||
tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]},
|
||||
friendPage = ${#strings.isEmpty(tag) ? (#lists.isEmpty(param.page) ? friends : friendFinder.list(page, friends.size)) : friendFinder.list({'page': page, 'size': friends.size, 'author': tag})}
|
||||
">
|
||||
|
||||
<div class="blog_list">
|
||||
<div class="blog_list_inner" uk-height-viewport="offset-top: true">
|
||||
@@ -19,15 +23,15 @@
|
||||
<li>
|
||||
<!-- 全部按钮 -->
|
||||
<a th:attr="data-href=@{/friends}"
|
||||
th:classappend="${#lists.isEmpty(param.author) ? 'active' : ''}" class="cat-link">
|
||||
th:classappend="${#strings.isEmpty(tag) ? 'active' : ''}" class="cat-link">
|
||||
全部<span></span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- 遍历所有作者 -->
|
||||
<th:block th:each="author : ${authors}">
|
||||
<li>
|
||||
<a th:attr="data-href=@{|/friends?author=${author}|}"
|
||||
th:classappend="${#strings.equals(param.author, author) ? 'active' : ''}"
|
||||
<a th:attr="data-href=@{/friends(tag=${author})}"
|
||||
th:classappend="${#strings.equals(tag, author) ? 'active' : ''}"
|
||||
th:text="${author}" class="cat-link">
|
||||
<span></span>
|
||||
</a>
|
||||
@@ -38,7 +42,7 @@
|
||||
|
||||
<div id="post_item" class="moment_list">
|
||||
|
||||
<div th:each="postInfo, iterstat: ${friends.items}" th:id="${'post-'+postInfo.metadata.name}"
|
||||
<div th:each="postInfo, iterstat: ${friendPage.items}" th:id="${'post-'+postInfo.metadata.name}"
|
||||
class="loop_content p_item moment_item uk-animation-slide-bottom-small"
|
||||
th:if="${postInfo.spec != null and not #strings.isEmpty(postInfo.spec.description)}"
|
||||
th:with="spec = ${postInfo.spec}">
|
||||
@@ -102,18 +106,24 @@
|
||||
</div>
|
||||
|
||||
<!-- 空数据 -->
|
||||
<th:block th:if="${#lists.isEmpty(friends.items)}">
|
||||
<th:block th:if="${#lists.isEmpty(friendPage.items)}">
|
||||
<th:block th:replace="~{macro/tpl/content-none}" />
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 分页:必须保持在 blog_list_inner 里面 -->
|
||||
<th:block th:if="${friends.totalPages>1}">
|
||||
<th:block th:if="${friendPage.totalPages>1}">
|
||||
<div id="t_pagination">
|
||||
<div class="post-paging" th:if="${friends.hasNext()}">
|
||||
<!-- 直接使用后端生成的完整 nextUrl -->
|
||||
<a th:data="${friends.nextUrl}" th:text="${theme.config.base_set.site_page}">
|
||||
<div class="post-paging" th:if="${friendPage.hasNext()}"
|
||||
th:with="_page = ${friendPage.page+1}">
|
||||
<a th:if="${#strings.isEmpty(tag)}"
|
||||
th:data="@{/friends(page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}">
|
||||
</a>
|
||||
<a th:unless="${#strings.isEmpty(tag)}"
|
||||
th:data="@{/friends(tag=${tag},page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,16 +10,20 @@
|
||||
|
||||
|
||||
|
||||
<div id="pjax-container" th:with="page = ${#strings.isEmpty(param.page) ? 1 : param.page}">
|
||||
<div id="pjax-container" th:with="
|
||||
page = ${#lists.isEmpty(param.page) ? 1 : param.page[0]},
|
||||
tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]}
|
||||
">
|
||||
|
||||
<th:block th:if="${theme.config.style.home_post_type=='moment' && pluginFinder.available('PluginMoments')}">
|
||||
<th:block th:if="${theme.config.style.home_post_type=='moment' && pluginFinder.available('PluginMoments')}"
|
||||
th:with="momentPage = ${#strings.isEmpty(tag) ? momentFinder.list(page, site.post.postPageSize) : momentFinder.listByTag(page, site.post.postPageSize, tag)}">
|
||||
<th:block
|
||||
th:replace="~{macro/home-moment :: home-moment(${momentFinder.list(page, site.post.postPageSize)},${momentFinder.listAllTags()})}">
|
||||
th:replace="~{macro/home-moment :: home-moment(${momentPage},${momentFinder.listAllTags()},'/')}">
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
||||
<th:block th:if="${theme.config.style.home_post_type=='post' || (not (theme.config.style.home_post_type=='moment' && pluginFinder.available('PluginMoments'))) }">
|
||||
<th:block th:replace="~{macro/home-blog :: home-blog(${posts},'/')}"></th:block>
|
||||
<th:block th:replace="~{macro/home-blog :: home-blog(${posts},'/',null,null)}"></th:block>
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
<th:block th:fragment="home-blog(_posts,path)">
|
||||
<th:block th:fragment="home-blog(_posts,path,tag,selectedCategory)">
|
||||
|
||||
<div class="normal_list">
|
||||
<div class="normal_list_inner" uk-height-viewport="offset-top: true">
|
||||
|
||||
<div class="posts_cat_nav">
|
||||
<ul id="cat_nav_items">
|
||||
<li><a th:data="${path}" class="active">全部<span></span></a>
|
||||
<li><a th:data="${path}" th:classappend="${#strings.isEmpty(tag) ? 'active' : ''}">全部<span></span></a>
|
||||
</li>
|
||||
<li th:if="${theme.config.post.post_nav == 'category'}" th:each="categoryItem,iStat : ${categoryFinder.listAll()}">
|
||||
<a th:data="${categoryItem.status.permalink}"
|
||||
class="">[[${categoryItem.spec.displayName}]]<span></span></a>
|
||||
<a th:if="${path == '/archives'}" th:data="@{/archives(tag=${categoryItem.spec.displayName})}"
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span></a>
|
||||
<a th:unless="${path == '/archives'}" th:data="${categoryItem.status.permalink}"
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span></a>
|
||||
</li>
|
||||
<li th:if="${theme.config.post.post_nav == 'custom_category'}"
|
||||
th:each="category : ${theme.config.post.nav_category}">
|
||||
<th:block th:with="categoryItem = ${categoryFinder.getByName(category)}">
|
||||
<a th:if="${categoryItem!=null}"
|
||||
<a th:if="${categoryItem!=null and path == '/archives'}"
|
||||
th:data="@{/archives(tag=${categoryItem.spec.displayName})}"
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span>
|
||||
</a>
|
||||
<a th:if="${categoryItem!=null and path != '/archives'}"
|
||||
th:data="${categoryItem.status.permalink}"
|
||||
class="">[[${categoryItem.spec.displayName}]]<span></span>
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span>
|
||||
</a>
|
||||
</th:block>
|
||||
</li>
|
||||
@@ -26,13 +32,20 @@
|
||||
<div id="post_item" class="norpost_list " th:with='postItems=${_posts.items}'
|
||||
th:classappend="${theme.config.post.post_list_type == 'grid' ? 'uk-grid-small uk-grid' : ''}">
|
||||
<th:block th:replace="~{'macro/tpl/content-post'}"></th:block>
|
||||
<th:block th:if="${#lists.isEmpty(postItems)}">
|
||||
<th:block th:replace="~{macro/tpl/content-none}"/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<th:block th:if="${_posts.totalPages>1}">
|
||||
<div id="pagination">
|
||||
<div class="post-paging" th:if="${_posts.hasNext()}"
|
||||
th:with="_page = ${_posts.page+1},_path = ${path == '/archives' ? path+'?page='+_page : path +'page/'+_page }">
|
||||
<a th:data="${_path}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
th:with="_page = ${_posts.page+1},_path = ${path +'page/'+_page }">
|
||||
<a th:if="${path == '/archives' and #strings.isEmpty(tag)}"
|
||||
th:data="@{/archives(page=${_page})}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:if="${path == '/archives' and not #strings.isEmpty(tag)}"
|
||||
th:data="@{/archives(tag=${tag},page=${_page})}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:if="${path != '/archives'}" th:data="${_path}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<th:block th:fragment="home-moment(_moments,tags)">
|
||||
<th:block th:fragment="home-moment(_moments,tags,path)" th:with="_path = ${#strings.isEmpty(path) ? '/moments' : path}">
|
||||
|
||||
<div class="blog_list">
|
||||
<div class="blog_list_inner" uk-height-viewport="offset-top: true">
|
||||
<div class="moment_cat_nav">
|
||||
<ul id="cat_nav_items">
|
||||
<li><a data="/moments" class="" th:classappend="${#lists.isEmpty(param.tag) ? 'active' : ''}"
|
||||
<li><a th:data="@{${_path}}" class="" th:classappend="${#lists.isEmpty(param.tag) ? 'active' : ''}"
|
||||
><span>全部</span></a>
|
||||
</li>
|
||||
<li th:each="tag,iStat : ${tags}">
|
||||
<a th:data="|/moments?tag=${tag.name}|" class=""
|
||||
<a th:data="@{${_path}(tag=${tag.name})}" class=""
|
||||
th:classappend="${#lists.contains(param.tag, tag.name) ? 'active' : ''}"
|
||||
><span>[[${tag.name}]]</span></a>
|
||||
</li>
|
||||
@@ -27,8 +27,13 @@
|
||||
<th:block th:if="${_moments.totalPages>1}">
|
||||
<div id="t_pagination">
|
||||
<div class="post-paging" th:if="${_moments.hasNext()}"
|
||||
th:with="tag = ${not #lists.isEmpty(param.tag) ? '?tag='+param.tag : ''},_page = ${_moments.page+1}">
|
||||
<a th:data="${'/moments/page/'+_page+tag}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
th:with="tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]},_page = ${_moments.page+1}">
|
||||
<a th:if="${#strings.isEmpty(tag)}"
|
||||
th:data="@{${_path}(page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:unless="${#strings.isEmpty(tag)}"
|
||||
th:data="@{${_path}(tag=${tag},page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<th:block th:fragment="home-photos(photoPage,groups,tag,selectedGroup)">
|
||||
<div class="normal_list">
|
||||
<div class="normal_list_inner" uk-height-viewport="offset-top: true">
|
||||
|
||||
<!-- 分类导航 -->
|
||||
<div class="photos_cat_nav">
|
||||
<ul id="cat_nav_items">
|
||||
<li>
|
||||
<!-- 修改:href 改为 data-href,并添加一个通用 class 如 'cat-link' -->
|
||||
<a th:attr="data-href=@{/photos}"
|
||||
th:classappend="${#strings.isEmpty(tag) and #strings.isEmpty(selectedGroup) ? 'active' : ''}"
|
||||
class="cat-link">
|
||||
全部<span></span>
|
||||
</a>
|
||||
</li>
|
||||
<th:block th:each="photoGroup : ${groups}">
|
||||
<li>
|
||||
<!-- 修改:这里也改为 data-href -->
|
||||
<a th:attr="data-href=@{/photos(tag=${photoGroup.spec.displayName})}"
|
||||
th:classappend="${#strings.equals(tag, photoGroup.spec.displayName) or #strings.equals(selectedGroup, photoGroup.metadata.name) ? 'active' : ''}"
|
||||
th:text="${photoGroup.spec.displayName}" class="cat-link">
|
||||
<span></span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 相册列表 -->
|
||||
<div id="photos_item" class="norpost_list">
|
||||
<div th:unless="${#lists.isEmpty(photoPage.items)}" class="gallery-photos page">
|
||||
|
||||
<div th:each="photo : ${photoPage.items}" class="gallery-photo">
|
||||
|
||||
<th:block th:with="
|
||||
img = ${!#strings.isEmpty(photo.spec.cover) ? photo.spec.cover : photo.spec.url},
|
||||
isVideo = ${#strings.endsWith(img, '.mp4') or #strings.endsWith(img, '.webm') or #strings.endsWith(img, '.ogg')}
|
||||
">
|
||||
|
||||
<span th:if="${isVideo}" th:href="${img}" data-fancybox="gallery"
|
||||
class="fancybox video-fancybox"
|
||||
style="position: relative; display: block; cursor: pointer;">
|
||||
<video class="photo-img" preload="metadata" muted playsinline>
|
||||
<source th:src="${img}" th:type="${#strings.endsWith(img, '.mp4') ? 'video/mp4' :
|
||||
(#strings.endsWith(img, '.webm') ? 'video/webm' : 'video/ogg')}" />
|
||||
</video>
|
||||
<div
|
||||
style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;">
|
||||
<i class="ri-play-circle-line play-icon"
|
||||
style="color: #41b87e; font-size: 40px; background-color: rgba(255, 255, 255, 0.8); border-radius: 50%;"></i>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span th:unless="${isVideo}" th:href="${img}" data-fancybox="gallery"
|
||||
class="fancybox" th:data-thumb="${img}"
|
||||
style="position: relative; display: block;">
|
||||
<img class="photo-img" loading="lazy" th:src="${img}" />
|
||||
</span>
|
||||
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空数据 -->
|
||||
<th:block th:if="${#lists.isEmpty(photoPage.items)}">
|
||||
<th:block th:replace="~{macro/tpl/content-none}" />
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<th:block th:if="${photoPage.hasPrevious()} or ${photoPage.hasNext()}">
|
||||
<div id="p_pagination">
|
||||
<div class="post-paging" th:if="${photoPage.hasNext()}"
|
||||
th:with="_page = ${photoPage.page+1}">
|
||||
<a th:if="${#strings.isEmpty(tag)}"
|
||||
th:data="@{/photos(page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:unless="${#strings.isEmpty(tag)}"
|
||||
th:data="@{/photos(tag=${tag},page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
@@ -1,5 +1,5 @@
|
||||
<th:block th:fragment="footer">
|
||||
<th:block th:with="customJsVersion='1.2.5-7'">
|
||||
<th:block th:with="customJsVersion='1.2.5-7-TYIL'">
|
||||
|
||||
<!-- 奇遇容器 -->
|
||||
<div class="center-img-container" id="centerImgContainer">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-7'}">
|
||||
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-7-DFQP'}">
|
||||
<th:block th:replace="~{'modules/variables/msg'}" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
|
||||
@@ -6,61 +6,6 @@
|
||||
<link rel="shortcut icon" th:href="@{${theme.config.base_set.favicon}}" title="Favicon">
|
||||
<meta name="robots" content="max-image-preview:large">
|
||||
|
||||
<!-- <style>
|
||||
.dl-warning-card { overflow: hidden; position: fixed; bottom: 1rem; left: 0; right: 0; margin: 0 auto; background-color: #ffffff; border-radius: 0.5rem; max-width: 720px; width: calc(100% - 2rem); box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 9999; display: none; opacity: 0; transform: translateY(20px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-sizing: border-box; border-left: 4px solid #f59e0b; }
|
||||
.dl-warning-header { display: flex; align-items: center; padding: 1rem; gap: 1rem; }
|
||||
.dl-warning-image { flex-shrink: 0; background-color: #fef3c7; justify-content: center; align-items: center; width: 2.5rem; height: 2.5rem; border-radius: 9999px; display: flex; }
|
||||
.dl-warning-image svg { color: #f59e0b; width: 1.25rem; height: 1.25rem; }
|
||||
.dl-warning-content { flex: 1; text-align: left; word-wrap: break-word; word-break: break-all; min-width: 0; }
|
||||
.dl-warning-title { color: #F59E0B; font-size: 0.95rem; font-weight: 600; line-height: 1.3rem; display: block; margin-bottom: 0.25rem; }
|
||||
.dl-warning-message { color: #6b7280; font-size: 0.875rem; line-height: 1.25rem; margin: 0; }
|
||||
.dl-warning-actions { display: flex; flex-direction: row; gap: 0.75rem; align-items: center; flex-shrink: 0; }
|
||||
.dl-warning-desactivate { padding: 0.375rem 0.75rem; background-color: #f59e0b; color: #ffffff; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; justify-content: center; align-items: center; display: inline-flex; border-radius: 0.375rem; border: none; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); cursor: pointer; white-space: nowrap; }
|
||||
.dl-warning-desactivate.loading { background-color: #d97706; cursor: not-allowed; opacity: 0.8; pointer-events: none; }
|
||||
.dl-warning-desactivate.loading::after { content: ""; width: 0.75rem; height: 0.75rem; border: 2px solid rgba(255,255,255,0.5); border-top-color: #ffffff; border-radius: 50%; margin-left: 0.5rem; margin-right: 0.25rem; animation: spin 1s linear infinite; flex-shrink: 0; }
|
||||
.dl-warning-desactivate:not(.loading):hover { background-color: #fbbf24; box-shadow: 0 2px 3px 0 rgba(0,0,0,0.06); transition: all 0.2s ease-in-out; }
|
||||
.dl-warning-cancel { padding: 0.375rem 0.75rem; background-color: #ffffff; color: #374151; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; justify-content: center; align-items: center; display: inline-flex; border-radius: 0.375rem; border: 1px solid #d1d5db; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); cursor: pointer; white-space: nowrap; }
|
||||
.dl-warning-cancel:hover { background-color: #ededed; border-color: #e5e7eb; box-shadow: 0 2px 3px 0 rgba(0,0,0,0.06); transition: all 0.2s ease-in-out; }
|
||||
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
|
||||
@media (max-width: 480px) {
|
||||
.dl-warning-card { bottom: 1rem; width: calc(100% - 1rem); max-width: 100%; }
|
||||
.dl-warning-header { padding: 0.75rem; gap: 0.75rem; align-items: center; }
|
||||
.dl-warning-image { width: 2rem; height: 2rem; }
|
||||
.dl-warning-image svg { width: 1rem; height: 1rem; }
|
||||
.dl-warning-title { font-size: 0.9rem; }
|
||||
.dl-warning-message { font-size: 0.85rem; }
|
||||
.dl-warning-actions { flex-direction: column; gap: 0.375rem; align-items: stretch; flex-shrink: 0; width: auto; margin-top: 0; }
|
||||
.dl-warning-desactivate, .dl-warning-cancel { font-size: 0.75rem; padding: 0.25rem 0.5rem; width: 100%; }
|
||||
.dl-warning-content { min-width: 0; word-wrap: break-word; word-break: break-all; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="dl-warning-card" id="lineCard">
|
||||
<div class="dl-warning-header">
|
||||
<div class="dl-warning-image"><svg aria-hidden="true" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" fill="none"><path d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" stroke-linejoin="round" stroke-linecap="round"></path></svg></div>
|
||||
<div class="dl-warning-content"><span class="dl-warning-title" id="cardHeading"></span><p class="dl-warning-message" id="cardPara"></p></div>
|
||||
<div class="dl-warning-actions"><button class="dl-warning-desactivate" id="switchBtn"></button><button class="dl-warning-cancel" id="cancelBtn">取消</button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
const lineCardEl = document.getElementById('lineCard'), cardHeadingEl = document.getElementById('cardHeading'), cardParaEl = document.getElementById('cardPara'), switchLineBtn = document.getElementById('switchBtn'), cancelLineBtn = document.getElementById('cancelBtn');
|
||||
const getCookie = (name) => document.cookie.split('; ').find(row => row.startsWith(`${name}=`))?.split('=')[1];
|
||||
const setSessionCookie = (name, value, domain = 'anian.cc') => document.cookie = `${name}=${value}; path=/; domain=${domain}; SameSite=Lax`;
|
||||
const showLineCard = () => { lineCardEl.style.display = 'block'; setTimeout(() => { lineCardEl.style.opacity = '1'; lineCardEl.style.transform = 'translateY(0)'; }, 10) };
|
||||
const hideLineCard = (setNoPrompt = false, setNoSpeedTest = false) => { lineCardEl.style.opacity = '0'; lineCardEl.style.transform = 'translateY(20px)'; setTimeout(() => { lineCardEl.style.display = 'none'; if (setNoPrompt) setSessionCookie('noPrompt_anian_cc', 'true'); if (setNoSpeedTest) setSessionCookie('noSpeedTest_anian_cc', 'true'); }, 300) };
|
||||
const handleLineSwitch = (baseUrl) => { switchLineBtn.classList.add('loading'); switchLineBtn.textContent = '切换中'; switchLineBtn.disabled = true; const currentScrollTop = window.scrollY || document.documentElement.scrollTop; document.cookie = `scrollParam=${currentScrollTop}; path=/; domain=anian.cc`; let finalUrl = baseUrl + location.pathname + location.search + location.hash; setTimeout(() => location.href = finalUrl, 500) };
|
||||
let isResourceLoaded = false, pageLoadTimeoutTimer = null, isLoadTimeoutAborted = false;
|
||||
const currentHost = location.hostname, isMainDomain = currentHost === 'anian.cc', isSubDomain = currentHost === 'www.anian.cc', isTestDomain = !isMainDomain && !isSubDomain;
|
||||
const scrollParam = getCookie('scrollParam'), noPromptCookie = getCookie('noPrompt_anian_cc'), noSpeedTestCookie = getCookie('noSpeedTest_anian_cc');
|
||||
cancelLineBtn.addEventListener('click', () => { hideLineCard(!isMainDomain, isMainDomain); });
|
||||
if (isSubDomain) { if (!scrollParam && !noPromptCookie) { cardHeadingEl.textContent = '温馨提示'; cardParaEl.textContent = '当前为备用线路,若主线路正常,请优先选择主线路'; switchLineBtn.textContent = '切换主线路'; switchLineBtn.onclick = () => handleLineSwitch('https://anian.cc'); showLineCard(); } }
|
||||
if (isMainDomain) { if (!noSpeedTestCookie) { pageLoadTimeoutTimer = setTimeout(() => { if (!isResourceLoaded) { isLoadTimeoutAborted = true; cardHeadingEl.textContent = '线路异常'; cardParaEl.textContent = '当前线路拥塞,若本地网络正常,可尝试切换至备用线路'; switchLineBtn.textContent = '切换副线路'; switchLineBtn.onclick = () => handleLineSwitch('https://www.anian.cc'); showLineCard(); } }, 15000); window.onload = () => { isResourceLoaded = true; clearTimeout(pageLoadTimeoutTimer); if (isLoadTimeoutAborted) return; const xhr = new XMLHttpRequest(); xhr.open('GET', `/upload/%E4%B8%8B%E8%BD%BD%20(9).mp4?_t=${Date.now()}`, true); let t = setTimeout(() => { xhr.abort(); cardHeadingEl.textContent = '线路异常'; cardParaEl.textContent = '当前线路拥塞,若本地网络正常,可尝试切换至备用线路'; switchLineBtn.textContent = '切换副线路'; switchLineBtn.onclick = () => handleLineSwitch('https://www.anian.cc'); showLineCard() }, 7500); xhr.onload = xhr.onerror = xhr.onabort = () => clearTimeout(t); xhr.send(); } } }
|
||||
if (isTestDomain) { if (!noPromptCookie) { cardHeadingEl.textContent = '线路警告'; cardParaEl.textContent = '当前为测试线路,若非开发所需,请优先选择主线路'; switchLineBtn.textContent = '切换主线路'; switchLineBtn.onclick = () => handleLineSwitch('https://anian.cc'); showLineCard(); } }
|
||||
})();
|
||||
</script> -->
|
||||
|
||||
<link rel="stylesheet" id="wp-block-library-css" th:href="@{/assets/css/style.min.css(v=${customJsVersion})}" media="all">
|
||||
<link rel="stylesheet" id="pix-style-css" th:href="@{/assets/css/style.css(v=${customJsVersion})}" media="all">
|
||||
<link rel="stylesheet" id="fancybox.css-css" th:href="@{/assets/libs/fancybox/jquery.fancybox.min.css(v=${customJsVersion})}" media="all">
|
||||
|
||||
@@ -20,19 +20,6 @@
|
||||
|
||||
</header><!-- #masthead -->
|
||||
|
||||
<!-- <div class="index_banner">
|
||||
<div class="bg bg1"></div>
|
||||
<div class="bg bg2"></div>
|
||||
<div class="user_info">
|
||||
<div class="top">
|
||||
<div class="left">
|
||||
<div class="name">[[${theme.config.base_set.nice_name}]]</div>
|
||||
<div class="des">[[${theme.config.base_set.admin_des}]]</div>
|
||||
</div>
|
||||
<div class="avatar"><img th:src="${theme.config.base_set.default_avatar}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="index_banner" id="banner" uk-img="loading: eager">
|
||||
<div class="user_info">
|
||||
<div class="top">
|
||||
|
||||
@@ -28,70 +28,6 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- <div class="m_top_nav top_tool is_mobile">
|
||||
<a class="top_nav_btn" uk-toggle="target: #m_offcanvas"><i class="ri-menu-2-line"></i></a>
|
||||
<div id="m_offcanvas" class="m_offcanvas uk-animation-fast"
|
||||
uk-offcanvas="overlay: true;mode: push;container:.main_wrap">
|
||||
<div class="uk-offcanvas-bar inner"
|
||||
th:with="topMenu = ${#strings.isEmpty(theme.config.base_set.left_nav) ? menuFinder.getPrimary() : menuFinder.getByName(theme.config.base_set.left_nav)}">
|
||||
|
||||
<div class="m_logo"><a href="/"><img th:src="${theme.config.base_top_set.mobile_logo}"></a></div>
|
||||
|
||||
<div class="menu-top-container" th:if="${not #lists.isEmpty(topMenu)}">
|
||||
<ul id="top_menu" class="menu">
|
||||
<th:block th:each="menuItem : ${topMenu.menuItems}">
|
||||
<li th:unless="${not #lists.isEmpty(menuItem.children)}"
|
||||
class="menu-item menu-item-type-post_type menu-item-object-page">
|
||||
<a th:target="${menuItem.spec.target?.value}" th:href="@{${menuItem.status.href}}"
|
||||
th:with="icon = ${#annotations.getOrDefault(menuItem, 'icon', '')}">
|
||||
<th:block th:if="${not #strings.isEmpty(icon)}"
|
||||
th:with="index = ${icon.lastIndexOf('.')}">
|
||||
<i th:unless="${index!=-1}" th:class="${icon}"></i>
|
||||
<img th:if="${index!=-1}" th:src="${icon}">
|
||||
</th:block>
|
||||
<span class="nav_title" th:text="${menuItem.status.displayName}"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li th:if="${not #lists.isEmpty(menuItem.children)}"
|
||||
class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children has_children"
|
||||
th:classappend="${'menu-item-'+iterStat.index}">
|
||||
<a href="#" th:with="icon = ${#annotations.getOrDefault(menuItem, 'icon', '')}">
|
||||
<th:block th:if="${not #strings.isEmpty(icon)}"
|
||||
th:with="index = ${icon.lastIndexOf('.')}">
|
||||
<i th:unless="${index!=-1}" th:class="${icon}"></i>
|
||||
<img th:if="${index!=-1}" th:src="${icon}">
|
||||
</th:block>
|
||||
<span class="nav_title">[[${menuItem.status.displayName}]]</span>
|
||||
<i class="ri-arrow-down-s-line drop_icon"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li th:each="childMenu,iterStat : ${menuItem.children}"
|
||||
th:id="${'menu-item-'+iterStat.index}"
|
||||
class="menu-item menu-item-type-custom menu-item-object-custom"
|
||||
th:classappend="${'menu-item-'+iterStat.index}">
|
||||
<a th:href="@{${childMenu.status.href}}"
|
||||
th:with="icon = ${#annotations.getOrDefault(childMenu, 'icon', '')}"
|
||||
th:target="${childMenu.spec.target?.value}">
|
||||
<th:block th:if="${not #strings.isEmpty(icon)}"
|
||||
th:with="index = ${icon.lastIndexOf('.')}">
|
||||
<i th:unless="${index!=-1}" th:class="${icon}"></i>
|
||||
<img th:if="${index!=-1}" th:src="${icon}">
|
||||
</th:block>
|
||||
<span class="nav_title">[[${childMenu.status.displayName}]]</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</th:block>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div th:unless="${not #lists.isEmpty(topMenu)}" class="nav_tips">请前往后台设置左侧菜单/移动端菜单</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search_mod">
|
||||
<div th:if="${pluginFinder.available('PluginSearchWidget')}" class="t_search_on top_tool icon_color">
|
||||
|
||||
@@ -8,9 +8,13 @@
|
||||
|
||||
<th:block th:replace="~{modules/header}"/>
|
||||
|
||||
<div id="pjax-container">
|
||||
<div id="pjax-container" th:with="
|
||||
page = ${#lists.isEmpty(param.page) ? 1 : param.page[0]},
|
||||
tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]},
|
||||
momentPage = ${#lists.isEmpty(param.page) ? moments : (#strings.isEmpty(tag) ? momentFinder.list(page, moments.size) : momentFinder.listByTag(page, moments.size, tag))}
|
||||
">
|
||||
|
||||
<th:block th:replace="~{macro/home-moment :: home-moment(${moments},${tags})}"></th:block>
|
||||
<th:block th:replace="~{macro/home-moment :: home-moment(${momentPage},${tags},'/moments')}"></th:block>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
+17
-78
@@ -7,85 +7,24 @@
|
||||
<div class="page_main uk-width-2-3@m">
|
||||
<th:block th:replace="~{modules/header}" />
|
||||
|
||||
<div id="pjax-container">
|
||||
<div class="normal_list">
|
||||
<div class="normal_list_inner" uk-height-viewport="offset-top: true">
|
||||
<div id="pjax-container" th:with="
|
||||
page = ${#lists.isEmpty(param.page) or #strings.isEmpty(param.page[0]) ? 1 : param.page[0]},
|
||||
tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]},
|
||||
groupParam = ${#lists.isEmpty(param.group) ? null : param.group[0]},
|
||||
requestTag = ${not #strings.isEmpty(tag) ? tag : groupParam}
|
||||
">
|
||||
<th:block th:if="${#strings.isEmpty(requestTag)}">
|
||||
<th:block th:with="photoPage = ${#lists.isEmpty(param.page) ? photos : photoFinder.list(page, photos.size)}">
|
||||
<th:block th:replace="~{macro/home-photos :: home-photos(${photoPage},${groups},null,null)}"></th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
||||
<!-- 分类导航 -->
|
||||
<div class="photos_cat_nav">
|
||||
<ul id="cat_nav_items">
|
||||
<li>
|
||||
<!-- 修改:href 改为 data-href,并添加一个通用 class 如 'cat-link' -->
|
||||
<a th:attr="data-href=@{/photos}"
|
||||
th:classappend="${#lists.isEmpty(param.group) ? 'active' : ''}" class="cat-link">
|
||||
全部<span></span>
|
||||
</a>
|
||||
</li>
|
||||
<th:block th:each="group : ${groups}">
|
||||
<li>
|
||||
<!-- 修改:这里也改为 data-href -->
|
||||
<a th:attr="data-href=@{|/photos?group=${group.metadata.name}|}"
|
||||
th:classappend="${#lists.contains(param.group, group.metadata.name) ? 'active' : ''}"
|
||||
th:text="${group.spec.displayName}" class="cat-link">
|
||||
<span></span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 相册列表 -->
|
||||
<div id="photos_item" class="norpost_list">
|
||||
<div th:unless="${#lists.isEmpty(photos.items)}" class="gallery-photos page">
|
||||
|
||||
<div th:each="photo : ${photos.items}" class="gallery-photo">
|
||||
|
||||
<th:block th:with="
|
||||
img = ${!#strings.isEmpty(photo.spec.cover) ? photo.spec.cover : photo.spec.url},
|
||||
isVideo = ${#strings.endsWith(img, '.mp4') or #strings.endsWith(img, '.webm') or #strings.endsWith(img, '.ogg')}
|
||||
">
|
||||
|
||||
<span th:if="${isVideo}" th:href="${img}" data-fancybox="gallery"
|
||||
class="fancybox video-fancybox"
|
||||
style="position: relative; display: block; cursor: pointer;">
|
||||
<video class="photo-img" preload="metadata" muted playsinline>
|
||||
<source th:src="${img}" th:type="${#strings.endsWith(img, '.mp4') ? 'video/mp4' :
|
||||
(#strings.endsWith(img, '.webm') ? 'video/webm' : 'video/ogg')}" />
|
||||
</video>
|
||||
<div
|
||||
style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;">
|
||||
<i class="ri-play-circle-line play-icon"
|
||||
style="color: #41b87e; font-size: 40px; background-color: rgba(255, 255, 255, 0.8); border-radius: 50%;"></i>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span th:unless="${isVideo}" th:href="${img}" data-fancybox="gallery"
|
||||
class="fancybox" th:data-thumb="${img}"
|
||||
style="position: relative; display: block;">
|
||||
<img class="photo-img" loading="lazy" th:src="${img}" />
|
||||
</span>
|
||||
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空数据 -->
|
||||
<th:block th:if="${#lists.isEmpty(photos.items)}">
|
||||
<th:block th:replace="~{macro/tpl/content-none}" />
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<th:block th:if="${photos.hasPrevious()} or ${photos.hasNext()}">
|
||||
<div id="p_pagination">
|
||||
<div class="post-paging" th:if="${photos.hasNext()}">
|
||||
<a th:data="@{${photos.nextUrl}}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:unless="${#strings.isEmpty(requestTag)}" th:each="photoGroup : ${groups}">
|
||||
<th:block th:if="${#strings.equals(requestTag, photoGroup.spec.displayName) or #strings.equals(requestTag, photoGroup.metadata.name)}"
|
||||
th:with="photoPage = ${photoFinder.list(page, photos.size, photoGroup.metadata.name)}">
|
||||
<th:block th:replace="~{macro/home-photos :: home-photos(${photoPage},${groups},${photoGroup.spec.displayName},${photoGroup.metadata.name})}"></th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<!-- 瀑布流自适应 -->
|
||||
|
||||
Reference in New Issue
Block a user