重写目录样式;适配新域名
This commit is contained in:
@@ -45,13 +45,13 @@
|
||||
|
||||
@media (min-width: 960px) and (max-width: 1359.98px) {
|
||||
.listree-box {
|
||||
margin-left: calc((100vw - 860px) / 2 + 284px);
|
||||
margin-left: calc((100vw - 860px) / 2 + 284px + 50px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1360px) {
|
||||
.listree-box {
|
||||
margin-left: calc((100vw - 1400px) / 2 + 291px);
|
||||
margin-left: calc((100vw - 1400px) / 2 + 291px + 50px);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,7 +584,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 豆瓣页:默认不显示翻页按钮,避免初始化前出现蓝色链接文本 */
|
||||
#douban_pagination {
|
||||
display: none;
|
||||
padding: 30px;
|
||||
@@ -620,7 +619,6 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 豆瓣页:内容区域左右间距与分类导航保持一致 */
|
||||
.douban_page #douban_item {
|
||||
padding: 0;
|
||||
display: grid;
|
||||
@@ -671,7 +669,6 @@
|
||||
}
|
||||
|
||||
|
||||
/* 强制网格单元同高并让卡片内部撑满单元,确保水平分割线对齐 */
|
||||
.douban_page #douban_item {
|
||||
align-items: stretch !important;
|
||||
}
|
||||
|
||||
@@ -129,6 +129,47 @@
|
||||
background-color: var(--dark-ac-btn);
|
||||
}
|
||||
|
||||
.dark .listree-box {
|
||||
color: var(--light-color);
|
||||
background: rgb(27 29 48 / 94%);
|
||||
border-color: var(--dark-border);
|
||||
box-shadow: 0 18px 48px rgb(0 0 0 / 28%);
|
||||
}
|
||||
|
||||
.dark .toc_nav .listree-btn:hover,
|
||||
.dark .toc_nav .listree-btn.is-active {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.dark .toc_nav .listree-btn.is-active i {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.dark #listree-ol ul {
|
||||
border-left-color: var(--dark-border);
|
||||
}
|
||||
|
||||
.dark #listree-ol li a {
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.dark #listree-ol li a:hover {
|
||||
color: var(--light-color);
|
||||
background: rgb(255 255 255 / 7%);
|
||||
}
|
||||
|
||||
.dark #listree-ol>li.current>a,
|
||||
.dark #listree-ol>li ul li.current>a {
|
||||
color: var(--dark-ac-btn);
|
||||
border-left-color: var(--dark-ac-btn);
|
||||
background: rgb(43 72 255 / 13%);
|
||||
}
|
||||
|
||||
.dark #listree-ol::-webkit-scrollbar-thumb {
|
||||
background: rgb(43 72 255 / 48%);
|
||||
}
|
||||
|
||||
.dark .uk-dropdown{
|
||||
background: var(--dark-border);
|
||||
color: #666;
|
||||
|
||||
+157
-46
@@ -313,6 +313,40 @@ header#masthead {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.toc_nav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.toc-ready .toc_nav[aria-hidden="false"] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.toc_nav .listree-btn {
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
transition: transform .22s ease;
|
||||
}
|
||||
|
||||
.toc_nav .listree-btn:hover,
|
||||
.toc_nav .listree-btn.is-active {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.toc_nav .listree-btn:active {
|
||||
transform: scale(.94);
|
||||
}
|
||||
|
||||
.toc_nav .listree-btn i {
|
||||
font-size: 20px;
|
||||
transition: transform .22s ease;
|
||||
}
|
||||
|
||||
.toc_nav .listree-btn.is-active i {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.uk-modal-close-full.uk-close {
|
||||
bottom: 5%;
|
||||
top: auto;
|
||||
@@ -1334,6 +1368,7 @@ a.close_local {
|
||||
.moment_cat_nav,
|
||||
.posts_cat_nav,
|
||||
.photos_cat_nav,
|
||||
.douban_cat_nav,
|
||||
.friends_cat_nav {
|
||||
padding: 25px 40px;
|
||||
border-bottom: 1px solid var(--pix-background);
|
||||
@@ -1342,6 +1377,7 @@ a.close_local {
|
||||
.moment_cat_nav ul,
|
||||
.posts_cat_nav ul,
|
||||
.photos_cat_nav ul,
|
||||
.douban_cat_nav ul,
|
||||
.friends_cat_nav ul {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1356,6 +1392,7 @@ a.close_local {
|
||||
.moment_cat_nav ul li,
|
||||
.posts_cat_nav ul li,
|
||||
.photos_cat_nav ul li,
|
||||
.douban_cat_nav ul li,
|
||||
.friends_cat_nav ul li {
|
||||
list-style: none;
|
||||
flex: none;
|
||||
@@ -1364,6 +1401,7 @@ a.close_local {
|
||||
.moment_cat_nav ul::-webkit-scrollbar,
|
||||
.posts_cat_nav ul::-webkit-scrollbar,
|
||||
.photos_cat_nav ul::-webkit-scrollbar,
|
||||
.douban_cat_nav ul::-webkit-scrollbar,
|
||||
.friends_cat_nav ul::-webkit-scrollbar {
|
||||
|
||||
display: none;
|
||||
@@ -1374,6 +1412,7 @@ a.close_local {
|
||||
.moment_cat_nav ul li a,
|
||||
.posts_cat_nav ul li a,
|
||||
.photos_cat_nav ul li a,
|
||||
.douban_cat_nav ul li a,
|
||||
.friends_cat_nav ul li a {
|
||||
padding: 5px 10px;
|
||||
background: #e1e9e5;
|
||||
@@ -1388,6 +1427,7 @@ a.close_local {
|
||||
.moment_cat_nav ul li a:hover,
|
||||
.posts_cat_nav ul li a:hover,
|
||||
.photos_cat_nav ul li a:hover,
|
||||
.douban_cat_nav ul li a:hover,
|
||||
.friends_cat_nav ul li a:hover {
|
||||
background-color: var(--pix-theme);
|
||||
color: #fff !important;
|
||||
@@ -1396,6 +1436,7 @@ a.close_local {
|
||||
.moment_cat_nav ul li a.active,
|
||||
.posts_cat_nav ul li a.active,
|
||||
.photos_cat_nav ul li a.active,
|
||||
.douban_cat_nav ul li a.active,
|
||||
.friends_cat_nav ul li a.active {
|
||||
background: var(--pix-theme);
|
||||
color: #fff !important;
|
||||
@@ -2268,21 +2309,20 @@ a.go_top.show {
|
||||
|
||||
/* 手机端顶部导航栏回到顶部按钮 */
|
||||
.tool_top {
|
||||
position: fixed;
|
||||
bottom: 10%;
|
||||
opacity: 0;
|
||||
transition: all 0.15s;
|
||||
font-size: 26px;
|
||||
transform: translateY(20px);
|
||||
transform: translateY(8px);
|
||||
transition: opacity 0.15s, transform 0.15s;
|
||||
pointer-events: none;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.tool_top.show {
|
||||
opacity: 1;
|
||||
transform: translateY(0px);
|
||||
transform: translateY(0);
|
||||
pointer-events: auto;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.tool_top .tool_top_icon {
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.footer_nav_box .left_inner {
|
||||
@@ -5974,76 +6014,147 @@ a.change i.ri-refresh-line {
|
||||
|
||||
/*toc*/
|
||||
.listree-box {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
background-color: var(--toc-color);
|
||||
color: #fff;
|
||||
border-radius: 0 10px 10px 0;
|
||||
}
|
||||
|
||||
h3.listree-titles {
|
||||
float: right;
|
||||
cursor: default;
|
||||
padding: 20px 8px 9px 6px;
|
||||
font-size: 1.01rem;
|
||||
}
|
||||
|
||||
h3.listree-titles a.listree-btn {
|
||||
color: #fff;
|
||||
top: 10px;
|
||||
left: 15px;
|
||||
display: block;
|
||||
width: 22px;
|
||||
text-align: center;
|
||||
width: 290px;
|
||||
max-width: calc(100vw - 32px);
|
||||
max-height: calc(100vh - 124px);
|
||||
overflow: hidden;
|
||||
color: #29372f;
|
||||
background: rgb(255 255 255 / 92%);
|
||||
border: 1px solid rgb(34 187 109 / 16%);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 18px 48px rgb(23 45 31 / 16%);
|
||||
backdrop-filter: blur(.7rem);
|
||||
-webkit-backdrop-filter: blur(.7rem);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
transform: translate3d(-12px, 8px, 0) scale(.98);
|
||||
transform-origin: top left;
|
||||
transition: opacity .24s ease, visibility .24s ease, transform .24s ease;
|
||||
}
|
||||
|
||||
.listree-box.is-open {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
transform: translate3d(0, 0, 0) scale(1);
|
||||
}
|
||||
|
||||
#listree-ol {
|
||||
max-height: 230px;
|
||||
overflow: scroll;
|
||||
display: block;
|
||||
max-height: min(58vh, 420px);
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
float: left;
|
||||
height: 100%;
|
||||
min-height: 100px;
|
||||
line-height: 1.5;
|
||||
margin: 20px 0px 20px -10px;
|
||||
padding-right: 20px;
|
||||
align-items: center;
|
||||
border-right: 1px solid #eeeeef;
|
||||
float: none;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
line-height: 1.45;
|
||||
margin: 0;
|
||||
padding: 12px 10px 14px;
|
||||
list-style: none;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#listree-ol li {
|
||||
line-height: 1.8;
|
||||
margin-bottom: 6px;
|
||||
line-height: inherit;
|
||||
margin: 2px 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#listree-ol li a {
|
||||
color: #fff;
|
||||
display: block;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 7px 10px 7px 12px;
|
||||
color: #52685b;
|
||||
border-left: 3px solid transparent;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
|
||||
}
|
||||
|
||||
#listree-ol li a:hover {
|
||||
color: #15251c;
|
||||
background: rgb(34 187 109 / 8%);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
#listree-ol ul {
|
||||
margin-top: 0px;
|
||||
margin: 3px 0 3px 12px;
|
||||
padding-left: 10px;
|
||||
border-left: 1px solid rgb(34 54 41 / 10%);
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#listree-ol a.node-name--H1,
|
||||
#listree-ol a.node-name--H2 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#listree-ol a.node-name--H4,
|
||||
#listree-ol a.node-name--H5,
|
||||
#listree-ol a.node-name--H6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
a#listree-click.current,
|
||||
#listree-ol>li.current>a,
|
||||
#listree-ol>li ul li.current>a {
|
||||
color: #f2ff2c;
|
||||
color: var(--toc-color);
|
||||
border-left-color: var(--toc-color);
|
||||
background: rgb(34 187 109 / 10%);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.listree-box.is-open #listree-ol li {
|
||||
animation: listreeItemIn .26s ease both;
|
||||
}
|
||||
|
||||
#listree-ol::-webkit-scrollbar-track {
|
||||
background-color: #fff;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#listree-ol::-webkit-scrollbar-thumb {
|
||||
background: rgb(199, 201, 204);
|
||||
background: rgb(34 187 109 / 26%);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
#listree-ol::-webkit-scrollbar {
|
||||
width: 3px;
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
@keyframes listreeItemIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-6px);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.toc_nav .listree-btn,
|
||||
.toc_nav .listree-btn i,
|
||||
.listree-box,
|
||||
#listree-ol li a {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.listree-box.is-open #listree-ol li {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
.dark .db--container {
|
||||
@@ -6872,4 +6983,4 @@ a#listree-click.current,
|
||||
font-family: 'MuYao';
|
||||
src: url('/upload/mu-yao-sui-xin-shou-xie-ti.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,6 +303,7 @@
|
||||
.moment_cat_nav,
|
||||
.posts_cat_nav,
|
||||
.photos_cat_nav,
|
||||
.douban_cat_nav,
|
||||
.friends_cat_nav {
|
||||
padding: 15px;
|
||||
}
|
||||
@@ -742,30 +743,42 @@
|
||||
}
|
||||
|
||||
/* 手机端文章目录调整 */
|
||||
h3.listree-titles {
|
||||
font-size: 0.8rem;
|
||||
padding: 9px 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.listree-box {
|
||||
left: 40px;
|
||||
right: 12px;
|
||||
max-width: 85vw;
|
||||
max-height: calc(100vh - 96px);
|
||||
margin-left: 0;
|
||||
border-radius: 12px;
|
||||
transform: translate3d(0, -8px, 0) scale(.98);
|
||||
transform-origin: top center;
|
||||
}
|
||||
|
||||
#listree-ol li a {
|
||||
font-size: 0.8rem;
|
||||
.listree-box.is-open {
|
||||
transform: translate3d(0, 0, 0) scale(1);
|
||||
}
|
||||
|
||||
#listree-ol {
|
||||
margin: 10px 0 15px -10px;
|
||||
padding-right: 15px;
|
||||
max-height: min(56vh, 420px);
|
||||
margin: 0;
|
||||
padding: 10px 8px 12px;
|
||||
}
|
||||
|
||||
#listree-ol li {
|
||||
line-height: 1.2;
|
||||
margin-top: 6px;
|
||||
line-height: inherit;
|
||||
margin: 2px 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#listree-ol li a {
|
||||
font-size: 0.82rem;
|
||||
padding: 7px 9px 7px 10px;
|
||||
}
|
||||
|
||||
.toc_nav .listree-btn.is-active i {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* 手机端底部音乐按钮颜色 */
|
||||
.footer_menu a.playing-music,
|
||||
.footer_menu a.playing-music i,
|
||||
@@ -773,7 +786,11 @@
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
/* 手机端顶部工具按钮 */
|
||||
.top_tool a {
|
||||
padding: 6px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+102
-62
@@ -1697,7 +1697,7 @@ $('body').on('click', '.yiyan_box .change', function () {
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const targetElement = document.querySelector('.yiyan_box p');
|
||||
if (url.includes('api.anian.cc')) {
|
||||
if (url.includes('api.anian.net')) {
|
||||
// 新增处理逻辑
|
||||
targetElement.innerText = data.content || '一日不见如隔三秋';
|
||||
const tooltipTitle = data.title || '失败:超时或发生错误';
|
||||
@@ -1842,91 +1842,134 @@ if (currentElement) {
|
||||
});
|
||||
}
|
||||
|
||||
$('body').on('click', '.listree-btn', function () {
|
||||
"目录[+]" == $(".listree-btn").text() ? $(".listree-btn").attr("title", "收起").text("目录[-]").parent().next().show() : $(".listree-btn").attr("title", "展开").text("目录[+]").parent().next().hide();
|
||||
return !1
|
||||
$('body').on('click', '.listree-btn', function (event) {
|
||||
event.preventDefault();
|
||||
setListreeOpen(!$('.listree-box').hasClass('is-open'));
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).on('click.listreeOutside', function (event) {
|
||||
if (!$('body').hasClass('toc-open')) return;
|
||||
if ($(event.target).closest('.listree-box, .toc_nav').length) return;
|
||||
setListreeOpen(false);
|
||||
});
|
||||
|
||||
$(document).on('keydown.listree', function (event) {
|
||||
if (event.key === 'Escape') {
|
||||
setListreeOpen(false);
|
||||
}
|
||||
});
|
||||
|
||||
function resetListree() {
|
||||
$('body').removeClass('toc-ready toc-open');
|
||||
$('.toc_nav').attr('aria-hidden', 'true');
|
||||
$('.listree-btn')
|
||||
.removeClass('is-active')
|
||||
.attr({
|
||||
'title': '展开目录',
|
||||
'aria-label': '展开目录',
|
||||
'aria-expanded': 'false'
|
||||
});
|
||||
$('.listree-box')
|
||||
.removeClass('is-open')
|
||||
.attr('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
function setListreeOpen(open) {
|
||||
if (open && !$('body').hasClass('toc-ready')) return;
|
||||
|
||||
$('body').toggleClass('toc-open', open);
|
||||
$('.listree-box')
|
||||
.toggleClass('is-open', open)
|
||||
.attr('aria-hidden', open ? 'false' : 'true');
|
||||
$('.listree-btn')
|
||||
.toggleClass('is-active', open)
|
||||
.attr({
|
||||
'title': open ? '收起目录' : '展开目录',
|
||||
'aria-label': open ? '收起目录' : '展开目录',
|
||||
'aria-expanded': open ? 'true' : 'false'
|
||||
});
|
||||
}
|
||||
|
||||
// toc
|
||||
function autotree() {
|
||||
$(document).ready(function () {
|
||||
$('.listree-titles').html('<a class="listree-btn" title="展开">目录[+]</a>')
|
||||
$('#listree-ol').empty();
|
||||
$("#listree-ol").css("display", "none")
|
||||
resetListree();
|
||||
|
||||
$('#listree-ol').empty().hide();
|
||||
|
||||
// 获取所有标题元素
|
||||
var headings = document.querySelectorAll('.post-single .single-content *:is(h1, h2, h3, h4, h5, h6)');
|
||||
|
||||
// 为标题元素添加 listree-list 类,并修改 id
|
||||
headings.forEach(function (heading, index) {
|
||||
heading.classList.add('listree-list');
|
||||
heading.id = 'listree-list' + index;
|
||||
});
|
||||
|
||||
// 创建一个空的目录列表
|
||||
var tocList = document.querySelector('#listree-ol');
|
||||
|
||||
if (!tocList || headings.length < 1) {
|
||||
$(window).off('scroll.listree resize.listree');
|
||||
return;
|
||||
}
|
||||
|
||||
// 保存每个级别的父列表项
|
||||
var parentItems = {};
|
||||
|
||||
// 遍历每个标题元素
|
||||
headings.forEach(function (heading, index) {
|
||||
// 创建列表项
|
||||
var listItem = document.createElement('li');
|
||||
heading.classList.add('listree-list');
|
||||
heading.id = 'listree-list' + index;
|
||||
|
||||
// 创建标题链接
|
||||
var level = parseInt(heading.tagName.slice(1));
|
||||
var listItem = document.createElement('li');
|
||||
var link = document.createElement('a');
|
||||
// 直接设置链接的href为标题元素的id
|
||||
var parentItem = null;
|
||||
|
||||
listItem.setAttribute('data-level', level);
|
||||
listItem.style.setProperty('--toc-index', index);
|
||||
|
||||
link.href = '#listree-list' + index;
|
||||
link.classList.add('toc-link', 'node-name--' + heading.tagName);
|
||||
link.textContent = heading.textContent.trim();
|
||||
|
||||
// 将标题链接添加到列表项中
|
||||
listItem.appendChild(link);
|
||||
|
||||
// 获取当前标题级别
|
||||
var level = parseInt(heading.tagName.slice(1));
|
||||
|
||||
// 查找当前标题的父级列表项
|
||||
var parentItem = parentItems[level - 1];
|
||||
|
||||
// 如果存在父级列表项,则将当前列表项作为其子项
|
||||
if (parentItem) {
|
||||
// 如果父级列表项还没有子列表,则创建一个子列表
|
||||
if (!parentItem.querySelector('ul')) {
|
||||
var subList = document.createElement('ul');
|
||||
parentItem.appendChild(subList);
|
||||
for (var parentLevel = level - 1; parentLevel >= 1; parentLevel--) {
|
||||
if (parentItems[parentLevel]) {
|
||||
parentItem = parentItems[parentLevel];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 将当前列表项添加到父级列表的子列表中
|
||||
if (parentItem) {
|
||||
if (!parentItem.querySelector('ul')) {
|
||||
parentItem.appendChild(document.createElement('ul'));
|
||||
}
|
||||
parentItem.querySelector('ul').appendChild(listItem);
|
||||
} else {
|
||||
// 如果不存在父级列表项,则将当前列表项直接添加到根列表中
|
||||
tocList.appendChild(listItem);
|
||||
}
|
||||
|
||||
// 更新当前级别的父列表项为当前列表项
|
||||
parentItems[level] = listItem;
|
||||
Object.keys(parentItems).forEach(function (key) {
|
||||
if (parseInt(key) > level) {
|
||||
delete parentItems[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('body').addClass('toc-ready');
|
||||
$('.toc_nav').attr('aria-hidden', 'false');
|
||||
$('#listree-ol').show();
|
||||
|
||||
$(".listree-btn").click(function () {
|
||||
"目录[+]" == $(".listree-btn").text() ? $(".listree-btn").attr("title", "收起").text("目录[-]").parent().next().show() : $(".listree-btn").attr("title", "展开").text("目录[+]").parent().next().hide();
|
||||
return !1
|
||||
});
|
||||
$("a.toc-link").click(function (event) {
|
||||
$('body').off('click.listreeLink', 'a.toc-link').on('click.listreeLink', 'a.toc-link', function (event) {
|
||||
event.preventDefault();
|
||||
var targetId = $(this).attr("href");
|
||||
var $target = $(targetId);
|
||||
if (!$target.length) return;
|
||||
|
||||
$("html, body").animate({
|
||||
scrollTop: $(targetId).offset().top - 77
|
||||
}, 800);
|
||||
scrollTop: $target.offset().top - 77
|
||||
}, 500);
|
||||
|
||||
if (window.innerWidth <= 768) {
|
||||
setListreeOpen(false);
|
||||
}
|
||||
});
|
||||
// 判断是否存在目录,设置显示或隐藏
|
||||
if ($('#listree-ol').children().length > 0) {
|
||||
$(".listree-box").css("display", "block");
|
||||
} else {
|
||||
$(".listree-box").css("display", "none");
|
||||
}
|
||||
})
|
||||
jQuery(document).ready(function (f) {
|
||||
var T = f(".listree-list");
|
||||
@@ -1935,6 +1978,7 @@ function autotree() {
|
||||
var b = [];
|
||||
|
||||
function Q() {
|
||||
b = [];
|
||||
T.each(function () {
|
||||
var T = f(this).offset();
|
||||
b.push(Math.floor(T.top))
|
||||
@@ -1943,16 +1987,11 @@ function autotree() {
|
||||
|
||||
function a(T) {
|
||||
var b = f("#listree-ol li");
|
||||
var Q = f(".listree-list dt");
|
||||
if (b.length < 1)
|
||||
return;
|
||||
var a = b.outerHeight();
|
||||
if (!b.eq(T).hasClass("current")) {
|
||||
b.removeClass("current");
|
||||
b.eq(T).addClass("current");
|
||||
Q.animate({
|
||||
top: a * T + (b.outerHeight() - Q.outerHeight()) / 2 + 1
|
||||
}, 50)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1980,7 +2019,10 @@ function autotree() {
|
||||
|
||||
Q();
|
||||
setTimeout(X, 0);
|
||||
f(window).on("scroll", X)
|
||||
f(window).off('scroll.listree resize.listree').on('scroll.listree', X).on('resize.listree', function () {
|
||||
Q();
|
||||
X();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2420,7 +2462,7 @@ function initGreenDigitalClock() {
|
||||
const COOKIE_EXPIRE_YEARS = 10;
|
||||
const NOTICE_DETAIL_PATH = '/notice';
|
||||
const RSS_URLS = [
|
||||
'https://git.anian.cc/anian/halo-theme-pix/releases.rss',
|
||||
'https://git.anian.net/anian/halo-theme-pix/releases.rss',
|
||||
];
|
||||
|
||||
async function getAllLatestNoticeDatesFromRSS() {
|
||||
@@ -2555,7 +2597,7 @@ function anianxSpeedFetchLuckWithTimeout(timeout) {
|
||||
const controller = new AbortController();
|
||||
const timer = setTimeout(() => controller.abort(), timeout);
|
||||
|
||||
return fetch("https://api.anian.cc/luck/api", {
|
||||
return fetch("https://api.anian.net/luck/api", {
|
||||
signal: controller.signal
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
@@ -2690,7 +2732,7 @@ function anianxSpeedFetchIpWithTimeout(timeout) {
|
||||
const controller = new AbortController();
|
||||
const timer = setTimeout(() => controller.abort(), timeout);
|
||||
|
||||
return fetch("https://api.anian.cc/ip/api", {
|
||||
return fetch("https://api.anian.net/ip/api", {
|
||||
signal: controller.signal
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
@@ -2732,7 +2774,7 @@ function anianxSpeedFetchXiehouyuWithTimeout(timeout) {
|
||||
const controller = new AbortController();
|
||||
const timer = setTimeout(() => controller.abort(), timeout);
|
||||
|
||||
return fetch("https://api.anian.cc/riddle/api", {
|
||||
return fetch("https://api.anian.net/riddle/api", {
|
||||
signal: controller.signal
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
@@ -2948,7 +2990,7 @@ async function handleSubscribe(event) {
|
||||
|
||||
try {
|
||||
const res = await fetch(
|
||||
"https://anian.cc/apis/api.flow.post.kunkunyu.com/v1alpha1/follows/-/submit",
|
||||
"/apis/api.flow.post.kunkunyu.com/v1alpha1/follows/-/submit",
|
||||
{
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
@@ -3020,5 +3062,3 @@ $(document).ready(function () {
|
||||
initjump();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ $('body').on('click', '.moment_card_type a', function () {
|
||||
$('body').on('click', '.edit_content .push_card', function () {
|
||||
var card_url = $('.edit_card_box .edit_content input').val();
|
||||
var num = $('.card_sortble .moment_card_item').length;
|
||||
if (num > 2) {
|
||||
cocoMessage.error('最多插入3个卡片');
|
||||
if (num > 4) {
|
||||
cocoMessage.error('最多插入5个卡片');
|
||||
$('.edit_card_box .edit_content input').val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user