6 Commits

25 changed files with 3652 additions and 1976 deletions
+17
View File
@@ -2,6 +2,23 @@
> 基于原作者v1.2.5代码修改
#### v1.2.5-5
1. 朋友圈支持图片显示(需同步更新插件)
2. 手机端底部导航栏新增公告未读提示
3. 更新通讯录、储物柜
4. 优化操作提示、图片排版
#### v1.2.5-4
1. 修复侧边栏测速异常、拖拽片刻图片异常、手机端文章目录异常、页面提示异常
2. 优化多种场景下的提示、衔接、样式
3. 新增片刻删除提示框及删除动画
#### v1.2.5-3
1. 朋友圈支持根据作者筛选内容(需同步更新插件)
2. 支持前台弹窗登入登出
3. 附录页面功能补全
4. 对线路切换、加载异常等情况进行了深度优化
#### v1.2.5-2
1. 添加侧边栏、页面、文章等HTML内容块
2. 通知书推送时机改为RSS触发
+7 -7
View File
@@ -299,7 +299,7 @@
<div class="people-grid">
<div class="person">
<div class="avatar">
<img src="/upload/8aea7800gy1i2vfbxoqhdj24w07c0b2p.jpg">
<img src="/upload/20260416214530_191_129.jpg">
</div>
<div class="info">
<p class="name">黄诗扶</p>
@@ -310,18 +310,18 @@
</div>
<div class="person">
<div class="avatar">
<img src="/upload/ec39c62fly1i3rextah4gj22dc35s1ky.jpg">&nbsp;
<img src="/upload/20260416213611_190_129.jpg">
</div>
<div class="info">
<p class="name">双笙</p>
<p class="bio">
什么?你问我为什么喜欢包包?可能因为是青春吧?
什么?你问我为什么喜欢包包?可能因为是青春吧?
</p>
</div>
</div>
<div class="person">
<div class="avatar">
<img src="/upload/005Jyswjgy1hywx7z7sb7j30zk1betbd.jpg">
<img src="/upload/005Jyswjgy1ic7xfxtlu8j33402c0npe.jpg">
</div>
<div class="info">
<p class="name">浅影阿</p>
@@ -332,12 +332,12 @@
</div>
<div class="person">
<div class="avatar">
<img src="/upload/ab0efe4ely1hnpfzqqw1oj23ls5eoqvg.jpg">
<img src="/upload/67f2efd2gy1i8iv8nkuqjj23344mokjp.jpg">
</div>
<div class="info">
<p class="name">平生不晚</p>
<p class="name">玄觞</p>
<p class="bio">
首先是戏腔好听,然后是妆造好看,最后就来到了这里
你们古风圈,怎么都喊女生王子,喊男生二婶呢?
</p>
</div>
</div>
+184 -215
View File
@@ -1,119 +1,23 @@
<div
style="max-width: 1200px; margin: 20px auto; padding: 0 15px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
<!-- 链接卡片容器 - 桌面4列,平板/手机2列 -->
<div class="link-container" style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;">
<!-- 媒体查询:桌面端(≥768px)显示4列 -->
<style>
/* 基础布局样式 */
@media (min-width: 768px) {
.link-container {
grid-template-columns: repeat(4, 1fr) !important;
}
}
.ri-icon {
color: white !important;
fill: white !important;
}
.link-container>a {
display: flex !important;
flex-direction: column !important;
height: 100% !important;
text-decoration: none !important;
}
.link-container>a>div {
flex: 1 !important;
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
border-radius: 12px !important;
padding: 25px 15px !important;
text-align: center !important;
position: relative !important;
overflow: hidden !important;
transition: all 0.3s ease !important;
/* 基础边框:无!important,靠类优先级控制 */
border: 2px solid transparent;
}
/* ========== CSS优先级顺序:默认 → 未读基础 → hover → 未读hover ========== */
/* 1. 通用默认样式(初始无黑框) */
.link-card-default {
background: #f0f7f4 !important;
transform: translateY(0) !important;
box-shadow: none !important;
border-color: transparent !important;
}
/* 2. 公告未读基础样式(红色调,优先级高于默认) */
.notice-unread {
background: #fff5f5 !important;
/* 浅红背景 */
}
.notice-unread .notice-icon-bg {
background: #e53e3e !important;
/* 红色图标背景 */
}
.notice-unread .notice-title {
color: #c53030 !important;
/* 深红标题 */
}
.notice-unread .notice-desc {
color: #e53e3e !important;
/* 红色描述 */
font-weight: 500 !important;
}
/* 3. 通用hover样式(绿色边框,必显) */
.link-card-hover {
transform: translateY(-5px) !important;
box-shadow: 0 10px 20px rgba(72, 187, 120, 0.15) !important;
border: 2px solid #74c69d !important;
/* 绿色边框 */
}
/* 4. 公告未读hover样式(红色边框,优先级最高) */
.notice-unread-hover {
transform: translateY(-5px) !important;
box-shadow: 0 10px 20px rgba(229, 62, 62, 0.15) !important;
border: 2px solid #fc8181 !important;
/* 红色边框 */
}
</style>
<!-- 公告模块 -->
<a href="/notice">
<div id="my-links-widget" style="max-width: 1200px; margin: 20px auto; padding: 0 15px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
<div id="link-container" class="link-container" style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;">
<a href="/notice" target="_self" data-is-notice="true">
<div id="notice-card" class="link-card-default">
<div
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 class="notice-icon-bg"
style="width: 60px; height: 60px; background: #40916c; border-radius: 10px; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;">
<div class="icon-box" 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-megaphone-line ri-icon" style="font-size: 30px;"></i>
</div>
<h4 id="notice-title" class="notice-title"
style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">通知书</h4>
<p id="notice-desc" class="notice-desc"
style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">最新通知与提醒</p>
<h4 class="notice-title" style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">通知书</h4>
<p class="notice-desc" style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">最新通知与提醒</p>
</div>
</div>
</a>
<!-- 告知信链接 -->
<a href="/about">
<a href="/about" target="_self">
<div class="link-card-default">
<div
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="width: 60px; height: 60px; background: #40916c; border-radius: 10px; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;">
<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-mail-line ri-icon" style="font-size: 30px;"></i>
</div>
<h4 style="color: #2d6a4f; margin: 0 0 5px; font-size: 18px; font-weight: 500;">告知信</h4>
@@ -122,160 +26,225 @@
</div>
</a>
<!-- 通讯录链接 -->
<a href="/address">
<a href="/content" target="_self">
<div class="link-card-default">
<div
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="width: 60px; height: 60px; background: #40916c; border-radius: 10px; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;">
<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-plant-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="/photos" 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-folder-image-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="/address" 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-contacts-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>
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">猜猜看会有谁呢</p>
</div>
</div>
</a>
<!-- 朋友圈链接 -->
<a href="/friends">
<a href="/friends" target="_self">
<div class="link-card-default">
<div
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="width: 60px; height: 60px; background: #40916c; border-radius: 10px; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;">
<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-message-3-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>
<p style="color: #36A28E; font-size: 13px; margin: 0; opacity: 0.8;">大家都在干什么</p>
</div>
</div>
</a>
<a href="/store" 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-building-4-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="/qiyu" 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-book-3-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">
<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-file-list-3-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="https://git.anian.cc/explore/repos" 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-pull-request-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="#" 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-door-open-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="#" 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>
</a>
</div>
<!-- 兼容PJAX的脚本(核心:保留未读类,仅重置hover/默认类) -->
<script>
// 2. 公告状态初始化(保留未读类)
async function initNoticeStatus() {
const combinedDateStr = await getAllLatestNoticeDatesFromRSS();
const noticeCard = document.getElementById('notice-card');
const noticeTitle = document.getElementById('notice-title');
const noticeDesc = document.getElementById('notice-desc');
if (!noticeCard || !noticeTitle || !noticeDesc) return;
if (!combinedDateStr) {
console.warn('获取最新版本失败');
return;
<style>
@media (max-width: 767px) {
#my-links-widget { margin-top: 40px !important; }
}
@media (min-width: 768px) {
.link-container { grid-template-columns: repeat(4, 1fr) !important; }
}
.ri-icon { color: white !important; fill: white !important; }
.link-container>a { display: flex !important; flex-direction: column !important; height: 100% !important; text-decoration: none !important; }
.link-container>a>div { flex: 1 !important; display: flex !important; flex-direction: column !important; justify-content: center !important; border-radius: 12px !important; padding: 25px 15px !important; text-align: center !important; position: relative !important; overflow: hidden !important; transition: all 0.3s ease !important; border: 2px solid #e2e8f0; }
.link-card-default { background: #f0f7f4 !important; }
// 保存未读状态标记(避免重置类时丢失)
const isUnreadBefore = noticeCard.classList.contains('notice-unread');
.notice-unread {
background: #fffbeb !important;
border-color: #fce788 !important;
}
.notice-unread .icon-box { background: #d69e2e !important; }
.notice-unread .notice-title { color: #b7791f !important; }
.notice-unread .notice-desc { color: #d69e2e !important; font-weight: 500 !important; }
// 重置基础样式(保留未读类)
noticeCard.classList.remove('link-card-hover', 'notice-unread-hover');
noticeCard.classList.add('link-card-default');
noticeTitle.textContent = '通知书';
noticeDesc.textContent = '最新通知与提醒';
const decorCircle = noticeCard.querySelector('div[style*="position: absolute; top: -20px"]');
decorCircle && (decorCircle.style.background = '#d8f3dc');
.link-card-hover { transform: translateY(-5px) !important; box-shadow: 0 10px 20px rgba(72, 187, 120, 0.15) !important; border-color: #74c69d !important; }
.notice-unread-hover { transform: translateY(-5px) !important; box-shadow: 0 10px 20px rgba(214, 158, 46, 0.15) !important; border-color: #ecc94b !important; }
</style>
// 判断未读状态(重新应用未读类)
const local_notice = getCookie('latest_notice_date');
const isUnread = !local_notice || local_notice !== combinedDateStr;
<script>
(function() {
const widget = document.getElementById('my-links-widget');
if (!widget) return;
async function initNoticeStatus() {
const noticeCard = document.getElementById('notice-card');
if (!noticeCard || typeof getAllLatestNoticeDatesFromRSS !== 'function') return;
const combinedDateStr = await getAllLatestNoticeDatesFromRSS();
const decorCircle = noticeCard.querySelector('.decor-circle');
const isUnread = combinedDateStr && (!getCookie('latest_notice_date') || getCookie('latest_notice_date') !== combinedDateStr);
if (isUnread) {
initNoticeTip();
noticeTitle.textContent = `通知书`;
noticeDesc.textContent = `有新通知待查看`;
noticeCard.classList.add('notice-unread'); // 重新添加未读类
decorCircle && (decorCircle.style.background = '#fed7d7');
typeof initNoticeTip === 'function' && initNoticeTip();
$('.footer_menu a[href="/navigator"]').css('color', '#ecc94b').find('i').css('color', '#ecc94b');
noticeCard.querySelector('.notice-title').textContent = '通知书';
noticeCard.querySelector('.notice-desc').textContent = '有新通知待查看';
noticeCard.classList.add('notice-unread');
if(decorCircle) decorCircle.style.background = '#fef3c7';
// 绑定点击标记已读
const noticeLink = noticeCard.closest('a');
noticeLink.removeEventListener('click', markNoticeRead);
noticeLink.addEventListener('click', markNoticeRead);
function markNoticeRead() {
setLongCookie('latest_notice_date', combinedDateStr);
markAsRead(combinedDateStr);
// 标记已读:移除未读类,恢复默认
noticeTitle.textContent = '通知书';
noticeDesc.textContent = '最新通知与提醒';
noticeCard.classList.remove('notice-unread');
noticeCard.classList.add('link-card-default');
decorCircle && (decorCircle.style.background = '#d8f3dc');
}
} else if (isUnreadBefore) {
// 已读:移除未读类
noticeCard.classList.remove('notice-unread');
noticeLink.onclick = function() {
$.cookie('latest_notice_date', combinedDateStr, { path: '/', domain: 'anian.cc', expires: 365 });
typeof markAsRead === 'function' && markAsRead(combinedDateStr);
};
}
}
// 3. Hover事件绑定(核心:不删除notice-unread类)
function initCardHover() {
// 移除所有旧事件
document.querySelectorAll('.link-container > a').forEach(card => {
card.removeEventListener('mouseenter', handleMouseEnter);
card.removeEventListener('mouseleave', handleMouseLeave);
});
const cardDiv = card.querySelector('div');
const decorCircle = cardDiv.querySelector('.decor-circle');
// 重置hover样式(保留未读类)
document.querySelectorAll('.link-container > a > div').forEach(cardDiv => {
cardDiv.classList.remove('link-card-hover', 'notice-unread-hover');
if (!cardDiv.classList.contains('link-card-default')) {
cardDiv.classList.add('link-card-default');
}
});
// 重新绑定hover事件
document.querySelectorAll('.link-container > a').forEach(card => {
card.addEventListener('mouseenter', handleMouseEnter);
card.addEventListener('mouseleave', handleMouseLeave);
});
// Hover处理函数(仅切换hover类,保留未读/默认类)
function handleMouseEnter() {
const cardDiv = this.querySelector('div');
const decorCircle = cardDiv.querySelector('div[style*="position: absolute; top: -20px"]');
// 移除默认hover,添加对应hover类
cardDiv.classList.remove('link-card-default');
if (cardDiv.id === 'notice-card' && cardDiv.classList.contains('notice-unread')) {
cardDiv.classList.add('notice-unread-hover'); // 未读→红色hover
card.onmouseenter = () => {
if (cardDiv.classList.contains('notice-unread')) {
cardDiv.classList.add('notice-unread-hover');
} else {
cardDiv.classList.add('link-card-hover'); // 其他→绿色hover
}
decorCircle && (decorCircle.style.transform = 'scale(1.5)');
cardDiv.classList.add('link-card-hover');
}
if(decorCircle) decorCircle.style.transform = 'scale(1.5)';
};
function handleMouseLeave() {
const cardDiv = this.querySelector('div');
const decorCircle = cardDiv.querySelector('div[style*="position: absolute; top: -20px"]');
// 移除hover类,恢复默认类(保留未读类)
card.onmouseleave = () => {
cardDiv.classList.remove('link-card-hover', 'notice-unread-hover');
cardDiv.classList.add('link-card-default');
decorCircle && (decorCircle.style.transform = 'scale(1)');
}
if(decorCircle) decorCircle.style.transform = 'scale(1)';
};
});
}
// 4. 统一初始化入口
function initAll() {
initNoticeStatus();
if (!document.getElementById('my-links-widget')) return;
initCardHover();
initNoticeStatus();
}
// 5. 绑定加载事件(初始+PJAX)
if (document.readyState === 'loading') {
document.addEventListener("DOMContentLoaded", initAll);
document.addEventListener("pjax:complete", initAll);
window.jQuery && jQuery(document).on('pjax:complete', initAll);
} else {
initAll();
}
})();
</script>
</div>
-2
View File
@@ -236,7 +236,6 @@
// 检查是否有解析错误
const parseError = xmlDoc.getElementsByTagName("parsererror");
if (parseError.length > 0) {
console.error("[RSS Debug] XML 解析失败", parseError[0].textContent);
listBox.innerHTML = '<div style="color:#f56c6c;">XML 解析错误</div>';
return;
}
@@ -265,7 +264,6 @@
listBox.innerHTML = htmlContent || '<div style="color:#999;">暂无更新内容</div>';
} catch (error) {
console.error('[RSS Debug] 请求发生异常:', error);
listBox.innerHTML = `<div style="color:#f56c6c;font-size:14px;">请求失败: ${error.message}</div>`;
}
}
+111 -86
View File
@@ -3,7 +3,6 @@
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Inter", "Microsoft YaHei", Arial;
}
.store {
@@ -13,7 +12,7 @@
--danger: #E74C3C;
--bg: #F9FFFB;
--shadow: 0 12px 30px rgba(80, 200, 120, .12);
--radius: 18px;
--radius: 8px;
padding: 26px 14px;
background: var(--bg);
}
@@ -59,7 +58,7 @@
#tag-search {
width: 100%;
padding: 7px 12px 7px 34px;
border-radius: 10px;
border-radius: 8px;
border: 1px solid #c9efd6;
outline: none;
background: #fafffb;
@@ -79,7 +78,7 @@
flex-wrap: wrap;
gap: 8px;
padding: 8px;
border-radius: 12px;
border-radius: 8px;
border: 1px solid #c9efd6;
background: rgba(144, 238, 144, .08);
max-height: 100px;
@@ -89,7 +88,7 @@
.store .tag-item {
padding: 5px 7px;
border-radius: 9px;
border-radius: 8px;
border: 1px solid #90ee90;
font-size: 12px;
cursor: pointer;
@@ -107,31 +106,66 @@
.store .no-result {
width: 100%;
text-align: center;
align-items: center;
justify-content: center;
color: #7f8c8d;
font-size: 13px;
padding: 8px 0;
min-height: 100%;
padding: 0;
display: none;
}
/* 输入框 */
.store .input-group {
display: flex;
gap: 10px;
gap: 8px;
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 {
flex: 1;
padding: 8px 14px;
border-radius: 12px;
border-radius: 8px;
border: 2px solid #e8f7ec;
font-size: 14px;
outline: none;
}
#submit-btn {
padding: 10px;
border-radius: 12px;
padding: 10px 20px;
border-radius: 8px;
border: none;
background: linear-gradient(135deg, #50c878, #3a9156);
color: #fff;
@@ -139,17 +173,6 @@
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) {
.store {
@@ -166,7 +189,8 @@
}
.store .input-group {
flex-direction: column
flex-direction: column;
align-items: stretch;
}
#submit-btn {
@@ -176,34 +200,11 @@
.store .tag-list {
max-height: 120px
}
}
/* Toast */
.custom-toast {
position: fixed;
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;
#file-path {
width: 100%;
box-sizing: border-box;
}
.toast-show {
transform: translateX(-50%) translateY(0);
opacity: 1
}
.toast-error {
background: #E74C3C
}
.toast-warning {
background: #F39C12
}
</style>
@@ -211,58 +212,55 @@
<div class="container">
<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-search-wrapper">
<span class="search-icon">🔍</span>
<input id="tag-search" placeholder="搜索标签">
<span class="search-icon"><i class="ri-search-line"></i></span>
<input id="tag-search" placeholder="搜索标签..." autocomplete="off">
</div>
<div class="tag-list">
<div class="tag-item" data-value="test.zip">测试压缩包</div>
<div class="tag-item" data-value="docs/report.pdf">示例报告</div>
<div class="tag-item" data-value="images/banner.jpg">横幅图片</div>
<div class="tag-item" data-value="software/setup.exe">安装程序</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="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>
</div>
<div class="input-group">
<input id="file-path" placeholder="请输入路径" autocomplete="off">
<button id="submit-btn">访问 / 下载</button>
</div>
<p class="tips">⚠️ 错误过多将可能被封禁</p>
</div>
<div class="custom-toast" id="customToast"></div>
</div>
<script>
function initializeStoreEvents() {
let closeLoading = null;
const container = document.querySelector(".store");
if (!container || container.dataset.init === "1") return;
container.dataset.init = "1";
const input = document.getElementById('file-path');
const btn = document.getElementById('submit-btn');
const toast = document.getElementById('customToast');
const tagItems = document.querySelectorAll('.tag-item');
const tagSearch = document.getElementById('tag-search');
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 => {
t.onclick = () => {
input.value = t.dataset.value;
showToast('已填入 ' + t.dataset.value, 'success');
cocoMessage.success('已填入对应标签信息');
};
});
@@ -277,39 +275,66 @@
if (show) visible++;
});
noResult.style.display = visible === 0 ? 'block' : 'none';
noResult.style.display = visible === 0 ? 'flex' : 'none';
};
function check(url) {
return new Promise(r => {
const xhr = new XMLHttpRequest();
try {
xhr.open('HEAD', url, true);
} catch (e) {
r(0);
return;
}
xhr.timeout = 5000;
xhr.onload = () => r(xhr.status === 200);
xhr.onerror = () => r(false);
xhr.ontimeout = () => r(false);
xhr.onload = () => r(xhr.status);
xhr.onerror = () => r(0);
xhr.ontimeout = () => r(0);
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() {
const v = input.value.trim();
if (!v) return showToast('请输入路径');
const url = '/' + v;
btn.textContent = '检测中...';
if (!v) return cocoMessage.warning('请输入翻找目标');
const url = normalizeDestination(v);
if (!url) return cocoMessage.warning('翻找目标无效');
btn.textContent = '翻找中...';
closeLoading = cocoMessage.loading('正在翻找中,请稍候...');
btn.disabled = true;
const ok = await check(url);
if (ok) {
showToast('资源存在,跳转中', 'success');
setTimeout(() => location.href = url, 700);
} else showToast('资源不存在', 'error');
setTimeout(() => { btn.textContent = '访问 / 下载'; btn.disabled = false }, 700);
try {
const status = await check(url);
if (status === 200) {
cocoMessage.success('翻找成功,即将打开目标页面');
window.open(url, '_blank');
} else if (status === 404) {
cocoMessage.warning('翻找失败,失败过多将被封禁');
} else {
cocoMessage.error('翻找异常,请重试或刷新页面');
}
} finally {
closeLoading?.();
closeLoading = null;
btn.textContent = '翻 找';
btn.disabled = false;
}
}
btn.onclick = go;
input.onkeydown = e => { if (e.key === 'Enter') go(); };
}
document.addEventListener("DOMContentLoaded", initializeStoreEvents);
document.addEventListener("pjax:complete", initializeStoreEvents);
initializeStoreEvents();
</script>
+549
View File
@@ -17,10 +17,12 @@
max-width: 75dvw !important;
object-fit: contain;
}
/* 片刻视频容器鼠标样式 */
.fancybox.mo_img {
cursor: zoom-in;
}
/* 图库视频图标hover放大 */
.video-fancybox .play-icon {
transition: all 0.4s ease !important;
@@ -30,7 +32,554 @@
width: 40px;
height: 40px;
}
.video-fancybox:hover .play-icon {
transform: scale(1.3) !important;
opacity: 1;
}
/* 目录左边距:贴紧左侧边栏 */
.listree-box {
margin-left: 0;
}
@media (min-width: 960px) and (max-width: 1359.98px) {
.listree-box {
margin-left: calc((100vw - 860px) / 2 + 284px);
}
}
@media (min-width: 1360px) {
.listree-box {
margin-left: calc((100vw - 1400px) / 2 + 291px);
}
}
/* 登录容器 */
.custom-login-modal {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.55);
display: flex;
align-items: center;
justify-content: center;
z-index: 1999;
opacity: 0;
visibility: hidden;
transition: all .25s ease;
}
.custom-login-modal.show {
opacity: 1;
visibility: visible;
}
.login-modern-card {
width: 250px;
background: #ffffff;
padding: 30px 25px;
border-radius: 14px;
position: relative;
overflow: hidden;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
.login-modern-card::before {
position: absolute;
content: "";
width: 360px;
height: 360px;
background: #e6f9ee;
transform: rotate(45deg);
left: -230px;
bottom: 20px;
border-radius: 40px;
z-index: 0;
}
.login-modern-form {
display: flex;
flex-direction: column;
position: relative;
z-index: 2;
}
.login-modern-title {
text-align: center;
font-size: 1.3rem;
font-weight: 600;
color: #1f2937;
margin-bottom: 15px;
}
.login-modern-input-wrapper {
width: 100%;
position: relative;
display: flex;
align-items: center;
margin-bottom: 20px;
}
.login-modern-icon {
position: absolute;
left: 2px;
font-size: 18px;
color: #6b7280;
}
.custom-login-modal input.login-modern-input {
width: 100%;
height: 38px;
padding-left: 30px;
font-size: 0.9rem;
color: #1f2937;
background: transparent !important;
border: none !important;
border-radius: 0 !important;
outline: none !important;
box-shadow: none !important;
border-bottom: 2px solid #cbd5e1 !important;
transition: border-color .2s;
}
.custom-login-modal input.login-modern-input::placeholder {
color: #94a3b8;
}
.custom-login-modal input.login-modern-input:focus {
border-bottom: 2px solid #22c55e !important;
}
.login-modern-submit {
width: 100%;
height: 35px;
border: none;
border-radius: 6px;
background: #22c55e;
color: white;
font-size: 0.9rem;
letter-spacing: .5px;
cursor: pointer;
transition: background .2s;
display: flex;
align-items: center;
justify-content: center;
padding: 0 !important;
}
.login-modern-submit:hover {
background: #16a34a;
}
.login-modern-submit:disabled {
background: #a7d7bd;
cursor: not-allowed;
color: #f0fdf4;
}
.login-modern-submit:disabled:hover {
background: #a7d7bd;
}
.close-modal-btn {
position: absolute;
right: 5px;
top: 5px;
border: none;
background: transparent;
font-size: 22px;
color: #9ca3af;
cursor: pointer;
z-index: 3;
}
/* 退出登录 */
.pixar-notice-wrapper {
display: none;
position: fixed;
inset: 0;
z-index: 1999;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.35);
font-family: "Arial Rounded MT Bold", "Helvetica Rounded", Arial, sans-serif;
}
.pixar-notice-card {
--pixar-ui-blue: #5c99e2;
--pixar-ui-green: #61c470;
--pixar-ui-green-shadow: #45a253;
--pixar-ui-red: #e65e5e;
--pixar-ui-red-shadow: #c14242;
--pixar-ui-cream: #f5f1e8;
--pixar-ui-dark: #4d4c4a;
--pixar-ui-green-border: #2e7d32;
--pixar-ui-red-border: #8f2d2d;
--pixar-button-depth: 0.15em;
width: 19em;
max-width: 300px;
background: var(--pixar-ui-cream);
border-radius: 1.5em;
padding: 1.2em;
border: 0.2em solid var(--pixar-ui-dark);
box-shadow: 0.6em 0.6em 0 var(--pixar-ui-dark);
display: flex;
flex-direction: column;
transition: transform .2s cubic-bezier(.34, 1.56, .64, 1),
box-shadow .2s cubic-bezier(.34, 1.56, .64, 1);
}
.pixar-notice-card:hover {
transform: translateY(-.5em) rotate(-2deg);
box-shadow: .8em .8em 0 var(--pixar-ui-dark);
}
.pixar-notice-header {
display: flex;
align-items: center;
margin-bottom: 1em;
}
.pixar-notice-avatar {
width: 3.5em;
height: 3.5em;
border-radius: 50%;
background: linear-gradient(45deg, #f9a86d, #f48a58);
border: .2em solid var(--pixar-ui-dark);
box-shadow: .2em .2em 0 var(--pixar-ui-dark);
transition: transform .3s ease;
}
.pixar-notice-card:hover .pixar-notice-avatar {
transform: scale(1.05) rotate(5deg);
}
.pixar-notice-username {
margin-left: .8em;
font-size: 1.2em;
font-weight: 700;
color: var(--pixar-ui-dark);
}
.pixar-notice-image-area {
background: #d8d2c6;
border-radius: 1em;
padding: .8em;
border: .2em solid var(--pixar-ui-dark);
box-shadow: inset .2em .2em 0 #b3ac9f;
}
.pixar-notice-caption {
margin: 10px 5px !important;
font-size: .9em;
line-height: 1.4;
color: var(--pixar-ui-dark);
font-weight: 600;
}
.pixar-notice-actions {
display: flex;
justify-content: space-around;
margin-top: 1.5em;
}
.pixar-notice-btn {
border: .2em solid var(--pixar-ui-dark);
border-radius: 1em;
padding: .5em .8em;
font-size: 1.6em;
cursor: pointer;
background: var(--pixar-ui-green);
box-shadow:
0 var(--pixar-button-depth) 0 var(--pixar-ui-green-shadow),
0 .4em 0 var(--pixar-ui-dark);
transition: transform .1s ease,
box-shadow .1s ease;
}
.pixar-notice-btn:active {
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: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 {
background: var(--pixar-ui-red);
box-shadow:
0 var(--pixar-button-depth) 0 var(--pixar-ui-red-shadow),
0 .4em 0 var(--pixar-ui-dark);
}
.pixar-notice-btn-close:active {
box-shadow:
0 0 0 var(--pixar-ui-red-shadow),
0 var(--pixar-button-depth) 0 var(--pixar-ui-dark);
}
.pixar-notice-btn-confirm:hover {
border-color: var(--pixar-ui-green-border) !important;
}
.pixar-notice-btn-close:hover {
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.125rem;
font-weight: 600;
line-height: 1.5rem;
display: block;
}
.moments-message-text {
margin-top: 0.5rem;
margin-bottom: 0;
color: #6b7280;
font-size: 0.875rem;
line-height: 1.25rem;
}
.moments-button-group {
margin-top: 1rem;
display: flex;
gap: 0.75rem;
flex-direction: row-reverse;
}
.moments-btn-confirm {
flex: 1;
display: inline-flex;
padding: 0.5rem 1rem;
background-color: #dc2626;
color: #ffffff;
font-size: 0.875rem;
line-height: 1.5rem;
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.875rem;
line-height: 1.5rem;
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);
}
}
File diff suppressed because it is too large Load Diff
+78 -28
View File
@@ -3,6 +3,7 @@
* 合并了原 1440px 1920px 的通用样式并应用了你指定的 mod_third 布局
*/
@media only screen and (min-width: 1366px) {
/* --- 你提供的统一布局样式 --- */
body.mod_third .main_wrap,
body.mod_third .go_top_box {
@@ -13,23 +14,28 @@
body.mod_third .left_nav {
width: 21%;
}
body.mod_third .main_sidebar {
width: 21%;
}
body.mod_third .page_main {
width: 58%; /* 主内容区 */
width: 58%;
/* 主内容区 */
}
/* 底部导航栏和背景音乐盒定位 */
body.mod_third .footer_nav {
max-width: 1108px;
}
body.mod_third .bgm_box {
margin-left: -75px;
}
/* --- 桌面端通用的基础样式合并 (源自原1440/1920) --- */
.footer_top, .footer_text {
.footer_top,
.footer_text {
font-size: 12px;
}
@@ -91,11 +97,14 @@
padding: 0 40px;
}
.land_nav a span , .land_nav a i {
.land_nav a span,
.land_nav a i {
font-size: 14px;
}
body.mod_third .main_wrap , body.mod_third .go_top_box , body.mod_third .footer_nav {
body.mod_third .main_wrap,
body.mod_third .go_top_box,
body.mod_third .footer_nav {
max-width: 860px;
}
@@ -103,7 +112,7 @@
display: none;
}
body.mod_third #top_third{
body.mod_third #top_third {
display: flex;
}
@@ -201,7 +210,8 @@
margin: 0;
}
.land_right .beian , .land_right .copyright {
.land_right .beian,
.land_right .copyright {
color: #293563;
}
}
@@ -211,7 +221,10 @@
* 保持原样
*/
@media only screen and (max-width:960px) {
.main_wrap , .top_bar , .footer_nav {
.main_wrap,
.top_bar,
.footer_nav {
max-width: 720px;
}
@@ -219,7 +232,8 @@
margin-top: 0;
}
.lbc .page_main , .lbc .footer_nav_box .right {
.lbc .page_main,
.lbc .footer_nav_box .right {
width: 100%;
}
@@ -237,7 +251,9 @@
display: none;
}
body.mod_third .main_wrap, body.mod_third .go_top_box, body.mod_third .footer_nav {
body.mod_third .main_wrap,
body.mod_third .go_top_box,
body.mod_third .footer_nav {
max-width: 720px;
}
@@ -249,7 +265,7 @@
display: none;
}
body.mod_third_s #top_third{
body.mod_third_s #top_third {
display: block;
}
@@ -267,7 +283,9 @@
* 保持原样
*/
@media only screen and (max-width:540px) {
body.mod_third_s #top_third,body.mod_third #top_third{
body.mod_third_s #top_third,
body.mod_third #top_third {
display: flex;
}
@@ -282,11 +300,15 @@
height: 54px;
}
.moment_cat_nav, .posts_cat_nav, .photos_cat_nav {
.moment_cat_nav,
.posts_cat_nav,
.photos_cat_nav,
.friends_cat_nav {
padding: 15px;
}
#post_item,#photos_item {
#post_item,
#photos_item {
padding: 0 15px;
}
@@ -305,7 +327,8 @@
margin-right: 12px;
}
.normal_content .entry-content p, .normal_card_content .entry-content p {
.normal_content .entry-content p,
.normal_card_content .entry-content p {
display: none;
}
@@ -337,7 +360,9 @@
padding-bottom: 100px;
}
.single_wrap .comments-area, .page_content .comments-area , .single_content .comments-area {
.single_wrap .comments-area,
.page_content .comments-area,
.single_content .comments-area {
padding: 15px;
}
@@ -351,7 +376,8 @@
padding-left: 50px;
}
.comments-area ul.comment-list li .profile , .comments-area ul.comment-list li .profile a {
.comments-area ul.comment-list li .profile,
.comments-area ul.comment-list li .profile a {
width: 35px;
height: 35px;
}
@@ -360,12 +386,15 @@
width: calc(83px*3);
}
.t_media_item , a.up_img_btn{
.t_media_item,
a.up_img_btn {
width: 80px;
height: 80px;
}
.single_content, .page_content, .page_wrap {
.single_content,
.page_content,
.page_wrap {
padding: 0 15px;
padding-bottom: 100px;
}
@@ -378,7 +407,12 @@
bottom: 18%;
}
.blog_list_inner , .single_content, .page_content, .page_wrap , .normal_list_inner , .single_wrap {
.blog_list_inner,
.single_content,
.page_content,
.page_wrap,
.normal_list_inner,
.single_wrap {
border-radius: 12px;
position: relative;
z-index: 199;
@@ -394,7 +428,8 @@
margin-left: 0;
}
.top_bar , .dark .top_bar {
.top_bar,
.dark .top_bar {
height: 64px;
width: 100% !important;
border-radius: 0;
@@ -434,7 +469,8 @@
height: 240px;
}
.top_bar.uk-sticky-fixed.uk-active , .dark .top_bar.uk-sticky-fixed.uk-active {
.top_bar.uk-sticky-fixed.uk-active,
.dark .top_bar.uk-sticky-fixed.uk-active {
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
@@ -452,7 +488,11 @@
background: rgb(27 29 48 / 80%);
}
.top_tool i , .dark .top_tool i , .dark .mobile_active .top_tool i , .t_dark a i , .dark .t_dark a i {
.top_tool i,
.dark .top_tool i,
.dark .mobile_active .top_tool i,
.t_dark a i,
.dark .t_dark a i {
color: #fff;
}
@@ -460,7 +500,7 @@
color: #000000;
}
.top_tool input.s_input:focus ~ [class*=ri-] {
.top_tool input.s_input:focus~[class*=ri-] {
color: #4f4f4f;
}
@@ -539,7 +579,8 @@
margin: 0;
}
.land_right .beian , .land_right .copyright {
.land_right .beian,
.land_right .copyright {
color: #293563;
}
@@ -601,7 +642,8 @@
display: none;
}
a.bg_music , .dark a.bg_music {
a.bg_music,
.dark a.bg_music {
background: transparent;
width: auto;
height: auto;
@@ -612,7 +654,12 @@
color: #fff;
}
.player_mod .tool , a.m_prev , a.m_next , .timer , a.m_volume , .player_hand {
.player_mod .tool,
a.m_prev,
a.m_next,
.timer,
a.m_volume,
.player_hand {
display: none;
}
@@ -691,7 +738,7 @@
}
body.mod_third_s .footer_nav_box .right {
width:100%;
width: 100%;
}
/* 手机端文章目录调整 */
@@ -703,13 +750,16 @@
align-items: center;
justify-content: center;
}
#listree-ol li a {
font-size: 0.8rem;
}
#listree-ol {
margin: 10px 0 15px -10px;
padding-right: 15px;
}
#listree-ol li {
line-height: 1.2;
margin-top: 6px;
@@ -721,7 +771,7 @@
.footer_menu a.playing-music i,
.footer_menu a.playing-music .title {
color: #4CAF50;
}
}
+2 -1
View File
@@ -504,11 +504,12 @@ a:visited {
color: #252525;
}
/* 侧边栏颜色异常
a:hover,
a:focus,
a:active {
color: #191970;
}
} */
a:focus {
outline: thin dotted;
+244 -4
View File
@@ -4,7 +4,8 @@ function modify_m_bottom_music_button_link() {
if (!music) return;
music.addEventListener('click', function (event) {
event.preventDefault();
mu_box_show();
if (!box_up) mu_box_show();
else mu_box_hide(0);
});
}
@@ -24,15 +25,254 @@ function modify_m_bottom_music_button_link() {
// });
// }
// 登录逻辑
let csrfToken = '';
let publicKey = '';
let loginTimer = null;
let countdownSeconds = 3;
let closeLoading = null;
const login_modal = document.getElementById('customLoginModal');
const login_closeBtn = document.getElementById('closeLoginModal');
const login_loginBtn = document.getElementById('customLoginBtn');
// 获取令牌及公钥
async function fetchCSRFToken() {
login_modal.classList.add('show');
login_loginBtn.disabled = true;
login_loginBtn.textContent = '加载中...';
closeLoading = cocoMessage.loading('正在加载署名信息...');
try {
const response = await fetch('/login', { credentials: 'include' });
if (response.url.includes('/uc')) {
return 'logged';
}
const htmlText = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(htmlText, 'text/html');
// 获取 CSRF Token
const csrfInput = doc.querySelector('input[name="_csrf"]');
if (!csrfInput || !csrfInput.value) {
throw new Error('页面未找到 CSRF 令牌');
}
csrfToken = csrfInput.value;
// 获取 PublicKey
const publicKeyMatch = htmlText.match(/const publicKey = "([^"]+)";/);
if (!publicKeyMatch || !publicKeyMatch[1]) {
throw new Error('页面未找到 PublicKey');
}
publicKey = publicKeyMatch[1].replace(/\\\//g, '/');
return 'ok';
} catch (err) {
closeLoading?.()
cocoMessage.error('署名信息加载失败,请刷新');
if (loginTimer) { clearInterval(loginTimer) }
login_loginBtn.textContent = '错误!请刷新';
login_loginBtn.disabled = true;
return 'error';
}
}
// 打开弹窗逻辑
async function open_login_box() {
if (loginTimer) { clearInterval(loginTimer) }
countdownSeconds = 3;
const success = await fetchCSRFToken();
if (success === 'logged') {
closeLoading?.()
cocoMessage.success('您已署名成功,请刷新');
login_modal.classList.remove('show');
} else if (success === 'ok') {
loginTimer = setInterval(() => {
if (countdownSeconds > 0) {
login_loginBtn.textContent = '请稍等...' + countdownSeconds;
} else {
clearInterval(loginTimer);
closeLoading?.()
cocoMessage.success('署名信息加载完成');
login_loginBtn.textContent = '署 名';
login_loginBtn.disabled = false;
}
countdownSeconds--;
}, 1000);
} else {
closeLoading?.()
cocoMessage.error('服务器错误,请刷新');
login_modal.classList.remove('show');
}
}
// 关闭弹窗
login_closeBtn.addEventListener('click', () => {
closeLoading?.()
login_modal.classList.remove('show');
});
// 加密逻辑
function encryptPassword(password) {
try {
const encrypt = new JSEncrypt();
encrypt.setPublicKey(publicKey);
return encrypt.encrypt(password);
} catch (e) {
return null;
}
}
// 提交登录
login_loginBtn.addEventListener('click', async () => {
let islogin = false;
const username = document.getElementById('customUsername').value.trim();
const password = document.getElementById('customPassword').value.trim();
if (!username || !password) {
cocoMessage.warning('请先填写信息');
return;
}
const encryptedPwd = encryptPassword(password);
login_loginBtn.disabled = true;
login_closeBtn.disabled = true;
login_loginBtn.textContent = '验证中...';
closeLoading = cocoMessage.loading('正在验证信息...');
try {
countdownSeconds = 3
const response = await fetch('/login', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
credentials: 'include',
body: new URLSearchParams({
_csrf: csrfToken,
username: username,
password: encryptedPwd,
'remember-me': 'true'
})
});
// 核心细节:判断最终落点 URL
const finalUrl = response.url;
if (loginTimer) {
clearInterval(loginTimer);
}
if (finalUrl.includes('/uc')) {
islogin = true;
closeLoading?.()
cocoMessage.success('署名成功,正在跳转...');
login_loginBtn.textContent = '跳转中...';
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
$.cookie('load_type', 'login', { path: '/', domain: 'anian.cc' });
window.location.reload();
} else if (finalUrl.includes('error=invalid-credential')) {
closeLoading?.()
cocoMessage.warning('署名人与心上锁不匹配');
} else {
closeLoading?.()
cocoMessage.error('速度过快,请稍后重试');
}
} catch (err) {
closeLoading?.()
cocoMessage.error('服务器连接失败');
} finally {
if (!islogin) {
fetchCSRFToken();
login_closeBtn.disabled = false;
loginTimer = setInterval(() => {
if (countdownSeconds > 0) {
login_loginBtn.textContent = '请稍等...' + countdownSeconds;
} else {
clearInterval(loginTimer);
closeLoading?.()
cocoMessage.success('请重新尝试署名');
login_loginBtn.textContent = '署 名';
login_loginBtn.disabled = false;
}
countdownSeconds--;
}, 1000);
}
}
});
// 回车登录
document.addEventListener("keydown", function (e) {
if (e.key === "Enter") {
const modal = document.getElementById("customLoginModal");
if (modal.classList.contains("show")) {
document.getElementById("customLoginBtn").click();
}
}
});
// 退出登录
async function customLogout() {
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', true);
let closeLoading = cocoMessage.loading('退出登录中...');
try {
const getResponse = await fetch('/logout', { credentials: 'include' });
const htmlText = await getResponse.text();
const parser = new DOMParser();
const doc = parser.parseFromString(htmlText, 'text/html');
const logoutCsrfToken = doc.querySelector('input[name="_csrf"]')?.value;
if (!logoutCsrfToken) {
cocoMessage.error('页面未找到 CSRF 令牌');
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
closeLoading();
return;
}
const postResponse = await fetch('/logout', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
credentials: 'include',
body: new URLSearchParams({
'_csrf': logoutCsrfToken
})
});
if (postResponse.ok) {
closeLoading();
cocoMessage.success('您已成功退出登录');
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
$.cookie('load_type', 'logout', { path: '/', domain: 'anian.cc' });
window.location.reload();
} else {
closeLoading();
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
throw new Error('退出请求被拒绝');
}
} catch (err) {
closeLoading();
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
console.error('Logout Error:', err);
cocoMessage.error('退出失败,请手动刷新页面');
}
}
function open_logout_box() {
const wrapper = document.getElementById("pixarNoticeWrapper");
wrapper.style.display = "flex";
}
function hidePixarCard() {
const wrapper = document.getElementById("pixarNoticeWrapper");
wrapper.style.display = "none";
}
function confirmPixarAction() {
customLogout();
}
// 打开确认模态框
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);
modal.fadeIn(200);
}
+691 -617
View File
File diff suppressed because it is too large Load Diff
+141 -123
View File
@@ -1,13 +1,13 @@
main_content = $('.moment_type_main');
function remove_image_temp(){
if(!$('.image_edit_temp .add_img_box').length > 0){
function remove_image_temp() {
if (!$('.image_edit_temp .add_img_box').length > 0) {
var temp = $('.add_img_box');
$('.image_edit_temp').html(temp);
}
main_content.empty();
}
function back_image_temp(){
function back_image_temp() {
var temp = $('.add_img_box');
main_content.html(temp);
$('.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({
type: 'GET',
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) {
$('.edit_card_box .edit_content input').val('');
if (data.total > 0) {
if(data.total>1){
if (data.total > 1) {
cocoMessage.error('当前搜索的文章有多个无法选择');
}else{
} else {
var item = data.items[0]
$('.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('已生成卡片');
}
@@ -86,7 +86,7 @@ function card_post(card_url){
}
function edit_page(card_url){
function edit_page(card_url) {
$.ajax({
type: 'GET',
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) {
$('.edit_card_box .edit_content input').val('');
if (data.total > 0) {
if(data.total>1){
if (data.total > 1) {
cocoMessage.error('当前搜索的页面有多个无法选择');
}else{
} else {
var item = data.items[0]
$('.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('已生成卡片');
}
@@ -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}">
<a>
@@ -127,31 +127,25 @@ function getcard(name,cover,title,type){
</div>`
}
$(document).on('click', '.de_card', function() {
var msg = "确认删除此卡片?";
$(document).on('click', '.de_card', function () {
var num = $('.moment_card_item').length;
if (confirm(msg)==true){
$(this).parents('.moment_card_item').remove();
} else {
return false;
}
if(num == 1){
if (num == 1) {
$(".show_card").hide();
}
});
//图文编辑 返回图文编辑区域
$('body').on('click', '.moment_image_type a', function() {
$('body').on('click', '.moment_image_type a', function () {
back_image_temp();
$('.push_item').attr('type','image');
$('.push_item').attr('type', 'image');
});
//发布音乐--------------------------------------------------------------
$('body').on('click', '.moment_audio_type a', function() {
$('.push_item').attr('type','audio');
$('body').on('click', '.moment_audio_type a', function () {
$('.push_item').attr('type', 'audio');
main_content = $('.moment_type_main');
if($('.add_audio_box').length > 0){
if ($('.add_audio_box').length > 0) {
return false;
}
remove_image_temp();
@@ -180,57 +174,57 @@ $('body').on('click', '.moment_audio_type a', function() {
});
//音乐和视频上传
$(document).on('change','#moment_img_up',function(){
if($('#moment_img_up').val() == '')
$(document).on('change', '#moment_img_up', function () {
if ($('#moment_img_up').val() == '')
return;
var f = this.files[0];
var formData = new FormData();
formData.append('file',f);
formData.append('file', f);
const policyName = Theme.moments.policy_name;
const groupName = Theme.moments.group_name;
policyName && formData.append('policyName',policyName)
groupName && formData.append('groupName',groupName)
policyName && formData.append('policyName', policyName)
groupName && formData.append('groupName', groupName)
$.ajax({
type: "POST",
url: `${Theme.moments.attachments_upload_api}`,
dataType: 'json',
data: formData,
processData : false,
contentType : false,
processData: false,
contentType: false,
beforeSend: function () {
cocoMessage.info('上传中...');
$('.m_media_left i').remove();
$('.m_media_left').append("<div class='up_loading' uk-spinner='ratio: .6'></div>");
var imged = $('.m_media_left img');
if(imged.length > 0){
if (imged.length > 0) {
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"]
$('.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('上传成功');
$('input#moment_video_url').val(thum)
}
});
});
$('body').on('click', '.audio_choose a', function() {
$('body').on('click', '.audio_choose a', function () {
var text = '# 请插入封面,歌名以及歌曲外链';
var type = $(this).attr('au_type');
if(type != 'local'){
if (type != 'local') {
var text = '# 请输入歌曲ID';
}
$('.edit_audio_box .tips').text(text);
});
//发布视频--------------------------------------------------------------
$('body').on('click', '.moment_video_type a', function() {
$('.push_item').attr('type','video');
$('body').on('click', '.moment_video_type a', function () {
$('.push_item').attr('type', 'video');
main_content = $('.moment_type_main');
if($('.add_video_box').length > 0){
if ($('.add_video_box').length > 0) {
return false;
}
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 type = $(this).attr('vi_type');
if(type == 'bili'){
if (type == 'bili') {
var text = '# 请输入B站视频bvid';
}
$('.edit_video_box .tips').text(text);
@@ -279,75 +273,91 @@ $('body').on('click', '.video_choose a', function() {
//});
//删除片刻文章
$('body').on('click', '.control_delete_post', function() {
var pid = $(this).parent().attr('pid');
//删除片刻
// 全局变量暂存当前要删除的 ID
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', '#momentsCancelDeleteBtn', function (e) {
$('#momentsDeleteModal').fadeOut(200);
window.currentDeletePid = null;
});
// 点击确认删除 - 执行 AJAX
$('body').on('click', '#momentsConfirmDeleteBtn', function () {
var pid = window.currentDeletePid;
if (!pid) return;
let closeLoading = cocoMessage.loading('正在删除...');
$('.moments-btn-cancel, .moments-btn-confirm').prop('disabled', true);
$.ajax({
type: 'DELETE',
dataType: 'json',
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
url: `/apis/${Theme.moments.api}/v1alpha1/moments/` + pid,
contentType: "application/json",
beforeSend: function () {
cocoMessage.info('处理中..');
},
success: function (data) {
$('#momentsDeleteModal').fadeOut(200);
closeLoading?.()
cocoMessage.success('删除成功');
setTimeout(()=>{
$(`#post-${pid}`)[0].remove()
},1000)
window.currentDeletePid = null;
const $post = $(`#post-${pid}`);
if (!$post.length) return;
$post.addClass('moments-delete-disperse');
setTimeout(() => $post.remove(), 800);
},
error: function (request) {
if(request.status){
if (request.status) {
closeLoading?.()
cocoMessage.error('瞬间不存在或已删除');
}else{
} else {
closeLoading?.()
cocoMessage.error('删除失败');
}
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 stick = $(this).hasClass('stick');
if(stick){
if (stick) {
var state = 'stick';
} else {
var state = 'unstick';
}
var msg = "确定执行此操作?";
if (confirm(msg)==true){
if (confirm(msg) == true) {
$.ajax({
type: 'POST',
dataType: 'json',
url: Theme.ajaxurl,
data: {
'action':'stick_moment',
pid:pid,
state:state
'action': 'stick_moment',
pid: pid,
state: state
},
beforeSend: function () {
cocoMessage.info('处理中..');
},
success: function (data) {
if(data.state == '1'){
if (data.state == '1') {
cocoMessage.success(data.msg);
if(data.type == 'stick'){
var post_item = $('#post-'+pid+'.moment_item');
if (data.type == 'stick') {
var post_item = $('#post-' + pid + '.moment_item');
post_item.remove();
$('.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_control').remove();
$('#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();
} else {
$('#post-'+pid+'.moment_item').find('.sticky_icon').remove();
$('#post-' + pid + '.moment_item').find('.sticky_icon').remove();
}
} else {
@@ -362,46 +372,48 @@ $('body').on('click', '.sticky_btn', function() {
});
//编辑片刻
$('body').on('click', '.control_edit_post', function() {
$(".loca_text").empty().attr("state",'0');
$('body').on('click', '.control_edit_post', function () {
$('.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;");
$('.moment_image_type a').click();
$('#topic_content').val('');
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
$('.t_media_item').remove();
$('#moment_audio_api').remove();
var pid = $(this).parent().attr('pid');
$('.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({
type: 'GET',
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
url: `/apis/${Theme.moments.api}/v1alpha1/moments/` + pid,
beforeSend: function () {
cocoMessage.info('数据拉取中');
closeLoading = cocoMessage.loading('数据拉取中...');
//$('.t_form').before('<div class="edit_overlay"></div>');
},
success: function (data) {
$('.push_item').attr('version',data.metadata.version)
$('.push_item').attr('owner',data.spec.owner)
$('.push_item').attr('releaseTime',data.spec.releaseTime)
$('.push_item').attr('version', data.metadata.version)
$('.push_item').attr('owner', data.spec.owner)
$('.push_item').attr('releaseTime', data.spec.releaseTime)
//发布状态
if(data.spec.visible == 'PRIVATE'){
$(".simi a").html('<i class="ri-lock-line"></i>').attr('visible','PRIVATE');
$(".simi a").children().css({"background":"#ddd","color":"#c6c6c6"});
if (data.spec.visible == 'PRIVATE') {
$(".simi a").html('<i class="ri-lock-line"></i>').attr('visible', 'PRIVATE');
$(".simi a").children().css({ "background": "#ddd", "color": "#c6c6c6" });
} else {
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
}
var medium = data.spec.content.medium;
var tags = data.spec.tags
if(medium.length > 0){
if (medium.length > 0) {
var type = medium[0].type;
}
let content = data.spec.content.html;
if(content == null){
if (content == null) {
content = '';
}else{
} else {
// 创建一个新的HTML解析器对象
var parser = new DOMParser();
@@ -423,16 +435,15 @@ $('body').on('click', '.control_edit_post', function() {
}
$('#topic_content').val(content);
if(tags.length > 0){
if (tags.length > 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);
}
switch(type)
{
switch (type) {
case "PHOTO":
//if(data.moment_data.length > 0){ 文字片刻没有数据
edit_image(data);
@@ -448,35 +459,42 @@ $('body').on('click', '.control_edit_post', function() {
edit_video(data);
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() {
$('.push_item').attr('action','push').html('<i class="ri-send-plane-2-line"></i>发布');
$('body').on('click', '.normal_edit,.center .mobile_edit', function () {
$('.push_item').attr('action', 'push').html('<i class="ri-send-plane-2-line"></i>发布');
$('.moment_image_type a').click();
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
$('#topic_content').val('');
$(".loca_text").empty().attr("state",'0');
$(".loca_text").empty().attr("state", '0');
$('#set_local, [name="set_local"]').val('');
$('.t_media_item').remove();
$('.t_cat_toogle span').text('叽里咕噜');
});
//编辑片刻类型(已兼容图片+视频)------------------------------------------------------------------------------
function edit_image(data){
function edit_image(data) {
var m_data = data.spec.content.medium;
$('.t_media_item').remove();
$('.moment_image_type a').click();
if(m_data && m_data.length > 0){
if (m_data && m_data.length > 0) {
// reverse() 是为了配合 prepend,确保显示顺序与发布时一致
var new_data = [...m_data].reverse();
$.each(new_data, function(index, value) {
$.each(new_data, function (index, value) {
var src = value.url;
var type = value.originType || ""; // 获取 MIME 类型
var mediaInnerHtml = '';
@@ -508,24 +526,24 @@ function edit_image(data){
}
}
function edit_video(data){
function edit_video(data) {
var m_data = data.spec.content.medium[0];
var type = m_data.originType;
//var url = m_data.url;
$('.moment_video_type a').click();
var add = setInterval(function() {
if(type != 'video/bili'){
var add = setInterval(function () {
if (type != 'video/bili') {
var url = m_data.url;
$('input#moment_video_url').val(url);
if(url !== ''){
if (url !== '') {
$('.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') {
if($('.video_choose').length > 0){
} else if (type == 'video/bili') {
if ($('.video_choose').length > 0) {
var bvid = m_data.url;
UIkit.switcher('.video_choose').show(1);
$('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);
}
}, 100);
}
function edit_audio(data){
function edit_audio(data) {
var m_data = data.spec.content.medium[0];
var type = m_data.originType;
$('.moment_audio_type a').click();
var add = setInterval(function() {
if(type == 'audio/netease' || type == 'audio/tencent' || type == 'audio/kugou' || type == 'audio/kuwo'){
var add = setInterval(function () {
if (type == 'audio/netease' || type == 'audio/tencent' || type == 'audio/kugou' || type == 'audio/kuwo') {
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 index = $('.audio_choose li.'+result+'').index();
var index = $('.audio_choose li.' + result + '').index();
UIkit.switcher('.audio_choose').show(index);
$('.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);
}
} else {
@@ -562,7 +580,7 @@ function edit_audio(data){
$('.edit_audio_box .tips').text('# 请插入歌曲外链');
$('input#moment_audio_url').val(url);
}
if($('.edit_audio_box').length == 1){
if ($('.edit_audio_box').length == 1) {
clearInterval(add);
}
@@ -574,15 +592,15 @@ function edit_card(data) {
$('.card_sortble .moment_card_item').remove();
$('.moment_card_type a').click();
var pid = data.metadata.name;
var card_list = $("#post-"+pid+"").find('.moment_card_item');
var add = setInterval(function() {
var card_list = $("#post-" + pid + "").find('.moment_card_item');
var add = setInterval(function () {
$('.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 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);
}
}, 100);
+127 -121
View File
@@ -30,7 +30,7 @@ function updateMusicBtnColor(state) {
}
}
var rem=[];
var rem = [];
rem.audio = $('<audio id="pix_player"></audio>');
var audiobox = $('<audio id="pix_player">');
@@ -47,7 +47,7 @@ var m_title = $('.player_mod .m_info h2');
var m_artist = $('.player_mod .m_info small');
$(document).on('click','.play_btn',function(){
$(document).on('click', '.play_btn', function () {
$('.player_box').append(audiobox);
$('.pix_player').removeClass('playing');
$(this).parents('.pix_player').addClass('playing');
@@ -59,10 +59,10 @@ $(document).on('click','.play_btn',function(){
playLrc = lrc;
m_title.text(meta.find('.name').text());
m_artist.text(meta.find('.author').text());
m_cover.attr('src',$('.pix_player.playing .player_thum img').attr('src'));
m_cover.attr('src', $('.pix_player.playing .player_thum img').attr('src'));
if(audio_s == '' || audio_s !== url){
$('#pix_player').attr('src',url);
if (audio_s == '' || audio_s !== url) {
$('#pix_player').attr('src', url);
audiobox[0].play();
} else {
pasued();
@@ -74,60 +74,61 @@ $(document).on('click','.play_btn',function(){
});
// 初始化函数
function initAudio(){
audiobox[0].addEventListener("play",audioplay);
audiobox[0].addEventListener("pause",audiopause);
audiobox[0].addEventListener("timeupdate",updateProcess);
if(Theme.bgm_open == true){
audiobox[0].addEventListener("ended",endplay);
function initAudio() {
audiobox[0].addEventListener("play", audioplay);
audiobox[0].addEventListener("pause", audiopause);
audiobox[0].addEventListener("timeupdate", updateProcess);
if (Theme.bgm_open == true) {
audiobox[0].addEventListener("ended", endplay);
}
}
//音乐结束触发
function endplay(){
function endplay() {
var index = $('.musci_list_box li.active').index() + 1;
var max = $('.musci_list_box li').length;
var new_mid = 0;
if(loop=="one"){
new_mid = index-1;
}else if(loop=="none") {
new_mid = (Math.floor(Math.random() * max) + 1)-1;
}else if(loop=="all") {
if (loop == "one") {
new_mid = index - 1;
} else if (loop == "none") {
new_mid = (Math.floor(Math.random() * max) + 1) - 1;
} else if (loop == "all") {
new_mid = index > (max - 1) ? 0 : index;
}
mulist_play(new_mid);
}
// 当音乐标签加载完成之后所触发的函数
audiobox[0].oncanplay=function(){
var duration=handleTime(this.duration);
var currenttime=handleTime(this.currentTime);
audiobox[0].oncanplay = function () {
var duration = handleTime(this.duration);
var currenttime = handleTime(this.currentTime);
$(".timer .total_time").text(duration);
$(".timer .current_time").text(currenttime);
initAudio();
}
// 音乐播放暂停的函数
function pasued(){
if(Paused === false){
function pasued() {
if (Paused === false) {
audiobox[0].pause();
}else{
} else {
audiobox[0].play();
}
}
// 音乐播放之后触发的函数
function audioplay(){
function audioplay() {
box_up = true;
// 播放时
updateMusicBtnColor('play');
var mheight = $('.footer_nav_box').height();
$('.footer_nav_box').animate({top:-mheight},200,'linear');
Paused=false;
$('.footer_nav_box').animate({ top: -mheight }, 200, 'linear');
Paused = false;
$(".pix_player.playing .play_btn").html("<i class='ri-pause-line'></i>");
$('.m_play').html('<i class="ri-pause-circle-fill"></i>');
// 播放时显示歌词
if(Theme.play.lrc_open && typeof lyricsContainer !== 'undefined'){
if (Theme.play.lrc_open && typeof lyricsContainer !== 'undefined') {
lyricsContainer.css('display', 'block');
$('a.bg_lrc i').css("color", "");
$('a.bg_lrc').css("background", "");
@@ -135,15 +136,15 @@ function audioplay(){
}
// 音乐暂停之后触发的函数
function audiopause(){
function audiopause() {
// 暂停时
updateMusicBtnColor('pause');
Paused=true;
Paused = true;
$(".pix_player.playing .play_btn").html("<i class='ri-play-line'></i>");
$('.m_play').html('<i class="ri-play-circle-fill"></i>');
// 暂停时隐藏歌词
if(Theme.play.lrc_open && typeof lyricsContainer !== 'undefined'){
if (Theme.play.lrc_open && typeof lyricsContainer !== 'undefined') {
lyricsContainer.css('display', 'none');
$('a.bg_lrc i').css("color", "#aeaeae");
$('a.bg_lrc').css("background", "#EBF2ED");
@@ -151,29 +152,29 @@ function audiopause(){
}
// 更新进度条
function updateProcess(){
if(Paused!==false) return true;
function updateProcess() {
if (Paused !== false) return true;
var duration = handleTime(this.duration);
var currenttime = handleTime(this.currentTime);
var percent = audiobox[0].currentTime/audiobox[0].duration;
$(".player_mod .player_bar .progress").css('width',(percent)*100+"%");
var percent = audiobox[0].currentTime / audiobox[0].duration;
$(".player_mod .player_bar .progress").css('width', (percent) * 100 + "%");
$(".timer .total_time").text(duration);
$(".timer .current_time").text(currenttime);
}
//循环歌曲 m_loop
$(document).on('click','.m_loop',function(){
if($(this).hasClass('all')){
$(document).on('click', '.m_loop', function () {
if ($(this).hasClass('all')) {
$(this).removeClass('all');
$(this).addClass('one');
$(this).html('<i class="ri-repeat-one-line"></i>');
loop = 'one';
}else if(($(this).hasClass('one'))){
} else if (($(this).hasClass('one'))) {
$(this).removeClass('one');
$(this).addClass('none');
$(this).html('<i class="ri-shuffle-line"></i>');
loop = 'none';
}else {
} else {
$(this).removeClass('none');
$(this).addClass('all');
$(this).html('<i class="ri-repeat-line"></i>');
@@ -182,26 +183,26 @@ $(document).on('click','.m_loop',function(){
});
// 时间处理的函数
function handleTime(seconedTime){
var minute=parseInt(seconedTime/60,10);
if(minute<10){minute="0"+minute};
var second=(seconedTime-minute*60).toFixed(2).split(".")[0];
if(second<10){second="0"+second};
var Time=minute+":"+second;
function handleTime(seconedTime) {
var minute = parseInt(seconedTime / 60, 10);
if (minute < 10) { minute = "0" + minute };
var second = (seconedTime - minute * 60).toFixed(2).split(".")[0];
if (second < 10) { second = "0" + second };
var Time = minute + ":" + second;
return Time;
}
//视频播放
var video = $('#pix_video_player');
$(document).on('click','.video_play_btn',function(){
$(document).on('click', '.video_play_btn', function () {
var video = $(this).siblings('#pix_video_player');
video.attr('controls','controls');
video.attr('controls', 'controls');
$(this).remove();
video[0].play();
});
function stopOtherMedia(element) {
$("video").not(element).each(function(index, video) {
$("video").not(element).each(function (index, video) {
video.pause();
});
}
@@ -211,36 +212,36 @@ function autoload_music() {
var state = Theme.bgm_open;
var api = `${Theme.play.pix_mu_api || 'https://api.i-meto.com/meting/api'}?server=:server&type=:type&id=:id&r=:r`
var meta = {
server : Theme.play.mu_source,
type : Theme.play.mu_type,
id : Theme.play.play_id,
auth : ''
server: Theme.play.mu_source,
type: Theme.play.mu_type,
id: Theme.play.play_id,
auth: ''
}
if(state == true){
if (state == true) {
let url = api.replace(":server", meta.server).replace(":type", meta.type).replace(":id", meta.id).replace(":auth", meta.auth).replace(":r", Math.random());
$.ajax({
type: "get",
url:url,
url: url,
success: function (res) {
if(res.length > 0){
if (res.length > 0) {
var new_mid = 0;
if(loop=="none") {
new_mid = (Math.floor(Math.random() * res.length) + 1)-1;
if (loop == "none") {
new_mid = (Math.floor(Math.random() * res.length) + 1) - 1;
}
var f = res[new_mid];
var playnum = 1;
audiobox.attr('src',f.url);
audiobox.attr('src', f.url);
playLrc = f.lrc;
$('.player_mod .m_cover img').attr('src',f.pic);
$('.player_mod .m_cover img').attr('src', f.pic);
$('.player_mod .m_info h2').text(f.title || f.name);
$('.player_mod .m_info small').text(f.author || f.artist);
$('.player_box').append(audiobox);
playlist.push(res);
$.each(res, function(key, data) {
$(".musci_list_box").append('<li class="item" id='+ key +'>' + playnum++ + '. ' + (data.title || data.name) + ' - ' + (data.author || data.artist) + '</li>');
$.each(res, function (key, data) {
$(".musci_list_box").append('<li class="item" id=' + key + '>' + playnum++ + '. ' + (data.title || data.name) + ' - ' + (data.author || data.artist) + '</li>');
});
$(".musci_list_box li").removeClass('active').eq(new_mid).addClass('active');
@@ -253,17 +254,17 @@ function autoload_music() {
}
//播放选中音乐
function mulist_play(index){
audiobox[0].removeEventListener("play",audioplay);
audiobox[0].removeEventListener("pause",audiopause);
function mulist_play(index) {
audiobox[0].removeEventListener("play", audioplay);
audiobox[0].removeEventListener("pause", audiopause);
$(".pix_player.playing .play_btn").html("<i class='ri-play-line'></i>");
$(".m_play").html('<i class="ri-pause-circle-fill"></i>');
$('.musci_list_box li').eq(index).addClass('active').siblings().removeClass('active');
scrollToPosition(index);
var data = playlist[0][index];
playLrc = data.lrc;
audiobox.attr('src',data.url);
m_cover.attr('src',data.pic);
audiobox.attr('src', data.url);
m_cover.attr('src', data.pic);
m_title.text(data.title || data.name);
m_artist.text(data.author || data.artist);
audiobox[0].play();
@@ -273,7 +274,7 @@ function mulist_play(index){
updateMusicBtnColor('play');
// 新增:切换歌曲后强制显示歌词
if(Theme.play.lrc_open && typeof lyricsContainer !== 'undefined'){
if (Theme.play.lrc_open && typeof lyricsContainer !== 'undefined') {
lyricsContainer.css('display', 'block');
$('a.bg_lrc i').css("color", "");
$('a.bg_lrc').css("background", "");
@@ -284,14 +285,14 @@ function mulist_play(index){
$(document).on('click', '.ri-bar-chart-horizontal-line', function () {
var position = $('.musci_list_box li.active').index()
setTimeout(function () {
if($('.m_list').attr('aria-expanded')){
if ($('.m_list').attr('aria-expanded')) {
scrollToPosition(position)
}
}, 200);
});
//点击列表播放
$(document).on('click','.musci_list_box li',function(){
$(document).on('click', '.musci_list_box li', function () {
$('.musci_list_box li').removeClass('active');
$(this).addClass('active');
var id = $(this).attr('id');
@@ -299,26 +300,26 @@ $(document).on('click','.musci_list_box li',function(){
});
//上一首
$(document).on('click','.m_prev',function(){
$(document).on('click', '.m_prev', function () {
var index = $('.musci_list_box li.active').index() - 1;
var max = $('.musci_list_box li').length;
var new_mid = 0;
if(loop=="none") {
new_mid = (Math.floor(Math.random() * max) + 1)-1;
}else {
if (loop == "none") {
new_mid = (Math.floor(Math.random() * max) + 1) - 1;
} else {
new_mid = index < 0 ? max - 1 : index;
}
mulist_play(new_mid);
});
//下一首
$(document).on('click','.m_next',function(){
$(document).on('click', '.m_next', function () {
var index = $('.musci_list_box li.active').index() + 1;
var max = $('.musci_list_box li').length;
var new_mid = 0;
if(loop=="none") {
new_mid = (Math.floor(Math.random() * max) + 1)-1;
}else{
if (loop == "none") {
new_mid = (Math.floor(Math.random() * max) + 1) - 1;
} else {
new_mid = index > (max - 1) ? 0 : index;
}
mulist_play(new_mid);
@@ -326,11 +327,11 @@ $(document).on('click','.m_next',function(){
//播放和暂停
function m_play() {
if(Paused === false){
if (Paused === false) {
audiobox[0].pause();
$('.m_play').html('<i class="ri-play-circle-fill"></i>');
Paused = true;
}else{
} else {
audiobox[0].play();
$('.m_play').html('<i class="ri-pause-circle-fill"></i>');
Paused = false;
@@ -338,8 +339,8 @@ function m_play() {
}
//播放按钮
$(document).on('click','.m_play',function(){
if(!$("#pix_player").length > 0){
$(document).on('click', '.m_play', function () {
if (!$("#pix_player").length > 0) {
cocoMessage.error('没有音乐可播放');
return false;
} else {
@@ -349,14 +350,17 @@ $(document).on('click','.m_play',function(){
//触发显示播放器
var trigger;
function mu_box_show(){
let box_up = false;
function mu_box_show() {
clearTimeout(trigger);
box_up = true;
var mheight = $('.footer_nav_box').height();
$('.footer_nav_box').animate({top:-mheight},200,'linear');
$('.footer_nav_box').animate({ top: -mheight }, 200, 'linear');
}
function mu_box_hide() {
trigger = setTimeout(function() {
function mu_box_hide(time = 2000) {
clearTimeout(trigger);
trigger = setTimeout(function () {
// 获取屏幕宽度判断是否为手机端(与歌词容器响应式逻辑保持一致)
const isMobile = $(window).width() <= 767;
// 手机端隐藏时额外向下偏移50px(可根据需要调整数值),非手机端保持默认0px
@@ -366,49 +370,50 @@ function mu_box_hide() {
$('.footer_nav_box').animate({
top: hideTop
}, 200, 'linear');
}, 2000);
box_up = false;
}, time);
}
$(document).on('mouseenter', '.player_hand , .footer_nav_box', function(event) {
$(document).on('mouseenter', '.player_hand , .footer_nav_box', function (event) {
mu_box_show();
});
$(document).on('mouseleave', '.footer_nav_box .right_inner', function(event) {
trigger = setTimeout(function(){
$(document).on('mouseleave', '.footer_nav_box .right_inner', function (event) {
trigger = setTimeout(function () {
mu_box_hide();
},2000);
}, 2000);
});
//音乐进度条跳转
function getMousePosition(e){
function getMousePosition(e) {
var e = e || window.event;
var x = e.pageX;
var y = e.pageY;
return {'left':x,'top':y}
return { 'left': x, 'top': y }
}
$(document).on('click','.player_bar',function(){
$(document).on('click', '.player_bar', function () {
var long = (getMousePosition().left) - ($('.progress').offset().left);
$('.progress').width(long);
allTime = parseInt(audiobox[0].duration);
var nowtime = (long/$('.player_bar').width()) * allTime;
var nowtime = (long / $('.player_bar').width()) * allTime;
audiobox[0].currentTime = nowtime;
});
//音量调节 m_volume
$(document).on('click','.m_volume',function(){
if($(this).hasClass('mute')){
$(document).on('click', '.m_volume', function () {
if ($(this).hasClass('mute')) {
$(this).removeClass('mute');
$(this).html('<i class="ri-volume-down-line"></i>');
audiobox[0].muted = false;
}else{
} else {
$(this).addClass('mute');
audiobox[0].muted = true;
$(this).html('<i class="ri-volume-mute-line"></i>');
}
});
$(document).on('click','.vo_bar',function(){
$(document).on('click', '.vo_bar', function () {
var long = (getMousePosition().top) - ($(this).offset().top)
var meter = long / $(this).height();
var finalLong = 1 - meter;
@@ -418,34 +423,34 @@ $(document).on('click','.vo_bar',function(){
//文章歌曲
function autoload_posts_music() {
post_playlist.splice(0,post_playlist.length);
post_playlist.splice(0, post_playlist.length);
var pid = $('.posts_mu_list').attr('pid');
var api = `${Theme.play.pix_mu_api || 'https://api.i-meto.com/meting/api'}?server=:server&type=:type&id=:id&r=:r`
var meta = {
server : $('.posts_mu_list').attr('mus_source'),
type : $('.posts_mu_list').attr('mus_type'),
id : $('.posts_mu_list').attr('plays_id'),
server: $('.posts_mu_list').attr('mus_source'),
type: $('.posts_mu_list').attr('mus_type'),
id: $('.posts_mu_list').attr('plays_id'),
mu_on: $('.posts_mu_list').attr('mu_on'),
auth : ''
auth: ''
}
if(pid && meta.mu_on=='true'){
if (pid && meta.mu_on == 'true') {
let url = api.replace(":server", meta.server).replace(":type", meta.type).replace(":id", meta.id).replace(":auth", meta.auth).replace(":r", Math.random());
$.ajax({
type: "get",
url:url,
url: url,
beforeSend: function () {
$('.posts_mu_list').html('<div class="loading_box"><div uk-spinner></div></div>');
},
success: function (res) {
if(res.length > 0){
if (res.length > 0) {
$('.posts_mu_list .loading_box').remove();
var playnum = 1;
if(!$('#pix_player').length > 0){
if (!$('#pix_player').length > 0) {
$('.player_box').append(audiobox);
}
post_playlist.push(res);
$.each(res, function(key, data) {
$(".posts_mu_list").append('<li class="item" id='+ key +'><div class="mu_id">' + playnum++ + '</div><a class="s_play_btn"><i class="ri-play-circle-line"></i></a><div class="mus_info">'+ (data.title || data.name) +' <span>- ' + (data.author || data.artist) + '</span></div></li>');
$.each(res, function (key, data) {
$(".posts_mu_list").append('<li class="item" id=' + key + '><div class="mu_id">' + playnum++ + '</div><a class="s_play_btn"><i class="ri-play-circle-line"></i></a><div class="mus_info">' + (data.title || data.name) + ' <span>- ' + (data.author || data.artist) + '</span></div></li>');
});
}
}
@@ -454,7 +459,7 @@ function autoload_posts_music() {
}
//文章歌曲播放
$(document).on('click','.s_play_btn',function(){
$(document).on('click', '.s_play_btn', function () {
mu_box_show();
// 1. 同步更新文章内播放列表选中状态
$('.posts_mu_list li').removeClass('active');
@@ -463,16 +468,16 @@ $(document).on('click','.s_play_btn',function(){
$('.musci_list_box li').removeClass('active');
// 移除旧事件监听,防止重复触发
audiobox[0].removeEventListener("play",audioplay);
audiobox[0].removeEventListener("pause",audiopause);
audiobox[0].removeEventListener("play", audioplay);
audiobox[0].removeEventListener("pause", audiopause);
$(".m_play").html('<i class="ri-pause-circle-fill"></i>');
var id = $(this).parents('li').attr('id');
var data = post_playlist[0][id];
playLrc = data.lrc;
// 3. 修复歌手信息字段:优先用 data.author,其次用 data.artist
audiobox.attr('src',data.url);
m_cover.attr('src',data.pic);
audiobox.attr('src', data.url);
m_cover.attr('src', data.pic);
m_title.text(data.title || data.name); // 歌曲标题:优先 title,其次 name
m_artist.text(data.author || data.artist); // 歌手信息:优先 author,其次 artist
audiobox[0].play();
@@ -480,7 +485,7 @@ $(document).on('click','.s_play_btn',function(){
Paused = false;
// 新增:文章歌曲切换后强制显示歌词
if(Theme.play.lrc_open && typeof lyricsContainer !== 'undefined'){
if (Theme.play.lrc_open && typeof lyricsContainer !== 'undefined') {
lyricsContainer.css('display', 'block');
$('a.bg_lrc i').css("color", "");
$('a.bg_lrc').css("background", "");
@@ -488,8 +493,9 @@ $(document).on('click','.s_play_btn',function(){
});
//播放器按钮
$(document).on('click','a.bg_music',function(){
mu_box_show();
$(document).on('click', 'a.bg_music', function () {
if (!box_up) mu_box_show();
else mu_box_hide(0);
});
$(function () {
@@ -498,11 +504,11 @@ $(function () {
});
//播放类型切换
$(document).on('click','.audio_c_btn',function(){
$(document).on('click', '.audio_c_btn', function () {
var type = $(this).attr('au_type');
var input = $('<input type="text" placeholder="歌曲ID" name="moment_audio_api" id="moment_audio_api" class="required" required="required">');
$('.type_audio_text').empty();
$('.'+type+'_audio.type_audio_text').append(input);
$('.' + type + '_audio.type_audio_text').append(input);
});
$('.bg_lrc').click(function () {
@@ -526,7 +532,7 @@ $('.bg_lrc').click(function () {
});
//创建容器
if(Theme.play.lrc_open){
if (Theme.play.lrc_open) {
var lyricsContainer = $('<div class="lyrics-container"></div>');
$('.player_box').append(lyricsContainer);
var css = $(window).width() > 767 ?
@@ -645,7 +651,7 @@ function updateLyrics(currentTime, lyrics) {
// 监听音频播放进度更新事件,更新歌词
Theme.play.lrc_open && audiobox[0].addEventListener("timeupdate", async function () {
// 新增:只有歌词容器显示时才更新歌词(优化性能)
if(Theme.play.lrc_open && typeof lyricsContainer !== 'undefined' && lyricsContainer.css('display') !== 'none'){
if (Theme.play.lrc_open && typeof lyricsContainer !== 'undefined' && lyricsContainer.css('display') !== 'none') {
var lyrics = await fetchLyrics(playLrc)
updateLyrics(this.currentTime, lyrics);
}
@@ -663,7 +669,7 @@ function scrollToPosition(position) {
// 更新底部音乐图标颜色(根据是否播放)
function updateFooterMusicIcon(isPlaying) {
// 查找底部菜单中包含音乐图标的链接
var $entry = $('.footer_menu a').filter(function() {
var $entry = $('.footer_menu a').filter(function () {
return $(this).find('.ri-netease-cloud-music-line').length > 0;
}).first();
+2 -1
View File
@@ -3541,7 +3541,8 @@ iframe[uk-cover] {
.uk-sortable-drag {
position: fixed !important;
z-index: 1050 !important;
pointer-events: none
width: auto !important;
pointer-events: none;
}
.uk-sortable-placeholder {
+1 -1
View File
@@ -35,7 +35,7 @@
</th:block>
</div>
<div th:if="${posts.hasNext}" class="arc_pagenav">
<div th:if="${posts.hasNext}" class="arc_pagenav post-paging">
<a th:data="@{${posts.nextUrl}}" th:text="${theme.config.base_set.site_page}"></a>
</div>
+53 -8
View File
@@ -13,10 +13,32 @@
<div class="blog_list">
<div class="blog_list_inner" uk-height-viewport="offset-top: true">
<!-- 作者姓名导航栏(参照图库风格新增) -->
<div class="friends_cat_nav">
<ul id="cat_nav_items">
<li>
<!-- 全部按钮 -->
<a th:attr="data-href=@{/friends}"
th:classappend="${#lists.isEmpty(param.author) ? 'active' : ''}" class="cat-link">
全部<span></span>
</a>
</li>
<!-- 遍历所有作者 -->
<th:block th:each="author : ${authors}">
<li>
<a th:attr="data-href=@{|/friends?author=${author}|}"
th:classappend="${#strings.equals(param.author, author) ? 'active' : ''}"
th:text="${author}" class="cat-link">
<span></span>
</a>
</li>
</th:block>
</ul>
</div>
<div id="post_item" class="moment_list">
<div th:each="postInfo, iterstat: ${friends.items}"
th:id="${'post-'+postInfo.metadata.name}"
<div th:each="postInfo, iterstat: ${friends.items}" th:id="${'post-'+postInfo.metadata.name}"
class="loop_content p_item moment_item uk-animation-slide-bottom-small"
th:with="spec = ${postInfo.spec}">
@@ -49,9 +71,34 @@
<div th:utext="${spec.description}"></div>
</a>
</div>
<!-- 图片列表 -->
<div class="img_list img-dynamic-container">
<div class="list_inner"
th:with="isImgList=${#strings.startsWith(spec.title, 'img:::')}"
th:attr="num=${isImgList ? #arrays.length(#strings.substringAfter(spec.title, 'img:::').split(',')) : 0}">
<!-- 只有识别为图片列表时才渲染 -->
<th:block th:if="${isImgList}">
<!-- 去掉前缀,分割数组 -->
<th:block
th:with="imgArray=${#strings.substringAfter(spec.title, 'img:::').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>
@@ -65,11 +112,9 @@
<!-- 分页:必须保持在 blog_list_inner 里面 -->
<th:block th:if="${friends.totalPages>1}">
<div id="t_pagination">
<div class="post-paging"
th:if="${friends.hasNext()}"
th:with="_page = ${friends.page+1}">
<a th:data="${'/friends/page/'+_page}"
th:text="${theme.config.base_set.site_page}">
<div class="post-paging" th:if="${friends.hasNext()}">
<!-- 直接使用后端生成的完整 nextUrl -->
<a th:data="${friends.nextUrl}" th:text="${theme.config.base_set.site_page}">
</a>
</div>
</div>
+99 -7
View File
@@ -1,20 +1,111 @@
<th:block th:fragment="footer">
<th:block th:with="customJsVersion='1.2.5-2'">
<th:block th:with="customJsVersion='1.2.5-5'">
<!-- 奇遇容器 -->
<div class="center-img-container" id="centerImgContainer">
<img class="center-img" id="targetImg">
</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="custom-login-modal" id="customLoginModal">
<div class="login-modal-content login-modern-card">
<button class="close-modal-btn" id="closeLoginModal">&times;</button>
<form class="login-modern-form">
<p class="login-modern-title">日记簿署名</p>
<div class="login-modern-input-wrapper">
<i class="ri-user-line login-modern-icon"></i>
<input type="text" id="customUsername" class="login-modern-input" autocomplete="username"
placeholder="执笔人">
</div>
<div class="login-modern-input-wrapper">
<i class="ri-lock-line login-modern-icon"></i>
<input type="password" id="customPassword" class="login-modern-input"
autocomplete="current-password" placeholder="心上锁">
</div>
<button type="button" class="login-modern-submit" id="customLoginBtn">
落 款
</button>
</form>
</div>
</div>
<!-- 退出登录 -->
<div id="pixarNoticeWrapper" class="pixar-notice-wrapper">
<div class="pixar-notice-card" role="article" aria-labelledby="pixarNoticeUsername">
<div class="pixar-notice-header">
<div class="pixar-notice-avatar"></div>
<p class="pixar-notice-username" id="pixarNoticeUsername">阿年的日记簿</p>
</div>
<div class="pixar-notice-image-area">
<p class="pixar-notice-caption">
您确定要退出登录吗?<br>
请注意!<br>
未保存的内容将会被清空!
</p>
</div>
<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"
onclick="hidePixarCard()">
<i class="ri-close-line"></i>
</button>
</div>
</div>
</div>
<!-- 删除确认弹窗 -->
<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-confirm" type="button" id="momentsConfirmDeleteBtn">确认</button>
<button class="moments-btn-cancel" type="button" id="momentsCancelDeleteBtn">取消</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/jsencrypt/jsencrypt.min.js(v=${customJsVersion})}" id="jsencrypt.min-js"></script>
<script th:src="@{/assets/libs/jsencrypt/jsencrypt.min.js(v=${customJsVersion})}"
id="jsencrypt.min-js"></script>
<script th:src="@{/assets/libs/jquery/jquery.min.js(v=${customJsVersion})}" id="jquery.min-js"></script>
<script th:src="@{/assets/libs/qrious/qrious.min.js(v=${customJsVersion})}"></script>
<script th:src="@{/assets/libs/uikit/uikit.min.js(v=${customJsVersion})}" id="uikit.js-js"></script>
<script th:src="@{/assets/libs/jquery/jquery.cookie.js(v=${customJsVersion})}" id="jquery.cookie-js"></script>
<script th:src="@{/assets/libs/fancybox/jquery.fancybox.min.js(v=${customJsVersion})}" id="fancybox.js-js"></script>
<script th:src="@{/assets/libs/fancybox/jquery.fancybox.min.js(v=${customJsVersion})}"
id="fancybox.js-js"></script>
<script th:src="@{/assets/libs/jquery/jquery.form.js(v=${customJsVersion})}" id="jquery.form-js"></script>
<script th:src="@{/assets/libs/jquery/jquery.validate.js(v=${customJsVersion})}" id="jquery.validate-js"></script>
<script th:src="@{/assets/libs/jquery/jquery.validate.js(v=${customJsVersion})}"
id="jquery.validate-js"></script>
<script th:src="@{/assets/libs/message/coco-message.js(v=${customJsVersion})}" id="mesage-js"></script>
<script th:src="@{/assets/libs/lazyload/lazyload.min.js(v=${customJsVersion})}" id="lazyload-js"></script>
<script th:src="@{/assets/libs/nprogress/nprogress.js(v=${customJsVersion})}" id="nprogress-js"></script>
@@ -26,8 +117,9 @@
<script th:src="@{/assets/js/app.js(v=${customJsVersion})}" id="app-js"></script>
<script th:src="@{/assets/js/anian.js(v=${customJsVersion})}" id="anian-js"></script>
<link rel="prefetch" href="/upload/ma-shan-zheng.woff2" as="font" type="font/woff2" crossorigin>
<link rel="prefetch" href="/upload/mu-yao-sui-xin-shou-xie-ti.woff2" as="font" type="font/woff2" crossorigin>
<link rel="prefetch" href="/upload/ma-shan-zheng.woff2" crossorigin="anonymous">
<link rel="prefetch" href="/upload/mu-yao-sui-xin-shou-xie-ti.woff2" crossorigin="anonymous">
<link rel="prefetch" href="/upload/jiazai.gif">
</th:block>
+16 -11
View File
@@ -1,4 +1,4 @@
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-2'}">
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-5'}">
<th:block th:replace="~{'modules/variables/msg'}" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
@@ -44,16 +44,21 @@
</div>
<script>
const card=document.getElementById('lineCard'),heading=document.getElementById('cardHeading'),para=document.getElementById('cardPara'),switchBtn=document.getElementById('switchBtn'),cancelBtn=document.getElementById('cancelBtn');
const showCard=()=>{card.style.display='block';setTimeout(()=>{card.style.opacity='1';card.style.transform='translateY(0)';},10)};
const hideCard=()=>{card.style.opacity='0';card.style.transform='translateY(20px)';setTimeout(()=>{card.style.display='none'},300)};
const handleSwitch=(baseUrl)=>{switchBtn.classList.add('loading');switchBtn.textContent='切换中';switchBtn.disabled=true;const currentScrollTop=window.scrollY||document.documentElement.scrollTop;document.cookie=`scrollParam=${currentScrollTop}; path=/; domain=anian.cc`;let finalUrl=baseUrl+location.pathname+location.search+location.hash;setTimeout(()=>location.href=finalUrl,500)};
let isResourceLoaded=false,pageLoadTimeoutTimer=null,isLoadTimeoutAborted=false;
const currentHost=location.hostname,isMainDomain=currentHost.includes('anian.cc')&&!currentHost.includes('www.anian.cc');
cancelBtn.addEventListener('click',hideCard);
const scrollTop = document.cookie.split('; ').find(c => c.startsWith('scrollParam='))?.split('=')[1] ? decodeURIComponent(document.cookie.split('; ').find(c => c.startsWith('scrollParam='))?.split('=')[1]) : null;
if(!isMainDomain && !scrollTop && !isNaN(scrollTop)){heading.textContent='温馨提示';para.textContent='当前为备用线路,若主线路正常,请优先选择主线路';switchBtn.textContent='切换主线路';switchBtn.onclick=()=>handleSwitch('https://anian.cc');showCard();}
if(isMainDomain){pageLoadTimeoutTimer=setTimeout(()=>{if(!isResourceLoaded){isLoadTimeoutAborted=true;heading.textContent='线路异常';para.textContent='当前线路拥塞,若本地网络正常,可尝试切换至备用线路';switchBtn.textContent='切换副线路';switchBtn.onclick=()=>handleSwitch('https://www.anian.cc');showCard();}},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();heading.textContent='线路异常';para.textContent='当前线路拥塞,若本地网络正常,可尝试切换至备用线路';switchBtn.textContent='切换副线路';switchBtn.onclick=()=>handleSwitch('https://www.anian.cc');showCard()},7500);xhr.onload=xhr.onerror=xhr.onabort=()=>clearTimeout(t);xhr.send();}}
(function () {
const lineCardEl = document.getElementById('lineCard'), cardHeadingEl = document.getElementById('cardHeading'), cardParaEl = document.getElementById('cardPara'), switchLineBtn = document.getElementById('switchBtn'), cancelLineBtn = document.getElementById('cancelBtn');
const getCookie = (name) => document.cookie.split('; ').find(row => row.startsWith(`${name}=`))?.split('=')[1];
const setSessionCookie = (name, value, domain = 'anian.cc') => document.cookie = `${name}=${value}; path=/; domain=${domain}; SameSite=Lax`;
const showLineCard = () => { lineCardEl.style.display = 'block'; setTimeout(() => { lineCardEl.style.opacity = '1'; lineCardEl.style.transform = 'translateY(0)'; }, 10) };
const hideLineCard = (setNoPrompt = false, setNoSpeedTest = false) => { lineCardEl.style.opacity = '0'; lineCardEl.style.transform = 'translateY(20px)'; setTimeout(() => { lineCardEl.style.display = 'none'; if (setNoPrompt) setSessionCookie('noPrompt_anian_cc', 'true'); if (setNoSpeedTest) setSessionCookie('noSpeedTest_anian_cc', 'true'); }, 300) };
const handleLineSwitch = (baseUrl) => { switchLineBtn.classList.add('loading'); switchLineBtn.textContent = '切换中'; switchLineBtn.disabled = true; const currentScrollTop = window.scrollY || document.documentElement.scrollTop; document.cookie = `scrollParam=${currentScrollTop}; path=/; domain=anian.cc`; let finalUrl = baseUrl + location.pathname + location.search + location.hash; setTimeout(() => location.href = finalUrl, 500) };
let isResourceLoaded = false, pageLoadTimeoutTimer = null, isLoadTimeoutAborted = false;
const currentHost = location.hostname, isMainDomain = currentHost === 'anian.cc', isSubDomain = currentHost === 'www.anian.cc', isTestDomain = !isMainDomain && !isSubDomain;
const scrollParam = getCookie('scrollParam'), noPromptCookie = getCookie('noPrompt_anian_cc'), noSpeedTestCookie = getCookie('noSpeedTest_anian_cc');
cancelLineBtn.addEventListener('click', () => { hideLineCard(!isMainDomain, isMainDomain); });
if (isSubDomain) { if (!scrollParam && !noPromptCookie) { cardHeadingEl.textContent = '温馨提示'; cardParaEl.textContent = '当前为备用线路,若主线路正常,请优先选择主线路'; switchLineBtn.textContent = '切换主线路'; switchLineBtn.onclick = () => handleLineSwitch('https://anian.cc'); showLineCard(); } }
if (isMainDomain) { if (!noSpeedTestCookie) { pageLoadTimeoutTimer = setTimeout(() => { if (!isResourceLoaded) { isLoadTimeoutAborted = true; cardHeadingEl.textContent = '线路异常'; cardParaEl.textContent = '当前线路拥塞,若本地网络正常,可尝试切换至备用线路'; switchLineBtn.textContent = '切换副线路'; switchLineBtn.onclick = () => handleLineSwitch('https://www.anian.cc'); showLineCard(); } }, 15000); window.onload = () => { isResourceLoaded = true; clearTimeout(pageLoadTimeoutTimer); if (isLoadTimeoutAborted) return; const xhr = new XMLHttpRequest(); xhr.open('GET', `/upload/%E4%B8%8B%E8%BD%BD%20(9).mp4?_t=${Date.now()}`, true); let t = setTimeout(() => { xhr.abort(); cardHeadingEl.textContent = '线路异常'; cardParaEl.textContent = '当前线路拥塞,若本地网络正常,可尝试切换至备用线路'; switchLineBtn.textContent = '切换副线路'; switchLineBtn.onclick = () => handleLineSwitch('https://www.anian.cc'); showLineCard() }, 7500); xhr.onload = xhr.onerror = xhr.onabort = () => clearTimeout(t); xhr.send(); } } }
if (isTestDomain) { if (!noPromptCookie) { cardHeadingEl.textContent = '线路警告'; cardParaEl.textContent = '当前为测试线路,若非开发所需,请优先选择主线路'; switchLineBtn.textContent = '切换主线路'; switchLineBtn.onclick = () => handleLineSwitch('https://anian.cc'); showLineCard(); } }
})();
</script>
<link rel="stylesheet" id="wp-block-library-css" th:href="@{/assets/css/style.min.css(v=${customJsVersion})}" media="all">
+108 -1
View File
@@ -20,7 +20,7 @@
</header><!-- #masthead -->
<div class="index_banner">
<!-- <div class="index_banner">
<div class="bg bg1"></div>
<div class="bg bg2"></div>
<div class="user_info">
@@ -32,4 +32,111 @@
<div class="avatar"><img th:src="${theme.config.base_set.default_avatar}"></div>
</div>
</div>
</div> -->
<div class="index_banner" id="banner" uk-img="loading: eager">
<div class="user_info">
<div class="top">
<div class="left">
<div class="name">[[${theme.config.base_set.nice_name}]]</div>
<div class="des">[[${theme.config.base_set.admin_des}]]</div>
</div>
<div class="avatar"><img th:src="${theme.config.base_set.default_avatar}"></div>
</div>
</div>
</div>
<script>
// --------------------------
// 配置区域(请替换为实际图片地址)
// --------------------------
const BANNER_CONFIG = {
seasonal: {
'春季': '/upload/dingbu-chun.png', // 春季 Banner
'夏季': '/upload/dingbu-xia.png', // 夏季 Banner
'秋季': '/upload/dingbu-qiu.png', // 秋季 Banner
'冬季': '/upload/dingbu-dong.png' // 冬季 Banner
},
fallback: '/upload/dingbu-siji.png' // 兜底图
};
// --------------------------
// 原有 Cookie 工具函数(保持不变)
// --------------------------
function anian_setDailyCookie(name, value) {
const now = new Date();
const china = new Date(now.getTime() + 8 * 3600 * 1000);
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`;
}
function anian_getCookie(name) {
const nameEQ = encodeURIComponent(name) + '=';
const ca = document.cookie.split(';');
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) === ' ') c = c.substring(1);
if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length));
}
return null;
}
// --------------------------
// 新增:Banner 图片切换逻辑
// --------------------------
function setBanner(lunarInfo) {
const banner = document.getElementById('banner');
if (!banner) return;
// 根据季节选图,无匹配则用兜底
const season = lunarInfo?.jijie;
const imgUrl = BANNER_CONFIG.seasonal[season] || BANNER_CONFIG.fallback;
// 可以根据日期、节日覆盖imgUrl
// 设置图片并触发 UIkit 加载
banner.setAttribute('data-src', imgUrl);
window.UIkit && UIkit.update(banner);
}
// --------------------------
// 初始化逻辑(优化版)
// --------------------------
(function() {
const apiUrl = 'https://cn.apihz.cn/api/time/getday.php?id=10011724&key=0bdd2d8b3d97c0d476c98a41f108a96f';
const cookieName = 'anian_lunar_info';
// 1. 优先尝试从 Cookie 读取
const cached = anian_getCookie(cookieName);
if (cached) {
try {
setBanner(JSON.parse(cached));
return; // 有缓存直接结束
} catch (e) {}
}
// 2. 无缓存则请求 API
fetch(apiUrl)
.then(res => res.json())
.then(data => {
if (data.code !== 200) throw new Error('API Error');
// 组装农历信息(保留原有逻辑)
const lunarInfo = {
ganzhiYear: data.ganzhinian || '',
lunarMonth: data.nyue || '',
lunarDay: data.nri || '',
jieqi: (data.JIEQICN || '').includes('第1天') ? data.jieqi : '',
jijie: data.jijie || '',
traditionalFestival: data.YIFESTIVAL || ''
};
// 存 Cookie 并设置 Banner
anian_setDailyCookie(cookieName, JSON.stringify(lunarInfo));
setBanner(lunarInfo);
})
.catch(() => {
// 3. 失败兜底:显示默认图
setBanner(null);
});
})();
</script>
+9 -5
View File
@@ -6,8 +6,7 @@
uk-dropdown="mode: click;flip: false;offset: 12;toggle:.top_nav_btn;animation:uk-animation-slide-top-small;animate-out:uk-animation-slide-top-small;delay-hide:5000;boundary: .top_bar;stretch: x;">
<div class="inner"
th:with="topMenu = ${#strings.isEmpty(theme.config.base_top_set.top_nav) ? menuFinder.getPrimary() : menuFinder.getByName(theme.config.base_top_set.top_nav)}">
<div class="menu-top-container"
th:if="${not #lists.isEmpty(topMenu)}">
<div class="menu-top-container" th:if="${not #lists.isEmpty(topMenu)}">
<ul id="top_menu" class="menu">
<li class="menu-item menu-item-type-post_type menu-item-object-page"
th:each="menuItem : ${topMenu.menuItems}">
@@ -23,7 +22,7 @@
</div>
</div>
<div class="m_top_nav top_tool is_mobile">
<!-- <div class="m_top_nav top_tool is_mobile">
<a class="top_nav_btn" uk-toggle="target: #m_offcanvas"><i class="ri-menu-2-line"></i></a>
<div id="m_offcanvas" class="m_offcanvas uk-animation-fast"
uk-offcanvas="overlay: true;mode: push;container:.main_wrap">
@@ -85,8 +84,7 @@
<div th:unless="${not #lists.isEmpty(topMenu)}" class="nav_tips">请前往后台设置左侧菜单/移动端菜单</div>
</div>
</div>
</div>
</div> -->
<!-- 搜索区域 -->
<div class="search_mod">
@@ -94,4 +92,10 @@
<a onclick="SearchWidget.open()"><i class="ri-search-line s_toogle_btn"></i></a>
</div>
</div>
<!-- 回到顶部 -->
<div class="is_mobile">
<a class="tool_top" href="#page" uk-scroll="" data-pjax-state="">
<i class="ri-skip-up-line"></i></a>
</div>
</div>
+4 -4
View File
@@ -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="inner">
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
<a class="logout" href="/logout"><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>
@@ -24,7 +24,7 @@
</th:block>
<div sec:authorize="isAnonymous()" class="top_tool">
<a th:if="${theme.config.base_set.login_button}" onclick="loginUrl()"><i class="ri-user-3-line"></i></a>
<a th:if="${theme.config.base_set.login_button}" onclick="open_login_box()"><i class="ri-user-3-line"></i></a>
</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="inner">
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
<a class="logout" href="/logout"><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>
@@ -55,7 +55,7 @@
</th:block>
<div sec:authorize="isAnonymous()" class="top_tool">
<a th:if="${theme.config.base_set.login_button}" onclick="loginUrl()"><i class="ri-user-3-line"></i></a>
<a th:if="${theme.config.base_set.login_button}" onclick="open_login_box()"><i class="ri-user-3-line"></i></a>
</div>
</div>
+1 -1
View File
@@ -124,7 +124,7 @@
<div class="form_footer">
<div class="admin_tool">
<a href="/console" target="_blank"><i class="ri-function-line"></i> 管理</a>
<a class="logout" href="/logout"><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 class="moment_sure">
<button class="uk-modal-close push_close">取消</button>
@@ -1,5 +1,4 @@
<style th:if="${theme.config.moments.img_style == 'one'}">
.img_list .list_inner {
display: flex;
flex-wrap: wrap;
@@ -48,14 +47,13 @@
width: 30%;
margin: 2px;
}
.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(4):nth-last-child(1) {
width: 30%;
}
}
</style>
<style th:if="${theme.config.moments.img_style == 'two'}">
.img_list span:nth-last-child(1):first-child {
@@ -137,7 +135,8 @@
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;
}
@@ -165,7 +164,7 @@
grid-area: 3 / 3 / 4 / 4;
}
.img_list .list_inner[num='7'] {
.img_list .list_inner[num='7'] {
display: grid;
/* 采用 6 列网格,支持 50% (span 3) 和 33.3% (span 2) 两种尺寸 */
grid-template-columns: repeat(6, 1fr);
@@ -178,9 +177,9 @@
justify-content: unset;
align-content: unset;
align-items: unset;
}
}
.img_list .list_inner[num='7'] span {
.img_list .list_inner[num='7'] span {
/* 清除干扰,保持稳定性 */
margin: 0 !important;
padding: 0 !important;
@@ -189,24 +188,25 @@
/* 默认尺寸:中等 (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),
.img_list .list_inner[num='7'] span:nth-child(2) {
/* 第一行 (Item 1, 2):大尺寸 (50% 宽度, span 3/6) */
.img_list .list_inner[num='7'] span:nth-child(1),
.img_list .list_inner[num='7'] span:nth-child(2) {
grid-column: span 3;
}
}
/* 第三行 (Item 6, 7):大尺寸 (50% 宽度, span 3/6) */
.img_list .list_inner[num='7'] span:nth-child(6),
.img_list .list_inner[num='7'] span:nth-child(7) {
/* 第三行 (Item 6, 7):大尺寸 (50% 宽度, span 3/6) */
.img_list .list_inner[num='7'] span:nth-child(6),
.img_list .list_inner[num='7'] span:nth-child(7) {
grid-column: span 3;
}
}
/* 容器设置:保持 6 列网格,用于计算 1/3 和 1/2 宽度 */
.img_list .list_inner[num='8'] {
/* 容器设置:保持 6 列网格,用于计算 1/3 和 1/2 宽度 */
.img_list .list_inner[num='8'] {
display: grid;
grid-template-columns: repeat(6, 1fr); /* 6 列 */
grid-template-columns: repeat(6, 1fr);
/* 6 列 */
max-height: 100vw;
@@ -216,10 +216,10 @@
justify-content: unset;
align-content: unset;
align-items: unset;
}
}
/* 默认规则:应用到所有子项,用于第 1 行和第 3 行 (1/3 宽度) */
.img_list .list_inner[num='8'] span {
/* 默认规则:应用到所有子项,用于第 1 行和第 3 行 (1/3 宽度) */
.img_list .list_inner[num='8'] span {
margin: 0 !important;
padding: 0 !important;
width: auto;
@@ -227,20 +227,300 @@
/* 跨 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) {
/* 特殊规则:仅应用于第 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 个 */
/* 确保第 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 {
+1 -1
View File
@@ -33,7 +33,7 @@
</th:block>
</div>
<div th:if="${posts.hasNext}" class="arc_pagenav">
<div th:if="${posts.hasNext}" class="arc_pagenav post-paging">
<a th:data="@{${posts.nextUrl}}" th:text="${theme.config.base_set.site_page}"></a>
</div>
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
issues: "https://github.com/chengzhongxue/halo-theme-pix/issues"
settingName: "theme-pix-setting"
configMapName: "theme-pix-configMap"
version: "1.2.5-2"
version: "1.2.5-4"
require: ">=2.20.0"
customTemplates:
page: