Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 048e4336d1 | |||
| 92d591f70b | |||
| 061b00fc05 | |||
| 73dc2a1c1c | |||
| 565bf30ea5 | |||
| 5a3544f8df | |||
| ee5c1a2b5b | |||
| 9c26bece1b | |||
| 101189a077 |
@@ -2,11 +2,35 @@
|
|||||||
|
|
||||||
> 基于原作者v1.2.5代码修改
|
> 基于原作者v1.2.5代码修改
|
||||||
|
|
||||||
|
#### v1.2.5-7
|
||||||
|
1. 适配新接口(基于新版API-Python)
|
||||||
|
2. 更新附录页面、通知书页面
|
||||||
|
3. 朋友圈将不再显示内容为空的条目
|
||||||
|
4. 修复图文片刻中媒体库及拖拽时的图片样式
|
||||||
|
5. 修改灯箱相关UI颜色
|
||||||
|
6. 重写课外书分类获取逻辑(依赖豆瓣插件v1.2.2-2)
|
||||||
|
|
||||||
|
#### v1.2.5-6
|
||||||
|
1. 重构课外书页面
|
||||||
|
2. 音乐、背景、侧边栏等适配新接口(基于API-Python)
|
||||||
|
3. 修复分享海报空白、模态框失效等异常
|
||||||
|
|
||||||
|
#### v1.2.5-5
|
||||||
|
1. 朋友圈支持图片显示(需同步更新插件)
|
||||||
|
2. 手机端底部导航栏新增公告未读提示
|
||||||
|
3. 更新通讯录、储物柜
|
||||||
|
4. 优化操作提示、图片排版
|
||||||
|
|
||||||
|
#### v1.2.5-4
|
||||||
|
1. 修复侧边栏测速异常、拖拽片刻图片异常、手机端文章目录异常、页面提示异常
|
||||||
|
2. 优化多种场景下的提示、衔接、样式
|
||||||
|
3. 新增片刻删除提示框及删除动画
|
||||||
|
|
||||||
#### v1.2.5-3
|
#### v1.2.5-3
|
||||||
1. 朋友圈支持根据作者筛选内容(需同步更新插件)
|
1. 朋友圈支持根据作者筛选内容(需同步更新插件)
|
||||||
2. 支持前台弹窗登入登出
|
2. 支持前台弹窗登入登出
|
||||||
2. 附录页面功能补全
|
3. 附录页面功能补全
|
||||||
3. 对线路切换、加载异常等情况进行了深度优化
|
4. 对线路切换、加载异常等情况进行了深度优化
|
||||||
|
|
||||||
#### v1.2.5-2
|
#### v1.2.5-2
|
||||||
1. 添加侧边栏、页面、文章等HTML内容块
|
1. 添加侧边栏、页面、文章等HTML内容块
|
||||||
|
|||||||
@@ -299,7 +299,7 @@
|
|||||||
<div class="people-grid">
|
<div class="people-grid">
|
||||||
<div class="person">
|
<div class="person">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<img src="/upload/8aea7800gy1i2vfbxoqhdj24w07c0b2p.jpg">
|
<img src="/upload/20260416214530_191_129.jpg">
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p class="name">黄诗扶</p>
|
<p class="name">黄诗扶</p>
|
||||||
@@ -310,18 +310,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="person">
|
<div class="person">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<img src="/upload/ec39c62fly1i3rextah4gj22dc35s1ky.jpg">
|
<img src="/upload/20260416213611_190_129.jpg">
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p class="name">双笙</p>
|
<p class="name">双笙</p>
|
||||||
<p class="bio">
|
<p class="bio">
|
||||||
什么?你问我为什么喜欢包包?可能因为是“青春”吧?
|
什么?你问我为什么喜欢包包?可能因为是青春吧?
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="person">
|
<div class="person">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<img src="/upload/005Jyswjgy1hywx7z7sb7j30zk1betbd.jpg">
|
<img src="/upload/005Jyswjgy1ic7xfxtlu8j33402c0npe.jpg">
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p class="name">浅影阿</p>
|
<p class="name">浅影阿</p>
|
||||||
@@ -332,12 +332,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="person">
|
<div class="person">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<img src="/upload/ab0efe4ely1hnpfzqqw1oj23ls5eoqvg.jpg">
|
<img src="/upload/67f2efd2gy1i8iv8nkuqjj23344mokjp.jpg">
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p class="name">平生不晚</p>
|
<p class="name">玄觞</p>
|
||||||
<p class="bio">
|
<p class="bio">
|
||||||
首先是戏腔好听,然后是妆造好看,最后就来到了这里
|
你们古风圈,怎么都喊女生王子,喊男生二婶呢?
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -104,6 +104,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a href="https://api.anian.cc" target="_blank">
|
||||||
|
<div class="link-card-default">
|
||||||
|
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
||||||
|
<div style="position: relative; z-index: 1;">
|
||||||
|
<div style="width: 60px; height: 60px; background: #40916c; border-radius: 10px; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;">
|
||||||
|
<i class="ri-git-repository-line ri-icon" style="font-size: 30px;"></i>
|
||||||
|
</div>
|
||||||
|
<h4 style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">接口箱</h4>
|
||||||
|
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">运筹帷幄之中</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
<a href="/news-2026" target="_self">
|
<a href="/news-2026" target="_self">
|
||||||
<div class="link-card-default">
|
<div class="link-card-default">
|
||||||
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
||||||
@@ -112,12 +125,12 @@
|
|||||||
<i class="ri-file-list-3-line ri-icon" style="font-size: 30px;"></i>
|
<i class="ri-file-list-3-line ri-icon" style="font-size: 30px;"></i>
|
||||||
</div>
|
</div>
|
||||||
<h4 style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">每日报</h4>
|
<h4 style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">每日报</h4>
|
||||||
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">运筹帷幄之中</p>
|
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">决胜千里之外</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="https://git.anian.cc/explore/repos" target="_blank">
|
<a href="https://git.anian.cc" target="_blank">
|
||||||
<div class="link-card-default">
|
<div class="link-card-default">
|
||||||
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
||||||
<div style="position: relative; z-index: 1;">
|
<div style="position: relative; z-index: 1;">
|
||||||
@@ -130,7 +143,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="#" target="_self">
|
<a href="books" target="_self">
|
||||||
<div class="link-card-default">
|
<div class="link-card-default">
|
||||||
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
||||||
<div style="position: relative; z-index: 1;">
|
<div style="position: relative; z-index: 1;">
|
||||||
@@ -138,20 +151,7 @@
|
|||||||
<i class="ri-door-open-line ri-icon" style="font-size: 30px;"></i>
|
<i class="ri-door-open-line ri-icon" style="font-size: 30px;"></i>
|
||||||
</div>
|
</div>
|
||||||
<h4 style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">课外书</h4>
|
<h4 style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">课外书</h4>
|
||||||
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">敬请期待</p>
|
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">记忆中的锚点</p>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="#" target="_self">
|
|
||||||
<div class="link-card-default">
|
|
||||||
<div class="decor-circle" style="position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: #d8f3dc; border-radius: 50%; opacity: 0.3; transition: all 0.5s ease;"></div>
|
|
||||||
<div style="position: relative; z-index: 1;">
|
|
||||||
<div style="width: 60px; height: 60px; background: #40916c; border-radius: 10px; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;">
|
|
||||||
<i class="ri-git-repository-line ri-icon" style="font-size: 30px;"></i>
|
|
||||||
</div>
|
|
||||||
<h4 style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">笔记本</h4>
|
|
||||||
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">敬请期待</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@@ -199,14 +199,16 @@
|
|||||||
|
|
||||||
if (isUnread) {
|
if (isUnread) {
|
||||||
typeof initNoticeTip === 'function' && initNoticeTip();
|
typeof initNoticeTip === 'function' && initNoticeTip();
|
||||||
noticeCard.querySelector('.notice-title').textContent = `通知书`;
|
$('.footer_menu a[href="/navigator"]').css('color', '#ecc94b').find('i').css('color', '#ecc94b');
|
||||||
noticeCard.querySelector('.notice-desc').textContent = `有新通知待查看`;
|
noticeCard.querySelector('.notice-title').textContent = '通知书';
|
||||||
|
noticeCard.querySelector('.notice-desc').textContent = '有新通知待查看';
|
||||||
noticeCard.classList.add('notice-unread');
|
noticeCard.classList.add('notice-unread');
|
||||||
if(decorCircle) decorCircle.style.background = '#fef3c7';
|
if(decorCircle) decorCircle.style.background = '#fef3c7';
|
||||||
|
|
||||||
const noticeLink = noticeCard.closest('a');
|
const noticeLink = noticeCard.closest('a');
|
||||||
noticeLink.onclick = function() {
|
noticeLink.onclick = function() {
|
||||||
$.cookie('latest_notice_date', combinedDateStr, { path: '/', domain: 'anian.cc', expires: 365 });
|
// $.cookie('latest_notice_date', combinedDateStr, { path: '/', domain: 'anian.cc', expires: 365 });
|
||||||
|
$.cookie('latest_notice_date', combinedDateStr, { path: '/', expires: 365 });
|
||||||
typeof markAsRead === 'function' && markAsRead(combinedDateStr);
|
typeof markAsRead === 'function' && markAsRead(combinedDateStr);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+47
-10
@@ -1,25 +1,57 @@
|
|||||||
<div id="anian-update-wrapper-2026" class="anian-feed-root-container">
|
<div id="anian-update-wrapper-2026" class="anian-feed-root-container">
|
||||||
<div class="anian-feed-grid">
|
<div class="anian-feed-grid">
|
||||||
<div class="anian-feed-card" data-rss-url="https://git.anian.cc/anian/halo-plugin-photos/releases.rss">
|
|
||||||
<h3 class="anian-feed-caption">图库插件更新</h3>
|
|
||||||
|
<div class="anian-feed-card" data-rss-url="https://git.anian.cc/anian/halo-theme-pix/releases.rss">
|
||||||
|
<h3 class="anian-feed-caption">日记簿更新</h3>
|
||||||
<div class="anian-feed-list-box">
|
<div class="anian-feed-list-box">
|
||||||
<div class="anian-loading">加载中...</div>
|
<div class="anian-loading">加载中...</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="anian-feed-card" data-rss-url="https://git.anian.cc/anian/halo-plugin-friends/releases.rss">
|
<div class="anian-feed-card" data-rss-url="https://git.anian.cc/anian/halo-plugin-friends/releases.rss">
|
||||||
<h3 class="anian-feed-caption">朋友圈插件更新</h3>
|
<h3 class="anian-feed-caption">朋友圈功能更新</h3>
|
||||||
<div class="anian-feed-list-box">
|
<div class="anian-feed-list-box">
|
||||||
<div class="anian-loading">加载中...</div>
|
<div class="anian-loading">加载中...</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="anian-feed-card" data-rss-url="https://git.anian.cc/anian/halo-theme-pix/releases.rss">
|
<div class="anian-feed-card" data-rss-url="https://git.anian.cc/anian/halo-plugin-comment/releases.rss">
|
||||||
<h3 class="anian-feed-caption">主题更新</h3>
|
<h3 class="anian-feed-caption">评论功能更新</h3>
|
||||||
<div class="anian-feed-list-box">
|
<div class="anian-feed-list-box">
|
||||||
<div class="anian-loading">加载中...</div>
|
<div class="anian-loading">加载中...</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="anian-feed-card" data-rss-url="https://git.anian.cc/anian/halo-plugin-photos/releases.rss">
|
||||||
|
<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.cc/anian/halo-plugin-douban/releases.rss">
|
||||||
|
<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.cc/anian/halo-plugin-dever/releases.rss">
|
||||||
|
<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.cc/anian/api-python/releases.rss">
|
||||||
|
<h3 class="anian-feed-caption">应用接口更新</h3>
|
||||||
|
<div class="anian-feed-list-box">
|
||||||
|
<div class="anian-loading">加载中...</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -41,9 +73,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.anian-feed-card {
|
.anian-feed-card {
|
||||||
flex: 1;
|
flex: 0 0 calc((100% - 24px) / 2);
|
||||||
min-width: 320px;
|
max-width: calc((100% - 24px) / 2);
|
||||||
/* 优化最小宽度 */
|
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border: 1px solid #e1f3d8;
|
border: 1px solid #e1f3d8;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
@@ -55,6 +86,11 @@
|
|||||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.anian-feed-card:first-child {
|
||||||
|
flex-basis: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.anian-feed-caption {
|
.anian-feed-caption {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -70,7 +106,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.anian-feed-list-box {
|
.anian-feed-list-box {
|
||||||
max-height: 380px;
|
max-height: 250px;
|
||||||
/* 优化高度 */
|
/* 优化高度 */
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -197,7 +233,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.anian-feed-card {
|
.anian-feed-card {
|
||||||
min-width: 100%;
|
flex: 0 0 100%;
|
||||||
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.anian-feed-caption {
|
.anian-feed-caption {
|
||||||
|
|||||||
+114
-89
@@ -3,7 +3,6 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: "Inter", "Microsoft YaHei", Arial;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.store {
|
.store {
|
||||||
@@ -13,7 +12,7 @@
|
|||||||
--danger: #E74C3C;
|
--danger: #E74C3C;
|
||||||
--bg: #F9FFFB;
|
--bg: #F9FFFB;
|
||||||
--shadow: 0 12px 30px rgba(80, 200, 120, .12);
|
--shadow: 0 12px 30px rgba(80, 200, 120, .12);
|
||||||
--radius: 18px;
|
--radius: 8px;
|
||||||
padding: 26px 14px;
|
padding: 26px 14px;
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
}
|
}
|
||||||
@@ -59,7 +58,7 @@
|
|||||||
#tag-search {
|
#tag-search {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 7px 12px 7px 34px;
|
padding: 7px 12px 7px 34px;
|
||||||
border-radius: 10px;
|
border-radius: 8px;
|
||||||
border: 1px solid #c9efd6;
|
border: 1px solid #c9efd6;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: #fafffb;
|
background: #fafffb;
|
||||||
@@ -79,7 +78,7 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
border-radius: 12px;
|
border-radius: 8px;
|
||||||
border: 1px solid #c9efd6;
|
border: 1px solid #c9efd6;
|
||||||
background: rgba(144, 238, 144, .08);
|
background: rgba(144, 238, 144, .08);
|
||||||
max-height: 100px;
|
max-height: 100px;
|
||||||
@@ -89,7 +88,7 @@
|
|||||||
|
|
||||||
.store .tag-item {
|
.store .tag-item {
|
||||||
padding: 5px 7px;
|
padding: 5px 7px;
|
||||||
border-radius: 9px;
|
border-radius: 8px;
|
||||||
border: 1px solid #90ee90;
|
border: 1px solid #90ee90;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -107,31 +106,66 @@
|
|||||||
.store .no-result {
|
.store .no-result {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
color: #7f8c8d;
|
color: #7f8c8d;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
padding: 8px 0;
|
min-height: 100%;
|
||||||
|
padding: 0;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 输入框 */
|
/* 输入框 */
|
||||||
.store .input-group {
|
.store .input-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 8px;
|
||||||
margin: 16px 0;
|
margin: 16px 0;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.store .section-divider {
|
||||||
|
position: relative;
|
||||||
|
height: 18px;
|
||||||
|
margin: 6px 0 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.store .section-divider::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background: linear-gradient(90deg, rgba(80, 200, 120, 0), rgba(80, 200, 120, .55), rgba(80, 200, 120, 0));
|
||||||
|
box-shadow: 0 1px 0 rgba(80, 200, 120, .12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.store .section-divider::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
transform: translate(-50%, -50%) rotate(45deg);
|
||||||
|
border-radius: 2px;
|
||||||
|
background: linear-gradient(135deg, #90ee90, #50c878);
|
||||||
|
box-shadow: -14px 0 0 -3px rgba(80, 200, 120, .5), 14px 0 0 -3px rgba(80, 200, 120, .5), 0 0 0 2px #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#file-path {
|
#file-path {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 8px 14px;
|
padding: 8px 14px;
|
||||||
border-radius: 12px;
|
border-radius: 8px;
|
||||||
border: 2px solid #e8f7ec;
|
border: 2px solid #e8f7ec;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#submit-btn {
|
#submit-btn {
|
||||||
padding: 10px;
|
padding: 10px 20px;
|
||||||
border-radius: 12px;
|
border-radius: 8px;
|
||||||
border: none;
|
border: none;
|
||||||
background: linear-gradient(135deg, #50c878, #3a9156);
|
background: linear-gradient(135deg, #50c878, #3a9156);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@@ -139,17 +173,6 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 底部提示(改成浅黄色系) */
|
|
||||||
.store .tips {
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: center;
|
|
||||||
color: #a97400;
|
|
||||||
padding: 8px;
|
|
||||||
border-radius: 8px;
|
|
||||||
background: rgba(255, 215, 0, .12);
|
|
||||||
border: 1px solid rgba(243, 156, 18, .25);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 手机端 */
|
/* 手机端 */
|
||||||
@media(max-width:520px) {
|
@media(max-width:520px) {
|
||||||
.store {
|
.store {
|
||||||
@@ -166,7 +189,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.store .input-group {
|
.store .input-group {
|
||||||
flex-direction: column
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
#submit-btn {
|
#submit-btn {
|
||||||
@@ -176,34 +200,11 @@
|
|||||||
.store .tag-list {
|
.store .tag-list {
|
||||||
max-height: 120px
|
max-height: 120px
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Toast */
|
#file-path {
|
||||||
.custom-toast {
|
width: 100%;
|
||||||
position: fixed;
|
box-sizing: border-box;
|
||||||
top: 26px;
|
}
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%) translateY(-80px);
|
|
||||||
background: #2ECC71;
|
|
||||||
color: #fff;
|
|
||||||
padding: 12px 20px;
|
|
||||||
border-radius: 10px;
|
|
||||||
transition: .4s;
|
|
||||||
opacity: 0;
|
|
||||||
z-index: 9999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-show {
|
|
||||||
transform: translateX(-50%) translateY(0);
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-error {
|
|
||||||
background: #E74C3C
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-warning {
|
|
||||||
background: #F39C12
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -211,58 +212,55 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="top-bar"></div>
|
<div class="top-bar"></div>
|
||||||
|
|
||||||
<h1 class="title">Anian的储物柜</h1>
|
<h1 class="title">储物柜</h1>
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="file-path" placeholder="请输入翻找目标..." autocomplete="off">
|
||||||
|
<button id="submit-btn">翻 找</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section-divider" aria-hidden="true"></div>
|
||||||
|
|
||||||
<div class="tag-container">
|
<div class="tag-container">
|
||||||
<div class="tag-search-wrapper">
|
<div class="tag-search-wrapper">
|
||||||
<span class="search-icon">🔍</span>
|
<span class="search-icon"><i class="ri-search-line"></i></span>
|
||||||
<input id="tag-search" placeholder="搜索标签">
|
<input id="tag-search" placeholder="搜索标签..." autocomplete="off">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tag-list">
|
<div class="tag-list">
|
||||||
<div class="tag-item" data-value="test.zip">测试压缩包</div>
|
<div class="tag-item" data-value="/upload/jiazai.gif">加载动画</div>
|
||||||
<div class="tag-item" data-value="docs/report.pdf">示例报告</div>
|
<div class="tag-item" data-value="/upload/logo.png">网站Logo</div>
|
||||||
<div class="tag-item" data-value="images/banner.jpg">横幅图片</div>
|
<div class="tag-item" data-value="/upload/jiazai.gif">加载动画</div>
|
||||||
<div class="tag-item" data-value="software/setup.exe">安装程序</div>
|
<div class="tag-item" data-value="/upload/logo.png">网站Logo</div> <div class="tag-item" data-value="/upload/jiazai.gif">加载动画</div>
|
||||||
|
<div class="tag-item" data-value="/upload/logo.png">网站Logo</div> <div class="tag-item" data-value="/upload/jiazai.gif">加载动画</div>
|
||||||
|
<div class="tag-item" data-value="/upload/logo.png">网站Logo</div> <div class="tag-item" data-value="/upload/jiazai.gif">加载动画</div>
|
||||||
|
<div class="tag-item" data-value="/upload/logo.png">网站Logo</div> <div class="tag-item" data-value="/upload/jiazai.gif">加载动画</div>
|
||||||
|
<div class="tag-item" data-value="/upload/logo.png">网站Logo</div>
|
||||||
|
|
||||||
<div class="no-result" id="noResult">没有匹配的结果</div>
|
<div class="no-result" id="noResult">没有匹配的结果</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input-group">
|
|
||||||
<input id="file-path" placeholder="请输入路径" autocomplete="off">
|
|
||||||
<button id="submit-btn">访问 / 下载</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="tips">⚠️ 错误过多将可能被封禁</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="custom-toast" id="customToast"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function initializeStoreEvents() {
|
function initializeStoreEvents() {
|
||||||
|
let closeLoading = null;
|
||||||
const container = document.querySelector(".store");
|
const container = document.querySelector(".store");
|
||||||
if (!container || container.dataset.init === "1") return;
|
if (!container || container.dataset.init === "1") return;
|
||||||
container.dataset.init = "1";
|
container.dataset.init = "1";
|
||||||
|
|
||||||
const input = document.getElementById('file-path');
|
const input = document.getElementById('file-path');
|
||||||
const btn = document.getElementById('submit-btn');
|
const btn = document.getElementById('submit-btn');
|
||||||
const toast = document.getElementById('customToast');
|
|
||||||
const tagItems = document.querySelectorAll('.tag-item');
|
const tagItems = document.querySelectorAll('.tag-item');
|
||||||
const tagSearch = document.getElementById('tag-search');
|
const tagSearch = document.getElementById('tag-search');
|
||||||
const noResult = document.getElementById('noResult');
|
const noResult = document.getElementById('noResult');
|
||||||
|
|
||||||
function showToast(msg, type = 'warning') {
|
|
||||||
toast.textContent = msg;
|
|
||||||
toast.className = 'custom-toast toast-' + type + ' toast-show';
|
|
||||||
setTimeout(() => toast.classList.remove('toast-show'), 2600);
|
|
||||||
}
|
|
||||||
|
|
||||||
tagItems.forEach(t => {
|
tagItems.forEach(t => {
|
||||||
t.onclick = () => {
|
t.onclick = () => {
|
||||||
input.value = t.dataset.value;
|
input.value = t.dataset.value;
|
||||||
showToast('已填入 ' + t.dataset.value, 'success');
|
cocoMessage.success('已填入对应标签信息');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -277,39 +275,66 @@
|
|||||||
if (show) visible++;
|
if (show) visible++;
|
||||||
});
|
});
|
||||||
|
|
||||||
noResult.style.display = visible === 0 ? 'block' : 'none';
|
noResult.style.display = visible === 0 ? 'flex' : 'none';
|
||||||
};
|
};
|
||||||
|
|
||||||
function check(url) {
|
function check(url) {
|
||||||
return new Promise(r => {
|
return new Promise(r => {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.open('HEAD', url, true);
|
try {
|
||||||
|
xhr.open('HEAD', url, true);
|
||||||
|
} catch (e) {
|
||||||
|
r(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
xhr.timeout = 5000;
|
xhr.timeout = 5000;
|
||||||
xhr.onload = () => r(xhr.status === 200);
|
xhr.onload = () => r(xhr.status);
|
||||||
xhr.onerror = () => r(false);
|
xhr.onerror = () => r(0);
|
||||||
xhr.ontimeout = () => r(false);
|
xhr.ontimeout = () => r(0);
|
||||||
xhr.send();
|
xhr.send();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizeDestination(value) {
|
||||||
|
const trimmed = value.trim();
|
||||||
|
if (!trimmed || /\\/.test(trimmed)) return null;
|
||||||
|
|
||||||
|
const url = trimmed.charAt(0) === '/' ? trimmed : '/' + trimmed;
|
||||||
|
if (/^\/\//.test(url)) return null;
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
async function go() {
|
async function go() {
|
||||||
const v = input.value.trim();
|
const v = input.value.trim();
|
||||||
if (!v) return showToast('请输入路径');
|
if (!v) return cocoMessage.warning('请输入翻找目标');
|
||||||
const url = '/' + v;
|
const url = normalizeDestination(v);
|
||||||
btn.textContent = '检测中...';
|
if (!url) return cocoMessage.warning('翻找目标无效');
|
||||||
|
btn.textContent = '翻找中...';
|
||||||
|
closeLoading = cocoMessage.loading('正在翻找中,请稍候...');
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
const ok = await check(url);
|
try {
|
||||||
if (ok) {
|
const status = await check(url);
|
||||||
showToast('资源存在,跳转中', 'success');
|
if (status === 200) {
|
||||||
setTimeout(() => location.href = url, 700);
|
cocoMessage.success('翻找成功,即将打开目标页面');
|
||||||
} else showToast('资源不存在', 'error');
|
window.open(url, '_blank');
|
||||||
setTimeout(() => { btn.textContent = '访问 / 下载'; btn.disabled = false }, 700);
|
} else if (status === 404) {
|
||||||
|
cocoMessage.warning('翻找失败,失败过多将被封禁');
|
||||||
|
} else {
|
||||||
|
cocoMessage.error('翻找异常,请重试或刷新页面');
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
closeLoading?.();
|
||||||
|
closeLoading = null;
|
||||||
|
btn.textContent = '翻 找';
|
||||||
|
btn.disabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
btn.onclick = go;
|
btn.onclick = go;
|
||||||
input.onkeydown = e => { if (e.key === 'Enter') go(); };
|
input.onkeydown = e => { if (e.key === 'Enter') go(); };
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", initializeStoreEvents);
|
initializeStoreEvents();
|
||||||
document.addEventListener("pjax:complete", initializeStoreEvents);
|
|
||||||
</script>
|
</script>
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
<div class="nav4lite-section">
|
<div class="nav4lite-section">
|
||||||
<div class="nav4lite-grid">
|
<div class="nav4lite-grid">
|
||||||
<a href="/" class="nav4lite-item">
|
<a href="/address" class="nav4lite-item">
|
||||||
<span class="nav4lite-label">课外书</span>
|
<span class="nav4lite-label">通讯录</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="/friends" class="nav4lite-item">
|
<a href="/friends" class="nav4lite-item">
|
||||||
<span class="nav4lite-label">朋友圈</span>
|
<span class="nav4lite-label">朋友圈</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="/docs" class="nav4lite-item" target="_blank">
|
|
||||||
<span class="nav4lite-label">笔记本</span>
|
|
||||||
</a>
|
|
||||||
<a href="/address" class="nav4lite-item">
|
|
||||||
<span class="nav4lite-label">通讯录</span>
|
|
||||||
</a>
|
|
||||||
<a href="/navigator" class="nav4lite-center-dot" aria-label="查看详情"><i
|
<a href="/navigator" class="nav4lite-center-dot" aria-label="查看详情"><i
|
||||||
class="sidebar-more ri-arrow-right-s-line"></i></a>
|
class="sidebar-more ri-arrow-right-s-line"></i></a>
|
||||||
|
<a href="/books" class="nav4lite-item">
|
||||||
|
<span class="nav4lite-label">课外书</span>
|
||||||
|
</a>
|
||||||
|
<a href="/store" class="nav4lite-item" target="_blank">
|
||||||
|
<span class="nav4lite-label">储物柜</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="anian-lunar-date-widget">
|
<div class="anian-lunar-date-widget">
|
||||||
<div class="anian-lunar-date-text" id="anianLunarText">
|
<div class="anian-lunar-date-text" id="anianLunarText">
|
||||||
一日不见如隔三秋
|
一日不见 · 如隔三秋
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<div class="anianx-wrap">
|
<div class="anianx-wrap">
|
||||||
<div class="anianx-group">
|
<div class="anianx-group">
|
||||||
<button class="anianx-btn anianx-left" data-anianx-type="main" data-anianx-href="https://anian.cc">主线路</button>
|
<button class="anianx-btn anianx-left" data-anianx-type="main">观音签</button>
|
||||||
<button class="anianx-btn" data-anianx-type="test">测速</button>
|
<button class="anianx-btn" data-anianx-type="test">测速</button>
|
||||||
<button class="anianx-btn anianx-right" data-anianx-type="sub" data-anianx-href="https://www.anian.cc">副线路</button>
|
<button class="anianx-btn anianx-right" data-anianx-type="sub">歇后语</button>
|
||||||
<div class="anianx-bubble" id="anianxBubble"><span id="anianxBubbleText" class="anianx-loading">当前线路检测中</span></div>
|
<div class="anianx-bubble" id="anianxBubble"><span id="anianxBubbleText">一日不见 · 如隔三秋</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -304,6 +304,15 @@
|
|||||||
0 var(--pixar-button-depth) 0 var(--pixar-ui-dark);
|
0 var(--pixar-button-depth) 0 var(--pixar-ui-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pixar-notice-btn-close:disabled,
|
||||||
|
.pixar-notice-btn-confirm:disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
transform: translateY(var(--pixar-button-depth));
|
||||||
|
box-shadow:
|
||||||
|
0 0 0 var(--pixar-ui-green-shadow),
|
||||||
|
0 var(--pixar-button-depth) 0 var(--pixar-ui-dark);
|
||||||
|
}
|
||||||
|
|
||||||
.pixar-notice-btn-close {
|
.pixar-notice-btn-close {
|
||||||
background: var(--pixar-ui-red);
|
background: var(--pixar-ui-red);
|
||||||
box-shadow:
|
box-shadow:
|
||||||
@@ -323,4 +332,499 @@
|
|||||||
|
|
||||||
.pixar-notice-btn-close:hover {
|
.pixar-notice-btn-close:hover {
|
||||||
border-color: var(--pixar-ui-red-border) !important;
|
border-color: var(--pixar-ui-red-border) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮禁用样式 */
|
||||||
|
.push_item:disabled {
|
||||||
|
background: #c7d4ce;
|
||||||
|
cursor: not-allowed;
|
||||||
|
color: #f0fdf4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 删除确认弹窗样式 */
|
||||||
|
.moments-modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1999;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
animation: momentsFadeIn 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-card-widget {
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
background-color: #ffffff;
|
||||||
|
text-align: left;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||||
|
animation: momentsSlideUp 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-card-header {
|
||||||
|
padding: 1.5rem;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-header-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-icon-wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #fee2e2;
|
||||||
|
width: 3rem;
|
||||||
|
height: 3rem;
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-icon-wrapper svg {
|
||||||
|
color: #dc2626;
|
||||||
|
width: 1.5rem;
|
||||||
|
height: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-text-content {
|
||||||
|
flex: 1;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-title-text {
|
||||||
|
color: #111827;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-message-text {
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
margin-bottom: 0;
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-button-group {
|
||||||
|
margin-top: 1rem;
|
||||||
|
display: flex;
|
||||||
|
gap: 0.75rem;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-btn-confirm {
|
||||||
|
flex: 1;
|
||||||
|
display: inline-flex;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
background-color: #dc2626;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
line-height: 1.3rem;
|
||||||
|
font-weight: 500;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 0.375rem;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: transparent;
|
||||||
|
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-btn-confirm:hover {
|
||||||
|
background-color: #b91c1c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-btn-cancel {
|
||||||
|
flex: 1;
|
||||||
|
display: inline-flex;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #374151;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
line-height: 1.3rem;
|
||||||
|
font-weight: 500;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 0.375rem;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-btn-cancel:hover {
|
||||||
|
background-color: #f3f4f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-btn-confirm:disabled {
|
||||||
|
background-color: #fecaca;
|
||||||
|
cursor: not-allowed;
|
||||||
|
box-shadow: none;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.moments-btn-cancel:disabled,
|
||||||
|
.push_close:disabled {
|
||||||
|
background-color: #e7f0e5;
|
||||||
|
color: #9ca3af;
|
||||||
|
border-color: #e7f0e5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
box-shadow: none;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 追加:黄色警告模式 --- */
|
||||||
|
.theme-yellow .moments-icon-wrapper {
|
||||||
|
background-color: #fef3c7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-yellow .moments-icon-wrapper svg {
|
||||||
|
color: #d97706;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-yellow .moments-btn-confirm {
|
||||||
|
background-color: #d97706;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-yellow .moments-btn-confirm:hover {
|
||||||
|
background-color: #b45309;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 追加:绿色确认模式 --- */
|
||||||
|
.theme-green .moments-icon-wrapper {
|
||||||
|
background-color: #d1fae5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-green .moments-icon-wrapper svg {
|
||||||
|
color: #059669;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-green .moments-btn-confirm {
|
||||||
|
background-color: #059669;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-green .moments-btn-confirm:hover {
|
||||||
|
background-color: #047857;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 追加:红色保持默认,这里只是为了统一命名,可不加 --- */
|
||||||
|
.theme-red .moments-icon-wrapper {
|
||||||
|
background-color: #fee2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-red .moments-icon-wrapper svg {
|
||||||
|
color: #dc2626;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-red .moments-btn-confirm {
|
||||||
|
background-color: #dc2626;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes momentsFadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes momentsSlideUp {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 删除动画 --- */
|
||||||
|
/* 飘散消失动画 (持续 0.8s) */
|
||||||
|
.moments-delete-disperse {
|
||||||
|
animation: momentsDeleteDisperse 0.8s ease-in forwards;
|
||||||
|
transform-origin: center bottom;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes momentsDeleteDisperse {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0) rotate(0deg) scale(1);
|
||||||
|
filter: blur(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
20% {
|
||||||
|
opacity: 0.9;
|
||||||
|
transform: translateY(-10px) rotate(2deg) scale(1.02);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-120px) rotate(-8deg) scale(0.6);
|
||||||
|
filter: blur(3px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 豆瓣页:默认不显示翻页按钮,避免初始化前出现蓝色链接文本 */
|
||||||
|
#douban_pagination {
|
||||||
|
display: none;
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-top: 1px solid var(--pix-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
#douban_pagination .post-paging {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#douban_pagination a {
|
||||||
|
padding: 10px 15px;
|
||||||
|
background: var(--pix-theme);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex: none;
|
||||||
|
width: auto;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#douban_pagination .douban-more-loading {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 豆瓣页:内容区域左右间距与分类导航保持一致 */
|
||||||
|
.douban_page #douban_item {
|
||||||
|
padding: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
column-gap: 0;
|
||||||
|
row-gap: 0;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .loading_box {
|
||||||
|
text-align: center;
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_card_item {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 40px;
|
||||||
|
border-right: 1px solid #e5e7eb;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_card_item:nth-child(2n) {
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_card_inner {
|
||||||
|
display: grid !important;
|
||||||
|
grid-template-columns: 100px 1fr;
|
||||||
|
grid-template-rows: auto auto 1fr;
|
||||||
|
column-gap: 16px;
|
||||||
|
row-gap: 3px;
|
||||||
|
padding: 20px 0;
|
||||||
|
background: transparent;
|
||||||
|
width: 100%;
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_media_col {
|
||||||
|
width: 100px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 2 / 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 强制网格单元同高并让卡片内部撑满单元,确保水平分割线对齐 */
|
||||||
|
.douban_page #douban_item {
|
||||||
|
align-items: stretch !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_poster_link,
|
||||||
|
.douban_page #douban_item .douban_poster_img {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_poster_img {
|
||||||
|
display: block;
|
||||||
|
height: 140px;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_rating_wrap {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_text_col {
|
||||||
|
display: contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_title_row {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
grid-row: 1;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_title_text {
|
||||||
|
color: var(--pix-theme);
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.35;
|
||||||
|
font-weight: 650;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_title_text:hover {
|
||||||
|
color: rgb(28, 156, 90);
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_sub_meta {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
grid-column: 2;
|
||||||
|
grid-row: 2;
|
||||||
|
align-self: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_time_text {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 3px 8px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: rgba(168, 85, 247, 0.12);
|
||||||
|
color: #a855f7;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.4;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-right: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_type_badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 3px 8px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: rgba(56, 189, 248, 0.14);
|
||||||
|
color: #0369a1;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.4;
|
||||||
|
vertical-align: middle;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-right: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_score_badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 3px 8px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: rgba(249, 115, 22, 0.14);
|
||||||
|
color: #ea580c;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.4;
|
||||||
|
vertical-align: middle;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_content_box {
|
||||||
|
color: #374151;
|
||||||
|
grid-column: 2;
|
||||||
|
grid-row: 3;
|
||||||
|
align-self: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_content_main {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #1f2937;
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
max-height: 89.6px;
|
||||||
|
transition: max-height 0.35s ease;
|
||||||
|
will-change: max-height;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_content_main.is-expanded {
|
||||||
|
max-height: 10000px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_expand_btn {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0;
|
||||||
|
color: var(--pix-theme);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_content_meta {
|
||||||
|
margin: 8px 0 0;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #6b7280;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width:1359px) {
|
||||||
|
.douban_page #douban_item {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_card_item {
|
||||||
|
border-right: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width:540px) {
|
||||||
|
.douban_page #douban_item .douban_card_item {
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.douban_page #douban_item .douban_card_inner {
|
||||||
|
column-gap: 11px;
|
||||||
|
row-gap: 0px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5977,7 +5977,7 @@ a.change i.ri-refresh-line {
|
|||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
top: 485px;
|
top: 50%;
|
||||||
left: 0;
|
left: 0;
|
||||||
background-color: var(--toc-color);
|
background-color: var(--toc-color);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@@ -6630,7 +6630,7 @@ a#listree-click.current,
|
|||||||
|
|
||||||
.anianx-bubble {
|
.anianx-bubble {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -60px;
|
top: 50px;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #F6FAF8;
|
background: #F6FAF8;
|
||||||
|
|||||||
@@ -504,11 +504,12 @@ a:visited {
|
|||||||
color: #252525;
|
color: #252525;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 侧边栏颜色异常
|
||||||
a:hover,
|
a:hover,
|
||||||
a:focus,
|
a:focus,
|
||||||
a:active {
|
a:active {
|
||||||
color: #191970;
|
color: #191970;
|
||||||
}
|
} */
|
||||||
|
|
||||||
a:focus {
|
a:focus {
|
||||||
outline: thin dotted;
|
outline: thin dotted;
|
||||||
|
|||||||
+504
-22
@@ -30,6 +30,7 @@ let csrfToken = '';
|
|||||||
let publicKey = '';
|
let publicKey = '';
|
||||||
let loginTimer = null;
|
let loginTimer = null;
|
||||||
let countdownSeconds = 3;
|
let countdownSeconds = 3;
|
||||||
|
let closeLoading = null;
|
||||||
const login_modal = document.getElementById('customLoginModal');
|
const login_modal = document.getElementById('customLoginModal');
|
||||||
const login_closeBtn = document.getElementById('closeLoginModal');
|
const login_closeBtn = document.getElementById('closeLoginModal');
|
||||||
const login_loginBtn = document.getElementById('customLoginBtn');
|
const login_loginBtn = document.getElementById('customLoginBtn');
|
||||||
@@ -39,6 +40,7 @@ async function fetchCSRFToken() {
|
|||||||
login_modal.classList.add('show');
|
login_modal.classList.add('show');
|
||||||
login_loginBtn.disabled = true;
|
login_loginBtn.disabled = true;
|
||||||
login_loginBtn.textContent = '加载中...';
|
login_loginBtn.textContent = '加载中...';
|
||||||
|
closeLoading = cocoMessage.loading('正在加载署名信息...');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/login', { credentials: 'include' });
|
const response = await fetch('/login', { credentials: 'include' });
|
||||||
@@ -62,19 +64,23 @@ async function fetchCSRFToken() {
|
|||||||
publicKey = publicKeyMatch[1].replace(/\\\//g, '/');
|
publicKey = publicKeyMatch[1].replace(/\\\//g, '/');
|
||||||
return 'ok';
|
return 'ok';
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
closeLoading?.()
|
||||||
|
cocoMessage.error('署名信息加载失败,请刷新');
|
||||||
|
if (loginTimer) { clearInterval(loginTimer) }
|
||||||
|
login_loginBtn.textContent = '错误!请刷新';
|
||||||
|
login_loginBtn.disabled = true;
|
||||||
return 'error';
|
return 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开弹窗逻辑
|
// 打开弹窗逻辑
|
||||||
async function open_login_box() {
|
async function open_login_box() {
|
||||||
if (loginTimer) {
|
if (loginTimer) { clearInterval(loginTimer) }
|
||||||
clearInterval(loginTimer);
|
|
||||||
}
|
|
||||||
countdownSeconds = 3;
|
countdownSeconds = 3;
|
||||||
const success = await fetchCSRFToken();
|
const success = await fetchCSRFToken();
|
||||||
if (success === 'logged') {
|
if (success === 'logged') {
|
||||||
cocoMessage.success('您已经署名过了,请刷新');
|
closeLoading?.()
|
||||||
|
cocoMessage.success('您已署名成功,请刷新');
|
||||||
login_modal.classList.remove('show');
|
login_modal.classList.remove('show');
|
||||||
} else if (success === 'ok') {
|
} else if (success === 'ok') {
|
||||||
loginTimer = setInterval(() => {
|
loginTimer = setInterval(() => {
|
||||||
@@ -82,12 +88,15 @@ async function open_login_box() {
|
|||||||
login_loginBtn.textContent = '请稍等...' + countdownSeconds;
|
login_loginBtn.textContent = '请稍等...' + countdownSeconds;
|
||||||
} else {
|
} else {
|
||||||
clearInterval(loginTimer);
|
clearInterval(loginTimer);
|
||||||
|
closeLoading?.()
|
||||||
|
cocoMessage.success('署名信息加载完成');
|
||||||
login_loginBtn.textContent = '署 名';
|
login_loginBtn.textContent = '署 名';
|
||||||
login_loginBtn.disabled = false;
|
login_loginBtn.disabled = false;
|
||||||
}
|
}
|
||||||
countdownSeconds--;
|
countdownSeconds--;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.error('服务器错误,请刷新');
|
cocoMessage.error('服务器错误,请刷新');
|
||||||
login_modal.classList.remove('show');
|
login_modal.classList.remove('show');
|
||||||
}
|
}
|
||||||
@@ -95,7 +104,9 @@ async function open_login_box() {
|
|||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
login_closeBtn.addEventListener('click', () => {
|
login_closeBtn.addEventListener('click', () => {
|
||||||
|
closeLoading?.()
|
||||||
login_modal.classList.remove('show');
|
login_modal.classList.remove('show');
|
||||||
|
if (loginTimer) { clearInterval(loginTimer) }
|
||||||
});
|
});
|
||||||
|
|
||||||
// 加密逻辑
|
// 加密逻辑
|
||||||
@@ -111,6 +122,7 @@ function encryptPassword(password) {
|
|||||||
|
|
||||||
// 提交登录
|
// 提交登录
|
||||||
login_loginBtn.addEventListener('click', async () => {
|
login_loginBtn.addEventListener('click', async () => {
|
||||||
|
let islogin = false;
|
||||||
const username = document.getElementById('customUsername').value.trim();
|
const username = document.getElementById('customUsername').value.trim();
|
||||||
const password = document.getElementById('customPassword').value.trim();
|
const password = document.getElementById('customPassword').value.trim();
|
||||||
if (!username || !password) {
|
if (!username || !password) {
|
||||||
@@ -119,7 +131,9 @@ login_loginBtn.addEventListener('click', async () => {
|
|||||||
}
|
}
|
||||||
const encryptedPwd = encryptPassword(password);
|
const encryptedPwd = encryptPassword(password);
|
||||||
login_loginBtn.disabled = true;
|
login_loginBtn.disabled = true;
|
||||||
|
login_closeBtn.disabled = true;
|
||||||
login_loginBtn.textContent = '验证中...';
|
login_loginBtn.textContent = '验证中...';
|
||||||
|
closeLoading = cocoMessage.loading('正在验证信息...');
|
||||||
try {
|
try {
|
||||||
countdownSeconds = 3
|
countdownSeconds = 3
|
||||||
const response = await fetch('/login', {
|
const response = await fetch('/login', {
|
||||||
@@ -141,30 +155,43 @@ login_loginBtn.addEventListener('click', async () => {
|
|||||||
clearInterval(loginTimer);
|
clearInterval(loginTimer);
|
||||||
}
|
}
|
||||||
if (finalUrl.includes('/uc')) {
|
if (finalUrl.includes('/uc')) {
|
||||||
|
islogin = true;
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.success('署名成功,正在跳转...');
|
cocoMessage.success('署名成功,正在跳转...');
|
||||||
login_loginBtn.textContent = '跳转中...';
|
login_loginBtn.textContent = '跳转中...';
|
||||||
setTimeout(() => {
|
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||||
window.location.reload();
|
// $.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||||
}, 800);
|
// $.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')) {
|
} else if (finalUrl.includes('error=invalid-credential')) {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.warning('署名人与心上锁不匹配');
|
cocoMessage.warning('署名人与心上锁不匹配');
|
||||||
fetchCSRFToken();
|
|
||||||
} else {
|
} else {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.error('速度过快,请稍后重试');
|
cocoMessage.error('速度过快,请稍后重试');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.error('服务器连接失败');
|
cocoMessage.error('服务器连接失败');
|
||||||
} finally {
|
} finally {
|
||||||
loginTimer = setInterval(() => {
|
if (!islogin) {
|
||||||
if (countdownSeconds > 0) {
|
fetchCSRFToken();
|
||||||
login_loginBtn.textContent = '请稍等...' + countdownSeconds;
|
login_closeBtn.disabled = false;
|
||||||
} else {
|
loginTimer = setInterval(() => {
|
||||||
clearInterval(loginTimer);
|
if (countdownSeconds > 0) {
|
||||||
login_loginBtn.textContent = '署 名';
|
login_loginBtn.textContent = '请稍等...' + countdownSeconds;
|
||||||
login_loginBtn.disabled = false;
|
} else {
|
||||||
}
|
clearInterval(loginTimer);
|
||||||
countdownSeconds--;
|
closeLoading?.()
|
||||||
}, 1000);
|
cocoMessage.success('请重新尝试署名');
|
||||||
|
login_loginBtn.textContent = '署 名';
|
||||||
|
login_loginBtn.disabled = false;
|
||||||
|
}
|
||||||
|
countdownSeconds--;
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -181,6 +208,8 @@ document.addEventListener("keydown", function (e) {
|
|||||||
|
|
||||||
// 退出登录
|
// 退出登录
|
||||||
async function customLogout() {
|
async function customLogout() {
|
||||||
|
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', true);
|
||||||
|
let closeLoading = cocoMessage.loading('退出登录中...');
|
||||||
try {
|
try {
|
||||||
const getResponse = await fetch('/logout', { credentials: 'include' });
|
const getResponse = await fetch('/logout', { credentials: 'include' });
|
||||||
const htmlText = await getResponse.text();
|
const htmlText = await getResponse.text();
|
||||||
@@ -189,6 +218,8 @@ async function customLogout() {
|
|||||||
const logoutCsrfToken = doc.querySelector('input[name="_csrf"]')?.value;
|
const logoutCsrfToken = doc.querySelector('input[name="_csrf"]')?.value;
|
||||||
if (!logoutCsrfToken) {
|
if (!logoutCsrfToken) {
|
||||||
cocoMessage.error('页面未找到 CSRF 令牌');
|
cocoMessage.error('页面未找到 CSRF 令牌');
|
||||||
|
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
|
||||||
|
closeLoading();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const postResponse = await fetch('/logout', {
|
const postResponse = await fetch('/logout', {
|
||||||
@@ -202,20 +233,28 @@ async function customLogout() {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
if (postResponse.ok) {
|
if (postResponse.ok) {
|
||||||
|
closeLoading();
|
||||||
cocoMessage.success('您已成功退出登录');
|
cocoMessage.success('您已成功退出登录');
|
||||||
setTimeout(() => {
|
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||||
window.location.reload();
|
// $.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||||
}, 800);
|
// $.cookie('load_type', 'logout', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('scrollParam', currentScrollTop, { path: '/' });
|
||||||
|
$.cookie('load_type', 'logout', { path: '/' });
|
||||||
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
|
closeLoading();
|
||||||
|
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
|
||||||
throw new Error('退出请求被拒绝');
|
throw new Error('退出请求被拒绝');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
closeLoading();
|
||||||
|
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
|
||||||
console.error('Logout Error:', err);
|
console.error('Logout Error:', err);
|
||||||
cocoMessage.error('退出失败,请手动刷新页面');
|
cocoMessage.error('退出失败,请手动刷新页面');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPixarCard() {
|
function open_logout_box() {
|
||||||
const wrapper = document.getElementById("pixarNoticeWrapper");
|
const wrapper = document.getElementById("pixarNoticeWrapper");
|
||||||
wrapper.style.display = "flex";
|
wrapper.style.display = "flex";
|
||||||
}
|
}
|
||||||
@@ -229,7 +268,449 @@ function confirmPixarAction() {
|
|||||||
customLogout();
|
customLogout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 豆瓣页:分类筛选 + AJAX加载(不依赖 finder API)
|
||||||
|
function init_douban_page() {
|
||||||
|
var $page = $('.douban_page');
|
||||||
|
if ($page.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var $list = $('#douban_item');
|
||||||
|
var $pagination = $('#douban_pagination');
|
||||||
|
var $paginationBtn = $('#douban_pagination a');
|
||||||
|
|
||||||
|
if ($list.length === 0 || $paginationBtn.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var state = {
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
type: '',
|
||||||
|
loading: false
|
||||||
|
};
|
||||||
|
|
||||||
|
function escapeHtml(input) {
|
||||||
|
if (input === null || input === undefined) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return String(input)
|
||||||
|
.replace(/&/g, '&')
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>')
|
||||||
|
.replace(/"/g, '"')
|
||||||
|
.replace(/'/g, ''');
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatTime(isoTime) {
|
||||||
|
if (!isoTime) {
|
||||||
|
return '--';
|
||||||
|
}
|
||||||
|
var date = new Date(isoTime);
|
||||||
|
if (Number.isNaN(date.getTime())) {
|
||||||
|
return '--';
|
||||||
|
}
|
||||||
|
var year = date.getFullYear();
|
||||||
|
var month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
var day = String(date.getDate()).padStart(2, '0');
|
||||||
|
return year + '-' + month + '-' + day;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildRequestUrl(page, type) {
|
||||||
|
var query = new URLSearchParams({
|
||||||
|
page: String(page),
|
||||||
|
size: String(state.size)
|
||||||
|
});
|
||||||
|
if (type) {
|
||||||
|
query.append('type', type);
|
||||||
|
}
|
||||||
|
return '/apis/api.douban.moony.la/v1alpha1/doubanmovies?' + query.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderEmpty() {
|
||||||
|
return '<div class="loading_box"><img src="/upload/nodata.png" alt="暂无内容" style="max-width: 280px; width: 100%; height: auto;"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseScoreValue(rawScore) {
|
||||||
|
if (rawScore === null || rawScore === undefined || rawScore === '') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var scoreText = String(rawScore);
|
||||||
|
var matched = scoreText.match(/(\d+(?:\.\d+)?)/);
|
||||||
|
if (!matched || !matched[1]) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var scoreNumber = parseFloat(matched[1]);
|
||||||
|
if (Number.isNaN(scoreNumber)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (scoreNumber < 0) {
|
||||||
|
scoreNumber = 0;
|
||||||
|
}
|
||||||
|
if (scoreNumber > 5) {
|
||||||
|
scoreNumber = 5;
|
||||||
|
}
|
||||||
|
return scoreNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderTypeNav(typeList) {
|
||||||
|
var $navList = $('.douban_cat_nav ul');
|
||||||
|
if ($navList.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var navHtml = ['<li><a data-type="" class="cat-link active">全部<span></span></a></li>'];
|
||||||
|
var seen = {};
|
||||||
|
|
||||||
|
if (Array.isArray(typeList)) {
|
||||||
|
typeList.forEach(function (item) {
|
||||||
|
var key = item && item.key !== undefined && item.key !== null ? String(item.key).trim() : '';
|
||||||
|
if (!key || seen[key]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
seen[key] = true;
|
||||||
|
var safeKey = escapeHtml(key);
|
||||||
|
navHtml.push('<li><a data-type="' + safeKey + '" class="cat-link">' + safeKey + '<span></span></a></li>');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$navList.html(navHtml.join(''));
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderScore(rawScore) {
|
||||||
|
var scoreValue = parseScoreValue(rawScore);
|
||||||
|
if (scoreValue === null) {
|
||||||
|
return '暂无评分';
|
||||||
|
}
|
||||||
|
var formatted = scoreValue.toFixed(1);
|
||||||
|
return formatted + ' / 5.0';
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderItem(item) {
|
||||||
|
var spec = item && item.spec ? item.spec : {};
|
||||||
|
var faves = item && item.faves ? item.faves : {};
|
||||||
|
var name = escapeHtml(spec.name || '未命名条目');
|
||||||
|
var link = escapeHtml(spec.link || 'javascript:void(0);');
|
||||||
|
var poster = escapeHtml(spec.poster || '/themes/theme-pix/assets/img/theme/banner.jpg');
|
||||||
|
var rawScore = faves.score || spec.score || '';
|
||||||
|
var createTime = escapeHtml(formatTime(faves.createTime));
|
||||||
|
var dataType = escapeHtml(spec.type || '--');
|
||||||
|
var contentText = escapeHtml(spec.cardSubtitle || '暂无内容简介');
|
||||||
|
var pid = escapeHtml((item.metadata && item.metadata.name) || ('douban-' + Date.now()));
|
||||||
|
var scoreText = renderScore(rawScore);
|
||||||
|
|
||||||
|
return '' +
|
||||||
|
'<div id="post-' + pid + '" class="loop_content p_item moment_item douban_card_item uk-animation-slide-bottom-small">' +
|
||||||
|
' <div class="p_item_inner douban_card_inner">' +
|
||||||
|
' <div class="douban_text_col">' +
|
||||||
|
' <div class="douban_title_row">' +
|
||||||
|
' <a class="douban_title_text" target="_blank" rel="noopener" href="' + link + '">' +
|
||||||
|
' ' + name +
|
||||||
|
' </a>' +
|
||||||
|
' </div>' +
|
||||||
|
' <div class="douban_media_col">' +
|
||||||
|
' <img class="douban_poster_img" src="' + poster + '" alt="' + name + '">' +
|
||||||
|
' </div>' +
|
||||||
|
' <div class="douban_sub_meta">' +
|
||||||
|
' <time class="douban_time_text" datetime="' + createTime + '">' + createTime + '</time>' +
|
||||||
|
' <span class="douban_type_badge">' + dataType + '</span>' +
|
||||||
|
' <span class="douban_score_badge">' + escapeHtml(scoreText) + '</span>' +
|
||||||
|
' </div>' +
|
||||||
|
' <div class="douban_content_box">' +
|
||||||
|
' <p class="douban_content_main douban_content_collapsed" data-full="' + escapeHtml(contentText) + '">' + contentText + '</p>' +
|
||||||
|
' <a class="douban_expand_btn" style="display:none;">展开</a>' +
|
||||||
|
' </div>' +
|
||||||
|
' </div>' +
|
||||||
|
' </div>' +
|
||||||
|
'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePagination(hasNext, nextPage) {
|
||||||
|
if (hasNext) {
|
||||||
|
$paginationBtn
|
||||||
|
.attr('data-next-page', String(nextPage))
|
||||||
|
.attr('data', String(nextPage))
|
||||||
|
.text((window.Theme && Theme.site_page) ? Theme.site_page : '翻阅更多')
|
||||||
|
.show();
|
||||||
|
$pagination.removeClass('u-hide').css('display', 'flex');
|
||||||
|
} else {
|
||||||
|
$paginationBtn.removeAttr('data-next-page').removeAttr('data');
|
||||||
|
$paginationBtn.hide();
|
||||||
|
$pagination.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderList(data, isAppend) {
|
||||||
|
var items = (data && data.items) ? data.items : [];
|
||||||
|
if (!isAppend) {
|
||||||
|
$list.empty();
|
||||||
|
}
|
||||||
|
if (items.length === 0 && !isAppend) {
|
||||||
|
$list.html(renderEmpty());
|
||||||
|
updatePagination(false, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var html = items.map(renderItem).join('');
|
||||||
|
$list.append($(html).fadeIn(300));
|
||||||
|
if (typeof lazyLoadInstance !== 'undefined') {
|
||||||
|
lazyLoadInstance.update();
|
||||||
|
}
|
||||||
|
if (typeof initializeMomentFold === 'function') {
|
||||||
|
initializeMomentFold();
|
||||||
|
}
|
||||||
|
initializeDoubanExpand();
|
||||||
|
updatePagination(!!data.hasNext, (data.page || state.page) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function initializeDoubanExpand() {
|
||||||
|
var collapsedHeight = 89.6;
|
||||||
|
$(document).off('click.doubanExpand', '.douban_expand_btn').on('click.doubanExpand', '.douban_expand_btn', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var $btn = $(this);
|
||||||
|
var $content = $btn.prev('.douban_content_main');
|
||||||
|
if ($content.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($content.hasClass('is-expanded')) {
|
||||||
|
$content.removeClass('is-expanded');
|
||||||
|
$content.css('max-height', collapsedHeight + 'px');
|
||||||
|
$btn.text('展开');
|
||||||
|
} else {
|
||||||
|
var contentEl = $content[0];
|
||||||
|
var fullHeight = $content.data('fullHeight') || (contentEl ? contentEl.scrollHeight : 0);
|
||||||
|
$content.addClass('is-expanded');
|
||||||
|
$content.css('max-height', fullHeight + 'px');
|
||||||
|
$btn.text('收起');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.douban_content_main').each(function () {
|
||||||
|
var $content = $(this);
|
||||||
|
var $btn = $content.next('.douban_expand_btn');
|
||||||
|
if ($btn.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var scrollHeight = this.scrollHeight;
|
||||||
|
var clientHeight = this.clientHeight;
|
||||||
|
if (scrollHeight > clientHeight) {
|
||||||
|
$btn.show();
|
||||||
|
$content.data('fullHeight', scrollHeight);
|
||||||
|
$content.css('max-height', collapsedHeight + 'px');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestList(page, type, isAppend, hooks) {
|
||||||
|
hooks = hooks || {};
|
||||||
|
if (state.loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state.loading = true;
|
||||||
|
var appendStartIndex = isAppend ? $list.children('.p_item').length : 0;
|
||||||
|
var oldState = {
|
||||||
|
listHtml: $list.html(),
|
||||||
|
paginationVisible: $pagination.is(':visible'),
|
||||||
|
btnVisible: $paginationBtn.is(':visible'),
|
||||||
|
btnText: $paginationBtn.text(),
|
||||||
|
btnNextPage: $paginationBtn.attr('data-next-page')
|
||||||
|
};
|
||||||
|
var apiUrl = buildRequestUrl(page, type);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: apiUrl,
|
||||||
|
dataType: 'json',
|
||||||
|
beforeSend: function () {
|
||||||
|
if (!isAppend) {
|
||||||
|
$list.html('<div class="loading_box"><div uk-spinner></div></div>');
|
||||||
|
$pagination.hide();
|
||||||
|
} else {
|
||||||
|
$paginationBtn.hide();
|
||||||
|
if ($('#douban_pagination .douban-more-loading').length === 0) {
|
||||||
|
$('#douban_pagination .post-paging').append('<div class="douban-more-loading"><div uk-spinner></div></div>');
|
||||||
|
}
|
||||||
|
$pagination.css('display', 'flex');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
state.page = page;
|
||||||
|
renderList(data || {}, !!isAppend);
|
||||||
|
if (typeof hooks.onSuccess === 'function') {
|
||||||
|
hooks.onSuccess(data || {});
|
||||||
|
}
|
||||||
|
if (isAppend) {
|
||||||
|
var $newItems = $list.children('.p_item').slice(appendStartIndex);
|
||||||
|
if ($newItems.length > 0) {
|
||||||
|
var $scrollBody = (typeof $body !== 'undefined') ? $body : $('html,body');
|
||||||
|
var targetTop = $newItems.first().offset().top - 58;
|
||||||
|
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > targetTop)) {
|
||||||
|
$scrollBody.animate({ scrollTop: targetTop }, 500);
|
||||||
|
} else {
|
||||||
|
window.forceStopLoading = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
cocoMessage.error('数据获取失败');
|
||||||
|
if (!isAppend) {
|
||||||
|
if ($.trim(oldState.listHtml || '') !== '') {
|
||||||
|
$list.html(oldState.listHtml);
|
||||||
|
} else {
|
||||||
|
$list.html(renderEmpty());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (oldState.paginationVisible) {
|
||||||
|
$pagination.css('display', 'flex');
|
||||||
|
} else {
|
||||||
|
$pagination.hide();
|
||||||
|
}
|
||||||
|
if (oldState.btnVisible) {
|
||||||
|
$paginationBtn.show();
|
||||||
|
} else {
|
||||||
|
$paginationBtn.hide();
|
||||||
|
}
|
||||||
|
if (oldState.btnText) {
|
||||||
|
$paginationBtn.text(oldState.btnText);
|
||||||
|
}
|
||||||
|
if (oldState.btnNextPage) {
|
||||||
|
$paginationBtn.attr('data-next-page', oldState.btnNextPage);
|
||||||
|
$paginationBtn.attr('data', oldState.btnNextPage);
|
||||||
|
}
|
||||||
|
if (typeof hooks.onError === 'function') {
|
||||||
|
hooks.onError();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
state.loading = false;
|
||||||
|
$('#douban_pagination .douban-more-loading').remove();
|
||||||
|
$('.douban_cat_nav .cat-link').removeClass('disabled');
|
||||||
|
$paginationBtn.text((window.Theme && Theme.site_page) ? Theme.site_page : '翻阅更多');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).off('click.doubanCat', '.douban_cat_nav .cat-link').on('click.doubanCat', '.douban_cat_nav .cat-link', function () {
|
||||||
|
var $this = $(this);
|
||||||
|
if ($this.hasClass('disabled')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ($this.hasClass('active')) {
|
||||||
|
if (window._tagSwitchCallback) {
|
||||||
|
window._tagSwitchCallback.resolve();
|
||||||
|
window._tagSwitchCallback = null;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.douban_cat_nav .cat-link').addClass('disabled');
|
||||||
|
|
||||||
|
var $activeBefore = $('.douban_cat_nav .cat-link.active');
|
||||||
|
var oldType = state.type;
|
||||||
|
var targetType = $this.attr('data-type') || '';
|
||||||
|
var targetTag = $this.clone().find('span').remove().end().text().trim();
|
||||||
|
|
||||||
|
state.page = 1;
|
||||||
|
state.type = targetType;
|
||||||
|
|
||||||
|
requestList(1, state.type, false, {
|
||||||
|
onSuccess: function () {
|
||||||
|
$this.addClass('active').parent().siblings().children('.cat-link').removeClass('active');
|
||||||
|
|
||||||
|
var currentUrl = new URL(window.location.href);
|
||||||
|
if (!targetTag || targetTag === '全部') {
|
||||||
|
currentUrl.searchParams.delete('tag');
|
||||||
|
} else {
|
||||||
|
currentUrl.searchParams.set('tag', targetTag);
|
||||||
|
}
|
||||||
|
history.pushState({ url: currentUrl.pathname + currentUrl.search }, '', currentUrl.pathname + currentUrl.search);
|
||||||
|
|
||||||
|
// 分类切换后重置分页记录,避免自动恢复加载旧分类页数
|
||||||
|
$.removeCookie('page', { path: '/' });
|
||||||
|
|
||||||
|
if (window._tagSwitchCallback) {
|
||||||
|
window._tagSwitchCallback.resolve();
|
||||||
|
window._tagSwitchCallback = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onError: function () {
|
||||||
|
state.type = oldType;
|
||||||
|
if ($activeBefore.length > 0) {
|
||||||
|
$activeBefore.addClass('active').parent().siblings().children('.cat-link').removeClass('active');
|
||||||
|
}
|
||||||
|
if (window._tagSwitchCallback) {
|
||||||
|
window._tagSwitchCallback.reject();
|
||||||
|
window._tagSwitchCallback = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).off('click.doubanMore', '#douban_pagination a').on('click.doubanMore', '#douban_pagination a', function () {
|
||||||
|
if (state.loading) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var pageAttr = $(this).attr('data-next-page') || $(this).attr('data');
|
||||||
|
var nextPage = parseInt(pageAttr, 10);
|
||||||
|
if (!nextPage || Number.isNaN(nextPage)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
requestList(nextPage, state.type, true, {
|
||||||
|
onSuccess: function () {
|
||||||
|
// 与 app.js 现有逻辑保持一致:记录当前已加载到的页码
|
||||||
|
$.cookie('page', nextPage, { path: '/' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
function applyUrlTagState() {
|
||||||
|
var urlTag = new URLSearchParams(window.location.search).get('tag');
|
||||||
|
if (urlTag && urlTag.trim() !== '') {
|
||||||
|
var $matchedTag = $('.douban_cat_nav .cat-link').filter(function () {
|
||||||
|
var tagText = $(this).clone().find('span').remove().end().text().trim();
|
||||||
|
return tagText === urlTag;
|
||||||
|
}).first();
|
||||||
|
if ($matchedTag.length > 0) {
|
||||||
|
$matchedTag.addClass('active').parent().siblings().children('.cat-link').removeClass('active');
|
||||||
|
state.type = $matchedTag.attr('data-type') || '';
|
||||||
|
} else {
|
||||||
|
state.type = $('.douban_cat_nav .cat-link.active').attr('data-type') || '';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
state.type = $('.douban_cat_nav .cat-link.active').attr('data-type') || '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: '/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/types',
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
var typeList = Array.isArray(data) ? data : ((data && Array.isArray(data.items)) ? data.items : []);
|
||||||
|
renderTypeNav(typeList);
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
applyUrlTagState();
|
||||||
|
requestList(1, state.type, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开确认模态框
|
||||||
|
function openModal(title, msg, type) {
|
||||||
|
var modal = $('#momentsDeleteModal');
|
||||||
|
var card = modal.find('.moments-card-widget');
|
||||||
|
modal.find('.moments-title-text').text(title);
|
||||||
|
modal.find('.moments-message-text').text(msg);
|
||||||
|
card.removeClass('theme-red theme-yellow theme-green').addClass('theme-' + type);
|
||||||
|
$('.moments-btn-cancel, .moments-btn-confirm').prop('disabled', false);
|
||||||
|
$('body').off('click', '#momentsCancelBtn');
|
||||||
|
$('body').off('click', '#momentsConfirmBtn');
|
||||||
|
modal.fadeIn(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -244,6 +725,7 @@ function confirmPixarAction() {
|
|||||||
// 集合:PJAX(初始化执行+PJAX执行)
|
// 集合:PJAX(初始化执行+PJAX执行)
|
||||||
function init_anian_pjax() {
|
function init_anian_pjax() {
|
||||||
// modify_moment_video_size();
|
// modify_moment_video_size();
|
||||||
|
init_douban_page();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 集合:初始化(仅初始化执行一次)
|
// 集合:初始化(仅初始化执行一次)
|
||||||
|
|||||||
+337
-260
@@ -26,9 +26,9 @@ function highlightMenu() {
|
|||||||
|
|
||||||
// 获取清洗后的 pathname(去掉 ? 和 #)
|
// 获取清洗后的 pathname(去掉 ? 和 #)
|
||||||
function getPathname(url) {
|
function getPathname(url) {
|
||||||
const cleanUrl = url.substring(0,
|
const cleanUrl = url.substring(0,
|
||||||
url.indexOf('?') === -1
|
url.indexOf('?') === -1
|
||||||
? (url.indexOf('#') === -1 ? url.length : url.indexOf('#'))
|
? (url.indexOf('#') === -1 ? url.length : url.indexOf('#'))
|
||||||
: url.indexOf('?')
|
: url.indexOf('?')
|
||||||
)
|
)
|
||||||
return new URL(cleanUrl).pathname
|
return new URL(cleanUrl).pathname
|
||||||
@@ -133,25 +133,6 @@ cocoMessage.config({
|
|||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
|
|
||||||
//sortable事件 隐藏input
|
|
||||||
UIkit.util.on('.img_show', 'start', function (item) {
|
|
||||||
$(".up_img_btn").hide();
|
|
||||||
});
|
|
||||||
UIkit.util.on('.img_show', 'moved', function (item) {
|
|
||||||
var img_num = $('.add_img_box .t_media_item').length;
|
|
||||||
if (img_num < 9) {
|
|
||||||
$(".up_img_btn").show();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
UIkit.util.on('.img_show', 'stop', function (item) {
|
|
||||||
var img_num = $('.add_img_box .t_media_item').length;
|
|
||||||
if (img_num < 9) {
|
|
||||||
$(".up_img_btn").show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//ajax上传媒体文件到媒体库(已兼容图片/视频)
|
//ajax上传媒体文件到媒体库(已兼容图片/视频)
|
||||||
$(document).on('change', '#topic_img_up', function (e) {
|
$(document).on('change', '#topic_img_up', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -383,81 +364,13 @@ $(document).on('click', '.wp_get_media_list li', function () {
|
|||||||
//删除图片/视频(保留事件冒泡修复)
|
//删除图片/视频(保留事件冒泡修复)
|
||||||
$(document).on('click', '.topic-img-de', function (e) {
|
$(document).on('click', '.topic-img-de', function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
$(this).parent().remove();
|
||||||
var msg = "确认删除此媒体文件?";
|
|
||||||
if (confirm(msg)) {
|
|
||||||
$(this).parent().remove();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var num = $('.add_img_box .t_media_item').length;
|
var num = $('.add_img_box .t_media_item').length;
|
||||||
if (num < 9) {
|
if (num < 9) {
|
||||||
$("a.up_img_btn").show();
|
$("a.up_img_btn").show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 样式修复:3列布局 + 正方形显示(核心)
|
|
||||||
$(function () {
|
|
||||||
var style = `<style>
|
|
||||||
/* 媒体库视频封面:正方形显示,和图片一致 */
|
|
||||||
.media-video-thumb {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover; /* 裁剪为正方形,不拉伸 */
|
|
||||||
border: none;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
/* 媒体库li:适配3列,强制正方形 */
|
|
||||||
.wp_get_media_list li {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
width: calc(33.333% - 10px); /* 3列基础宽度 */
|
|
||||||
aspect-ratio: 1/1; /* 强制正方形(宽高比1:1) */
|
|
||||||
margin: 5px;
|
|
||||||
overflow: hidden; /* 裁剪超出部分 */
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 核心:.t_media_item 强制正方形 + 3列布局 */
|
|
||||||
.t_media_item {
|
|
||||||
position: relative !important;
|
|
||||||
display: inline-block !important;
|
|
||||||
width: calc(33.333% - 10px) !important; /* 3列宽度,和原有布局一致 */
|
|
||||||
aspect-ratio: 1/1 !important; /* 强制正方形,覆盖视频原比例 */
|
|
||||||
margin: 5px !important;
|
|
||||||
overflow: hidden !important; /* 裁剪超出的视频内容 */
|
|
||||||
vertical-align: top !important;
|
|
||||||
touch-action: none !important;
|
|
||||||
user-select: none !important;
|
|
||||||
}
|
|
||||||
/* 删除按钮:固定在正方形右上角 */
|
|
||||||
.t_media_item .topic-img-de {
|
|
||||||
position: absolute !important;
|
|
||||||
top: 5px !important;
|
|
||||||
right: 5px !important;
|
|
||||||
background: rgba(0,0,0,0.5) !important;
|
|
||||||
color: #fff !important;
|
|
||||||
width: 20px !important;
|
|
||||||
height: 20px !important;
|
|
||||||
border-radius: 50% !important;
|
|
||||||
display: flex !important;
|
|
||||||
align-items: center !important;
|
|
||||||
justify-content: center !important;
|
|
||||||
text-decoration: none !important;
|
|
||||||
z-index: 99 !important;
|
|
||||||
pointer-events: auto !important;
|
|
||||||
}
|
|
||||||
/* 视频/图片:裁剪为正方形,不拉伸 */
|
|
||||||
.t_media_item video, .t_media_item img {
|
|
||||||
width: 100% !important;
|
|
||||||
height: 100% !important;
|
|
||||||
object-fit: cover !important; /* 关键:裁剪多余部分,保持正方形 */
|
|
||||||
display: block !important;
|
|
||||||
}
|
|
||||||
</style>`;
|
|
||||||
$('head').append(style);
|
|
||||||
});
|
|
||||||
|
|
||||||
//插入外部图片链接
|
//插入外部图片链接
|
||||||
$(document).on('click', '.up_from_cdn a', function () {
|
$(document).on('click', '.up_from_cdn a', function () {
|
||||||
//$(".show_media_box .souqi").click();
|
//$(".show_media_box .souqi").click();
|
||||||
@@ -606,9 +519,8 @@ $(document).on('click', '.loca_text', function () {
|
|||||||
//发布更新瞬间
|
//发布更新瞬间
|
||||||
let isSubmittingMoment = false;
|
let isSubmittingMoment = false;
|
||||||
$(document).on('click', '.push_item', function () {
|
$(document).on('click', '.push_item', function () {
|
||||||
|
|
||||||
if (isSubmittingMoment) return false;
|
if (isSubmittingMoment) return false;
|
||||||
|
let closeLoading = null;
|
||||||
var content = $("#topic_content").val();
|
var content = $("#topic_content").val();
|
||||||
var catname = $(".t_cat_toogle span").text();
|
var catname = $(".t_cat_toogle span").text();
|
||||||
var loca = $(".loca_text").text();
|
var loca = $(".loca_text").text();
|
||||||
@@ -669,7 +581,8 @@ $(document).on('click', '.push_item', function () {
|
|||||||
pushData.metadata.annotations = { mylocal: loca };
|
pushData.metadata.annotations = { mylocal: loca };
|
||||||
}
|
}
|
||||||
|
|
||||||
cocoMessage.info("发布中..");
|
closeLoading = cocoMessage.loading('正在发布...');
|
||||||
|
$('.push_close, .push_item').prop('disabled', true);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -677,10 +590,18 @@ $(document).on('click', '.push_item', function () {
|
|||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
data: JSON.stringify(pushData),
|
data: JSON.stringify(pushData),
|
||||||
success() {
|
success() {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.success('发布成功!');
|
cocoMessage.success('发布成功!');
|
||||||
|
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||||
|
// $.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||||
|
// $.cookie('load_type', 'create', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('scrollParam', currentScrollTop, { path: '/' });
|
||||||
|
$.cookie('load_type', 'create', { path: '/' });
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
error() {
|
error() {
|
||||||
|
$('.push_close, .push_item').prop('disabled', false);
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.error('发布失败!');
|
cocoMessage.error('发布失败!');
|
||||||
release();
|
release();
|
||||||
}
|
}
|
||||||
@@ -717,7 +638,8 @@ $(document).on('click', '.push_item', function () {
|
|||||||
updateData.metadata.annotations = { mylocal: loca };
|
updateData.metadata.annotations = { mylocal: loca };
|
||||||
}
|
}
|
||||||
|
|
||||||
cocoMessage.info("更新中..");
|
closeLoading = cocoMessage.loading('正在更新...');
|
||||||
|
$('.push_close, .push_item').prop('disabled', true);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "PUT",
|
type: "PUT",
|
||||||
@@ -725,11 +647,19 @@ $(document).on('click', '.push_item', function () {
|
|||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
data: JSON.stringify(updateData),
|
data: JSON.stringify(updateData),
|
||||||
success() {
|
success() {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.success('更新成功!');
|
cocoMessage.success('更新成功!');
|
||||||
|
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||||
|
// $.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||||
|
// $.cookie('load_type', 'update', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('scrollParam', currentScrollTop, { path: '/' });
|
||||||
|
$.cookie('load_type', 'update', { path: '/' });
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
error() {
|
error() {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.error('更新失败!');
|
cocoMessage.error('更新失败!');
|
||||||
|
$('.push_close, .push_item').prop('disabled', false);
|
||||||
release();
|
release();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -922,7 +852,8 @@ $(document).on('click', '.moment_cat_nav ul li a', function () {
|
|||||||
history.pushState({ url: cat }, '', '/');
|
history.pushState({ url: cat }, '', '/');
|
||||||
}
|
}
|
||||||
if (!$.cookie('scrollParam')) {
|
if (!$.cookie('scrollParam')) {
|
||||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
// $.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.removeCookie('page', { path: '/' });
|
||||||
}
|
}
|
||||||
if (window._tagSwitchCallback) {
|
if (window._tagSwitchCallback) {
|
||||||
window._tagSwitchCallback.resolve(); // 标记成功
|
window._tagSwitchCallback.resolve(); // 标记成功
|
||||||
@@ -951,6 +882,9 @@ $(document).on('click', '.moment_cat_nav ul li a', function () {
|
|||||||
// ajax分类筛选朋友圈
|
// ajax分类筛选朋友圈
|
||||||
$(document).on('click', '.friends_cat_nav .cat-link', function () {
|
$(document).on('click', '.friends_cat_nav .cat-link', function () {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
if ($this.closest('.douban_cat_nav').length > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ($this.hasClass('disabled')) {
|
if ($this.hasClass('disabled')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -972,6 +906,10 @@ $(document).on('click', '.friends_cat_nav .cat-link', function () {
|
|||||||
|
|
||||||
// 获取目标 URL(注意这里用的是 data-href)
|
// 获取目标 URL(注意这里用的是 data-href)
|
||||||
var url = $this.attr('data-href');
|
var url = $this.attr('data-href');
|
||||||
|
if (!url) {
|
||||||
|
$('.friends_cat_nav .cat-link').removeClass('disabled');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@@ -1013,12 +951,15 @@ $(document).on('click', '.friends_cat_nav .cat-link', function () {
|
|||||||
initializeMomentFold();
|
initializeMomentFold();
|
||||||
|
|
||||||
// 更新浏览器历史状态
|
// 更新浏览器历史状态
|
||||||
url = url.replace('author', 'tag');
|
if (typeof url === 'string') {
|
||||||
history.pushState({ url: url }, '', url);
|
url = url.replace('author', 'tag');
|
||||||
|
history.pushState({ url: url }, '', url);
|
||||||
|
}
|
||||||
|
|
||||||
// 清除分页 cookie(保持原样)
|
// 清除分页 cookie(保持原样)
|
||||||
if (!$.cookie('scrollParam')) {
|
if (!$.cookie('scrollParam')) {
|
||||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
// $.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.removeCookie('page', { path: '/' });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window._tagSwitchCallback) {
|
if (window._tagSwitchCallback) {
|
||||||
@@ -1052,8 +993,6 @@ $(document).on('click', '#t_pagination a', function () {
|
|||||||
const currentPage = parseInt(href.match(/\d+/)[0]);
|
const currentPage = parseInt(href.match(/\d+/)[0]);
|
||||||
const $pagingArea = $('#t_pagination .post-paging');
|
const $pagingArea = $('#t_pagination .post-paging');
|
||||||
const originalPagingHtml = $pagingArea.html();
|
const originalPagingHtml = $pagingArea.html();
|
||||||
const isauto_loading = window.isAutoLoading
|
|
||||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@@ -1075,18 +1014,15 @@ $(document).on('click', '#t_pagination a', function () {
|
|||||||
} else {
|
} else {
|
||||||
$("#t_pagination a").hide();
|
$("#t_pagination a").hide();
|
||||||
}
|
}
|
||||||
if (isauto_loading) {
|
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > result.offset().top - 58)) {
|
||||||
if (window.scroll_param > result.offset().top - 58) {
|
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||||
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
} else window.forceStopLoading = true;
|
||||||
} else {
|
|
||||||
window.forceStopLoading = true;
|
|
||||||
}
|
|
||||||
} else $body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
|
||||||
getMomentAudio();
|
getMomentAudio();
|
||||||
initAgree();
|
initAgree();
|
||||||
lazyLoadInstance.update();
|
lazyLoadInstance.update();
|
||||||
initializeMomentFold();
|
initializeMomentFold();
|
||||||
$.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
// $.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('page', currentPage, { path: '/' });
|
||||||
} else {
|
} else {
|
||||||
$('#t_pagination a').hide();
|
$('#t_pagination a').hide();
|
||||||
}
|
}
|
||||||
@@ -1175,7 +1111,8 @@ $(document).ready(function () {
|
|||||||
history.pushState({ path: displayUrl }, '', displayUrl);
|
history.pushState({ path: displayUrl }, '', displayUrl);
|
||||||
|
|
||||||
if (!$.cookie('scrollParam')) {
|
if (!$.cookie('scrollParam')) {
|
||||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
// $.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.removeCookie('page', { path: '/' });
|
||||||
}
|
}
|
||||||
if (window._tagSwitchCallback) {
|
if (window._tagSwitchCallback) {
|
||||||
window._tagSwitchCallback.resolve(); // 标记成功
|
window._tagSwitchCallback.resolve(); // 标记成功
|
||||||
@@ -1214,8 +1151,6 @@ $(document).on('click', '#p_pagination a', function () {
|
|||||||
const $pagingArea = $('#p_pagination .post-paging');
|
const $pagingArea = $('#p_pagination .post-paging');
|
||||||
const originalPagingHtml = $pagingArea.html();
|
const originalPagingHtml = $pagingArea.html();
|
||||||
const targetOffsetTop = $('#p_pagination a').offset().top;
|
const targetOffsetTop = $('#p_pagination a').offset().top;
|
||||||
const isauto_loading = window.isAutoLoading
|
|
||||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: href,
|
url: href,
|
||||||
@@ -1234,15 +1169,12 @@ $(document).on('click', '#p_pagination a', function () {
|
|||||||
} else {
|
} else {
|
||||||
$("#p_pagination a").hide(); //如果没有下一页了,隐藏
|
$("#p_pagination a").hide(); //如果没有下一页了,隐藏
|
||||||
}
|
}
|
||||||
if (isauto_loading) {
|
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > targetOffsetTop - 358)) {
|
||||||
if (window.scroll_param > targetOffsetTop - 358) {
|
$body.animate({ scrollTop: targetOffsetTop - 358 }, 500);
|
||||||
$body.animate({ scrollTop: targetOffsetTop - 358 }, 500);
|
} else window.forceStopLoading = true;
|
||||||
} else {
|
|
||||||
window.forceStopLoading = true;
|
|
||||||
}
|
|
||||||
} else $body.animate({ scrollTop: targetOffsetTop - 358 }, 500);
|
|
||||||
pix.initGalleryPhotos();
|
pix.initGalleryPhotos();
|
||||||
$.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
// $.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('page', currentPage, { path: '/' });
|
||||||
} else {
|
} else {
|
||||||
$('#p_pagination a').hide();
|
$('#p_pagination a').hide();
|
||||||
}
|
}
|
||||||
@@ -1459,7 +1391,8 @@ $(document).on('click', '.posts_cat_nav ul li a', function (e) {
|
|||||||
}
|
}
|
||||||
history.pushState({ url: newUrl }, '', newUrl);
|
history.pushState({ url: newUrl }, '', newUrl);
|
||||||
if (!$.cookie('scrollParam')) {
|
if (!$.cookie('scrollParam')) {
|
||||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
// $.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.removeCookie('page', { path: '/'});
|
||||||
}
|
}
|
||||||
if (window._tagSwitchCallback) {
|
if (window._tagSwitchCallback) {
|
||||||
window._tagSwitchCallback.resolve(); // 标记成功
|
window._tagSwitchCallback.resolve(); // 标记成功
|
||||||
@@ -1492,8 +1425,6 @@ $('body').on('click', '#pagination a', function () {
|
|||||||
const originalPagingHtml = $pagingArea.html();
|
const originalPagingHtml = $pagingArea.html();
|
||||||
var href = $(this).attr('data');
|
var href = $(this).attr('data');
|
||||||
const currentPage = parseInt(href.match(/\d+/)[0]);
|
const currentPage = parseInt(href.match(/\d+/)[0]);
|
||||||
const isauto_loading = window.isAutoLoading
|
|
||||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: href,
|
url: href,
|
||||||
@@ -1519,16 +1450,13 @@ $('body').on('click', '#pagination a', function () {
|
|||||||
} else {
|
} else {
|
||||||
$("#pagination a").hide(); //如果没有下一页了,隐藏
|
$("#pagination a").hide(); //如果没有下一页了,隐藏
|
||||||
}
|
}
|
||||||
if (isauto_loading) {
|
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > result.offset().top - 58)) {
|
||||||
if (window.scroll_param > result.offset().top - 58) {
|
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||||
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
} else window.forceStopLoading = true;
|
||||||
} else {
|
|
||||||
window.forceStopLoading = true;
|
|
||||||
}
|
|
||||||
} else $body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
|
||||||
initAgree()
|
initAgree()
|
||||||
lazyLoadInstance.update();
|
lazyLoadInstance.update();
|
||||||
$.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
// $.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('page', currentPage, { path: '/' });
|
||||||
} else {
|
} else {
|
||||||
$("#pagination a").hide();
|
$("#pagination a").hide();
|
||||||
}
|
}
|
||||||
@@ -1548,8 +1476,6 @@ $('body').on('click', '.arc_pagenav a', function () {
|
|||||||
const $pagingArea = $('.arc_pagenav');
|
const $pagingArea = $('.arc_pagenav');
|
||||||
const originalPagingHtml = $pagingArea.html();
|
const originalPagingHtml = $pagingArea.html();
|
||||||
const postListElement = document.getElementById("post_item");
|
const postListElement = document.getElementById("post_item");
|
||||||
const isauto_loading = window.isAutoLoading
|
|
||||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
|
||||||
var href = $(this).attr('data');
|
var href = $(this).attr('data');
|
||||||
const currentPage = parseInt(href.match(/\d+/)[0]);
|
const currentPage = parseInt(href.match(/\d+/)[0]);
|
||||||
|
|
||||||
@@ -1579,18 +1505,14 @@ $('body').on('click', '.arc_pagenav a', function () {
|
|||||||
} else {
|
} else {
|
||||||
$(".arc_pagenav a").hide(); //如果没有下一页了,隐藏
|
$(".arc_pagenav a").hide(); //如果没有下一页了,隐藏
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.arc_pagenav .uk-spinner').remove();
|
$('.arc_pagenav .uk-spinner').remove();
|
||||||
if (isauto_loading) {
|
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > post.offset().top - 58)) {
|
||||||
if (window.scroll_param > post.offset().top - 58) {
|
$body.animate({ scrollTop: post.offset().top - 58 }, 500);
|
||||||
$body.animate({ scrollTop: post.offset().top - 58 }, 500);
|
} else window.forceStopLoading = true;
|
||||||
} else {
|
|
||||||
window.forceStopLoading = true;
|
|
||||||
}
|
|
||||||
} else $body.animate({ scrollTop: post.offset().top - 58 }, 500);
|
|
||||||
initAgree()
|
initAgree()
|
||||||
lazyLoadInstance.update();
|
lazyLoadInstance.update();
|
||||||
$.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
// $.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('page', currentPage, { path: '/' });
|
||||||
},
|
},
|
||||||
error: function () {
|
error: function () {
|
||||||
$pagingArea.html(originalPagingHtml);
|
$pagingArea.html(originalPagingHtml);
|
||||||
@@ -1698,7 +1620,8 @@ $('body').on('click', '.s_set_box a', function () {
|
|||||||
var type = $(this).attr('data');
|
var type = $(this).attr('data');
|
||||||
$(this).addClass('active').siblings('a').removeClass('active');
|
$(this).addClass('active').siblings('a').removeClass('active');
|
||||||
$('form#index_search input[type="hidden"]').val(type);
|
$('form#index_search input[type="hidden"]').val(type);
|
||||||
$.cookie('s_type', type, { expires: 30, path: '/', domain: 'anian.cc' });
|
// $.cookie('s_type', type, { expires: 30, path: '/', domain: 'anian.cc' });
|
||||||
|
$.cookie('s_type', type, { expires: 30, path: '/' });
|
||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('click', '.top_s_box a', function () {
|
$('body').on('click', '.top_s_box a', function () {
|
||||||
@@ -1713,9 +1636,11 @@ $('body').on('click', '.top_s_box a', function () {
|
|||||||
$('body').on('click', '.t_dark a', function () {
|
$('body').on('click', '.t_dark a', function () {
|
||||||
var t = $('html');
|
var t = $('html');
|
||||||
if (t.hasClass('dark')) {
|
if (t.hasClass('dark')) {
|
||||||
$.cookie('dark', 'normal', { path: '/', domain: 'anian.cc', expires: 30 });
|
// $.cookie('dark', 'normal', { path: '/', domain: 'anian.cc', expires: 30 });
|
||||||
|
$.cookie('dark', 'normal', { path: '/', expires: 30 });
|
||||||
} else {
|
} else {
|
||||||
$.cookie('dark', 'dark', { path: '/', domain: 'anian.cc', expires: 30 });
|
// $.cookie('dark', 'dark', { path: '/', domain: 'anian.cc', expires: 30 });
|
||||||
|
$.cookie('dark', 'dark', { path: '/', expires: 30 });
|
||||||
}
|
}
|
||||||
t.toggleClass('dark');
|
t.toggleClass('dark');
|
||||||
|
|
||||||
@@ -1760,22 +1685,32 @@ $('body').on('click', '.m_offcanvas', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 刷新内容(兼容一言和今日诗词API)
|
// 刷新内容(兼容一言和今日诗词API)
|
||||||
|
let yiyanLoading = false; // 标志是否正在请求
|
||||||
$('body').on('click', '.yiyan_box .change', function () {
|
$('body').on('click', '.yiyan_box .change', function () {
|
||||||
|
// 若请求还未恢复消息,直接return
|
||||||
|
if (yiyanLoading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
yiyanLoading = true; // 设置请求开始标志
|
||||||
var url = Theme.widget_yiyan.api || 'https://v1.hitokoto.cn';
|
var url = Theme.widget_yiyan.api || 'https://v1.hitokoto.cn';
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const targetElement = document.querySelector('.yiyan_box p');
|
const targetElement = document.querySelector('.yiyan_box p');
|
||||||
if (url.includes('jinrishici.com')) {
|
if (url.includes('api.anian.cc')) {
|
||||||
// 今日诗词API处理逻辑:标题添加《》
|
// 新增处理逻辑
|
||||||
targetElement.innerText = data.content;
|
targetElement.innerText = data.content || '一日不见如隔三秋';
|
||||||
targetElement.setAttribute("uk-tooltip", `《${data.origin}》${data.author}`);
|
const tooltipTitle = data.title || '失败:超时或发生错误';
|
||||||
|
targetElement.setAttribute("uk-tooltip", tooltipTitle === '失败:超时或发生错误' ? `${tooltipTitle}${data.author || ''}` : `《${tooltipTitle}》${data.author || ''}`);
|
||||||
} else {
|
} else {
|
||||||
// 原有一言API处理逻辑
|
// 原有一言API处理逻辑
|
||||||
targetElement.innerText = data.hitokoto;
|
targetElement.innerText = data.hitokoto || '一日不见如隔三秋';
|
||||||
targetElement.setAttribute("uk-tooltip", data.from);
|
targetElement.setAttribute("uk-tooltip", data.from || '失败:超时或发生错误');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.finally(() => {
|
||||||
|
yiyanLoading = false; // 请求完成,重置标志
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.yiyan_box .change').click();
|
$('.yiyan_box .change').click();
|
||||||
@@ -1807,7 +1742,8 @@ if (Theme.pjax) {
|
|||||||
initBlog();
|
initBlog();
|
||||||
refreshCommentWidget();
|
refreshCommentWidget();
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
// $.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.removeCookie('page', { path: '/' });
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2288,21 +2224,18 @@ function showCenterImage(imageUrl) {
|
|||||||
// 侧边栏农历信息显示函数
|
// 侧边栏农历信息显示函数
|
||||||
function anian_renderLunarUI() {
|
function anian_renderLunarUI() {
|
||||||
const textEl = document.getElementById('anianLunarText');
|
const textEl = document.getElementById('anianLunarText');
|
||||||
const cookieName = 'anian_lunar_info';
|
|
||||||
const defaultText = '一日不见如隔三秋';
|
|
||||||
const maxRetries = 20;
|
|
||||||
|
|
||||||
if (!textEl) return;
|
if (!textEl) return;
|
||||||
|
|
||||||
const doRender = (data) => {
|
const doRender = (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
textEl.innerHTML = defaultText;
|
textEl.innerHTML = '一日不见 · 如隔三秋';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { ganzhiYear = '', lunarMonth = '', lunarDay = '', jieqi = '', jijie = '', traditionalFestival = '' } = data;
|
const { ganzhiYear = '', lunarMonth = '', lunarDay = '', jieqi = '', jijie = '', traditionalFestival = '', shengxiao = '' } = data;
|
||||||
|
|
||||||
let text = `${ganzhiYear}年${lunarMonth}${lunarDay}`;
|
let text = `${ganzhiYear}${shengxiao}年 · ${lunarMonth}月${lunarDay}`;
|
||||||
const extra = [];
|
const extra = [];
|
||||||
if (jieqi) extra.push(jieqi);
|
if (jieqi) extra.push(jieqi);
|
||||||
if (traditionalFestival) extra.push(traditionalFestival);
|
if (traditionalFestival) extra.push(traditionalFestival);
|
||||||
@@ -2317,13 +2250,13 @@ function anian_renderLunarUI() {
|
|||||||
const tryRender = (attempt) => {
|
const tryRender = (attempt) => {
|
||||||
let data = null;
|
let data = null;
|
||||||
try {
|
try {
|
||||||
const cookieVal = anian_getCookie(cookieName);
|
const cookieVal = $.cookie('anian_lunar_info');
|
||||||
if (cookieVal) data = JSON.parse(cookieVal);
|
if (cookieVal) data = JSON.parse(cookieVal);
|
||||||
} catch (_) {}
|
} catch (_) { }
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
doRender(data);
|
doRender(data);
|
||||||
} else if (attempt < maxRetries) {
|
} else if (attempt < 20) {
|
||||||
setTimeout(() => tryRender(attempt + 1), 500);
|
setTimeout(() => tryRender(attempt + 1), 500);
|
||||||
} else {
|
} else {
|
||||||
doRender(null);
|
doRender(null);
|
||||||
@@ -2531,7 +2464,8 @@ function markAsRead(combinedDateStr) {
|
|||||||
const noticeBtn = document.getElementById('noticeBtn');
|
const noticeBtn = document.getElementById('noticeBtn');
|
||||||
if (!noticeBubble || !noticeBtn) return;
|
if (!noticeBubble || !noticeBtn) return;
|
||||||
|
|
||||||
$.cookie('latest_notice_date', combinedDateStr, { path: '/', domain: 'anian.cc', expires: 365 });
|
// $.cookie('latest_notice_date', combinedDateStr, { path: '/', domain: 'anian.cc', expires: 365 });
|
||||||
|
$.cookie('latest_notice_date', combinedDateStr, { path: '/', expires: 365 });
|
||||||
noticeBubble.classList.remove('show');
|
noticeBubble.classList.remove('show');
|
||||||
noticeBtn.classList.remove('has-notice');
|
noticeBtn.classList.remove('has-notice');
|
||||||
}
|
}
|
||||||
@@ -2579,6 +2513,7 @@ async function initNoticeTip() {
|
|||||||
if (hasUnread) {
|
if (hasUnread) {
|
||||||
noticeBubble.classList.add('show');
|
noticeBubble.classList.add('show');
|
||||||
noticeBtn.classList.add('has-notice');
|
noticeBtn.classList.add('has-notice');
|
||||||
|
$('.footer_menu a[href="/navigator"]').css('color', '#ecc94b').find('i').css('color', '#ecc94b');
|
||||||
} else {
|
} else {
|
||||||
noticeBubble.classList.remove('show');
|
noticeBubble.classList.remove('show');
|
||||||
noticeBtn.classList.remove('has-notice');
|
noticeBtn.classList.remove('has-notice');
|
||||||
@@ -2604,78 +2539,130 @@ function anianxSpeedMoveArrow(btn) {
|
|||||||
anianxSpeedBubble.style.setProperty("--anianx-arrow", center + "px");
|
anianxSpeedBubble.style.setProperty("--anianx-arrow", center + "px");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location.hostname === "anian.cc") {
|
function anianxSpeedSetTooltip(btn, text) {
|
||||||
anianxSpeedMainLine.classList.add("anianx-fixed");
|
if (!btn) return;
|
||||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
btn.setAttribute("title", text);
|
||||||
anianxSpeedBubbleText.innerText = "当前为主线路";
|
btn.setAttribute("uk-tooltip", "pos: top; offset: 2;");
|
||||||
anianxSpeedMoveArrow(anianxSpeedMainLine);
|
|
||||||
} else if (location.hostname === "www.anian.cc") {
|
|
||||||
anianxSpeedSubLine.classList.add("anianx-fixed");
|
|
||||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
|
||||||
anianxSpeedBubbleText.innerText = "当前为副线路";
|
|
||||||
anianxSpeedMoveArrow(anianxSpeedSubLine);
|
|
||||||
} else {
|
|
||||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
|
||||||
anianxSpeedBubbleText.innerText = "当前为测试线路";
|
|
||||||
anianxSpeedMoveArrow(anianxSpeedTestLine);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
anianxSpeedMainLine.addEventListener("click", () => {
|
function anianxSpeedClearTooltip(btn) {
|
||||||
if (anianxSpeedGlobalLock) return;
|
if (!btn) return;
|
||||||
anianxSpeedGlobalLock = true;
|
btn.removeAttribute("title");
|
||||||
if (anianxSpeedMainLine.classList.contains("anianx-fixed")) {
|
btn.removeAttribute("uk-tooltip");
|
||||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
}
|
||||||
anianxSpeedBubbleText.innerText = "当前为主线路";
|
|
||||||
anianxSpeedMoveArrow(anianxSpeedMainLine);
|
|
||||||
anianxSpeedGlobalLock = false;
|
|
||||||
} else {
|
|
||||||
anianxSpeedBubbleText.classList.add("anianx-loading");
|
|
||||||
anianxSpeedBubbleText.innerText = "正在切换至主线路";
|
|
||||||
anianxSpeedMoveArrow(anianxSpeedMainLine);
|
|
||||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
||||||
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
|
||||||
const finalUrl = anianxSpeedMainLine.dataset.anianxHref + location.pathname +
|
|
||||||
location.search + location.hash;
|
|
||||||
location.href = finalUrl;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
anianxSpeedSubLine.addEventListener("click", () => {
|
function anianxSpeedFetchLuckWithTimeout(timeout) {
|
||||||
if (anianxSpeedGlobalLock) return;
|
const controller = new AbortController();
|
||||||
anianxSpeedGlobalLock = true;
|
const timer = setTimeout(() => controller.abort(), timeout);
|
||||||
if (anianxSpeedSubLine.classList.contains("anianx-fixed")) {
|
|
||||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
|
||||||
anianxSpeedBubbleText.innerText = "当前为副线路";
|
|
||||||
anianxSpeedMoveArrow(anianxSpeedSubLine);
|
|
||||||
anianxSpeedGlobalLock = false;
|
|
||||||
} else {
|
|
||||||
anianxSpeedBubbleText.classList.add("anianx-loading");
|
|
||||||
anianxSpeedBubbleText.innerText = "正在切换至副线路";
|
|
||||||
anianxSpeedMoveArrow(anianxSpeedSubLine);
|
|
||||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
||||||
const baseUrl = anianxSpeedSubLine.dataset.anianxHref + location.pathname + location.search;
|
|
||||||
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
|
||||||
const finalUrl = baseUrl + location.hash;
|
|
||||||
location.href = finalUrl;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
anianxSpeedTestLine.addEventListener("click", () => {
|
return fetch("https://api.anian.cc/luck/api", {
|
||||||
if (anianxSpeedGlobalLock) return;
|
signal: controller.signal
|
||||||
anianxSpeedGlobalLock = true;
|
}).then(response => {
|
||||||
anianxSpeedBubbleText.classList.add("anianx-loading");
|
if (!response.ok) {
|
||||||
anianxSpeedBubbleText.innerText = "测速中";
|
throw new Error(`HTTP ${response.status}`);
|
||||||
anianxSpeedMoveArrow(anianxSpeedTestLine);
|
}
|
||||||
anianxSpeedTestWithTimeout(7500).then(result => {
|
return response.json();
|
||||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
|
||||||
anianxSpeedBubbleText.innerText = result;
|
|
||||||
}).catch(() => {
|
|
||||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
|
||||||
anianxSpeedBubbleText.innerText = "请检查网络或切换线路";
|
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
anianxSpeedGlobalLock = false;
|
clearTimeout(timer);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
function anianxSpeedBuildLuckTooltip(idText, poetryText, meaningText, explanationText) {
|
||||||
|
const signText = idText ? `第${idText}签。` : "第?签";
|
||||||
|
return [
|
||||||
|
signText,
|
||||||
|
poetryText || "",
|
||||||
|
meaningText || "",
|
||||||
|
explanationText || ""
|
||||||
|
].join("||  ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anianxSpeedMainLine) {
|
||||||
|
anianxSpeedMainLine.addEventListener("click", () => {
|
||||||
|
if (anianxSpeedGlobalLock) return;
|
||||||
|
anianxSpeedMoveArrow(anianxSpeedMainLine);
|
||||||
|
anianxSpeedGlobalLock = true;
|
||||||
|
anianxSpeedClearTooltip(anianxSpeedBubbleText);
|
||||||
|
anianxSpeedBubbleText.classList.add("anianx-loading");
|
||||||
|
anianxSpeedBubbleText.innerText = "抽取中";
|
||||||
|
|
||||||
|
const request = anianxSpeedFetchLuckWithTimeout(5000);
|
||||||
|
|
||||||
|
request.then(data => {
|
||||||
|
const result = data || {};
|
||||||
|
const typeText = result.type || "";
|
||||||
|
const titleText = result.title || "";
|
||||||
|
const idText = result.id || "";
|
||||||
|
const explanationText = result.explanation || "";
|
||||||
|
const poetryText = result.poetry || "";
|
||||||
|
const meaningText = result.meaning || "";
|
||||||
|
anianxSpeedBubbleText.innerText = [typeText, titleText].filter(Boolean).join(" · ") || "失败:超时或发生错误";
|
||||||
|
anianxSpeedSetTooltip(anianxSpeedBubbleText, anianxSpeedBuildLuckTooltip(idText, poetryText, meaningText, explanationText));
|
||||||
|
}).catch(() => {
|
||||||
|
anianxSpeedClearTooltip(anianxSpeedBubbleText);
|
||||||
|
anianxSpeedBubbleText.innerText = "失败:超时或发生错误";
|
||||||
|
}).finally(() => {
|
||||||
|
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||||
|
anianxSpeedGlobalLock = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anianxSpeedTestLine) {
|
||||||
|
anianxSpeedTestLine.addEventListener("click", () => {
|
||||||
|
if (anianxSpeedGlobalLock) return;
|
||||||
|
anianxSpeedMoveArrow(anianxSpeedTestLine);
|
||||||
|
anianxSpeedGlobalLock = true;
|
||||||
|
anianxSpeedClearTooltip(anianxSpeedBubbleText);
|
||||||
|
anianxSpeedBubbleText.classList.add("anianx-loading");
|
||||||
|
anianxSpeedBubbleText.innerText = "测速中";
|
||||||
|
Promise.all([
|
||||||
|
anianxSpeedTestWithTimeout(10000),
|
||||||
|
anianxSpeedFetchIpWithTimeout(5000)
|
||||||
|
]).then(([speedResult, ipResult]) => {
|
||||||
|
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||||
|
anianxSpeedBubbleText.innerText = speedResult;
|
||||||
|
const tooltipText = anianxSpeedBuildIpTooltip(ipResult);
|
||||||
|
anianxSpeedSetTooltip(anianxSpeedBubbleText, tooltipText);
|
||||||
|
}).catch(() => {
|
||||||
|
anianxSpeedClearTooltip(anianxSpeedBubbleText);
|
||||||
|
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||||
|
anianxSpeedBubbleText.innerText = "失败:超时或发生错误";
|
||||||
|
}).finally(() => {
|
||||||
|
anianxSpeedGlobalLock = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anianxSpeedSubLine) {
|
||||||
|
anianxSpeedSubLine.addEventListener("click", () => {
|
||||||
|
if (anianxSpeedGlobalLock) return;
|
||||||
|
anianxSpeedMoveArrow(anianxSpeedSubLine);
|
||||||
|
anianxSpeedGlobalLock = true;
|
||||||
|
anianxSpeedClearTooltip(anianxSpeedBubbleText);
|
||||||
|
anianxSpeedBubbleText.classList.add("anianx-loading");
|
||||||
|
anianxSpeedBubbleText.innerText = "加载中";
|
||||||
|
|
||||||
|
anianxSpeedFetchXiehouyuWithTimeout(5000).then(data => {
|
||||||
|
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||||
|
if (data && data.riddle) {
|
||||||
|
anianxSpeedBubbleText.innerText = data.riddle;
|
||||||
|
// 设置tooltip显示答案
|
||||||
|
const tooltipText = data.answer || "失败:超时或发生错误";
|
||||||
|
anianxSpeedSetTooltip(anianxSpeedBubbleText, tooltipText);
|
||||||
|
} else {
|
||||||
|
anianxSpeedClearTooltip(anianxSpeedBubbleText);
|
||||||
|
anianxSpeedBubbleText.innerText = "失败:超时或发生错误";
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
anianxSpeedClearTooltip(anianxSpeedBubbleText);
|
||||||
|
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||||
|
anianxSpeedBubbleText.innerText = "失败:超时或发生错误";
|
||||||
|
}).finally(() => {
|
||||||
|
anianxSpeedGlobalLock = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function anianxSpeedTestWithTimeout(timeout) {
|
function anianxSpeedTestWithTimeout(timeout) {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
@@ -2691,7 +2678,7 @@ function anianxSpeedTestWithTimeout(timeout) {
|
|||||||
const sec = (Date.now() - t0) / 1000;
|
const sec = (Date.now() - t0) / 1000;
|
||||||
const mbps = ((size * 8) / (sec * 1024 * 1024)).toFixed(2);
|
const mbps = ((size * 8) / (sec * 1024 * 1024)).toFixed(2);
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
resolve("正常:" + mbps + " Mbps");
|
resolve("访问速率:" + mbps + " Mbps");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
reject(e);
|
reject(e);
|
||||||
@@ -2699,6 +2686,68 @@ function anianxSpeedTestWithTimeout(timeout) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function anianxSpeedFetchIpWithTimeout(timeout) {
|
||||||
|
const controller = new AbortController();
|
||||||
|
const timer = setTimeout(() => controller.abort(), timeout);
|
||||||
|
|
||||||
|
return fetch("https://api.anian.cc/ip/api", {
|
||||||
|
signal: controller.signal
|
||||||
|
}).then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP ${response.status}`);
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}).then(data => {
|
||||||
|
clearTimeout(timer);
|
||||||
|
return {
|
||||||
|
ip: data.ip || "",
|
||||||
|
region: data.region || ""
|
||||||
|
};
|
||||||
|
}).catch(e => {
|
||||||
|
clearTimeout(timer);
|
||||||
|
return {
|
||||||
|
ip: "",
|
||||||
|
region: ""
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function anianxSpeedBuildIpTooltip(ipInfo) {
|
||||||
|
if (!ipInfo || (!ipInfo.ip && !ipInfo.region)) {
|
||||||
|
return "失败:超时或发生错误";
|
||||||
|
}
|
||||||
|
|
||||||
|
const lines = [];
|
||||||
|
if (ipInfo.ip) {
|
||||||
|
lines.push(`IP地址: ${ipInfo.ip}`);
|
||||||
|
}
|
||||||
|
if (ipInfo.region) {
|
||||||
|
lines.push(`<br>${ipInfo.region}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return lines.join("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
function anianxSpeedFetchXiehouyuWithTimeout(timeout) {
|
||||||
|
const controller = new AbortController();
|
||||||
|
const timer = setTimeout(() => controller.abort(), timeout);
|
||||||
|
|
||||||
|
return fetch("https://api.anian.cc/riddle/api", {
|
||||||
|
signal: controller.signal
|
||||||
|
}).then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP ${response.status}`);
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
}).then(data => {
|
||||||
|
clearTimeout(timer);
|
||||||
|
return data;
|
||||||
|
}).catch(e => {
|
||||||
|
clearTimeout(timer);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function initTagSwitch() {
|
function initTagSwitch() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -2731,6 +2780,11 @@ function initTagSwitch() {
|
|||||||
const linkText = $(this).clone().find('span').remove().end().text().trim();
|
const linkText = $(this).clone().find('span').remove().end().text().trim();
|
||||||
return linkText === activeTag;
|
return linkText === activeTag;
|
||||||
});
|
});
|
||||||
|
} else if (pathname === '/douban') {
|
||||||
|
targetLink = $('.douban_cat_nav ul li a').filter(function () {
|
||||||
|
const linkText = $(this).clone().find('span').remove().end().text().trim();
|
||||||
|
return linkText === activeTag;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetLink.length > 0) {
|
if (targetLink.length > 0) {
|
||||||
@@ -2744,10 +2798,12 @@ function initTagSwitch() {
|
|||||||
|
|
||||||
// 1. 定义一个全局标志位,用于外部强制终止
|
// 1. 定义一个全局标志位,用于外部强制终止
|
||||||
window.forceStopLoading = false;
|
window.forceStopLoading = false;
|
||||||
window.isAutoLoading = false;
|
window.loadMoreTimeout = false;
|
||||||
function loadMultiplePages(pageCount) {
|
function loadMultiplePages(pageCount) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
let loadedCount = 0;
|
let loadedCount = 0;
|
||||||
|
const bootstrapStartTime = Date.now();
|
||||||
|
const bootstrapTimeout = 10000;
|
||||||
window.forceStopLoading = false; // 每次启动重置标志位
|
window.forceStopLoading = false; // 每次启动重置标志位
|
||||||
|
|
||||||
const getCurrentBtn = () => {
|
const getCurrentBtn = () => {
|
||||||
@@ -2766,17 +2822,20 @@ function loadMultiplePages(pageCount) {
|
|||||||
|
|
||||||
const $btn = getCurrentBtn();
|
const $btn = getCurrentBtn();
|
||||||
if (!$btn || !$btn.length) {
|
if (!$btn || !$btn.length) {
|
||||||
|
// 慢网下分页按钮可能尚未渲染,短暂等待后再尝试
|
||||||
|
if (Date.now() - bootstrapStartTime < bootstrapTimeout) {
|
||||||
|
setTimeout(loadNext, 120);
|
||||||
|
return;
|
||||||
|
}
|
||||||
resolve();
|
resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const $pager = $btn.closest('.post-paging');
|
const $pager = $btn.closest('.post-paging');
|
||||||
const oldHref = $btn.attr('data');
|
const oldHref = $btn.attr('data');
|
||||||
|
|
||||||
window.isAutoLoading = true;
|
|
||||||
|
|
||||||
const pageStartTime = Date.now();
|
const pageStartTime = Date.now();
|
||||||
$btn.trigger('click'); // 加载更多
|
$btn.trigger('click'); // 加载更多
|
||||||
|
// console.log(`正在加载第 ${loadedCount + 1} 页,URL: ${oldHref}`);
|
||||||
|
|
||||||
const waitInterval = setInterval(() => {
|
const waitInterval = setInterval(() => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
@@ -2786,8 +2845,9 @@ function loadMultiplePages(pageCount) {
|
|||||||
resolve();
|
resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (now - pageStartTime > 2000) {
|
if (now - pageStartTime > 3000) {
|
||||||
clearInterval(waitInterval);
|
clearInterval(waitInterval);
|
||||||
|
window.loadMoreTimeout = true;
|
||||||
resolve(); // 解决 Promise,触发后续滚动
|
resolve(); // 解决 Promise,触发后续滚动
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2813,42 +2873,59 @@ function loadMultiplePages(pageCount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initjump() {
|
function initjump() {
|
||||||
|
let closeLoading = null;
|
||||||
|
const page = $.cookie('page');
|
||||||
|
const scrollParam = $.cookie('scrollParam');
|
||||||
|
const loadType = $.cookie('load_type')
|
||||||
|
const hasValidPage = page && !isNaN(page);
|
||||||
|
const hasValidScroll = scrollParam && !isNaN(scrollParam);
|
||||||
|
const shouldLoadAndScroll = hasValidPage && hasValidScroll;
|
||||||
|
// $.removeCookie('scrollParam', { path: '/', domain: 'anian.cc' });
|
||||||
|
// $.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||||
|
// $.removeCookie('load_type', { path: '/', domain: 'anian.cc' });
|
||||||
|
$.removeCookie('scrollParam', { path: '/' });
|
||||||
|
$.removeCookie('page', { path: '/' });
|
||||||
|
$.removeCookie('load_type', { path: '/' });
|
||||||
|
window.scroll_param = scrollParam;
|
||||||
|
if (hasValidScroll) {
|
||||||
|
closeLoading = cocoMessage.loading('自动恢复原内容中...');
|
||||||
|
}
|
||||||
initTagSwitch().then(() => {
|
initTagSwitch().then(() => {
|
||||||
const page = $.cookie('page');
|
|
||||||
const scrollParam = $.cookie('scrollParam');
|
|
||||||
$.removeCookie('scrollParam', { path: '/', domain: 'anian.cc' });
|
|
||||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
|
||||||
window.scroll_param = scrollParam;
|
|
||||||
|
|
||||||
const loadPageTask = () => {
|
const loadPageTask = () => {
|
||||||
if (page && !isNaN(page)) {
|
if (shouldLoadAndScroll) {
|
||||||
const targetPage = Number(page) - 1;
|
const targetPage = Number(page) - 1;
|
||||||
return loadMultiplePages(targetPage);
|
return loadMultiplePages(targetPage);
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
};
|
};
|
||||||
|
loadPageTask().then(() => {
|
||||||
if (scrollParam && !isNaN(scrollParam)) {
|
closeLoading?.()
|
||||||
const closeLoading = cocoMessage.loading('自动恢复原线路内容中...');
|
if (hasValidScroll) {
|
||||||
loadPageTask().then(() => {
|
|
||||||
// 执行滚动逻辑
|
|
||||||
const recordScroll = Number(scrollParam);
|
const recordScroll = Number(scrollParam);
|
||||||
const maxScroll = document.documentElement.scrollHeight - window.innerHeight;
|
const maxScroll = document.documentElement.scrollHeight - window.innerHeight;
|
||||||
const scrollDistance = Math.min(recordScroll, maxScroll);
|
const scrollDistance = Math.min(recordScroll, maxScroll);
|
||||||
|
|
||||||
$('html, body').animate({ scrollTop: scrollDistance }, 500);
|
$('html, body').animate({ scrollTop: scrollDistance }, 500);
|
||||||
|
switch (loadType) {
|
||||||
if (recordScroll > maxScroll && (recordScroll - maxScroll) > 200) {
|
case 'create':
|
||||||
closeLoading();
|
cocoMessage.success('发布成功!');
|
||||||
cocoMessage.warning('请手动加载原线路内容');
|
break;
|
||||||
} else {
|
case 'update':
|
||||||
const msg = location.hostname === "anian.cc" ? '主线路' : (location.hostname === "www.anian.cc" ? '副线路' : '测试线路');
|
cocoMessage.success('更新成功!');
|
||||||
closeLoading();
|
break;
|
||||||
cocoMessage.success(`已成功切换至${msg}`);
|
case 'login':
|
||||||
|
cocoMessage.success('登录成功!');
|
||||||
|
break;
|
||||||
|
case 'logout':
|
||||||
|
cocoMessage.success('登出成功!');
|
||||||
|
break;
|
||||||
|
// default:
|
||||||
|
// const line_msg = location.hostname === "anian.cc" ? '主线路' : (location.hostname === "www.anian.cc" ? '副线路' : '测试线路');
|
||||||
|
// cocoMessage.success('已成功切换至' + line_msg);
|
||||||
}
|
}
|
||||||
});
|
if (recordScroll > maxScroll && (recordScroll - maxScroll) > 200) { cocoMessage.warning('请手动加载原内容'); }
|
||||||
}
|
}
|
||||||
});
|
}).catch(() => closeLoading?.());
|
||||||
|
}).catch(() => closeLoading?.());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2867,7 +2944,7 @@ async function handleSubscribe(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
show("正在提交…");
|
show("正在提交...");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
@@ -2926,7 +3003,7 @@ function initBlog() {
|
|||||||
syncFooterWithAudioState(),
|
syncFooterWithAudioState(),
|
||||||
highlightMenu(),
|
highlightMenu(),
|
||||||
initializeMomentFold()
|
initializeMomentFold()
|
||||||
// nextBanner()
|
// nextBanner()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+154
-136
@@ -1,13 +1,13 @@
|
|||||||
main_content = $('.moment_type_main');
|
main_content = $('.moment_type_main');
|
||||||
function remove_image_temp(){
|
function remove_image_temp() {
|
||||||
if(!$('.image_edit_temp .add_img_box').length > 0){
|
if (!$('.image_edit_temp .add_img_box').length > 0) {
|
||||||
var temp = $('.add_img_box');
|
var temp = $('.add_img_box');
|
||||||
$('.image_edit_temp').html(temp);
|
$('.image_edit_temp').html(temp);
|
||||||
}
|
}
|
||||||
main_content.empty();
|
main_content.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
function back_image_temp(){
|
function back_image_temp() {
|
||||||
var temp = $('.add_img_box');
|
var temp = $('.add_img_box');
|
||||||
main_content.html(temp);
|
main_content.html(temp);
|
||||||
$('.image_edit_temp').empty();
|
$('.image_edit_temp').empty();
|
||||||
@@ -58,7 +58,7 @@ $('body').on('click', '.edit_content .push_card', function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function card_post(card_url){
|
function card_post(card_url) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: `/apis/api.console.halo.run/v1alpha1/posts?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
url: `/apis/api.console.halo.run/v1alpha1/posts?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
||||||
@@ -68,12 +68,12 @@ function card_post(card_url){
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('.edit_card_box .edit_content input').val('');
|
$('.edit_card_box .edit_content input').val('');
|
||||||
if (data.total > 0) {
|
if (data.total > 0) {
|
||||||
if(data.total>1){
|
if (data.total > 1) {
|
||||||
cocoMessage.error('当前搜索的文章有多个无法选择');
|
cocoMessage.error('当前搜索的文章有多个无法选择');
|
||||||
}else{
|
} else {
|
||||||
var item = data.items[0]
|
var item = data.items[0]
|
||||||
$('.show_card').show();
|
$('.show_card').show();
|
||||||
$('.card_sortble').append(getcard(item.post.metadata.name,item.post.spec.cover,item.post.spec.title,'post'));
|
$('.card_sortble').append(getcard(item.post.metadata.name, item.post.spec.cover, item.post.spec.title, 'post'));
|
||||||
cocoMessage.success('已生成卡片');
|
cocoMessage.success('已生成卡片');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ function card_post(card_url){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function edit_page(card_url){
|
function edit_page(card_url) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: `/apis/api.console.halo.run/v1alpha1/singlepages?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
url: `/apis/api.console.halo.run/v1alpha1/singlepages?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
||||||
@@ -96,12 +96,12 @@ function edit_page(card_url){
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('.edit_card_box .edit_content input').val('');
|
$('.edit_card_box .edit_content input').val('');
|
||||||
if (data.total > 0) {
|
if (data.total > 0) {
|
||||||
if(data.total>1){
|
if (data.total > 1) {
|
||||||
cocoMessage.error('当前搜索的页面有多个无法选择');
|
cocoMessage.error('当前搜索的页面有多个无法选择');
|
||||||
}else{
|
} else {
|
||||||
var item = data.items[0]
|
var item = data.items[0]
|
||||||
$('.show_card').show();
|
$('.show_card').show();
|
||||||
$('.card_sortble').append(getcard(item.page.metadata.name,item.page.spec.cover,item.page.spec.title,'page'));
|
$('.card_sortble').append(getcard(item.page.metadata.name, item.page.spec.cover, item.page.spec.title, 'page'));
|
||||||
cocoMessage.success('已生成卡片');
|
cocoMessage.success('已生成卡片');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ function edit_page(card_url){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getcard(name,cover,title,type){
|
function getcard(name, cover, title, type) {
|
||||||
|
|
||||||
return `<div class="moment_card_item" pid="${name}" type="${type}">
|
return `<div class="moment_card_item" pid="${name}" type="${type}">
|
||||||
<a>
|
<a>
|
||||||
@@ -127,31 +127,25 @@ function getcard(name,cover,title,type){
|
|||||||
</div>`
|
</div>`
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('click', '.de_card', function() {
|
$(document).on('click', '.de_card', function () {
|
||||||
var msg = "确认删除此卡片?";
|
|
||||||
var num = $('.moment_card_item').length;
|
var num = $('.moment_card_item').length;
|
||||||
if (confirm(msg)==true){
|
$(this).parents('.moment_card_item').remove();
|
||||||
$(this).parents('.moment_card_item').remove();
|
if (num == 1) {
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(num == 1){
|
|
||||||
$(".show_card").hide();
|
$(".show_card").hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//图文编辑 返回图文编辑区域
|
//图文编辑 返回图文编辑区域
|
||||||
$('body').on('click', '.moment_image_type a', function() {
|
$('body').on('click', '.moment_image_type a', function () {
|
||||||
back_image_temp();
|
back_image_temp();
|
||||||
$('.push_item').attr('type','image');
|
$('.push_item').attr('type', 'image');
|
||||||
});
|
});
|
||||||
|
|
||||||
//发布音乐--------------------------------------------------------------
|
//发布音乐--------------------------------------------------------------
|
||||||
$('body').on('click', '.moment_audio_type a', function() {
|
$('body').on('click', '.moment_audio_type a', function () {
|
||||||
$('.push_item').attr('type','audio');
|
$('.push_item').attr('type', 'audio');
|
||||||
main_content = $('.moment_type_main');
|
main_content = $('.moment_type_main');
|
||||||
if($('.add_audio_box').length > 0){
|
if ($('.add_audio_box').length > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
remove_image_temp();
|
remove_image_temp();
|
||||||
@@ -180,57 +174,57 @@ $('body').on('click', '.moment_audio_type a', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//音乐和视频上传
|
//音乐和视频上传
|
||||||
$(document).on('change','#moment_img_up',function(){
|
$(document).on('change', '#moment_img_up', function () {
|
||||||
if($('#moment_img_up').val() == '')
|
if ($('#moment_img_up').val() == '')
|
||||||
return;
|
return;
|
||||||
var f = this.files[0];
|
var f = this.files[0];
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
formData.append('file',f);
|
formData.append('file', f);
|
||||||
const policyName = Theme.moments.policy_name;
|
const policyName = Theme.moments.policy_name;
|
||||||
const groupName = Theme.moments.group_name;
|
const groupName = Theme.moments.group_name;
|
||||||
policyName && formData.append('policyName',policyName)
|
policyName && formData.append('policyName', policyName)
|
||||||
groupName && formData.append('groupName',groupName)
|
groupName && formData.append('groupName', groupName)
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: `${Theme.moments.attachments_upload_api}`,
|
url: `${Theme.moments.attachments_upload_api}`,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: formData,
|
data: formData,
|
||||||
processData : false,
|
processData: false,
|
||||||
contentType : false,
|
contentType: false,
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
cocoMessage.info('上传中...');
|
cocoMessage.info('上传中...');
|
||||||
$('.m_media_left i').remove();
|
$('.m_media_left i').remove();
|
||||||
$('.m_media_left').append("<div class='up_loading' uk-spinner='ratio: .6'></div>");
|
$('.m_media_left').append("<div class='up_loading' uk-spinner='ratio: .6'></div>");
|
||||||
var imged = $('.m_media_left img');
|
var imged = $('.m_media_left img');
|
||||||
if(imged.length > 0){
|
if (imged.length > 0) {
|
||||||
imged.remove();
|
imged.remove();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
success: function(data){
|
success: function (data) {
|
||||||
var thum = data.metadata.annotations["storage.halo.run/uri"] || data.metadata.annotations["storage.halo.run/external-link"]
|
var thum = data.metadata.annotations["storage.halo.run/uri"] || data.metadata.annotations["storage.halo.run/external-link"]
|
||||||
$('.m_media_left .up_loading').remove();
|
$('.m_media_left .up_loading').remove();
|
||||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="'+thum+'">');
|
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="' + thum + '">');
|
||||||
cocoMessage.success('上传成功');
|
cocoMessage.success('上传成功');
|
||||||
$('input#moment_video_url').val(thum)
|
$('input#moment_video_url').val(thum)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('click', '.audio_choose a', function() {
|
$('body').on('click', '.audio_choose a', function () {
|
||||||
var text = '# 请插入封面,歌名以及歌曲外链';
|
var text = '# 请插入封面,歌名以及歌曲外链';
|
||||||
var type = $(this).attr('au_type');
|
var type = $(this).attr('au_type');
|
||||||
if(type != 'local'){
|
if (type != 'local') {
|
||||||
var text = '# 请输入歌曲ID';
|
var text = '# 请输入歌曲ID';
|
||||||
}
|
}
|
||||||
$('.edit_audio_box .tips').text(text);
|
$('.edit_audio_box .tips').text(text);
|
||||||
});
|
});
|
||||||
|
|
||||||
//发布视频--------------------------------------------------------------
|
//发布视频--------------------------------------------------------------
|
||||||
$('body').on('click', '.moment_video_type a', function() {
|
$('body').on('click', '.moment_video_type a', function () {
|
||||||
$('.push_item').attr('type','video');
|
$('.push_item').attr('type', 'video');
|
||||||
main_content = $('.moment_type_main');
|
main_content = $('.moment_type_main');
|
||||||
if($('.add_video_box').length > 0){
|
if ($('.add_video_box').length > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
remove_image_temp();
|
remove_image_temp();
|
||||||
@@ -265,10 +259,10 @@ $('body').on('click', '.moment_video_type a', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('click', '.video_choose a', function() {
|
$('body').on('click', '.video_choose a', function () {
|
||||||
var text = '# 请上传视频或填写视频外链';
|
var text = '# 请上传视频或填写视频外链';
|
||||||
var type = $(this).attr('vi_type');
|
var type = $(this).attr('vi_type');
|
||||||
if(type == 'bili'){
|
if (type == 'bili') {
|
||||||
var text = '# 请输入B站视频bvid';
|
var text = '# 请输入B站视频bvid';
|
||||||
}
|
}
|
||||||
$('.edit_video_box .tips').text(text);
|
$('.edit_video_box .tips').text(text);
|
||||||
@@ -279,75 +273,91 @@ $('body').on('click', '.video_choose a', function() {
|
|||||||
|
|
||||||
//});
|
//});
|
||||||
|
|
||||||
//删除片刻文章
|
//删除片刻
|
||||||
$('body').on('click', '.control_delete_post', function() {
|
// 全局变量暂存当前要删除的 ID
|
||||||
var pid = $(this).parent().attr('pid');
|
window.currentDeletePid = null;
|
||||||
|
|
||||||
var msg = "确定删除瞬间?";
|
// 删除片刻文章 - 打开弹窗
|
||||||
if (confirm(msg)==true){
|
$('body').on('click', '.control_delete_post', function () {
|
||||||
|
window.currentDeletePid = $(this).parent().attr('pid');
|
||||||
|
openModal('删除确认', '确定删除瞬间?该条数据将被永久移除!', 'red');
|
||||||
|
|
||||||
|
// 点击取消按钮 - 关闭弹窗
|
||||||
|
$('body').on('click', '#momentsCancelBtn', function (e) {
|
||||||
|
$('#momentsDeleteModal').fadeOut(200);
|
||||||
|
window.currentDeletePid = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 点击确认删除 - 执行 AJAX
|
||||||
|
$('body').on('click', '#momentsConfirmBtn', function () {
|
||||||
|
var pid = window.currentDeletePid;
|
||||||
|
if (!pid) return;
|
||||||
|
let closeLoading = cocoMessage.loading('正在删除...');
|
||||||
|
$('.moments-btn-cancel, .moments-btn-confirm').prop('disabled', true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
|
url: `/apis/${Theme.moments.api}/v1alpha1/moments/` + pid,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
beforeSend: function () {
|
|
||||||
cocoMessage.info('处理中..');
|
|
||||||
},
|
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
$('#momentsDeleteModal').fadeOut(200);
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.success('删除成功');
|
cocoMessage.success('删除成功');
|
||||||
setTimeout(()=>{
|
window.currentDeletePid = null;
|
||||||
$(`#post-${pid}`)[0].remove()
|
const $post = $(`#post-${pid}`);
|
||||||
},1000)
|
if (!$post.length) return;
|
||||||
|
$post.addClass('moments-delete-disperse');
|
||||||
|
setTimeout(() => $post.remove(), 800);
|
||||||
},
|
},
|
||||||
error: function (request) {
|
error: function (request) {
|
||||||
if(request.status){
|
if (request.status) {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.error('瞬间不存在或已删除');
|
cocoMessage.error('瞬间不存在或已删除');
|
||||||
}else{
|
} else {
|
||||||
|
closeLoading?.()
|
||||||
cocoMessage.error('删除失败');
|
cocoMessage.error('删除失败');
|
||||||
}
|
}
|
||||||
console.log(request)
|
console.log(request)
|
||||||
|
$('.moments-btn-cancel, .moments-btn-confirm').prop('disabled', false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
});
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//置顶片刻
|
//置顶片刻
|
||||||
$('body').on('click', '.sticky_btn', function() {
|
$('body').on('click', '.sticky_btn', function () {
|
||||||
var pid = $(this).parent().attr('pid');
|
var pid = $(this).parent().attr('pid');
|
||||||
var stick = $(this).hasClass('stick');
|
var stick = $(this).hasClass('stick');
|
||||||
if(stick){
|
if (stick) {
|
||||||
var state = 'stick';
|
var state = 'stick';
|
||||||
} else {
|
} else {
|
||||||
var state = 'unstick';
|
var state = 'unstick';
|
||||||
}
|
}
|
||||||
var msg = "确定执行此操作?";
|
var msg = "确定执行此操作?";
|
||||||
if (confirm(msg)==true){
|
if (confirm(msg) == true) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: Theme.ajaxurl,
|
url: Theme.ajaxurl,
|
||||||
data: {
|
data: {
|
||||||
'action':'stick_moment',
|
'action': 'stick_moment',
|
||||||
pid:pid,
|
pid: pid,
|
||||||
state:state
|
state: state
|
||||||
},
|
},
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
cocoMessage.info('处理中..');
|
cocoMessage.info('处理中..');
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if(data.state == '1'){
|
if (data.state == '1') {
|
||||||
cocoMessage.success(data.msg);
|
cocoMessage.success(data.msg);
|
||||||
if(data.type == 'stick'){
|
if (data.type == 'stick') {
|
||||||
var post_item = $('#post-'+pid+'.moment_item');
|
var post_item = $('#post-' + pid + '.moment_item');
|
||||||
post_item.remove();
|
post_item.remove();
|
||||||
$('.moment_list').prepend(post_item.prop('outerHTML'));
|
$('.moment_list').prepend(post_item.prop('outerHTML'));
|
||||||
$('#post-'+pid+'.moment_item').find('.post_footer_meta .right').prepend('<span class="sticky_icon"><i class="ri-fire-line"></i> TOP</span>');
|
$('#post-' + pid + '.moment_item').find('.post_footer_meta .right').prepend('<span class="sticky_icon"><i class="ri-fire-line"></i> TOP</span>');
|
||||||
$('#post-'+pid+'.moment_item').find('.post_control').remove();
|
$('#post-' + pid + '.moment_item').find('.post_control').remove();
|
||||||
} else {
|
} else {
|
||||||
$('#post-'+pid+'.moment_item').find('.sticky_icon').remove();
|
$('#post-' + pid + '.moment_item').find('.sticky_icon').remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -362,46 +372,48 @@ $('body').on('click', '.sticky_btn', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//编辑片刻
|
//编辑片刻
|
||||||
$('body').on('click', '.control_edit_post', function() {
|
$('body').on('click', '.control_edit_post', function () {
|
||||||
$(".loca_text").empty().attr("state",'0');
|
$('.push_close, .push_item').prop('disabled', true);
|
||||||
|
let closeLoading = null;
|
||||||
|
$(".loca_text").empty().attr("state", '0');
|
||||||
$(".loca_text").attr("uk-tooltip", "title:获取位置; pos: top; offset:2;");
|
$(".loca_text").attr("uk-tooltip", "title:获取位置; pos: top; offset:2;");
|
||||||
$('.moment_image_type a').click();
|
$('.moment_image_type a').click();
|
||||||
$('#topic_content').val('');
|
$('#topic_content').val('');
|
||||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
|
||||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
|
||||||
$('.t_media_item').remove();
|
$('.t_media_item').remove();
|
||||||
$('#moment_audio_api').remove();
|
$('#moment_audio_api').remove();
|
||||||
var pid = $(this).parent().attr('pid');
|
var pid = $(this).parent().attr('pid');
|
||||||
$('.push_item').html('<i class="ri-edit-box-line"></i>更新');
|
$('.push_item').html('<i class="ri-edit-box-line"></i>更新');
|
||||||
$('.push_item').attr('pid',pid).attr('action','update')
|
$('.push_item').attr('pid', pid).attr('action', 'update')
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
|
url: `/apis/${Theme.moments.api}/v1alpha1/moments/` + pid,
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
cocoMessage.info('数据拉取中');
|
closeLoading = cocoMessage.loading('数据拉取中...');
|
||||||
//$('.t_form').before('<div class="edit_overlay"></div>');
|
//$('.t_form').before('<div class="edit_overlay"></div>');
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('.push_item').attr('version',data.metadata.version)
|
$('.push_item').attr('version', data.metadata.version)
|
||||||
$('.push_item').attr('owner',data.spec.owner)
|
$('.push_item').attr('owner', data.spec.owner)
|
||||||
$('.push_item').attr('releaseTime',data.spec.releaseTime)
|
$('.push_item').attr('releaseTime', data.spec.releaseTime)
|
||||||
//发布状态
|
//发布状态
|
||||||
if(data.spec.visible == 'PRIVATE'){
|
if (data.spec.visible == 'PRIVATE') {
|
||||||
$(".simi a").html('<i class="ri-lock-line"></i>').attr('visible','PRIVATE');
|
$(".simi a").html('<i class="ri-lock-line"></i>').attr('visible', 'PRIVATE');
|
||||||
$(".simi a").children().css({"background":"#ddd","color":"#c6c6c6"});
|
$(".simi a").children().css({ "background": "#ddd", "color": "#c6c6c6" });
|
||||||
} else {
|
} else {
|
||||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
|
||||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
|
||||||
}
|
}
|
||||||
var medium = data.spec.content.medium;
|
var medium = data.spec.content.medium;
|
||||||
var tags = data.spec.tags
|
var tags = data.spec.tags
|
||||||
if(medium.length > 0){
|
if (medium.length > 0) {
|
||||||
var type = medium[0].type;
|
var type = medium[0].type;
|
||||||
}
|
}
|
||||||
let content = data.spec.content.html;
|
let content = data.spec.content.html;
|
||||||
if(content == null){
|
if (content == null) {
|
||||||
content = '';
|
content = '';
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
// 创建一个新的HTML解析器对象
|
// 创建一个新的HTML解析器对象
|
||||||
var parser = new DOMParser();
|
var parser = new DOMParser();
|
||||||
@@ -423,16 +435,15 @@ $('body').on('click', '.control_edit_post', function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#topic_content').val(content);
|
$('#topic_content').val(content);
|
||||||
if(tags.length > 0){
|
if (tags.length > 0) {
|
||||||
$('.t_cat_toogle span').text(tags[0]);
|
$('.t_cat_toogle span').text(tags[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data.metadata.annotations?.mylocal!=null && data.metadata.annotations?.mylocal!='') {
|
if (data.metadata.annotations?.mylocal != null && data.metadata.annotations?.mylocal != '') {
|
||||||
$('.loca_text').text(data.metadata.annotations?.mylocal);
|
$('.loca_text').text(data.metadata.annotations?.mylocal);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(type)
|
switch (type) {
|
||||||
{
|
|
||||||
case "PHOTO":
|
case "PHOTO":
|
||||||
//if(data.moment_data.length > 0){ 文字片刻没有数据
|
//if(data.moment_data.length > 0){ 文字片刻没有数据
|
||||||
edit_image(data);
|
edit_image(data);
|
||||||
@@ -448,35 +459,42 @@ $('body').on('click', '.control_edit_post', function() {
|
|||||||
edit_video(data);
|
edit_video(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cocoMessage.success('拉取完成');
|
closeLoading();
|
||||||
|
cocoMessage.success('数据拉取完成');
|
||||||
|
$('.push_close, .push_item').prop('disabled', false);
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
closeLoading();
|
||||||
|
cocoMessage.error('数据拉取失败');
|
||||||
|
$('.push_close').prop('disabled', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//发布片刻重置
|
//发布片刻重置
|
||||||
$('body').on('click', '.normal_edit,.center .mobile_edit', function() {
|
$('body').on('click', '.normal_edit,.center .mobile_edit', function () {
|
||||||
$('.push_item').attr('action','push').html('<i class="ri-send-plane-2-line"></i>发布');
|
$('.push_item').attr('action', 'push').html('<i class="ri-send-plane-2-line"></i>发布');
|
||||||
$('.moment_image_type a').click();
|
$('.moment_image_type a').click();
|
||||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
|
||||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
|
||||||
$('#topic_content').val('');
|
$('#topic_content').val('');
|
||||||
$(".loca_text").empty().attr("state",'0');
|
$(".loca_text").empty().attr("state", '0');
|
||||||
$('#set_local, [name="set_local"]').val('');
|
$('#set_local, [name="set_local"]').val('');
|
||||||
$('.t_media_item').remove();
|
$('.t_media_item').remove();
|
||||||
$('.t_cat_toogle span').text('叽里咕噜');
|
$('.t_cat_toogle span').text('叽里咕噜');
|
||||||
});
|
});
|
||||||
|
|
||||||
//编辑片刻类型(已兼容图片+视频)------------------------------------------------------------------------------
|
//编辑片刻类型(已兼容图片+视频)------------------------------------------------------------------------------
|
||||||
function edit_image(data){
|
function edit_image(data) {
|
||||||
var m_data = data.spec.content.medium;
|
var m_data = data.spec.content.medium;
|
||||||
$('.t_media_item').remove();
|
$('.t_media_item').remove();
|
||||||
$('.moment_image_type a').click();
|
$('.moment_image_type a').click();
|
||||||
|
|
||||||
if(m_data && m_data.length > 0){
|
if (m_data && m_data.length > 0) {
|
||||||
// reverse() 是为了配合 prepend,确保显示顺序与发布时一致
|
// reverse() 是为了配合 prepend,确保显示顺序与发布时一致
|
||||||
var new_data = [...m_data].reverse();
|
var new_data = [...m_data].reverse();
|
||||||
|
|
||||||
$.each(new_data, function(index, value) {
|
$.each(new_data, function (index, value) {
|
||||||
var src = value.url;
|
var src = value.url;
|
||||||
var type = value.originType || ""; // 获取 MIME 类型
|
var type = value.originType || ""; // 获取 MIME 类型
|
||||||
var mediaInnerHtml = '';
|
var mediaInnerHtml = '';
|
||||||
@@ -484,10 +502,10 @@ function edit_image(data){
|
|||||||
// --- 核心逻辑:判定是否为视频 ---
|
// --- 核心逻辑:判定是否为视频 ---
|
||||||
// 1. 检查 MIME 类型是否以 video/ 开头
|
// 1. 检查 MIME 类型是否以 video/ 开头
|
||||||
// 2. 检查文件名后缀是否为常见的视频格式(防止 originType 丢失的情况)
|
// 2. 检查文件名后缀是否为常见的视频格式(防止 originType 丢失的情况)
|
||||||
var isVideo = type.startsWith('video/') ||
|
var isVideo = type.startsWith('video/') ||
|
||||||
src.toLowerCase().endsWith('.mp4') ||
|
src.toLowerCase().endsWith('.mp4') ||
|
||||||
src.toLowerCase().endsWith('.webm') ||
|
src.toLowerCase().endsWith('.webm') ||
|
||||||
src.toLowerCase().endsWith('.mov');
|
src.toLowerCase().endsWith('.mov');
|
||||||
|
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
// 如果是视频,使用 video 标签预览
|
// 如果是视频,使用 video 标签预览
|
||||||
@@ -502,30 +520,30 @@ function edit_image(data){
|
|||||||
<a class="topic-img-de"><i class="ri-subtract-line"></i></a>
|
<a class="topic-img-de"><i class="ri-subtract-line"></i></a>
|
||||||
${mediaInnerHtml}
|
${mediaInnerHtml}
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
$(".img_show").prepend(media);
|
$(".img_show").prepend(media);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit_video(data){
|
function edit_video(data) {
|
||||||
var m_data = data.spec.content.medium[0];
|
var m_data = data.spec.content.medium[0];
|
||||||
var type = m_data.originType;
|
var type = m_data.originType;
|
||||||
//var url = m_data.url;
|
//var url = m_data.url;
|
||||||
$('.moment_video_type a').click();
|
$('.moment_video_type a').click();
|
||||||
|
|
||||||
var add = setInterval(function() {
|
var add = setInterval(function () {
|
||||||
if(type != 'video/bili'){
|
if (type != 'video/bili') {
|
||||||
var url = m_data.url;
|
var url = m_data.url;
|
||||||
|
|
||||||
$('input#moment_video_url').val(url);
|
$('input#moment_video_url').val(url);
|
||||||
if(url !== ''){
|
if (url !== '') {
|
||||||
$('.m_media_left i').remove();
|
$('.m_media_left i').remove();
|
||||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="'+url+'">');
|
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="' + url + '">');
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if(type == 'video/bili') {
|
} else if (type == 'video/bili') {
|
||||||
if($('.video_choose').length > 0){
|
if ($('.video_choose').length > 0) {
|
||||||
var bvid = m_data.url;
|
var bvid = m_data.url;
|
||||||
UIkit.switcher('.video_choose').show(1);
|
UIkit.switcher('.video_choose').show(1);
|
||||||
$('input#moment_video_bili').val(bvid);
|
$('input#moment_video_bili').val(bvid);
|
||||||
@@ -533,26 +551,26 @@ function edit_video(data){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($('.edit_video_box').length == 1){
|
if ($('.edit_video_box').length == 1) {
|
||||||
clearInterval(add);
|
clearInterval(add);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit_audio(data){
|
function edit_audio(data) {
|
||||||
var m_data = data.spec.content.medium[0];
|
var m_data = data.spec.content.medium[0];
|
||||||
var type = m_data.originType;
|
var type = m_data.originType;
|
||||||
$('.moment_audio_type a').click();
|
$('.moment_audio_type a').click();
|
||||||
var add = setInterval(function() {
|
var add = setInterval(function () {
|
||||||
if(type == 'audio/netease' || type == 'audio/tencent' || type == 'audio/kugou' || type == 'audio/kuwo'){
|
if (type == 'audio/netease' || type == 'audio/tencent' || type == 'audio/kugou' || type == 'audio/kuwo') {
|
||||||
var result = type.substring(type.indexOf("audio/") + 6);
|
var result = type.substring(type.indexOf("audio/") + 6);
|
||||||
if($('.audio_choose').length > 0){
|
if ($('.audio_choose').length > 0) {
|
||||||
var n_id = m_data.url;
|
var n_id = m_data.url;
|
||||||
var index = $('.audio_choose li.'+result+'').index();
|
var index = $('.audio_choose li.' + result + '').index();
|
||||||
UIkit.switcher('.audio_choose').show(index);
|
UIkit.switcher('.audio_choose').show(index);
|
||||||
$('.edit_audio_box .tips').text('# 请输入歌曲ID');
|
$('.edit_audio_box .tips').text('# 请输入歌曲ID');
|
||||||
$('.'+result+'_audio').append('<input type="text" placeholder="歌曲ID" name="moment_audio_api" id="moment_audio_api" class="required" required="required">');
|
$('.' + result + '_audio').append('<input type="text" placeholder="歌曲ID" name="moment_audio_api" id="moment_audio_api" class="required" required="required">');
|
||||||
$('input#moment_audio_api').val(n_id);
|
$('input#moment_audio_api').val(n_id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -562,7 +580,7 @@ function edit_audio(data){
|
|||||||
$('.edit_audio_box .tips').text('# 请插入歌曲外链');
|
$('.edit_audio_box .tips').text('# 请插入歌曲外链');
|
||||||
$('input#moment_audio_url').val(url);
|
$('input#moment_audio_url').val(url);
|
||||||
}
|
}
|
||||||
if($('.edit_audio_box').length == 1){
|
if ($('.edit_audio_box').length == 1) {
|
||||||
clearInterval(add);
|
clearInterval(add);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -574,15 +592,15 @@ function edit_card(data) {
|
|||||||
$('.card_sortble .moment_card_item').remove();
|
$('.card_sortble .moment_card_item').remove();
|
||||||
$('.moment_card_type a').click();
|
$('.moment_card_type a').click();
|
||||||
var pid = data.metadata.name;
|
var pid = data.metadata.name;
|
||||||
var card_list = $("#post-"+pid+"").find('.moment_card_item');
|
var card_list = $("#post-" + pid + "").find('.moment_card_item');
|
||||||
var add = setInterval(function() {
|
var add = setInterval(function () {
|
||||||
$('.show_card').show();
|
$('.show_card').show();
|
||||||
$.each(m_data, function(index, value) {
|
$.each(m_data, function (index, value) {
|
||||||
var srcValue = card_list.eq(index).find('img').attr('src');
|
var srcValue = card_list.eq(index).find('img').attr('src');
|
||||||
var h4Text = card_list.eq(index).find('h4').text();
|
var h4Text = card_list.eq(index).find('h4').text();
|
||||||
$('.card_sortble').append(getcard(value.url,srcValue,h4Text,value.originType));
|
$('.card_sortble').append(getcard(value.url, srcValue, h4Text, value.originType));
|
||||||
});
|
});
|
||||||
if($('.edit_card_box').length == 1){
|
if ($('.edit_card_box').length == 1) {
|
||||||
clearInterval(add);
|
clearInterval(add);
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|||||||
@@ -27,7 +27,13 @@ const poster = (function() {
|
|||||||
* @param {object} config - 配置对象
|
* @param {object} config - 配置对象
|
||||||
*/
|
*/
|
||||||
function init(config) {
|
function init(config) {
|
||||||
const $container = document.querySelector(config.selector)
|
const $container = config.container || document.querySelector(config.selector)
|
||||||
|
if (!$container) {
|
||||||
|
if (config.callback) {
|
||||||
|
config.callback(null)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
// ------------------ 【修复点 2:清理容器,避免PJAX残余】 ------------------
|
// ------------------ 【修复点 2:清理容器,避免PJAX残余】 ------------------
|
||||||
// 在重新绘制前,确保清空容器,移除旧的 img 和 wrapper
|
// 在重新绘制前,确保清空容器,移除旧的 img 和 wrapper
|
||||||
$container.innerHTML = '';
|
$container.innerHTML = '';
|
||||||
@@ -121,7 +127,7 @@ const poster = (function() {
|
|||||||
|
|
||||||
// 3. 绘制覆盖层
|
// 3. 绘制覆盖层
|
||||||
ctx.fillStyle="rgba(0, 0, 0, 0.3)";
|
ctx.fillStyle="rgba(0, 0, 0, 0.3)";
|
||||||
ctx.fillRect(20, 20, $canvas.width - 40, $canvas.height / 1.2 - 40);
|
ctx.fillRect(20, 20, $canvas.width - 40, $canvas.height / 1.2 - 40);
|
||||||
|
|
||||||
// 4. 绘制时间 (使用预先绘制好的 Canvas)
|
// 4. 绘制时间 (使用预先绘制好的 Canvas)
|
||||||
ctx.drawImage($day, -20, 50)
|
ctx.drawImage($day, -20, 50)
|
||||||
@@ -157,7 +163,7 @@ const poster = (function() {
|
|||||||
// 移除旧的 wrapper 并添加最终海报图
|
// 移除旧的 wrapper 并添加最终海报图
|
||||||
$container.appendChild(img);
|
$container.appendChild(img);
|
||||||
// 必须先移除再调用 callback,以确保 DOM 结构干净
|
// 必须先移除再调用 callback,以确保 DOM 结构干净
|
||||||
$container.removeChild($wrapper)
|
$container.removeChild($wrapper)
|
||||||
|
|
||||||
if (config.callback) {
|
if (config.callback) {
|
||||||
config.callback($container)
|
config.callback($container)
|
||||||
@@ -165,7 +171,9 @@ const poster = (function() {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error('海报图片加载失败:', error);
|
console.error('海报图片加载失败:', error);
|
||||||
// 可在此处添加错误处理,例如显示一个错误信息
|
// 可在此处添加错误处理,例如显示一个错误信息
|
||||||
$container.removeChild($wrapper);
|
if ($wrapper.parentNode === $container) {
|
||||||
|
$container.removeChild($wrapper);
|
||||||
|
}
|
||||||
if (config.callback) {
|
if (config.callback) {
|
||||||
// 即使失败也调用回调,传入 null 或错误信息,以便上层逻辑处理
|
// 即使失败也调用回调,传入 null 或错误信息,以便上层逻辑处理
|
||||||
config.callback(null);
|
config.callback(null);
|
||||||
@@ -356,10 +364,26 @@ const poster = (function() {
|
|||||||
// ajax生成文章海报
|
// ajax生成文章海报
|
||||||
// 此处调用部分需要确保在 PJAX 环境下,该事件监听器能够重新绑定(如果使用传统的 document.ready,在 PJAX 中需要改为监听 pjax:success 等事件)
|
// 此处调用部分需要确保在 PJAX 环境下,该事件监听器能够重新绑定(如果使用传统的 document.ready,在 PJAX 中需要改为监听 pjax:success 等事件)
|
||||||
$('body').on('click', '.cr_poster', function () {
|
$('body').on('click', '.cr_poster', function () {
|
||||||
|
let closeLoading = null;
|
||||||
|
closeLoading = cocoMessage.loading('海报生成中...');
|
||||||
|
var $trigger = $(this);
|
||||||
var post_id = $(this).attr('poster-data');
|
var post_id = $(this).attr('poster-data');
|
||||||
var banner = $(this).attr('banner');
|
var banner = $(this).attr('banner');
|
||||||
var single_content = $('.single-content');
|
var single_content = $('.single-content');
|
||||||
var t_content = $('#post-'+post_id+' .t_content');
|
var t_content = $('#post-'+post_id+' .t_content');
|
||||||
|
var modal = '#share_modal_' + post_id;
|
||||||
|
var $modalList = $(modal);
|
||||||
|
var $modal = $trigger.closest(modal);
|
||||||
|
if ($modal.length === 0) {
|
||||||
|
$modal = $(modal + ':visible').first();
|
||||||
|
}
|
||||||
|
if ($modal.length === 0) {
|
||||||
|
$modal = $modalList.first();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($modal.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 确保 content 区域存在
|
// 确保 content 区域存在
|
||||||
var content_element = single_content.length > 0 ? single_content[0] : (t_content.length > 0 ? t_content[0] : null);
|
var content_element = single_content.length > 0 ? single_content[0] : (t_content.length > 0 ? t_content[0] : null);
|
||||||
@@ -392,43 +416,45 @@ $('body').on('click', '.cr_poster', function () {
|
|||||||
|
|
||||||
new QRious({ element: twoCodeCanvas, value: permalink, size: 260, });
|
new QRious({ element: twoCodeCanvas, value: permalink, size: 260, });
|
||||||
|
|
||||||
var poster_box_selector = '#share_modal_' + post_id + ' .poster_box';
|
var $posterBoxAp = $modal.find('.poster_box_ap').first();
|
||||||
|
if ($posterBoxAp.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------ 【修复点 2:清理容器】 ------------------
|
// ------------------ 【修复点 2:清理容器】 ------------------
|
||||||
// 先移除旧的 poster_box
|
// 仅在当前弹窗作用域内移除旧容器,避免影响 PJAX 残留节点
|
||||||
$('.poster_box').remove();
|
$posterBoxAp.find('.poster_box').remove();
|
||||||
// 重新创建并插入新的 poster_box
|
// 重新创建并插入新的 poster_box
|
||||||
$('#share_modal_' + post_id + ' .poster_box_ap').append('<div class="poster_box"></div>');
|
var $posterBox = $('<div class="poster_box"></div>');
|
||||||
|
$posterBoxAp.append($posterBox);
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
if (content_length > 120) {
|
if (content_length > 120) {
|
||||||
content = content.substring(0, 80) + '...'
|
content = content.substring(0, 80) + '...'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Posterdown 函数中不再需要移除 loading_box,因为 init 会清空容器
|
// 海报生成回调
|
||||||
function Posterdown(e) {
|
function Posterdown(e) {
|
||||||
var modal = '#share_modal_' + post_id;
|
|
||||||
|
|
||||||
// 检查海报是否成功生成
|
// 检查海报是否成功生成
|
||||||
if (e && $(modal + ' .poster_box img').length > 0) {
|
if (e && $posterBox.find('img').length > 0) {
|
||||||
var url = $(modal + ' .poster_box img').attr('src');
|
closeLoading?.()
|
||||||
$(modal + ' .post_share_box').removeClass('hide');
|
cocoMessage.success("海报生成成功!") // 图片加载完成后才触发
|
||||||
$(modal + ' .poster_download').attr('href', url).attr('download', 'poster_' + post_id + '.png');
|
var url = $posterBox.find('img').attr('src');
|
||||||
|
var $shareBox = $modal.find('.post_share_box');
|
||||||
|
|
||||||
|
$shareBox.removeClass('hide');
|
||||||
|
$modal.find('.poster_download').attr('href', url).attr('download', 'poster_' + post_id + '.png');
|
||||||
} else {
|
} else {
|
||||||
// 错误处理,如果海报生成失败
|
// 错误处理,如果海报生成失败
|
||||||
cocoMessage.error("海报生成失败,请检查图片链接!");
|
closeLoading?. ();
|
||||||
|
cocoMessage.error("海报生成失败,请重试!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移除 loading box 的时机提前,或者在 init 开始前完成
|
|
||||||
// $('.loading_box').remove(); // 原始代码中这行在创建 loading_box 之后,但其作用是移除**所有** .loading_box,可能存在问题
|
|
||||||
|
|
||||||
// 重新添加 loading 状态,并在 init 中等待
|
|
||||||
$(poster_box_selector).append('<div class="loading_box"><div uk-spinner></div></div>');
|
|
||||||
|
|
||||||
poster.init({
|
poster.init({
|
||||||
banner: banner,
|
banner: banner,
|
||||||
selector: poster_box_selector, // 传入完整的选择器
|
selector: modal + ' .poster_box',
|
||||||
|
container: $posterBox[0],
|
||||||
title: title,
|
title: title,
|
||||||
content: content,
|
content: content,
|
||||||
logo: Theme.site_logo,
|
logo: Theme.site_logo,
|
||||||
@@ -436,9 +462,31 @@ $('body').on('click', '.cr_poster', function () {
|
|||||||
description: Theme.admin_des,
|
description: Theme.admin_des,
|
||||||
callback: Posterdown
|
callback: Posterdown
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('pjax:success', function (event) {
|
||||||
|
// 清理 PJAX 残留的 modal:只删除那些在当前页面没有对应按钮的 modal
|
||||||
|
var allModals = $('[id^="share_modal_"]');
|
||||||
|
var currentPostIds = {};
|
||||||
|
|
||||||
// 移除 loading 动画
|
// 收集当前页面所有的 post_id
|
||||||
$(poster_box_selector + ' .loading_box').remove();
|
$('.cr_poster').each(function() {
|
||||||
|
var pid = $(this).attr('poster-data');
|
||||||
|
if (pid) {
|
||||||
|
currentPostIds[pid] = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 只删除残留的 modal(不在当前页面按钮列表中的)
|
||||||
|
allModals.each(function() {
|
||||||
|
var $m = $(this);
|
||||||
|
var modalId = $m.attr('id');
|
||||||
|
var postId = modalId ? modalId.replace('share_modal_', '') : null;
|
||||||
|
|
||||||
|
if (postId && !currentPostIds[postId]) {
|
||||||
|
$m.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -3541,7 +3541,7 @@ iframe[uk-cover] {
|
|||||||
.uk-sortable-drag {
|
.uk-sortable-drag {
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
z-index: 1050 !important;
|
z-index: 1050 !important;
|
||||||
pointer-events: none
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uk-sortable-placeholder {
|
.uk-sortable-placeholder {
|
||||||
|
|||||||
+15
-34
@@ -10,46 +10,27 @@
|
|||||||
|
|
||||||
<div id="pjax-container">
|
<div id="pjax-container">
|
||||||
|
|
||||||
<main id="primary" class="site-main">
|
<div class="blog_list douban_page">
|
||||||
|
<div class="blog_list_inner" uk-height-viewport="offset-top: true">
|
||||||
|
|
||||||
<div class="page_content" uk-height-viewport="offset-top: true">
|
<div class="friends_cat_nav douban_cat_nav">
|
||||||
|
<ul>
|
||||||
|
<li><a data-type="" class="cat-link active">全部<span></span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<article class="post-276 page type-page status-publish hentry">
|
<div id="douban_item" class="moment_list douban_list"></div>
|
||||||
<header class="entry-header">
|
|
||||||
<div class="left">
|
|
||||||
<i class="ri-focus-2-line"></i>
|
|
||||||
<h1 class="entry-title" th:text="${title}"></h1>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
|
<div id="douban_pagination" class="u-hide">
|
||||||
<div class="entry-content single-content">
|
<div class="post-paging">
|
||||||
<section class="db--container">
|
<a data-next-page="2" th:text="${theme.config.base_set.site_page}"></a>
|
||||||
<nav class="db--nav">
|
|
||||||
<div th:each="type : ${types}" class="db--navItem JiEun"
|
|
||||||
th:classappend="${type.key == 'movie' ? 'current' : ''}"
|
|
||||||
th:data-type="${type.key}" th:text="${type.key}"></div>
|
|
||||||
</nav>
|
|
||||||
<div class="db--genres"></div>
|
|
||||||
<div class="db--type">
|
|
||||||
<div class="db--typeItem" data-status="mark">想看</div>
|
|
||||||
<div class="db--typeItem" data-status="doing">在看</div>
|
|
||||||
<div class="db--typeItem is-active" data-status="done">看过</div>
|
|
||||||
</div>
|
|
||||||
<div class="db--list db--list__card" data-type="movie">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="block-more block-more__centered">
|
|
||||||
<div class="lds-ripple u-hide">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</div>
|
||||||
|
|
||||||
|
<div id="comment_form_reset"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</main>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+35
-14
@@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns:th="https://www.thymeleaf.org"
|
<html xmlns:th="https://www.thymeleaf.org"
|
||||||
th:replace="~{modules/layouts/layout :: layout(_head = null,_content = ~{::content},_title = ${title + ' - ' + site.title})}">
|
th:replace="~{modules/layouts/layout :: layout(_head = null,_content = ~{::content},_title = ${title + ' - ' + site.title})}">
|
||||||
|
|
||||||
<th:block th:fragment="content">
|
<th:block th:fragment="content">
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<!-- 全部按钮 -->
|
<!-- 全部按钮 -->
|
||||||
<a th:attr="data-href=@{/friends}"
|
<a th:attr="data-href=@{/friends}"
|
||||||
th:classappend="${#lists.isEmpty(param.author) ? 'active' : ''}" class="cat-link">
|
th:classappend="${#lists.isEmpty(param.author) ? 'active' : ''}" class="cat-link">
|
||||||
全部<span></span>
|
全部<span></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
<th:block th:each="author : ${authors}">
|
<th:block th:each="author : ${authors}">
|
||||||
<li>
|
<li>
|
||||||
<a th:attr="data-href=@{|/friends?author=${author}|}"
|
<a th:attr="data-href=@{|/friends?author=${author}|}"
|
||||||
th:classappend="${#strings.equals(param.author, author) ? 'active' : ''}"
|
th:classappend="${#strings.equals(param.author, author) ? 'active' : ''}"
|
||||||
th:text="${author}" class="cat-link">
|
th:text="${author}" class="cat-link">
|
||||||
<span></span>
|
<span></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -38,10 +38,10 @@
|
|||||||
|
|
||||||
<div id="post_item" class="moment_list">
|
<div id="post_item" class="moment_list">
|
||||||
|
|
||||||
<div th:each="postInfo, iterstat: ${friends.items}"
|
<div th:each="postInfo, iterstat: ${friends.items}" th:id="${'post-'+postInfo.metadata.name}"
|
||||||
th:id="${'post-'+postInfo.metadata.name}"
|
class="loop_content p_item moment_item uk-animation-slide-bottom-small"
|
||||||
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}">
|
th:with="spec = ${postInfo.spec}">
|
||||||
|
|
||||||
<div class="p_item_inner">
|
<div class="p_item_inner">
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<time itemprop="datePublished"
|
<time itemprop="datePublished"
|
||||||
th:datetime="${#dates.format(spec.pubDate, 'yyyy-MM-dd HH:mm')}">
|
th:datetime="${#dates.format(spec.pubDate, 'yyyy-MM-dd HH:mm')}">
|
||||||
<th:block th:replace="~{modules/widgets/time :: time(${spec.pubDate})}">
|
<th:block th:replace="~{modules/widgets/time :: time(${spec.pubDate})}">
|
||||||
</th:block>
|
</th:block>
|
||||||
</time>
|
</time>
|
||||||
@@ -72,9 +72,32 @@
|
|||||||
<div th:utext="${spec.description}"></div>
|
<div th:utext="${spec.description}"></div>
|
||||||
</a>
|
</a>
|
||||||
</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}">
|
||||||
|
<!-- 仅使用 imageFiles;字段缺失或为空时不显示图片 -->
|
||||||
|
<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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -88,11 +111,9 @@
|
|||||||
<!-- 分页:必须保持在 blog_list_inner 里面 -->
|
<!-- 分页:必须保持在 blog_list_inner 里面 -->
|
||||||
<th:block th:if="${friends.totalPages>1}">
|
<th:block th:if="${friends.totalPages>1}">
|
||||||
<div id="t_pagination">
|
<div id="t_pagination">
|
||||||
<div class="post-paging"
|
<div class="post-paging" th:if="${friends.hasNext()}">
|
||||||
th:if="${friends.hasNext()}">
|
|
||||||
<!-- 直接使用后端生成的完整 nextUrl -->
|
<!-- 直接使用后端生成的完整 nextUrl -->
|
||||||
<a th:data="${friends.nextUrl}"
|
<a th:data="${friends.nextUrl}" th:text="${theme.config.base_set.site_page}">
|
||||||
th:text="${theme.config.base_set.site_page}">
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<th:block th:fragment="footer">
|
<th:block th:fragment="footer">
|
||||||
<th:block th:with="customJsVersion='1.2.5-3'">
|
<th:block th:with="customJsVersion='1.2.5-7'">
|
||||||
|
|
||||||
<!-- 奇遇容器 -->
|
<!-- 奇遇容器 -->
|
||||||
<div class="center-img-container" id="centerImgContainer">
|
<div class="center-img-container" id="centerImgContainer">
|
||||||
@@ -41,31 +41,59 @@
|
|||||||
<div class="pixar-notice-image-area">
|
<div class="pixar-notice-image-area">
|
||||||
<p class="pixar-notice-caption">
|
<p class="pixar-notice-caption">
|
||||||
您确定要退出登录吗?<br>
|
您确定要退出登录吗?<br>
|
||||||
退出后您仍能以访客身份翻阅本日记簿...
|
请注意:<br>
|
||||||
|
未保存的内容将会被清空!
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pixar-notice-actions">
|
<div class="pixar-notice-actions">
|
||||||
|
|
||||||
<!-- 确认按钮 -->
|
|
||||||
<button class="pixar-notice-btn pixar-notice-btn-confirm" aria-label="Confirm"
|
|
||||||
onclick="confirmPixarAction()">
|
|
||||||
<i class="ri-check-line"></i>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!-- 关闭按钮 -->
|
<!-- 关闭按钮 -->
|
||||||
<button class="pixar-notice-btn pixar-notice-btn-close" aria-label="Close"
|
<button class="pixar-notice-btn pixar-notice-btn-close" aria-label="Close"
|
||||||
onclick="hidePixarCard()">
|
onclick="hidePixarCard()">
|
||||||
<i class="ri-close-line"></i>
|
<i class="ri-close-line"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!-- 确认按钮 -->
|
||||||
|
<button class="pixar-notice-btn pixar-notice-btn-confirm" aria-label="Confirm"
|
||||||
|
onclick="confirmPixarAction()">
|
||||||
|
<i class="ri-check-line"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script th:if="${pluginFinder.available('plugin-douban')}"
|
<!-- 删除确认弹窗 -->
|
||||||
th:src="@{/plugins/plugin-douban/assets/static/db.min.js(v=${customJsVersion})}" class="pjax"></script>
|
<div class="moments-modal-overlay" id="momentsDeleteModal" style="display: none;">
|
||||||
|
<div class="moments-card-widget">
|
||||||
|
<div class="moments-card-header">
|
||||||
|
<!-- 新增这一层包裹 -->
|
||||||
|
<div class="moments-header-row">
|
||||||
|
<div class="moments-icon-wrapper">
|
||||||
|
<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="moments-text-content">
|
||||||
|
<span class="moments-title-text"></span>
|
||||||
|
<p class="moments-message-text"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="moments-button-group">
|
||||||
|
<button class="moments-btn-cancel" type="button" id="momentsCancelBtn">取消</button>
|
||||||
|
<button class="moments-btn-confirm" type="button" id="momentsConfirmBtn">确认</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <script th:if="${pluginFinder.available('plugin-douban')}"
|
||||||
|
th:src="@{/plugins/plugin-douban/assets/static/db.min.js(v=${customJsVersion})}" class="pjax"></script> -->
|
||||||
<script th:src="@{/assets/libs/axios/axios.min.js(v=${customJsVersion})}" id="axios.min-js"></script>
|
<script th:src="@{/assets/libs/axios/axios.min.js(v=${customJsVersion})}" id="axios.min-js"></script>
|
||||||
<script th:src="@{/assets/libs/jsencrypt/jsencrypt.min.js(v=${customJsVersion})}"
|
<script th:src="@{/assets/libs/jsencrypt/jsencrypt.min.js(v=${customJsVersion})}"
|
||||||
id="jsencrypt.min-js"></script>
|
id="jsencrypt.min-js"></script>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-3'}">
|
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-7'}">
|
||||||
<th:block th:replace="~{'modules/variables/msg'}" />
|
<th:block th:replace="~{'modules/variables/msg'}" />
|
||||||
<meta charset="UTF-8">
|
<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">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<link rel="shortcut icon" th:href="@{${theme.config.base_set.favicon}}" title="Favicon">
|
<link rel="shortcut icon" th:href="@{${theme.config.base_set.favicon}}" title="Favicon">
|
||||||
<meta name="robots" content="max-image-preview:large">
|
<meta name="robots" content="max-image-preview:large">
|
||||||
|
|
||||||
<style>
|
<!-- <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-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-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 { flex-shrink: 0; background-color: #fef3c7; justify-content: center; align-items: center; width: 2.5rem; height: 2.5rem; border-radius: 9999px; display: flex; }
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
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 (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(); } }
|
if (isTestDomain) { if (!noPromptCookie) { cardHeadingEl.textContent = '线路警告'; cardParaEl.textContent = '当前为测试线路,若非开发所需,请优先选择主线路'; switchLineBtn.textContent = '切换主线路'; switchLineBtn.onclick = () => handleLineSwitch('https://anian.cc'); showLineCard(); } }
|
||||||
})();
|
})();
|
||||||
</script>
|
</script> -->
|
||||||
|
|
||||||
<link rel="stylesheet" id="wp-block-library-css" th:href="@{/assets/css/style.min.css(v=${customJsVersion})}" media="all">
|
<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="pix-style-css" th:href="@{/assets/css/style.css(v=${customJsVersion})}" media="all">
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<link rel="stylesheet" id="album-css" th:href="@{/assets/css/album.css(v=${customJsVersion})}" media="all">
|
<link rel="stylesheet" id="album-css" th:href="@{/assets/css/album.css(v=${customJsVersion})}" media="all">
|
||||||
<link rel="stylesheet" id="anian-css" th:href="@{/assets/css/anian.css(v=${customJsVersion})}" media="all">
|
<link rel="stylesheet" id="anian-css" th:href="@{/assets/css/anian.css(v=${customJsVersion})}" media="all">
|
||||||
<link th:if="${theme.config.style.theme_set != 'green-normal' && theme.config.style.theme_set != 'dark-theme'}" rel="stylesheet" id="theme.color-css" th:href="@{/assets/css/{theme_set}.css(theme_set=${theme.config.style.theme_set},v=${customJsVersion})}" media="all">
|
<link th:if="${theme.config.style.theme_set != 'green-normal' && theme.config.style.theme_set != 'dark-theme'}" rel="stylesheet" id="theme.color-css" th:href="@{/assets/css/{theme_set}.css(theme_set=${theme.config.style.theme_set},v=${customJsVersion})}" media="all">
|
||||||
<link th:if="${pluginFinder.available('plugin-douban')}" rel="stylesheet" id="wpd-css-css" th:href="@{/plugins/plugin-douban/assets/static/db.min.css(v=${customJsVersion})}" type="text/css" media="screen">
|
<!-- <link th:if="${pluginFinder.available('plugin-douban')}" rel="stylesheet" id="wpd-css-css" th:href="@{/plugins/plugin-douban/assets/static/db.min.css(v=${customJsVersion})}" type="text/css" media="screen"> -->
|
||||||
|
|
||||||
<style th:if="${not #strings.isEmpty(theme.config.custom.code_css)}" th:utext="${theme.config.custom.code_css}"></style>
|
<style th:if="${not #strings.isEmpty(theme.config.custom.code_css)}" th:utext="${theme.config.custom.code_css}"></style>
|
||||||
<style>:root { --toc-color: [(${theme.config.post.tocColor})]; } .wp-block-button__link { color: #fff; background-color: #32373c; border-radius: 9999px; text-decoration: none; padding: .6em 1.3em; } .wp-block-file__button { background: #32373c; color: #fff; text-decoration: none; }</style>
|
<style>:root { --toc-color: [(${theme.config.post.tocColor})]; } .wp-block-button__link { color: #fff; background-color: #32373c; border-radius: 9999px; text-decoration: none; padding: .6em 1.3em; } .wp-block-file__button { background: #32373c; color: #fff; text-decoration: none; }</style>
|
||||||
|
|||||||
@@ -51,12 +51,12 @@
|
|||||||
// --------------------------
|
// --------------------------
|
||||||
const BANNER_CONFIG = {
|
const BANNER_CONFIG = {
|
||||||
seasonal: {
|
seasonal: {
|
||||||
'春季': '/upload/dingbu-chun.png', // 春季 Banner
|
'春': '/upload/chun.jpg',
|
||||||
'夏季': '/upload/dingbu-xia.png', // 夏季 Banner
|
'夏': '/upload/xia.jpg',
|
||||||
'秋季': '/upload/dingbu-qiu.png', // 秋季 Banner
|
'秋': '/upload/qiu.jpg',
|
||||||
'冬季': '/upload/dingbu-dong.png' // 冬季 Banner
|
'冬': '/upload/dong.jpg'
|
||||||
},
|
},
|
||||||
fallback: '/upload/dingbu-siji.png' // 兜底图
|
fallback: '/upload/dingbu-siji.png'
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------
|
// --------------------------
|
||||||
@@ -66,7 +66,7 @@ function anian_setDailyCookie(name, value) {
|
|||||||
const now = new Date();
|
const now = new Date();
|
||||||
const china = new Date(now.getTime() + 8 * 3600 * 1000);
|
const china = new Date(now.getTime() + 8 * 3600 * 1000);
|
||||||
const expires = new Date(Date.UTC(china.getUTCFullYear(), china.getUTCMonth(), china.getUTCDate(), 15, 59, 59));
|
const expires = new Date(Date.UTC(china.getUTCFullYear(), china.getUTCMonth(), china.getUTCDate(), 15, 59, 59));
|
||||||
document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}; expires=${expires.toUTCString()}; path=/; domain=anian.cc`;
|
document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}; expires=${expires.toUTCString()}; path=/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function anian_getCookie(name) {
|
function anian_getCookie(name) {
|
||||||
@@ -102,7 +102,7 @@ function setBanner(lunarInfo) {
|
|||||||
// 初始化逻辑(优化版)
|
// 初始化逻辑(优化版)
|
||||||
// --------------------------
|
// --------------------------
|
||||||
(function() {
|
(function() {
|
||||||
const apiUrl = 'https://cn.apihz.cn/api/time/getday.php?id=10011724&key=0bdd2d8b3d97c0d476c98a41f108a96f';
|
const apiUrl = 'https://api.anian.cc/lunar/api';
|
||||||
const cookieName = 'anian_lunar_info';
|
const cookieName = 'anian_lunar_info';
|
||||||
|
|
||||||
// 1. 优先尝试从 Cookie 读取
|
// 1. 优先尝试从 Cookie 读取
|
||||||
@@ -118,16 +118,15 @@ function setBanner(lunarInfo) {
|
|||||||
fetch(apiUrl)
|
fetch(apiUrl)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.code !== 200) throw new Error('API Error');
|
// 组装农历信息,保持 cookie 字段名不变
|
||||||
|
|
||||||
// 组装农历信息(保留原有逻辑)
|
|
||||||
const lunarInfo = {
|
const lunarInfo = {
|
||||||
ganzhiYear: data.ganzhinian || '',
|
ganzhiYear: data.nian || '',
|
||||||
lunarMonth: data.nyue || '',
|
lunarMonth: data.yue || '',
|
||||||
lunarDay: data.nri || '',
|
lunarDay: data.ri || '',
|
||||||
jieqi: (data.JIEQICN || '').includes('第1天') ? data.jieqi : '',
|
jieqi: data.jieqi || '',
|
||||||
jijie: data.jijie || '',
|
jijie: data.jijie || '',
|
||||||
traditionalFestival: data.YIFESTIVAL || ''
|
shengxiao: data.shengxiao || '',
|
||||||
|
traditionalFestival: data.jieri || ''
|
||||||
};
|
};
|
||||||
|
|
||||||
// 存 Cookie 并设置 Banner
|
// 存 Cookie 并设置 Banner
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="user_pannel round12" uk-dropdown="mode: click;toggle:#top_ava;pos:bottom-right;animation:uk-animation-slide-top-small">
|
<div class="user_pannel round12" uk-dropdown="mode: click;toggle:#top_ava;pos:bottom-right;animation:uk-animation-slide-top-small">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
|
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
|
||||||
<a class="logout" href="javascript:void(0);" onclick="showPixarCard()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
<a class="logout" href="javascript:void(0);" onclick="open_logout_box()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<div class="user_pannel round12" uk-dropdown="mode: click;toggle:#top_ava2;pos:bottom-right;animation:uk-animation-slide-top-small">
|
<div class="user_pannel round12" uk-dropdown="mode: click;toggle:#top_ava2;pos:bottom-right;animation:uk-animation-slide-top-small">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
|
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
|
||||||
<a class="logout" href="javascript:void(0);" onclick="showPixarCard()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
<a class="logout" href="javascript:void(0);" onclick="open_logout_box()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
<div class="form_footer">
|
<div class="form_footer">
|
||||||
<div class="admin_tool">
|
<div class="admin_tool">
|
||||||
<a href="/console" target="_blank"><i class="ri-function-line"></i> 管理</a>
|
<a href="/console" target="_blank"><i class="ri-function-line"></i> 管理</a>
|
||||||
<a class="logout" href="javascript:void(0);" onclick="showPixarCard()"><i class="ri-logout-circle-r-line"></i> 登出</a>
|
<a class="logout" href="javascript:void(0);" onclick="open_logout_box()"><i class="ri-logout-circle-r-line"></i> 登出</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="moment_sure">
|
<div class="moment_sure">
|
||||||
<button class="uk-modal-close push_close">取消</button>
|
<button class="uk-modal-close push_close">取消</button>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<style th:if="${theme.config.moments.img_style == 'one'}">
|
<style th:if="${theme.config.moments.img_style == 'one'}">
|
||||||
|
|
||||||
.img_list .list_inner {
|
.img_list .list_inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -48,14 +47,13 @@
|
|||||||
width: 30%;
|
width: 30%;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img_list span:nth-child(1):nth-last-child(4),
|
.img_list span:nth-child(1):nth-last-child(4),
|
||||||
.img_list span:nth-child(3):nth-last-child(2),
|
.img_list span:nth-child(3):nth-last-child(2),
|
||||||
.img_list span:nth-child(4):nth-last-child(1) {
|
.img_list span:nth-child(4):nth-last-child(1) {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<style th:if="${theme.config.moments.img_style == 'two'}">
|
<style th:if="${theme.config.moments.img_style == 'two'}">
|
||||||
.img_list span:nth-last-child(1):first-child {
|
.img_list span:nth-last-child(1):first-child {
|
||||||
@@ -137,7 +135,8 @@
|
|||||||
grid-area: 5 / 4 / 7 / 7;
|
grid-area: 5 / 4 / 7 / 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img_list .list_inner[num='5'] span:nth-child(4) img,.img_list .list_inner[num='5'] span:nth-child(5) img {
|
.img_list .list_inner[num='5'] span:nth-child(4) img,
|
||||||
|
.img_list .list_inner[num='5'] span:nth-child(5) img {
|
||||||
height: 127.35px;
|
height: 127.35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,82 +164,363 @@
|
|||||||
grid-area: 3 / 3 / 4 / 4;
|
grid-area: 3 / 3 / 4 / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img_list .list_inner[num='7'] {
|
.img_list .list_inner[num='7'] {
|
||||||
display: grid;
|
display: grid;
|
||||||
/* 采用 6 列网格,支持 50% (span 3) 和 33.3% (span 2) 两种尺寸 */
|
/* 采用 6 列网格,支持 50% (span 3) 和 33.3% (span 2) 两种尺寸 */
|
||||||
grid-template-columns: repeat(6, 1fr);
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
|
||||||
/* 间距修正 */
|
|
||||||
gap: 6px;
|
|
||||||
padding: 3px;
|
|
||||||
|
|
||||||
/* 清除干扰 */
|
|
||||||
justify-content: unset;
|
|
||||||
align-content: unset;
|
|
||||||
align-items: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img_list .list_inner[num='7'] span {
|
/* 间距修正 */
|
||||||
/* 清除干扰,保持稳定性 */
|
gap: 6px;
|
||||||
margin: 0 !important;
|
padding: 3px;
|
||||||
padding: 0 !important;
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
|
|
||||||
/* 默认尺寸:中等 (33.3% 宽度, span 2/6) */
|
|
||||||
grid-column: span 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 第一行 (Item 1, 2):大尺寸 (50% 宽度, span 3/6) */
|
/* 清除干扰 */
|
||||||
.img_list .list_inner[num='7'] span:nth-child(1),
|
justify-content: unset;
|
||||||
.img_list .list_inner[num='7'] span:nth-child(2) {
|
align-content: unset;
|
||||||
grid-column: span 3;
|
align-items: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 第三行 (Item 6, 7):大尺寸 (50% 宽度, span 3/6) */
|
.img_list .list_inner[num='7'] span {
|
||||||
.img_list .list_inner[num='7'] span:nth-child(6),
|
/* 清除干扰,保持稳定性 */
|
||||||
.img_list .list_inner[num='7'] span:nth-child(7) {
|
margin: 0 !important;
|
||||||
grid-column: span 3;
|
padding: 0 !important;
|
||||||
}
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
/* 容器设置:保持 6 列网格,用于计算 1/3 和 1/2 宽度 */
|
/* 默认尺寸:中等 (33.3% 宽度, span 2/6) */
|
||||||
.img_list .list_inner[num='8'] {
|
grid-column: span 2;
|
||||||
display: grid;
|
}
|
||||||
grid-template-columns: repeat(6, 1fr); /* 6 列 */
|
|
||||||
|
|
||||||
max-height: 100vw;
|
|
||||||
|
|
||||||
gap: 6px;
|
|
||||||
padding: 3px;
|
|
||||||
|
|
||||||
justify-content: unset;
|
|
||||||
align-content: unset;
|
|
||||||
align-items: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 默认规则:应用到所有子项,用于第 1 行和第 3 行 (1/3 宽度) */
|
/* 第一行 (Item 1, 2):大尺寸 (50% 宽度, span 3/6) */
|
||||||
.img_list .list_inner[num='8'] span {
|
.img_list .list_inner[num='7'] span:nth-child(1),
|
||||||
margin: 0 !important;
|
.img_list .list_inner[num='7'] span:nth-child(2) {
|
||||||
padding: 0 !important;
|
grid-column: span 3;
|
||||||
width: auto;
|
}
|
||||||
height: auto;
|
|
||||||
|
|
||||||
/* 跨 2 列 = 1/3 宽度 (6列/2=3张/行) */
|
|
||||||
grid-column: span 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 特殊规则:仅应用于第 2 行的 2 张图片 (1/2 宽度) */
|
/* 第三行 (Item 6, 7):大尺寸 (50% 宽度, span 3/6) */
|
||||||
.img_list .list_inner[num='8'] span:nth-child(4),
|
.img_list .list_inner[num='7'] span:nth-child(6),
|
||||||
.img_list .list_inner[num='8'] span:nth-child(5) {
|
.img_list .list_inner[num='7'] span:nth-child(7) {
|
||||||
/* 跨 3 列 = 1/2 宽度 (6列/3=2张/行) */
|
grid-column: span 3;
|
||||||
grid-column: span 3;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* 确保第 1 行和第 3 行的宽度不被其他 CSS 规则干扰 */
|
/* 容器设置:保持 6 列网格,用于计算 1/3 和 1/2 宽度 */
|
||||||
.img_list .list_inner[num='8'] span:nth-child(-n+3), /* 第 1, 2, 3 个 */
|
.img_list .list_inner[num='8'] {
|
||||||
.img_list .list_inner[num='8'] span:nth-child(n+6) { /* 第 6, 7, 8 个 */
|
display: grid;
|
||||||
grid-column: span 2;
|
grid-template-columns: repeat(6, 1fr);
|
||||||
}
|
/* 6 列 */
|
||||||
|
|
||||||
|
max-height: 100vw;
|
||||||
|
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 默认规则:应用到所有子项,用于第 1 行和第 3 行 (1/3 宽度) */
|
||||||
|
.img_list .list_inner[num='8'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
|
/* 跨 2 列 = 1/3 宽度 (6列/2=3张/行) */
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 特殊规则:仅应用于第 2 行的 2 张图片 (1/2 宽度) */
|
||||||
|
.img_list .list_inner[num='8'] span:nth-child(4),
|
||||||
|
.img_list .list_inner[num='8'] span:nth-child(5) {
|
||||||
|
/* 跨 3 列 = 1/2 宽度 (6列/3=2张/行) */
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 确保第 1 行和第 3 行的宽度不被其他 CSS 规则干扰 */
|
||||||
|
.img_list .list_inner[num='8'] span:nth-child(-n+3),
|
||||||
|
/* 第 1, 2, 3 个 */
|
||||||
|
.img_list .list_inner[num='8'] span:nth-child(n+6) {
|
||||||
|
/* 第 6, 7, 8 个 */
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 10 张:完整矩形(6 列,3+2+2+3) */
|
||||||
|
.img_list .list_inner[num='10'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='10'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='10'] span:nth-child(4),
|
||||||
|
.img_list .list_inner[num='10'] span:nth-child(5),
|
||||||
|
.img_list .list_inner[num='10'] span:nth-child(6),
|
||||||
|
.img_list .list_inner[num='10'] span:nth-child(7) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 11 张:完整矩形(6 列,2+3+3+3) */
|
||||||
|
.img_list .list_inner[num='11'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='11'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='11'] span:nth-child(1),
|
||||||
|
.img_list .list_inner[num='11'] span:nth-child(2) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 13 张:完整矩形(6 列,3+2+3+2+3) */
|
||||||
|
.img_list .list_inner[num='13'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='13'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='13'] span:nth-child(4),
|
||||||
|
.img_list .list_inner[num='13'] span:nth-child(5),
|
||||||
|
.img_list .list_inner[num='13'] span:nth-child(9),
|
||||||
|
.img_list .list_inner[num='13'] span:nth-child(10) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 14 张:完整矩形(6 列,3+3+2+3+3) */
|
||||||
|
.img_list .list_inner[num='14'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='14'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='14'] span:nth-child(7),
|
||||||
|
.img_list .list_inner[num='14'] span:nth-child(8) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 16 张:完整矩形(6 列,3+2+3+3+2+3) */
|
||||||
|
.img_list .list_inner[num='16'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='16'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='16'] span:nth-child(4),
|
||||||
|
.img_list .list_inner[num='16'] span:nth-child(5),
|
||||||
|
.img_list .list_inner[num='16'] span:nth-child(12),
|
||||||
|
.img_list .list_inner[num='16'] span:nth-child(13) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 17 张:完整矩形(6 列,2+3+2+3+2+3+2) */
|
||||||
|
.img_list .list_inner[num='17'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='17'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(1),
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(2),
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(6),
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(7),
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(11),
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(12),
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(16),
|
||||||
|
.img_list .list_inner[num='17'] span:nth-child(17) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 19 张:完整矩形(6 列,3+3+2+3+3+2+3) */
|
||||||
|
.img_list .list_inner[num='19'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='19'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='19'] span:nth-child(7),
|
||||||
|
.img_list .list_inner[num='19'] span:nth-child(8),
|
||||||
|
.img_list .list_inner[num='19'] span:nth-child(15),
|
||||||
|
.img_list .list_inner[num='19'] span:nth-child(16) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 20 张:完整矩形(6 列,3+2+3+2+3+2+3+2) */
|
||||||
|
.img_list .list_inner[num='20'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='20'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(4),
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(5),
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(9),
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(10),
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(14),
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(15),
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(19),
|
||||||
|
.img_list .list_inner[num='20'] span:nth-child(20) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 22 张:完整矩形(6 列,3+3+2+3+3+2+3+3) */
|
||||||
|
.img_list .list_inner[num='22'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='22'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='22'] span:nth-child(7),
|
||||||
|
.img_list .list_inner[num='22'] span:nth-child(8),
|
||||||
|
.img_list .list_inner[num='22'] span:nth-child(15),
|
||||||
|
.img_list .list_inner[num='22'] span:nth-child(16) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 23 张:完整矩形(6 列,3+2+3+2+3+2+3+2+3) */
|
||||||
|
.img_list .list_inner[num='23'] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
justify-content: unset;
|
||||||
|
align-content: unset;
|
||||||
|
align-items: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='23'] span {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(4),
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(5),
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(9),
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(10),
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(14),
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(15),
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(19),
|
||||||
|
.img_list .list_inner[num='23'] span:nth-child(20) {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.img_list span img {
|
.img_list span img {
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ spec:
|
|||||||
issues: "https://github.com/chengzhongxue/halo-theme-pix/issues"
|
issues: "https://github.com/chengzhongxue/halo-theme-pix/issues"
|
||||||
settingName: "theme-pix-setting"
|
settingName: "theme-pix-setting"
|
||||||
configMapName: "theme-pix-configMap"
|
configMapName: "theme-pix-configMap"
|
||||||
version: "1.2.5-3"
|
version: "1.2.5-7"
|
||||||
require: ">=2.20.0"
|
require: ">=2.20.0"
|
||||||
customTemplates:
|
customTemplates:
|
||||||
page:
|
page:
|
||||||
|
|||||||
Reference in New Issue
Block a user