重构课外书;更新侧边栏;修复模态框、分享海报异常
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<th:block th:fragment="footer">
|
||||
<th:block th:with="customJsVersion='1.2.5-5'">
|
||||
<th:block th:with="customJsVersion='1.2.5-6'">
|
||||
|
||||
<!-- 奇遇容器 -->
|
||||
<div class="center-img-container" id="centerImgContainer">
|
||||
@@ -41,25 +41,25 @@
|
||||
<div class="pixar-notice-image-area">
|
||||
<p class="pixar-notice-caption">
|
||||
您确定要退出登录吗?<br>
|
||||
请注意!<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>
|
||||
|
||||
<!-- 确认按钮 -->
|
||||
<button class="pixar-notice-btn pixar-notice-btn-confirm" aria-label="Confirm"
|
||||
onclick="confirmPixarAction()">
|
||||
<i class="ri-check-line"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -85,15 +85,15 @@
|
||||
</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>
|
||||
<button class="moments-btn-cancel" type="button" id="momentsCancelBtn">取消</button>
|
||||
<button class="moments-btn-confirm" type="button" id="momentsConfirmBtn">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script th:if="${pluginFinder.available('plugin-douban')}"
|
||||
th:src="@{/plugins/plugin-douban/assets/static/db.min.js(v=${customJsVersion})}" class="pjax"></script>
|
||||
<!-- <script th: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>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-5'}">
|
||||
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-6'}">
|
||||
<th:block th:replace="~{'modules/variables/msg'}" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
|
||||
@@ -6,7 +6,7 @@
|
||||
<link rel="shortcut icon" th:href="@{${theme.config.base_set.favicon}}" title="Favicon">
|
||||
<meta name="robots" content="max-image-preview:large">
|
||||
|
||||
<style>
|
||||
<!-- <style>
|
||||
.dl-warning-card { overflow: hidden; position: fixed; bottom: 1rem; left: 0; right: 0; margin: 0 auto; background-color: #ffffff; border-radius: 0.5rem; max-width: 720px; width: calc(100% - 2rem); box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 9999; display: none; opacity: 0; transform: translateY(20px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-sizing: border-box; border-left: 4px solid #f59e0b; }
|
||||
.dl-warning-header { display: flex; align-items: center; padding: 1rem; gap: 1rem; }
|
||||
.dl-warning-image { flex-shrink: 0; background-color: #fef3c7; justify-content: center; align-items: center; width: 2.5rem; height: 2.5rem; border-radius: 9999px; display: flex; }
|
||||
@@ -59,7 +59,7 @@
|
||||
if (isMainDomain) { if (!noSpeedTestCookie) { pageLoadTimeoutTimer = setTimeout(() => { if (!isResourceLoaded) { isLoadTimeoutAborted = true; cardHeadingEl.textContent = '线路异常'; cardParaEl.textContent = '当前线路拥塞,若本地网络正常,可尝试切换至备用线路'; switchLineBtn.textContent = '切换副线路'; switchLineBtn.onclick = () => handleLineSwitch('https://www.anian.cc'); showLineCard(); } }, 15000); window.onload = () => { isResourceLoaded = true; clearTimeout(pageLoadTimeoutTimer); if (isLoadTimeoutAborted) return; const xhr = new XMLHttpRequest(); xhr.open('GET', `/upload/%E4%B8%8B%E8%BD%BD%20(9).mp4?_t=${Date.now()}`, true); let t = setTimeout(() => { xhr.abort(); cardHeadingEl.textContent = '线路异常'; cardParaEl.textContent = '当前线路拥塞,若本地网络正常,可尝试切换至备用线路'; switchLineBtn.textContent = '切换副线路'; switchLineBtn.onclick = () => handleLineSwitch('https://www.anian.cc'); showLineCard() }, 7500); xhr.onload = xhr.onerror = xhr.onabort = () => clearTimeout(t); xhr.send(); } } }
|
||||
if (isTestDomain) { if (!noPromptCookie) { cardHeadingEl.textContent = '线路警告'; cardParaEl.textContent = '当前为测试线路,若非开发所需,请优先选择主线路'; switchLineBtn.textContent = '切换主线路'; switchLineBtn.onclick = () => handleLineSwitch('https://anian.cc'); showLineCard(); } }
|
||||
})();
|
||||
</script>
|
||||
</script> -->
|
||||
|
||||
<link rel="stylesheet" id="wp-block-library-css" th:href="@{/assets/css/style.min.css(v=${customJsVersion})}" media="all">
|
||||
<link rel="stylesheet" id="pix-style-css" th:href="@{/assets/css/style.css(v=${customJsVersion})}" media="all">
|
||||
@@ -73,7 +73,7 @@
|
||||
<link rel="stylesheet" id="album-css" th:href="@{/assets/css/album.css(v=${customJsVersion})}" media="all">
|
||||
<link rel="stylesheet" id="anian-css" th:href="@{/assets/css/anian.css(v=${customJsVersion})}" media="all">
|
||||
<link th:if="${theme.config.style.theme_set != 'green-normal' && theme.config.style.theme_set != 'dark-theme'}" rel="stylesheet" id="theme.color-css" th:href="@{/assets/css/{theme_set}.css(theme_set=${theme.config.style.theme_set},v=${customJsVersion})}" media="all">
|
||||
<link th:if="${pluginFinder.available('plugin-douban')}" rel="stylesheet" id="wpd-css-css" th:href="@{/plugins/plugin-douban/assets/static/db.min.css(v=${customJsVersion})}" type="text/css" media="screen">
|
||||
<!-- <link th:if="${pluginFinder.available('plugin-douban')}" rel="stylesheet" id="wpd-css-css" th:href="@{/plugins/plugin-douban/assets/static/db.min.css(v=${customJsVersion})}" type="text/css" media="screen"> -->
|
||||
|
||||
<style th:if="${not #strings.isEmpty(theme.config.custom.code_css)}" th:utext="${theme.config.custom.code_css}"></style>
|
||||
<style>:root { --toc-color: [(${theme.config.post.tocColor})]; } .wp-block-button__link { color: #fff; background-color: #32373c; border-radius: 9999px; text-decoration: none; padding: .6em 1.3em; } .wp-block-file__button { background: #32373c; color: #fff; text-decoration: none; }</style>
|
||||
|
||||
@@ -51,12 +51,12 @@
|
||||
// --------------------------
|
||||
const BANNER_CONFIG = {
|
||||
seasonal: {
|
||||
'春季': '/upload/dingbu-chun.png', // 春季 Banner
|
||||
'夏季': '/upload/dingbu-xia.png', // 夏季 Banner
|
||||
'秋季': '/upload/dingbu-qiu.png', // 秋季 Banner
|
||||
'冬季': '/upload/dingbu-dong.png' // 冬季 Banner
|
||||
'春': '/upload/chun.jpg',
|
||||
'夏': '/upload/xia.jpg',
|
||||
'秋': '/upload/qiu.jpg',
|
||||
'冬': '/upload/dong.jpg'
|
||||
},
|
||||
fallback: '/upload/dingbu-siji.png' // 兜底图
|
||||
fallback: '/upload/dingbu-siji.png'
|
||||
};
|
||||
|
||||
// --------------------------
|
||||
@@ -66,7 +66,7 @@ function anian_setDailyCookie(name, value) {
|
||||
const now = new Date();
|
||||
const 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`;
|
||||
document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}; expires=${expires.toUTCString()}; path=/`;
|
||||
}
|
||||
|
||||
function anian_getCookie(name) {
|
||||
@@ -102,7 +102,7 @@ function setBanner(lunarInfo) {
|
||||
// 初始化逻辑(优化版)
|
||||
// --------------------------
|
||||
(function() {
|
||||
const apiUrl = 'https://cn.apihz.cn/api/time/getday.php?id=10011724&key=0bdd2d8b3d97c0d476c98a41f108a96f';
|
||||
const apiUrl = 'https://api.anian.cc/lunar';
|
||||
const cookieName = 'anian_lunar_info';
|
||||
|
||||
// 1. 优先尝试从 Cookie 读取
|
||||
@@ -118,16 +118,15 @@ function setBanner(lunarInfo) {
|
||||
fetch(apiUrl)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (data.code !== 200) throw new Error('API Error');
|
||||
|
||||
// 组装农历信息(保留原有逻辑)
|
||||
// 组装农历信息,保持 cookie 字段名不变
|
||||
const lunarInfo = {
|
||||
ganzhiYear: data.ganzhinian || '',
|
||||
lunarMonth: data.nyue || '',
|
||||
lunarDay: data.nri || '',
|
||||
jieqi: (data.JIEQICN || '').includes('第1天') ? data.jieqi : '',
|
||||
ganzhiYear: data.nian || '',
|
||||
lunarMonth: data.yue || '',
|
||||
lunarDay: data.ri || '',
|
||||
jieqi: data.jieqi || '',
|
||||
jijie: data.jijie || '',
|
||||
traditionalFestival: data.YIFESTIVAL || ''
|
||||
shengxiao: data.shengxiao || '',
|
||||
traditionalFestival: data.jieri || ''
|
||||
};
|
||||
|
||||
// 存 Cookie 并设置 Banner
|
||||
|
||||
Reference in New Issue
Block a user