fix(theme): align reference layouts and restore passing contracts
Align homepage and category discovery, modern widgets, admin controls, quotes, and comments with the reference theme. Remove superseded paths and add rendering and behavior coverage. Update stale asset and finance contracts; all 760 Node tests and 139 widget assertions pass.
This commit is contained in:
1 parent
b520d29368
commit
8aa116ec43
63 files changed
+1985
-2304
No files matched your search
@@ -146,7 +146,7 @@ export const pageSchema = {
|
||||
key: 'yiyan_intro',
|
||||
type: 'content',
|
||||
ui_only: true,
|
||||
content: '<p class="aksrt-hint"><b>精彩一言功能:</b>随机显示中英文的文案,在此支持一言内容插入到文章页位置,同时可以使用小工具模块调用。<br/>主题默认调用的文件为:<code>themes/aksrt/yiyan/qv-yiyan.txt</code><br/>您可以将以上文件复制到 <code>wp-content</code> 文件夹,并重命名为 <code>yiyan.txt</code>,再进行修改或添加内容,则今后更新主题就无需二次修改</p>',
|
||||
content: '<p class="aksrt-hint"><b>精彩一言功能:</b>随机显示中英文文案,可插入文章页或添加“一言”小工具。默认句库位于 <code>themes/aksrt/yiyan/qv-yiyan.txt</code>。您也可以将自定义句库保存为 <code>wp-content/yiyan.txt</code>,更新主题时即可保留自定义内容。</p>',
|
||||
},
|
||||
{ key: 'yiyan_single_content_header', label: '文章内容头部显示一言', type: 'switch', default: false },
|
||||
{ key: 'yiyan_single_content_footer', label: '文章内容尾部显示一言', type: 'switch', default: false },
|
||||
|
||||
@@ -886,336 +886,16 @@ ul.breadcrumb > li:last-child,
|
||||
}
|
||||
|
||||
/* source: assets/css/frontend/homepage-fixed/base.css */
|
||||
/**
|
||||
* Homepage Fixed Layout — legacy Visual Parity
|
||||
*
|
||||
* Implements legacy's homepage visual language:
|
||||
* - System font stack with Chinese fallbacks
|
||||
* - 1200px container, 311px sidebar
|
||||
* - Post cards: list mode (190px thumb) + card mode (3-col grid)
|
||||
* - legacy shadow/radius/spacing values
|
||||
* - scale(1.02) thumbnail hover
|
||||
* - Lazy-load animations (blur/fade/scale)
|
||||
* - Full responsive: 1200/991/767/640px breakpoints
|
||||
*
|
||||
* Tab nav / tab panes / sort menu use the legacy class contract
|
||||
* (.index-tab, .ajax-option, .ajaxpager) styled by assets/css/main.css.
|
||||
*/
|
||||
|
||||
/* ================================================================
|
||||
1. HOMEPAGE CONTAINER & TYPOGRAPHY
|
||||
================================================================ */
|
||||
|
||||
/** Homepage inherits the reference navigation, widgets and pagination from main.css. */
|
||||
.aksrt-homepage {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
line-height: 1.42857143;
|
||||
color: var(--main-color, #4e5358);
|
||||
background: transparent;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
/* Slightly looser than stock legacy short pages: air between stream and footer */
|
||||
padding-bottom: 28px;
|
||||
}
|
||||
|
||||
.aksrt-homepage a[href] {
|
||||
transition: color 0.2s, background 0.3s, opacity 0.3s, box-shadow 0.3s, transform 0.3s;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
2. LAYOUT SHELL
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage__fluid-zone.content-shell,
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
max-width: min(100%, var(--container, 1200px));
|
||||
}
|
||||
|
||||
.aksrt-homepage__fluid-zone.content-shell {
|
||||
padding-top: 18px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
padding-top: 0;
|
||||
/* 36px + a bit more breathing room before footer */
|
||||
padding-bottom: 56px;
|
||||
}
|
||||
|
||||
/* Bottom fluid zone (if any) keeps a little gap above footer */
|
||||
.aksrt-homepage__fluid-zone--bottom {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.aksrt-homepage {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dual-column geometry is owned by body.site-layout-* float rules in layout.css. */
|
||||
.aksrt-homepage__content-layout {
|
||||
display: block;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.aksrt-homepage__fluid-zone.content-shell,
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
max-width: 95%;
|
||||
}
|
||||
color: var(--main-color);
|
||||
}
|
||||
|
||||
.aksrt-homepage__content-layout,
|
||||
.aksrt-homepage__content-zone,
|
||||
.aksrt-homepage__fluid-zone,
|
||||
.aksrt-homepage__aside {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.aksrt-homepage__content-zone .widget-card:last-child,
|
||||
.aksrt-homepage__aside .widget:last-child,
|
||||
.aksrt-homepage__fluid-zone .widget-fluid:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
3. FLUID WIDGETS
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage__fluid-zone .widget-fluid {
|
||||
margin-bottom: 20px;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_tab_posts,
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_category_block,
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_category_tabs,
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_category_recommend {
|
||||
padding: 15px;
|
||||
background: var(--surface-1, #fff);
|
||||
border: none;
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.aksrt-homepage__content-zone .widget-card,
|
||||
.aksrt-homepage__aside .widget {
|
||||
background: var(--surface-1, #fff);
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
4. STREAM TITLE BOX (legacy title-theme / 第N页)
|
||||
================================================================ */
|
||||
|
||||
.title-theme {
|
||||
position: relative;
|
||||
padding-left: 1.2em;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.title-theme::before {
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
bottom: 10%;
|
||||
left: 2px;
|
||||
width: 4px;
|
||||
content: "";
|
||||
background: var(--color-primary);
|
||||
border-radius: 5px;
|
||||
box-shadow: 1px 1px 3px -1px var(--color-primary);
|
||||
}
|
||||
|
||||
.flex {
|
||||
/* No !important: the site-layout-1 / fluid-widget-wrap wide-mode rule
|
||||
(.posts-item:not(.card) { display: inline-flex }) must out-rank this
|
||||
utility or the no-sidebar two-column pairing collapses back to
|
||||
half-width stacked rows. */
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex.xx,
|
||||
.xx {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flex1,
|
||||
.flex-1 {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.jsb,
|
||||
.jb {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.ac {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
5. PAGINATION
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage .navigation.pagination .nav-links,
|
||||
.aksrt-homepage .pagination {
|
||||
gap: 0;
|
||||
margin: 20px 0 10px;
|
||||
}
|
||||
|
||||
.aksrt-homepage .navigation.pagination .page-numbers,
|
||||
.aksrt-homepage .pagination .page-numbers {
|
||||
min-width: 34px;
|
||||
height: 34px;
|
||||
padding: 0 10px;
|
||||
margin: 3px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius-xs, 3px);
|
||||
background: var(--surface-4, #eee);
|
||||
color: var(--color-ink-3, #777);
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.aksrt-homepage .navigation.pagination .page-numbers:hover,
|
||||
.aksrt-homepage .pagination .page-numbers:hover {
|
||||
opacity: 1;
|
||||
background: var(--color-primary-soft);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.aksrt-homepage .navigation.pagination .current,
|
||||
.aksrt-homepage .pagination .current {
|
||||
background: var(--color-primary, var(--color-primary)) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
6. SIDEBAR
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage__aside > .aksrt-panel,
|
||||
.aksrt-homepage__aside > .widget {
|
||||
margin-bottom: 15px;
|
||||
padding: 15px;
|
||||
background: var(--surface-1, #fff);
|
||||
border: 0;
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside > .aksrt-panel:last-child,
|
||||
.aksrt-homepage__aside > .widget:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-list li,
|
||||
.aksrt-homepage__aside .widget_recent_entries li,
|
||||
.aksrt-homepage__aside .recent-posts-row {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-title,
|
||||
.aksrt-homepage__content-zone .widget-title {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-title {
|
||||
position: relative;
|
||||
margin: 0 0 10px;
|
||||
padding-left: 1.2em;
|
||||
padding-bottom: 8px;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-title::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
bottom: 10%;
|
||||
left: 2px;
|
||||
width: 4px;
|
||||
height: auto;
|
||||
background: var(--color-primary, var(--color-primary));
|
||||
border-radius: 5px;
|
||||
box-shadow: 1px 1px 3px -1px var(--color-primary, var(--color-primary));
|
||||
transition: transform 0.4s ease;
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_recent_entries li a,
|
||||
.aksrt-homepage__aside .widget-list li a {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_recent_entries li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_search .search-field {
|
||||
height: 40px;
|
||||
border-radius: 30px;
|
||||
background: var(--surface-2, #eee);
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_search .search-submit {
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
border-radius: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .tag-cloud {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .tag-cloud a {
|
||||
padding: 4px 10px;
|
||||
border-radius: 20px;
|
||||
font-size: 12px;
|
||||
border: 0;
|
||||
background: var(--surface-2, #eee);
|
||||
transition: background 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .tag-cloud a:hover {
|
||||
background: var(--color-primary, var(--color-primary));
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget.notop,
|
||||
.aksrt-homepage .box-body.notop {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget.nobottom,
|
||||
.aksrt-homepage .box-body.nobottom {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget.widget_custom_html {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.posts-row{margin-right:-8px;margin-bottom:15px;margin-left:-8px}.posts-row>*:not(.post_ajax_loader){margin-right:8px!important;margin-left:8px!important}.posts-row>.post_ajax_loader .posts-item,.posts-row>.post_ajax_loader .posts-mini{margin-right:8px;margin-left:8px}.posts-item{margin:15px 0;padding:20px;overflow:hidden;background:var(--main-bg-color, #fff);border-radius:var(--main-radius, 8px);box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08));transition:.2s}.posts-item.flex,.posts-item .flex,.posts-mini .flex{display:flex}.posts-item .flex.xx,.posts-mini .flex.xx{flex-direction:column}.posts-item .flex.ac,.posts-mini .flex.ac{align-items:center}.posts-item .flex.jsb,.posts-mini .flex.jsb{justify-content:space-between}.posts-item .flex1,.posts-mini .flex1{flex:1;overflow:hidden}.posts-item .post-graphic:not(.order1){margin-right:20px}.posts-item .order1.post-graphic{margin-right:0;margin-left:20px}.posts-item .item-thumbnail{position:relative;display:block;width:190px;height:0;padding-bottom:var(--posts-list-scale, 70%);overflow:hidden;border-radius:var(--main-radius, 8px)}.item-thumbnail.contain img{object-fit:contain}.swiper-slide.gradient-bg .dplayer-poster img,.swiper-slide.gradient-bg>*>img{object-fit:contain!important;border-radius:0!important}.item-thumbnail .swiper-wrapper{height:100%!important}.list .item-thumbnail .aksrt-slider,.list .item-thumbnail.new-swiper{position:absolute;width:100%;height:100%;margin:0!important}.item-thumbnail .dplayer.dplayer-thumb{position:absolute;inset:0;z-index:1;padding-bottom:var(--posts-list-scale, 70%);background:#000;opacity:0;transition:opacity .3s}.card .item-thumbnail .dplayer.dplayer-thumb{padding-bottom:var(--posts-card-scale, 70%)}.item-thumbnail .dplayer-thumb video,.item-thumbnail .swiper-wrapper,.item-thumbnail img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.item-thumbnail .swiper-pagination{right:0!important;bottom:0!important;left:0!important;padding:0 2px!important;text-align:center!important}.posts-item.thumb-dplayer-playing .dplayer-thumb{opacity:1}.posts-item.thumb-dplayer-playing .abs-center{opacity:0}.posts-item .item-heading{display:-webkit-box;max-height:2.8em;margin-top:0;margin-bottom:5px;overflow:hidden;font-size:18px;line-height:1.4em;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.font-bold{font-weight:700}.list.style2 .item-thumbnail{width:130px}.list.style2 .item-heading{display:unset;max-height:1.4em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.posts-item .item-heading>a{color:var(--key-color, #333)}.posts-item .item-heading>a:hover{color:var(--focus-color, #f04494)}.posts-item .item-excerpt{margin:0 0 6px;overflow:hidden;color:var(--muted-color, #777);text-overflow:ellipsis;white-space:nowrap}.posts-item .item-meta item{margin-right:8px;font-size:13px}.posts-item .item-meta svg.icon,.posts-mini .item-meta svg.icon{display:inline-block;width:1em;height:1em;margin-right:2px;fill:currentColor;overflow:hidden;vertical-align:-.15em}.posts-item .meta-right item:last-child{margin-right:0}.item-meta .avatar-mini{width:20px;height:20px;border-radius:50%;transform:translateY(-1px)}.item-meta .meta-pay{padding:0 4px}.item-meta .meta-pay img{width:1em;height:1em;object-fit:contain;vertical-align:-.15em}.posts-item .item-meta a,.posts-mini .item-meta a{color:inherit}.posts-item .item-tags a{margin-right:5px;padding:2px 5px;font-size:11px}.posts-item .item-tags a .fa{font-size:1em}.posts-item.card{display:inline-block;width:calc(33.333% - 16px);margin:8px;padding:10px;vertical-align:top;transition:.3s}.posts-item.card:last-child{margin-bottom:20px}.posts-item.card .item-body{width:100%;margin:10px 0 0;padding:0}.posts-item.card .item-meta item{font-size:12px}.posts-mini-con .item-heading,.posts-item.card .item-heading{font-size:14px}.posts-item.card .item-heading{min-height:2.8em}.posts-item.card .item-tags{min-height:23px}.posts-item.card .item-thumbnail{width:100%;padding-bottom:var(--posts-card-scale, 70%)}.posts-item.card.style2{background:transparent;box-shadow:none}.posts-item.card.style2:hover{background:var(--main-bg-color, #fff);box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08))}.posts-item.card.style3{padding:0}.posts-item.card.style3 .item-thumbnail,.posts-item.card.style3 .item-thumbnail img{border-radius:var(--main-radius, 8px) var(--main-radius, 8px) 0 0}.posts-item.card.style3 .item-body{margin:0;padding:10px}.posts-item.mult-thumb .thumb-items{margin:0 -3px 6px}.posts-item.mult-thumb .thumb-items>span{position:relative;display:inline-block;width:calc(25% - 6px);height:0;margin:0 3px;padding-bottom:calc(var(--posts-list-scale, 70%) / 4)}.posts-item.mult-thumb .thumb-items>span>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.posts-item.mult-thumb .thumb-items.contain>span{overflow:hidden;background:var(--main-border-color, rgba(50, 50, 50, .06));border-radius:var(--main-radius, 8px)}.posts-item.mult-thumb .thumb-items.contaiLine truncated
|
||||
.posts-row{margin-right:-8px;margin-bottom:15px;margin-left:-8px}.posts-row>*:not(.post_ajax_loader){margin-right:8px!important;margin-left:8px!important}.posts-row>.post_ajax_loader .posts-item,.posts-row>.post_ajax_loader .posts-mini{margin-right:8px;margin-left:8px}.posts-item{margin:15px 0;padding:20px;overflow:hidden;background:var(--main-bg-color, #fff);border-radius:var(--main-radius, 8px);box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08));transition:.2s}.posts-item.flex,.posts-item .flex,.posts-mini .flex{display:flex}.posts-item .flex.xx,.posts-mini .flex.xx{flex-direction:column}.posts-item .flex.ac,.posts-mini .flex.ac{align-items:center}.posts-item .flex.jsb,.posts-mini .flex.jsb{justify-content:space-between}.posts-item .flex1,.posts-mini .flex1{flex:1;overflow:hidden}.posts-item .post-graphic:not(.order1){margin-right:20px}.posts-item .order1.post-graphic{margin-right:0;margin-left:20px}.posts-item .item-thumbnail{position:relative;display:block;width:190px;height:0;padding-bottom:var(--posts-list-scale, 70%);overflow:hidden;border-radius:var(--main-radius, 8px)}.item-thumbnail.contain img{object-fit:contain}.swiper-slide.gradient-bg .dplayer-poster img,.swiper-slide.gradient-bg>*>img{object-fit:contain!important;border-radius:0!important}.item-thumbnail .swiper-wrapper{height:100%!important}.list .item-thumbnail .aksrt-slider,.list .item-thumbnail.new-swiper{position:absolute;width:100%;height:100%;margin:0!important}.item-thumbnail .dplayer.dplayer-thumb{position:absolute;inset:0;z-index:1;padding-bottom:var(--posts-list-scale, 70%);background:#000;opacity:0;transition:opacity .3s}.card .item-thumbnail .dplayer.dplayer-thumb{padding-bottom:var(--posts-card-scale, 70%)}.item-thumbnail .dplayer-thumb video,.item-thumbnail .swiper-wrapper,.item-thumbnail img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.item-thumbnail .swiper-pagination{right:0!important;bottom:0!important;left:0!important;padding:0 2px!important;text-align:center!important}.posts-item.thumb-dplayer-playing .dplayer-thumb{opacity:1}.posts-item.thumb-dplayer-playing .abs-center{opacity:0}.posts-item .item-heading{display:-webkit-box;max-height:2.8em;margin-top:0;margin-bottom:5px;overflow:hidden;font-size:18px;line-height:1.4em;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.font-bold{font-weight:700}.list.style2 .item-thumbnail{width:130px}.list.style2 .item-heading{display:unset;max-height:1.4em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.posts-item .item-heading>a{color:var(--key-color, #333)}.posts-item .item-heading>a:hover{color:var(--focus-color, #f04494)}.posts-item .item-excerpt{margin:0 0 6px;overflow:hidden;color:var(--muted-color, #777);text-overflow:ellipsis;white-space:nowrap}.posts-item .item-meta item{margin-right:8px;font-size:13px}.posts-item .item-meta svg.icon,.posts-mini .item-meta svg.icon{display:inline-block;width:1em;height:1em;margin-right:2px;fill:currentColor;overflow:hidden;vertical-align:-.15em}.posts-item .meta-right item:last-child{margin-right:0}.item-meta .avatar-mini{width:20px;height:20px;border-radius:50%;transform:translateY(-1px)}.item-meta .meta-pay{padding:0 4px}.item-meta .meta-pay img{width:1em;height:1em;object-fit:contain;vertical-align:-.15em}.posts-item .item-meta a,.posts-mini .item-meta a{color:inherit}.posts-item .item-tags a{margin-right:5px;padding:2px 5px;font-size:11px}.posts-item .item-tags a .fa{font-size:1em}.posts-item.card{display:inline-block;width:calc(33.333% - 16px);margin:8px;padding:10px;vertical-align:top;transition:.3s}.posts-item.card:last-child{margin-bottom:20px}.posts-item.card .item-body{width:100%;margin:10px 0 0;padding:0}.posts-item.card .item-meta item{font-size:12px}.posts-mini-con .item-heading,.posts-item.card .item-heading{font-size:14px}.posts-item.card .item-heading{min-height:2.8em}.posts-item.card .item-tags{min-height:23px}.posts-item.card .item-thumbnail{width:100%;padding-bottom:var(--posts-card-scale, 70%)}.posts-item.card.style2{background:transparent;box-shadow:none}.posts-item.card.style2:hover{background:var(--main-bg-color, #fff);box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08))}.posts-item.card.style3{padding:0}.posts-item.card.style3 .item-thumbnail,.posts-item.card.style3 .item-thumbnail img{border-radius:var(--main-radius, 8px) var(--main-radius, 8px) 0 0}.posts-item.card.style3 .item-body{margin:0;padding:10px}.posts-item.mult-thumb .thumb-items{margin:0 -3px 6px}.posts-item.mult-thumb .thumb-items>span{position:relative;display:inline-block;width:calc(25% - 6px);height:0;margin:0 3px;padding-bottom:calc(var(--posts-list-scale, 70%) / 4)}.posts-item.mult-thumb .thumb-items>span>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.posts-item.mult-thumb .thumb-items.contain>span{overflow:hidden;background:var(--main-border-color, rgba(50, 50, 50, .06));border-radius:var(--main-radius, 8px)}.posts-item.mult-thumb .thumb-items.contaiLine truncated
|
||||
+12
-188
@@ -2464,6 +2464,12 @@ a[href] {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* FA5's later .fa rule sets 900; keep outline glyphs at their regular weight. */
|
||||
.fa.far {
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
@@ -3322,104 +3328,13 @@ body.site-layout-3 .sidebar,
|
||||
max-width: 720px;
|
||||
}
|
||||
|
||||
.term-page-header {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.08));
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface-1);
|
||||
box-shadow: var(--shadow-sm, 0 1px 6px rgba(15, 23, 42, 0.04));
|
||||
/* Reference cover ratio must outrank the shared panel padding. */
|
||||
body.category .site-main {
|
||||
line-height: 1.42857143;
|
||||
}
|
||||
|
||||
.term-page-header__body {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.term-page-header__eyebrow {
|
||||
margin: 0 0 8px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.term-page-header__desc {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.term-page-header__cover {
|
||||
min-height: 140px;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
border-top: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.08));
|
||||
}
|
||||
|
||||
.term-page-header--simple .term-page-header__cover {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Card style: accent top border, slightly more padding */
|
||||
.term-page-header--card {
|
||||
border-top: 3px solid var(--color-primary, #f04494);
|
||||
}
|
||||
|
||||
.term-page-header--card .term-page-header__body {
|
||||
padding: 28px 24px;
|
||||
}
|
||||
|
||||
/* Cover style: full-width hero with background image */
|
||||
.term-page-header--cover {
|
||||
border: none;
|
||||
border-radius: var(--radius-lg);
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
min-height: 220px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.term-page-header__cover-bg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
border-radius: var(--radius-lg);
|
||||
}
|
||||
|
||||
.term-page-header__cover-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(135deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 100%);
|
||||
border-radius: var(--radius-lg);
|
||||
}
|
||||
|
||||
.term-page-header--cover .term-page-header__body {
|
||||
flex: 1;
|
||||
align-items: flex-end;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.term-page-header__body--overlay .entry-title,
|
||||
.term-page-header__body--overlay .term-page-header__desc,
|
||||
.term-page-header__body--overlay .term-page-header__eyebrow {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.term-page-header__body--overlay .term-page-header__eyebrow {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.term-page-header--cover {
|
||||
min-height: 160px;
|
||||
}
|
||||
.page-cover.aksrt-panel {
|
||||
padding: 0 0 calc(25% + 80px);
|
||||
}
|
||||
|
||||
.aksrt-admin-quicklink {
|
||||
@@ -3444,103 +3359,18 @@ body.site-layout-3 .sidebar,
|
||||
background: var(--color-primary-soft, rgba(59, 130, 246, 0.08));
|
||||
}
|
||||
|
||||
.archive-filter-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
margin: -8px 0 24px;
|
||||
padding: 16px 18px;
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.06));
|
||||
}
|
||||
|
||||
.archive-filter-bar__main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.archive-filter-bar__label {
|
||||
color: var(--color-ink-4);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.archive-filter-bar__chips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.archive-filter-bar__chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 34px;
|
||||
padding: 0 12px;
|
||||
border-radius: var(--radius-pill, 999px);
|
||||
background: var(--surface-1);
|
||||
color: var(--color-ink-2);
|
||||
text-decoration: none;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.archive-filter-bar__chip.is-active,
|
||||
.archive-filter-bar__chip:hover {
|
||||
background: var(--color-primary);
|
||||
color: var(--color-on-primary, #fff);
|
||||
}
|
||||
|
||||
.archive-filter-bar__meta {
|
||||
color: var(--color-ink-4);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.archive-filter-bar__sort {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.archive-filter-bar__main--tags {
|
||||
border-top: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.06));
|
||||
padding-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* §3.4 custom_filter dimension rows */
|
||||
.archive-filter-bar__main--custom {
|
||||
border-top: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.06));
|
||||
padding-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.content-stream {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.content-main--archive,
|
||||
.content-main--tag,
|
||||
.content-main--category,
|
||||
.content-main--search,
|
||||
.content-main--single {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.content-stream__list {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.content-stream__empty {
|
||||
padding: 28px 24px;
|
||||
border-radius: var(--radius-lg);
|
||||
@@ -3558,12 +3388,6 @@ body.site-layout-3 .sidebar,
|
||||
全站只有一套加载语言。 */
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.term-page-header__body {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.aksrt-admin-quicklink {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
:root{--color-primary: #f04494;--color-primary-hover: #e0307e;--color-primary-active: #c9206d;--color-primary-soft: rgba(240, 68, 148, .1);--color-primary-softer: rgba(240, 68, 148, .05);--color-on-primary: #FFFFFF;--color-ink: #333333;--color-ink-2: #4e5358;--color-ink-3: #777777;--color-ink-4: #999999;--surface-page: #f5f6f7;--surface-1: #FFFFFF;--surface-2: #eeeeee;--surface-3: #e9ecef;--surface-4: #f8f8f8;--color-line: rgba(50, 50, 50, .06);--color-line-soft: rgba(0, 0, 0, .03);--color-line-stronger: rgba(50, 50, 50, .12);--color-success: #10B981;--color-warning: #F59E0B;--color-error: #EF4444;--color-info: #3B82F6;--color-accent: #18a058;--color-accent-soft: rgba(24, 160, 88, .12);--color-accent-shadow: rgba(24, 160, 88, .28);--font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;--text-xs: .75rem;--text-sm: .875rem;--text-base: .875rem;--text-md: 1.125rem;--text-lg: 1.25rem;--text-xl: 1.5rem;--text-2xl: 1.875rem;--text-3xl: 2.25rem;--text-4xl: 3rem;--text-5xl: 3.75rem;--leading-tight: 1.2;--leading-snug: 1.4;--leading-normal: 1.6;--leading-relaxed: 1.6;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-7: 32px;--space-8: 40px;--space-9: 48px;--space-10: 64px;--space-11: 80px;--space-12: 96px;--radius-xs: 3px;--radius-sm: 4px;--radius: 8px;--radius-lg: 8px;--radius-xl: 12px;--radius-2xl: 16px;--radius-pill: 100px;--radius-avatar: 50%;--shadow-xs: 0 1px 2px rgba(0, 0, 0, .03);--shadow-sm: 0 0 10px rgba(116, 116, 116, .08);--shadow: 0 0 10px rgba(116, 116, 116, .12);--shadow-lg: 0 12px 32px rgba(18, 18, 18, .1);--shadow-drawer: 0 18px 60px rgba(0, 0, 0, .2);--nav-height: 60px;--container: 1200px;--container-wide: 1440px;--container-read: 760px;--container-page: 880px;--sidebar-width: 311px;--content-gap: 24px;--section-gap: 24px;--sidebar-bp: 992px;--ease: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-spring: cubic-bezier(.34, 1.56, .64, 1);--dur-fast: .15s;--dur: .25s;--dur-slow: .4s;--focus-ring: 0 0 2px 3px rgba(253, 83, 161, .4);--z-dropdown: 100;--z-sticky: 200;--z-fixed: 300;--z-overlay: 400;--z-modal: 500;--z-popover: 600;--z-toast: 700;--z-tooltip: 800;--radius-btn: 4px;--btn-sm-h: 28px;--btn-md-h: 34px;--btn-lg-h: 44px;--card-padding: 15px;--card-padding-sm: 10px;--card-gap: 16px;--card-gap-lg: 20px;--color-primary-light: var(--color-primary-soft);--color-surface: var(--surface-1);--color-line-strong: var(--color-line);--color-bg-hover: var(--surface-2);--color-border-light: var(--color-line-soft);--color-fill: var(--surface-2);--color-warning-bg: #fffbe6;--color-warning-text: #ad6800;--text-secondary: var(--color-ink-3);--text-tertiary: var(--color-ink-4);--surface-active: var(--surface-2);--surface-card: var(--surface-1);--surface-hover: var(--surface-2);--surface-secondary: var(--surface-2);--radius-code: var(--radius);--radius-full: 100px;--shadow-xl: 0 0 10px rgba(116, 116, 116, .12);--space-16: 64px;--z-floating: 900;--transition-fast: .15s ease;--transition-base: .25s ease;--header-bg: var(--blur-bg);--header-color: var(--color-ink-2);--footer-bg: var(--surface-1);--footer-color: var(--color-ink-4);--blur-bg: rgba(255, 255, 255, .8);--float-btn-bg: rgba(200, 200, 200, .4);--font-heading: var(--font-ui);--radius-card: var(--radius);--radius-md: var(--radius);--color-primary-50: var(--color-primary-soft);--color-primary-dark: var(--color-primary-active);--shadow-md: var(--shadow);--mini-radius: calc(var(--radius) / 1.4);--aksrt-avatar-size-xs: 24px;--aksrt-avatar-size-sm: 32px;--aksrt-avatar-size: 40px;--aksrt-avatar-size-lg: 56px;--aksrt-avatar-size-xl: 80px;--aksrt-card-thumb-scale: 56.25%;--aksrt-rose: #f43f5e;--aksrt-rose-soft: rgba(244, 63, 94, .12);--aksrt-blue: #3b82f6;--aksrt-blue-soft: rgba(59, 130, 246, .12);--aksrt-green: #10b981;--aksrt-green-soft: rgba(16, 185, 129, .12);--aksrt-orange: #f97316;--aksrt-orange-soft:rgba(249, 115, 22, .12);--aksrt-purple: #8b5cf6;--aksrt-purple-soft:rgba(139, 92, 246, .12);--aksrt-cyan: #06b6d4;--aksrt-cyan-soft: rgba(6, 182, 212, .12);--aksrt-yellow: #eab308;--aksrt-yellow-soft:rgba(234, 179, 8, .12);--aksrt-red: #ef4444;--aksrt-red-soft: rgba(239, 68, 68, .12);--aksrt-teal: #14b8a6;--aksrt-teal-soft: rgba(20, 184, 166, .12);--aksrt-indigo: #6366f1;--aksrt-indigo-soft:rgba(99, 102, 241, .12);--aksrt-pink: #ec4899;--aksrt-pink-soft: rgba(236, 72, 153, .12);--aksrt-vip-gold-1: #f6d365;--aksrt-vip-gold-2: #fda085;--aksrt-grad-sunset-1: #f093fb;--aksrt-grad-sunset-2: #f5576c;--aksrt-graLine truncated
|
||||
:root{--color-primary: #f04494;--color-primary-hover: #e0307e;--color-primary-active: #c9206d;--color-primary-soft: rgba(240, 68, 148, .1);--color-primary-softer: rgba(240, 68, 148, .05);--color-on-primary: #FFFFFF;--color-ink: #333333;--color-ink-2: #4e5358;--color-ink-3: #777777;--color-ink-4: #999999;--surface-page: #f5f6f7;--surface-1: #FFFFFF;--surface-2: #eeeeee;--surface-3: #e9ecef;--surface-4: #f8f8f8;--color-line: rgba(50, 50, 50, .06);--color-line-soft: rgba(0, 0, 0, .03);--color-line-stronger: rgba(50, 50, 50, .12);--color-success: #10B981;--color-warning: #F59E0B;--color-error: #EF4444;--color-info: #3B82F6;--color-accent: #18a058;--color-accent-soft: rgba(24, 160, 88, .12);--color-accent-shadow: rgba(24, 160, 88, .28);--font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;--text-xs: .75rem;--text-sm: .875rem;--text-base: .875rem;--text-md: 1.125rem;--text-lg: 1.25rem;--text-xl: 1.5rem;--text-2xl: 1.875rem;--text-3xl: 2.25rem;--text-4xl: 3rem;--text-5xl: 3.75rem;--leading-tight: 1.2;--leading-snug: 1.4;--leading-normal: 1.6;--leading-relaxed: 1.6;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-7: 32px;--space-8: 40px;--space-9: 48px;--space-10: 64px;--space-11: 80px;--space-12: 96px;--radius-xs: 3px;--radius-sm: 4px;--radius: 8px;--radius-lg: 8px;--radius-xl: 12px;--radius-2xl: 16px;--radius-pill: 100px;--radius-avatar: 50%;--shadow-xs: 0 1px 2px rgba(0, 0, 0, .03);--shadow-sm: 0 0 10px rgba(116, 116, 116, .08);--shadow: 0 0 10px rgba(116, 116, 116, .12);--shadow-lg: 0 12px 32px rgba(18, 18, 18, .1);--shadow-drawer: 0 18px 60px rgba(0, 0, 0, .2);--nav-height: 60px;--container: 1200px;--container-wide: 1440px;--container-read: 760px;--container-page: 880px;--sidebar-width: 311px;--content-gap: 24px;--section-gap: 24px;--sidebar-bp: 992px;--ease: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-spring: cubic-bezier(.34, 1.56, .64, 1);--dur-fast: .15s;--dur: .25s;--dur-slow: .4s;--focus-ring: 0 0 2px 3px rgba(253, 83, 161, .4);--z-dropdown: 100;--z-sticky: 200;--z-fixed: 300;--z-overlay: 400;--z-modal: 500;--z-popover: 600;--z-toast: 700;--z-tooltip: 800;--radius-btn: 4px;--btn-sm-h: 28px;--btn-md-h: 34px;--btn-lg-h: 44px;--card-padding: 15px;--card-padding-sm: 10px;--card-gap: 16px;--card-gap-lg: 20px;--color-primary-light: var(--color-primary-soft);--color-surface: var(--surface-1);--color-line-strong: var(--color-line);--color-bg-hover: var(--surface-2);--color-border-light: var(--color-line-soft);--color-fill: var(--surface-2);--color-warning-bg: #fffbe6;--color-warning-text: #ad6800;--text-secondary: var(--color-ink-3);--text-tertiary: var(--color-ink-4);--surface-active: var(--surface-2);--surface-card: var(--surface-1);--surface-hover: var(--surface-2);--surface-secondary: var(--surface-2);--radius-code: var(--radius);--radius-full: 100px;--shadow-xl: 0 0 10px rgba(116, 116, 116, .12);--space-16: 64px;--z-floating: 900;--transition-fast: .15s ease;--transition-base: .25s ease;--header-bg: var(--blur-bg);--header-color: var(--color-ink-2);--footer-bg: var(--surface-1);--footer-color: var(--color-ink-4);--blur-bg: rgba(255, 255, 255, .8);--float-btn-bg: rgba(200, 200, 200, .4);--font-heading: var(--font-ui);--radius-card: var(--radius);--radius-md: var(--radius);--color-primary-50: var(--color-primary-soft);--color-primary-dark: var(--color-primary-active);--shadow-md: var(--shadow);--mini-radius: calc(var(--radius) / 1.4);--aksrt-avatar-size-xs: 24px;--aksrt-avatar-size-sm: 32px;--aksrt-avatar-size: 40px;--aksrt-avatar-size-lg: 56px;--aksrt-avatar-size-xl: 80px;--aksrt-card-thumb-scale: 56.25%;--aksrt-rose: #f43f5e;--aksrt-rose-soft: rgba(244, 63, 94, .12);--aksrt-blue: #3b82f6;--aksrt-blue-soft: rgba(59, 130, 246, .12);--aksrt-green: #10b981;--aksrt-green-soft: rgba(16, 185, 129, .12);--aksrt-orange: #f97316;--aksrt-orange-soft:rgba(249, 115, 22, .12);--aksrt-purple: #8b5cf6;--aksrt-purple-soft:rgba(139, 92, 246, .12);--aksrt-cyan: #06b6d4;--aksrt-cyan-soft: rgba(6, 182, 212, .12);--aksrt-yellow: #eab308;--aksrt-yellow-soft:rgba(234, 179, 8, .12);--aksrt-red: #ef4444;--aksrt-red-soft: rgba(239, 68, 68, .12);--aksrt-teal: #14b8a6;--aksrt-teal-soft: rgba(20, 184, 166, .12);--aksrt-indigo: #6366f1;--aksrt-indigo-soft:rgba(99, 102, 241, .12);--aksrt-pink: #ec4899;--aksrt-pink-soft: rgba(236, 72, 153, .12);--aksrt-vip-gold-1: #f6d365;--aksrt-vip-gold-2: #fda085;--aksrt-grad-sunset-1: #f093fb;--aksrt-grad-sunset-2: #f5576c;--aksrt-graLine truncated
|
||||
@@ -49,6 +49,12 @@ a[href] {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* FA5's later .fa rule sets 900; keep outline glyphs at their regular weight. */
|
||||
.fa.far {
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
|
||||
@@ -1,333 +1,13 @@
|
||||
/**
|
||||
* Homepage Fixed Layout — legacy Visual Parity
|
||||
*
|
||||
* Implements legacy's homepage visual language:
|
||||
* - System font stack with Chinese fallbacks
|
||||
* - 1200px container, 311px sidebar
|
||||
* - Post cards: list mode (190px thumb) + card mode (3-col grid)
|
||||
* - legacy shadow/radius/spacing values
|
||||
* - scale(1.02) thumbnail hover
|
||||
* - Lazy-load animations (blur/fade/scale)
|
||||
* - Full responsive: 1200/991/767/640px breakpoints
|
||||
*
|
||||
* Tab nav / tab panes / sort menu use the legacy class contract
|
||||
* (.index-tab, .ajax-option, .ajaxpager) styled by assets/css/main.css.
|
||||
*/
|
||||
|
||||
/* ================================================================
|
||||
1. HOMEPAGE CONTAINER & TYPOGRAPHY
|
||||
================================================================ */
|
||||
|
||||
/** Homepage inherits the reference navigation, widgets and pagination from main.css. */
|
||||
.aksrt-homepage {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
line-height: 1.42857143;
|
||||
color: var(--main-color, #4e5358);
|
||||
background: transparent;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
/* Slightly looser than stock legacy short pages: air between stream and footer */
|
||||
padding-bottom: 28px;
|
||||
}
|
||||
|
||||
.aksrt-homepage a[href] {
|
||||
transition: color 0.2s, background 0.3s, opacity 0.3s, box-shadow 0.3s, transform 0.3s;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
2. LAYOUT SHELL
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage__fluid-zone.content-shell,
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
max-width: min(100%, var(--container, 1200px));
|
||||
}
|
||||
|
||||
.aksrt-homepage__fluid-zone.content-shell {
|
||||
padding-top: 18px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
padding-top: 0;
|
||||
/* 36px + a bit more breathing room before footer */
|
||||
padding-bottom: 56px;
|
||||
}
|
||||
|
||||
/* Bottom fluid zone (if any) keeps a little gap above footer */
|
||||
.aksrt-homepage__fluid-zone--bottom {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.aksrt-homepage {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dual-column geometry is owned by body.site-layout-* float rules in layout.css. */
|
||||
.aksrt-homepage__content-layout {
|
||||
display: block;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.aksrt-homepage__fluid-zone.content-shell,
|
||||
.aksrt-homepage__shell.content-shell {
|
||||
max-width: 95%;
|
||||
}
|
||||
color: var(--main-color);
|
||||
}
|
||||
|
||||
.aksrt-homepage__content-layout,
|
||||
.aksrt-homepage__content-zone,
|
||||
.aksrt-homepage__fluid-zone,
|
||||
.aksrt-homepage__aside {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.aksrt-homepage__content-zone .widget-card:last-child,
|
||||
.aksrt-homepage__aside .widget:last-child,
|
||||
.aksrt-homepage__fluid-zone .widget-fluid:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
3. FLUID WIDGETS
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage__fluid-zone .widget-fluid {
|
||||
margin-bottom: 20px;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_tab_posts,
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_category_block,
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_category_tabs,
|
||||
.aksrt-homepage .widget-fluid.widget_aksrt_category_recommend {
|
||||
padding: 15px;
|
||||
background: var(--surface-1, #fff);
|
||||
border: none;
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.aksrt-homepage__content-zone .widget-card,
|
||||
.aksrt-homepage__aside .widget {
|
||||
background: var(--surface-1, #fff);
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
4. STREAM TITLE BOX (legacy title-theme / 第N页)
|
||||
================================================================ */
|
||||
|
||||
.title-theme {
|
||||
position: relative;
|
||||
padding-left: 1.2em;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.title-theme::before {
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
bottom: 10%;
|
||||
left: 2px;
|
||||
width: 4px;
|
||||
content: "";
|
||||
background: var(--color-primary);
|
||||
border-radius: 5px;
|
||||
box-shadow: 1px 1px 3px -1px var(--color-primary);
|
||||
}
|
||||
|
||||
.flex {
|
||||
/* No !important: the site-layout-1 / fluid-widget-wrap wide-mode rule
|
||||
(.posts-item:not(.card) { display: inline-flex }) must out-rank this
|
||||
utility or the no-sidebar two-column pairing collapses back to
|
||||
half-width stacked rows. */
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex.xx,
|
||||
.xx {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flex1,
|
||||
.flex-1 {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.jsb,
|
||||
.jb {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.ac {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
5. PAGINATION
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage .navigation.pagination .nav-links,
|
||||
.aksrt-homepage .pagination {
|
||||
gap: 0;
|
||||
margin: 20px 0 10px;
|
||||
}
|
||||
|
||||
.aksrt-homepage .navigation.pagination .page-numbers,
|
||||
.aksrt-homepage .pagination .page-numbers {
|
||||
min-width: 34px;
|
||||
height: 34px;
|
||||
padding: 0 10px;
|
||||
margin: 3px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius-xs, 3px);
|
||||
background: var(--surface-4, #eee);
|
||||
color: var(--color-ink-3, #777);
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.aksrt-homepage .navigation.pagination .page-numbers:hover,
|
||||
.aksrt-homepage .pagination .page-numbers:hover {
|
||||
opacity: 1;
|
||||
background: var(--color-primary-soft);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.aksrt-homepage .navigation.pagination .current,
|
||||
.aksrt-homepage .pagination .current {
|
||||
background: var(--color-primary, var(--color-primary)) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
6. SIDEBAR
|
||||
================================================================ */
|
||||
|
||||
.aksrt-homepage__aside > .aksrt-panel,
|
||||
.aksrt-homepage__aside > .widget {
|
||||
margin-bottom: 15px;
|
||||
padding: 15px;
|
||||
background: var(--surface-1, #fff);
|
||||
border: 0;
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside > .aksrt-panel:last-child,
|
||||
.aksrt-homepage__aside > .widget:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-list li,
|
||||
.aksrt-homepage__aside .widget_recent_entries li,
|
||||
.aksrt-homepage__aside .recent-posts-row {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-title,
|
||||
.aksrt-homepage__content-zone .widget-title {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-title {
|
||||
position: relative;
|
||||
margin: 0 0 10px;
|
||||
padding-left: 1.2em;
|
||||
padding-bottom: 8px;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget-title::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
bottom: 10%;
|
||||
left: 2px;
|
||||
width: 4px;
|
||||
height: auto;
|
||||
background: var(--color-primary, var(--color-primary));
|
||||
border-radius: 5px;
|
||||
box-shadow: 1px 1px 3px -1px var(--color-primary, var(--color-primary));
|
||||
transition: transform 0.4s ease;
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_recent_entries li a,
|
||||
.aksrt-homepage__aside .widget-list li a {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_recent_entries li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_search .search-field {
|
||||
height: 40px;
|
||||
border-radius: 30px;
|
||||
background: var(--surface-2, #eee);
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .widget_search .search-submit {
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
border-radius: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .tag-cloud {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .tag-cloud a {
|
||||
padding: 4px 10px;
|
||||
border-radius: 20px;
|
||||
font-size: 12px;
|
||||
border: 0;
|
||||
background: var(--surface-2, #eee);
|
||||
transition: background 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.aksrt-homepage__aside .tag-cloud a:hover {
|
||||
background: var(--color-primary, var(--color-primary));
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget.notop,
|
||||
.aksrt-homepage .box-body.notop {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget.nobottom,
|
||||
.aksrt-homepage .box-body.nobottom {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.aksrt-homepage .widget.widget_custom_html {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
@@ -253,104 +253,13 @@ body.site-layout-3 .sidebar,
|
||||
max-width: 720px;
|
||||
}
|
||||
|
||||
.term-page-header {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.08));
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface-1);
|
||||
box-shadow: var(--shadow-sm, 0 1px 6px rgba(15, 23, 42, 0.04));
|
||||
/* Reference cover ratio must outrank the shared panel padding. */
|
||||
body.category .site-main {
|
||||
line-height: 1.42857143;
|
||||
}
|
||||
|
||||
.term-page-header__body {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.term-page-header__eyebrow {
|
||||
margin: 0 0 8px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.term-page-header__desc {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.term-page-header__cover {
|
||||
min-height: 140px;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
border-top: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.08));
|
||||
}
|
||||
|
||||
.term-page-header--simple .term-page-header__cover {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Card style: accent top border, slightly more padding */
|
||||
.term-page-header--card {
|
||||
border-top: 3px solid var(--color-primary, #f04494);
|
||||
}
|
||||
|
||||
.term-page-header--card .term-page-header__body {
|
||||
padding: 28px 24px;
|
||||
}
|
||||
|
||||
/* Cover style: full-width hero with background image */
|
||||
.term-page-header--cover {
|
||||
border: none;
|
||||
border-radius: var(--radius-lg);
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
min-height: 220px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.term-page-header__cover-bg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
border-radius: var(--radius-lg);
|
||||
}
|
||||
|
||||
.term-page-header__cover-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(135deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 100%);
|
||||
border-radius: var(--radius-lg);
|
||||
}
|
||||
|
||||
.term-page-header--cover .term-page-header__body {
|
||||
flex: 1;
|
||||
align-items: flex-end;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.term-page-header__body--overlay .entry-title,
|
||||
.term-page-header__body--overlay .term-page-header__desc,
|
||||
.term-page-header__body--overlay .term-page-header__eyebrow {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.term-page-header__body--overlay .term-page-header__eyebrow {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.term-page-header--cover {
|
||||
min-height: 160px;
|
||||
}
|
||||
.page-cover.aksrt-panel {
|
||||
padding: 0 0 calc(25% + 80px);
|
||||
}
|
||||
|
||||
.aksrt-admin-quicklink {
|
||||
@@ -375,103 +284,18 @@ body.site-layout-3 .sidebar,
|
||||
background: var(--color-primary-soft, rgba(59, 130, 246, 0.08));
|
||||
}
|
||||
|
||||
.archive-filter-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
margin: -8px 0 24px;
|
||||
padding: 16px 18px;
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.06));
|
||||
}
|
||||
|
||||
.archive-filter-bar__main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.archive-filter-bar__label {
|
||||
color: var(--color-ink-4);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.archive-filter-bar__chips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.archive-filter-bar__chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 34px;
|
||||
padding: 0 12px;
|
||||
border-radius: var(--radius-pill, 999px);
|
||||
background: var(--surface-1);
|
||||
color: var(--color-ink-2);
|
||||
text-decoration: none;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.archive-filter-bar__chip.is-active,
|
||||
.archive-filter-bar__chip:hover {
|
||||
background: var(--color-primary);
|
||||
color: var(--color-on-primary, #fff);
|
||||
}
|
||||
|
||||
.archive-filter-bar__meta {
|
||||
color: var(--color-ink-4);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.archive-filter-bar__sort {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.archive-filter-bar__main--tags {
|
||||
border-top: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.06));
|
||||
padding-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* §3.4 custom_filter dimension rows */
|
||||
.archive-filter-bar__main--custom {
|
||||
border-top: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.06));
|
||||
padding-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.content-stream {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.content-main--archive,
|
||||
.content-main--tag,
|
||||
.content-main--category,
|
||||
.content-main--search,
|
||||
.content-main--single {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.content-stream__list {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.content-stream__empty {
|
||||
padding: 28px 24px;
|
||||
border-radius: var(--radius-lg);
|
||||
@@ -489,12 +313,6 @@ body.site-layout-3 .sidebar,
|
||||
全站只有一套加载语言。 */
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.term-page-header__body {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.aksrt-admin-quicklink {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,33 @@
|
||||
box-shadow: var(--card-shadow, 0 2px 8px rgba(0, 0, 0, .06));
|
||||
}
|
||||
|
||||
.aksrt-yiyan[data-aksrt-yiyan] {
|
||||
cursor: pointer;
|
||||
transition: box-shadow .2s ease, opacity .2s ease;
|
||||
}
|
||||
|
||||
.aksrt-yiyan[data-aksrt-yiyan]:hover,
|
||||
.aksrt-yiyan[data-aksrt-yiyan]:focus-visible {
|
||||
box-shadow: inset 0 0 5px 0 var(--focus-shadow-color, rgba(253, 83, 161, .3));
|
||||
}
|
||||
|
||||
.aksrt-yiyan .yiyan {
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.aksrt-yiyan .yiyan .en {
|
||||
font-size: .9em;
|
||||
opacity: .8;
|
||||
}
|
||||
|
||||
.aksrt-yiyan.is-loading {
|
||||
opacity: .65;
|
||||
}
|
||||
|
||||
.aksrt-yiyan.is-error .cn {
|
||||
color: var(--muted-color, #777);
|
||||
}
|
||||
|
||||
/* ---- Front / After content insertion ---- */
|
||||
.article-front-content,
|
||||
.article-after-content {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 400 240"><defs><linearGradient id="g" x1="-674.76" x2="-674.76" y1="-2991.46" y2="-2991.96" gradientTransform="matrix(390 0 0 -196 263353 -586207.5)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a8a8a8" stop-opacity=".15"/><stop offset="1" stop-color="#a8a8a8" stop-opacity="0"/></linearGradient><linearGradient id="d" x1="123" x2="194" y1="119.5" y2="119.5" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f2f2f2"/><stop offset=".13" stop-color="#ededed"/><stop offset=".59" stop-color="#e0e0e0"/><stop offset="1" stop-color="#dbdbdb"/></linearGradient><linearGradient id="a" x1="225.5" x2="225.5" y1="170" y2="63" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fafafa"/><stop offset="1" stop-color="#dbdbdb"/></linearGradient><linearGradient id="j" x1="123" x2="257" y1="68.5" y2="68.5" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#c9c9c9"/><stop offset=".57" stop-color="#dadada"/><stop offset="1" stop-color="#ebebeb"/></linearGradient><linearGradient xlink:href="#a" id="k" x1="123" x2="218.86" y1="63"/><linearGradient xlink:href="#a" id="l" x1="204.49" x2="204.49" y1="88" y2="54.05"/><linearGradient id="b" x1="142.55" x2="226.6" y1="66.08" y2="66.08" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fafafa"/><stop offset="1" stop-color="#ececec"/></linearGradient><linearGradient xlink:href="#b" id="m" x1="142.55" x2="161.04" y1="82.49" y2="82.49"/><linearGradient id="n" x1="-694.55" x2="-694.58" y1="-3120.44" y2="-3121.15" gradientTransform="matrix(-17 0 0 -23 -11666 -71655)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff6ec"/><stop offset="1" stop-color="#fdead6"/></linearGradient><linearGradient id="o" x1="-693.58" x2="-693.58" y1="-3151.07" y2="-3151.89" gradientTransform="matrix(-18 0 0 -19 -12342 -59761)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#494b80"/><stop offset="1" stop-color="#272756"/></linearGradient><linearGradient id="p" x1="-683.18" x2="-683.18" y1="-3044.31" y2="-3045.11" gradientTransform="matrix(-46 0 0 -48 -31283 -145999.5)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#faa35e"/><stop offset="1" stop-color="#f66357"/></linearGradient><linearGradient id="q" x1="-682.78" x2="-682.78" y1="-3042.82" y2="-3043.64" gradientTransform="matrix(-48.98 0 0 -49 -33299.76 -148958.01)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8caff7"/><stop offset="1" stop-color="#6a95f5"/></linearGradient><linearGradient id="c" x1="-692.52" x2="-692.96" y1="-3232.02" y2="-3231.86" gradientTransform="matrix(-19 0 0 -13 -13045 -41835.98)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1f1f49"/><stop offset="1" stop-color="#424776"/></linearGradient><linearGradient xlink:href="#c" id="r" x1="-692.45" x2="-693.07" y1="-3231.86" y2="-3231.73" gradientTransform="matrix(-19 0 0 -13 -13038 -41828.98)"/><linearGradient xlink:href="#d" id="s" x1="151.92" x2="219.58" y1="65.75" y2="65.75"/><linearGradient id="e" x1="213.5" x2="213.5" y1="39" y2="21.82" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#4b82fa" stop-opacity="0"/><stop offset="1" stop-color="#4b82fa" stop-opacity=".6"/></linearGradient><linearGradient xlink:href="#e" id="t" x1="227" x2="227" y1="40" y2="18"/><linearGradient xlink:href="#e" id="u" x1="235.5" x2="235.5" y1="45" y2="29"/><radialGradient id="f" cx="186.19" cy="17834.54" r="114.55" gradientTransform="matrix(1 0 0 .15 8.71 -2479.79)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#808083"/><stop offset=".07" stop-color="#9a9a9c"/><stop offset=".17" stop-color="#b9b9ba"/><stop offset=".28" stop-color="#d2d2d4"/><stop offset=".4" stop-color="#e6e6e7"/><stop offset=".53" stop-color="#f4f4f5"/><stop offset=".7" stop-color="#fdfdfd"/><stop offset=".99" stop-color="#fff"/></radialGradient><radialGradient id="h" cx="-509.96" cy="-2945.9" r="1.3" gradientTransform="matrix(0 21 22.62 0 66882.46 10879.55)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#c1c1c1"/></radialGradient><radialGradient id="i" cx="-464.23" cy="-2925.45" r=".94" gradientTransform="matrix(0 16 17.23 0 50697.21 7516.25)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#d7d7d7"/></radialGradient></defs><g data-name="图层 1" style="isolation:isolate"><ellipse cx="194" cy="167" rx="114" ry="17" style="opacity:.36;mix-blend-mode:multiply;fill:url(#f)"/><ellipse cx="198" cy="217.36" rx="195" ry="98" style="fill:url(#g)"/><circle cx="254.57" cy="174.43" r="14.43" style="opacity:.84;fill:url(#h);isolation:isolate"/><circle cx="285.5" cy="90.86" r="8" style="opacity:.66;fill:url(#i);isolation:isolate"/><path d="m123 69 71 19v82l-66-26-5-75z" style="fill:url(#d)"/><path d="m257 63-63 25v82l61-28 2-79z" style="fill:url(#a)"/><path d="m195 49-72 20 71 19 63-25-62-14z" style="fill:url(#j)"/>Line truncated
|
||||
|
After Width: | Height: | Size: 8.3 KiB |
@@ -1,234 +0,0 @@
|
||||
/**
|
||||
* AKSRT Archive AJAX Filter
|
||||
*/
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function initArchiveFilter(root) {
|
||||
var scope = root || document;
|
||||
var bar = scope.querySelector(".archive-filter-bar--ajax[data-ajax-archive]");
|
||||
if (!bar || bar.dataset.aksrtArchiveInit === "1") return;
|
||||
bar.dataset.aksrtArchiveInit = "1";
|
||||
|
||||
var archiveType = bar.dataset.ajaxArchive || "category";
|
||||
var termId = parseInt(bar.dataset.termId, 10) || 0;
|
||||
var wrap = scope.querySelector("[data-ajax-wrap]");
|
||||
if (!wrap) return;
|
||||
|
||||
// 归档面与首页共用同一套骨架契约:.post_ajax_loader + .is-loading,
|
||||
// 不再使用独立 spinner 遮罩 / opacity 淡出。
|
||||
var loading = wrap.querySelector(".post_ajax_loader");
|
||||
var REST_BASE = "/wp-json/aksrt/v1/archive/posts";
|
||||
var emptyText = archiveType === "tag" ? "该标签下暂无文章" : "该分类下暂无文章";
|
||||
|
||||
var state = {
|
||||
filter_cat: "",
|
||||
filter_tag: "",
|
||||
custom: {},
|
||||
sort: "date",
|
||||
page: 1
|
||||
};
|
||||
|
||||
var activeCat = bar.querySelector("[data-filter-cat].is-active");
|
||||
if (activeCat) state.filter_cat = activeCat.dataset.filterCat || "";
|
||||
var activeTag = bar.querySelector("[data-filter-tag].is-active");
|
||||
if (activeTag) state.filter_tag = activeTag.dataset.filterTag || "";
|
||||
var activeSort = bar.querySelector("[data-filter-sort].is-active");
|
||||
if (activeSort) state.sort = activeSort.dataset.filterSort || "date";
|
||||
// 自定义高级筛选维度:以当前 URL 参数为准(SSR active 状态与 URL 一致)。
|
||||
if (bar.querySelector("[data-filter-dim]")) {
|
||||
new URLSearchParams(window.location.search).forEach(function (value, key) {
|
||||
if (bar.querySelector('[data-filter-dim="' + key + '"]')) {
|
||||
state.custom[key] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function buildUrl() {
|
||||
var params = new URLSearchParams();
|
||||
params.set("archive_type", archiveType);
|
||||
params.set("term_id", String(termId));
|
||||
if (state.filter_cat) params.set("filter_cat", state.filter_cat);
|
||||
if (state.filter_tag) params.set("filter_tag", state.filter_tag);
|
||||
if (Object.keys(state.custom).length) params.set("custom_filter", JSON.stringify(state.custom));
|
||||
|
||||
params.set("sort", state.sort || "date");
|
||||
params.set("page", String(state.page));
|
||||
return REST_BASE + "?" + params.toString();
|
||||
}
|
||||
|
||||
function updateActiveChips() {
|
||||
bar.querySelectorAll("[data-filter-cat]").forEach(function (el) {
|
||||
el.classList.toggle("is-active", (el.dataset.filterCat || "") === state.filter_cat);
|
||||
});
|
||||
bar.querySelectorAll("[data-filter-tag]").forEach(function (el) {
|
||||
el.classList.toggle("is-active", (el.dataset.filterTag || "") === state.filter_tag);
|
||||
});
|
||||
bar.querySelectorAll("[data-filter-sort]").forEach(function (el) {
|
||||
el.classList.toggle("is-active", (el.dataset.filterSort || "date") === state.sort);
|
||||
});
|
||||
bar.querySelectorAll("[data-filter-dim]").forEach(function (el) {
|
||||
var current = state.custom[el.dataset.filterDim] || "";
|
||||
el.classList.toggle("is-active", (el.dataset.filterDimValue || "") !== "" && (el.dataset.filterDimValue || "") === current);
|
||||
});
|
||||
}
|
||||
|
||||
function showLoading() {
|
||||
if (loading) loading.classList.add("is-loading");
|
||||
}
|
||||
|
||||
function hideLoading() {
|
||||
if (loading) loading.classList.remove("is-loading");
|
||||
}
|
||||
|
||||
function rebuildEmptyState() {
|
||||
var noResults = document.createElement("div");
|
||||
noResults.className = "no-results content-stream__empty";
|
||||
noResults.innerHTML = "<p>" + emptyText + "</p>";
|
||||
wrap.appendChild(noResults);
|
||||
}
|
||||
|
||||
function fetchPosts(pushState) {
|
||||
showLoading();
|
||||
fetch(buildUrl(), {
|
||||
method: "GET",
|
||||
headers: { Accept: "application/json" },
|
||||
credentials: "same-origin"
|
||||
})
|
||||
.then(function (r) {
|
||||
if (!r.ok) throw new Error("HTTP " + r.status);
|
||||
return r.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
hideLoading();
|
||||
if (data.html !== undefined) {
|
||||
// 只清真实内容;骨架(.post_ajax_loader)与分页控件保留复用 ——
|
||||
// 与参考主题 post_ajax success 只 hide 不删的生命周期一致。
|
||||
var keep = function (node) {
|
||||
return node === loading ||
|
||||
node.classList.contains("post_ajax_loader") ||
|
||||
node.classList.contains("ajax-pag");
|
||||
};
|
||||
Array.from(wrap.children).forEach(function (child) {
|
||||
if (!keep(child)) wrap.removeChild(child);
|
||||
});
|
||||
if (data.html) {
|
||||
var temp = document.createElement("div");
|
||||
temp.innerHTML = data.html;
|
||||
while (temp.firstChild) wrap.appendChild(temp.firstChild);
|
||||
} else {
|
||||
rebuildEmptyState();
|
||||
}
|
||||
// legacy 事件顺序:先 post_ajax.ed,再全局 auto_fun 重扫
|
||||
wrap.dispatchEvent(new CustomEvent("post_ajax.ed", { bubbles: true }));
|
||||
if (typeof window.auto_fun === "function") window.auto_fun();
|
||||
}
|
||||
if (pushState !== false) {
|
||||
var url = new URL(window.location.href);
|
||||
url.searchParams.delete("orderby");
|
||||
url.searchParams.delete("order");
|
||||
url.searchParams.delete("paged");
|
||||
url.searchParams.delete("aksrt_filter_cat");
|
||||
url.searchParams.delete("aksrt_filter_tag");
|
||||
bar.querySelectorAll("[data-filter-dim]").forEach(function (el) {
|
||||
url.searchParams.delete(el.dataset.filterDim);
|
||||
});
|
||||
if (state.filter_cat) url.searchParams.set("aksrt_filter_cat", state.filter_cat);
|
||||
if (state.filter_tag) url.searchParams.set("aksrt_filter_tag", state.filter_tag);
|
||||
Object.keys(state.custom).forEach(function (key) {
|
||||
url.searchParams.set(key, state.custom[key]);
|
||||
});
|
||||
if (state.sort) url.searchParams.set("orderby", state.sort);
|
||||
if (state.page > 1) url.searchParams.set("paged", String(state.page));
|
||||
history.pushState({ aksrtArchive: true, state: Object.assign({}, state) }, "", url.toString());
|
||||
}
|
||||
})
|
||||
.catch(function () {
|
||||
hideLoading();
|
||||
});
|
||||
}
|
||||
|
||||
bar.addEventListener("click", function (e) {
|
||||
var chip = e.target.closest("[data-filter-cat], [data-filter-tag], [data-filter-sort], [data-filter-dim]");
|
||||
if (!chip) return;
|
||||
e.preventDefault();
|
||||
|
||||
var changed = false;
|
||||
if (chip.dataset.filterCat !== undefined) {
|
||||
var newCat = chip.dataset.filterCat;
|
||||
if (newCat !== state.filter_cat) {
|
||||
state.filter_cat = newCat;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (chip.dataset.filterTag !== undefined) {
|
||||
var newTag = chip.dataset.filterTag;
|
||||
if (newTag !== state.filter_tag) {
|
||||
state.filter_tag = newTag;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (chip.dataset.filterSort !== undefined) {
|
||||
var newSort = chip.dataset.filterSort || "date";
|
||||
if (newSort !== state.sort) {
|
||||
state.sort = newSort;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (chip.dataset.filterDim !== undefined) {
|
||||
var dimKey = chip.dataset.filterDim;
|
||||
var dimValue = chip.dataset.filterDimValue || "";
|
||||
if (dimValue !== (state.custom[dimKey] || "")) {
|
||||
if (dimValue === "") {
|
||||
delete state.custom[dimKey];
|
||||
} else {
|
||||
state.custom[dimKey] = dimValue;
|
||||
}
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
state.page = 1;
|
||||
updateActiveChips();
|
||||
fetchPosts(true);
|
||||
}
|
||||
});
|
||||
|
||||
wrap.addEventListener("click", function (e) {
|
||||
var pageLink = e.target.closest(".pagination a, .nav-links a, a.page-numbers");
|
||||
if (!pageLink || !wrap.contains(pageLink)) return;
|
||||
var href = pageLink.getAttribute("href");
|
||||
if (!href) return;
|
||||
|
||||
var match = href.match(/[?&]paged=(\d+)/);
|
||||
if (match) {
|
||||
e.preventDefault();
|
||||
state.page = parseInt(match[1], 10) || 1;
|
||||
fetchPosts(true);
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("popstate", function (e) {
|
||||
if (e.state && e.state.aksrtArchive) {
|
||||
state = Object.assign(state, e.state.state);
|
||||
updateActiveChips();
|
||||
fetchPosts(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init(root) {
|
||||
initArchiveFilter(root);
|
||||
}
|
||||
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", function () { init(); });
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
// AJAX 注入新内容后由 auto_fun 重扫(bar 级 data 标记保证幂等)。
|
||||
if (window.jQuery) {
|
||||
window.jQuery(document).on("auto_fun", function () { init(); });
|
||||
}
|
||||
})();
|
||||
@@ -510,7 +510,7 @@
|
||||
showListLoading(commentsArea);
|
||||
}
|
||||
function applyCommentOrder(order) {
|
||||
if (order !== "newest" && order !== "oldest" && order !== "hottest") {
|
||||
if (order !== "newest" && order !== "hottest") {
|
||||
order = "newest";
|
||||
}
|
||||
renderLoadingState();
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"aksrt-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("aksrt-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.AksrtModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.aksrtData||window2.aksrt||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/aksrt/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&Line truncated
|
||||
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"aksrt-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("aksrt-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.AksrtModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.aksrtData||window2.aksrt||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/aksrt/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&Line truncated
|
||||
+69
-239
@@ -1,255 +1,85 @@
|
||||
/**
|
||||
* AKSRT Yiyan — 一言轮播组件
|
||||
*
|
||||
* Fetches random quotes from hitokoto.cn API and auto-rotates.
|
||||
* Public v1 returns one sentence per request; multi-quote carousels
|
||||
* issue parallel fetches. Category `c` must be a letter a–l (or omitted).
|
||||
* Bilingual quote switcher, matching the reference theme's local quote file.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var API_BASE = 'https://v1.hitokoto.cn/';
|
||||
var TYPE_RE = /^[a-l]$/i;
|
||||
var MIN_COUNT = 1;
|
||||
var MAX_COUNT = 10;
|
||||
var DEFAULT_COUNT = 5;
|
||||
var DEFAULT_INTERVAL_SEC = 5;
|
||||
var REFRESH_MS = 30000;
|
||||
|
||||
function normalizeType(raw) {
|
||||
if (raw == null || raw === '') {
|
||||
return '';
|
||||
}
|
||||
var t = String(raw).trim().toLowerCase();
|
||||
return TYPE_RE.test(t) ? t : '';
|
||||
}
|
||||
function updateQuote(el) {
|
||||
if (el.dataset.loading === '1') return;
|
||||
el.dataset.loading = '1';
|
||||
|
||||
function normalizeCount(raw) {
|
||||
var n = parseInt(raw, 10);
|
||||
if (isNaN(n) || n < MIN_COUNT) {
|
||||
return DEFAULT_COUNT;
|
||||
}
|
||||
return Math.min(MAX_COUNT, n);
|
||||
}
|
||||
fetch(el.dataset.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
|
||||
body: 'action=aksrt_yiyan',
|
||||
})
|
||||
.then(function (response) {
|
||||
if (!response.ok) throw new Error('HTTP ' + response.status);
|
||||
return response.json();
|
||||
})
|
||||
.then(function (response) {
|
||||
var quote = response && response.success && response.data;
|
||||
if (!quote || !quote.cn || !quote.en) throw new Error('empty quote');
|
||||
|
||||
function normalizeIntervalMs(raw) {
|
||||
var sec = parseInt(raw, 10);
|
||||
if (isNaN(sec) || sec < 3) {
|
||||
sec = DEFAULT_INTERVAL_SEC;
|
||||
}
|
||||
return Math.min(60, sec) * 1000;
|
||||
}
|
||||
|
||||
function buildApiUrl(type) {
|
||||
var params = new URLSearchParams();
|
||||
params.set('encode', 'json');
|
||||
if (type) {
|
||||
params.set('c', type);
|
||||
}
|
||||
return API_BASE + '?' + params.toString();
|
||||
}
|
||||
|
||||
function mapQuote(data) {
|
||||
if (!data || typeof data !== 'object') {
|
||||
return null;
|
||||
}
|
||||
var text = data.hitokoto || data.text || '';
|
||||
if (!text) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
text: String(text),
|
||||
from: data.from ? String(data.from) : '',
|
||||
};
|
||||
}
|
||||
|
||||
function ensureStructure(el) {
|
||||
var textEl = el.querySelector('.aksrt-yiyan__text');
|
||||
if (textEl) {
|
||||
return {
|
||||
textEl: textEl,
|
||||
fromEl: el.querySelector('.aksrt-yiyan__from'),
|
||||
dotsEl: el.querySelector('.aksrt-yiyan__dots'),
|
||||
};
|
||||
}
|
||||
|
||||
var content = document.createElement('div');
|
||||
content.className = 'aksrt-yiyan__content';
|
||||
|
||||
textEl = document.createElement('p');
|
||||
textEl.className = 'aksrt-yiyan__text';
|
||||
textEl.textContent = '加载中…';
|
||||
content.appendChild(textEl);
|
||||
|
||||
var fromEl = document.createElement('p');
|
||||
fromEl.className = 'aksrt-yiyan__from';
|
||||
content.appendChild(fromEl);
|
||||
|
||||
el.appendChild(content);
|
||||
|
||||
var dotsEl = document.createElement('div');
|
||||
dotsEl.className = 'aksrt-yiyan__dots';
|
||||
dotsEl.setAttribute('aria-hidden', 'true');
|
||||
el.appendChild(dotsEl);
|
||||
|
||||
return { textEl: textEl, fromEl: fromEl, dotsEl: dotsEl };
|
||||
}
|
||||
|
||||
function fetchOneQuote(type) {
|
||||
return fetch(buildApiUrl(type), {
|
||||
credentials: 'omit',
|
||||
mode: 'cors',
|
||||
}).then(function (r) {
|
||||
return r
|
||||
.json()
|
||||
.catch(function () {
|
||||
return null;
|
||||
})
|
||||
.then(function (data) {
|
||||
if (!r.ok) {
|
||||
var msg =
|
||||
data && data.message
|
||||
? String(data.message)
|
||||
: 'HTTP ' + r.status;
|
||||
throw new Error(msg);
|
||||
}
|
||||
var quote = mapQuote(data);
|
||||
if (!quote) {
|
||||
throw new Error('empty');
|
||||
}
|
||||
return quote;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function fetchQuotes(type, count) {
|
||||
var jobs = [];
|
||||
var i;
|
||||
for (i = 0; i < count; i += 1) {
|
||||
jobs.push(
|
||||
fetchOneQuote(type).catch(function () {
|
||||
return null;
|
||||
})
|
||||
);
|
||||
}
|
||||
return Promise.all(jobs).then(function (results) {
|
||||
var quotes = [];
|
||||
var seen = Object.create(null);
|
||||
results.forEach(function (q) {
|
||||
if (!q || !q.text) {
|
||||
return;
|
||||
}
|
||||
// Dedupe identical text from parallel random draws.
|
||||
if (seen[q.text]) {
|
||||
return;
|
||||
}
|
||||
seen[q.text] = 1;
|
||||
quotes.push(q);
|
||||
});
|
||||
return quotes;
|
||||
});
|
||||
}
|
||||
|
||||
function initYiyan(el) {
|
||||
if (el.dataset.yiyanBound) {
|
||||
return;
|
||||
}
|
||||
el.dataset.yiyanBound = '1';
|
||||
|
||||
var count = normalizeCount(el.dataset.count);
|
||||
var interval = normalizeIntervalMs(el.dataset.interval);
|
||||
var type = normalizeType(el.dataset.type);
|
||||
var parts = ensureStructure(el);
|
||||
var textEl = parts.textEl;
|
||||
var fromEl = parts.fromEl;
|
||||
var dotsEl = parts.dotsEl;
|
||||
var quotes = [];
|
||||
var currentIndex = 0;
|
||||
var timer = null;
|
||||
|
||||
function showQuote(index) {
|
||||
if (!quotes.length || !textEl) {
|
||||
return;
|
||||
}
|
||||
var q = quotes[index % quotes.length];
|
||||
textEl.style.opacity = '0';
|
||||
setTimeout(function () {
|
||||
textEl.textContent = '"' + q.text + '"';
|
||||
textEl.style.opacity = '1';
|
||||
if (fromEl) {
|
||||
fromEl.textContent = q.from ? '—— ' + q.from : '';
|
||||
}
|
||||
}, 200);
|
||||
|
||||
if (dotsEl) {
|
||||
dotsEl.querySelectorAll('.aksrt-yiyan__dot').forEach(function (dot, i) {
|
||||
dot.classList.toggle('is-active', i === index % quotes.length);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function nextQuote() {
|
||||
if (quotes.length < 2) {
|
||||
return;
|
||||
}
|
||||
currentIndex = (currentIndex + 1) % quotes.length;
|
||||
showQuote(currentIndex);
|
||||
}
|
||||
|
||||
function startTimer() {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
if (quotes.length > 1) {
|
||||
timer = setInterval(nextQuote, interval);
|
||||
}
|
||||
}
|
||||
|
||||
function buildDots() {
|
||||
if (!dotsEl || quotes.length < 2) {
|
||||
if (dotsEl) {
|
||||
dotsEl.innerHTML = '';
|
||||
}
|
||||
return;
|
||||
}
|
||||
dotsEl.innerHTML = '';
|
||||
quotes.forEach(function (_, i) {
|
||||
var dot = document.createElement('span');
|
||||
dot.className = 'aksrt-yiyan__dot' + (i === 0 ? ' is-active' : '');
|
||||
dotsEl.appendChild(dot);
|
||||
});
|
||||
}
|
||||
|
||||
el.addEventListener('mouseenter', function () {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
});
|
||||
el.addEventListener('mouseleave', function () {
|
||||
startTimer();
|
||||
});
|
||||
|
||||
fetchQuotes(type, count)
|
||||
.then(function (list) {
|
||||
quotes = list;
|
||||
if (!quotes.length) {
|
||||
textEl.textContent = '暂无内容';
|
||||
return;
|
||||
}
|
||||
buildDots();
|
||||
showQuote(0);
|
||||
startTimer();
|
||||
var cn = el.querySelector('.cn');
|
||||
var en = el.querySelector('.en');
|
||||
if (cn) cn.textContent = quote.cn;
|
||||
if (en) en.textContent = quote.en;
|
||||
el.classList.remove('is-loading');
|
||||
el.classList.remove('is-error');
|
||||
el.classList.add('is-ready');
|
||||
})
|
||||
.catch(function () {
|
||||
textEl.textContent = '加载失败,请稍后再试';
|
||||
el.classList.remove('is-loading');
|
||||
el.classList.add('is-error');
|
||||
var cn = el.querySelector('.cn');
|
||||
if (cn && !el.classList.contains('is-ready')) cn.textContent = '加载失败,点击重试';
|
||||
})
|
||||
.finally(function () {
|
||||
delete el.dataset.loading;
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).off('auto_fun.aksrt-yiyan').on('auto_fun.aksrt-yiyan', function () {
|
||||
document.querySelectorAll('[data-aksrt-yiyan]').forEach(initYiyan);
|
||||
});
|
||||
function init(root) {
|
||||
var scope = root || document;
|
||||
var elements = [];
|
||||
if (scope.matches && scope.matches('[data-aksrt-yiyan]')) elements.push(scope);
|
||||
if (scope.querySelectorAll) elements = elements.concat(Array.prototype.slice.call(scope.querySelectorAll('[data-aksrt-yiyan]')));
|
||||
elements.forEach(function (el) {
|
||||
if (el.dataset.yiyanBound) return;
|
||||
el.dataset.yiyanBound = '1';
|
||||
|
||||
el.addEventListener('click', function () {
|
||||
updateQuote(el);
|
||||
});
|
||||
el.addEventListener('keydown', function (event) {
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
event.preventDefault();
|
||||
updateQuote(el);
|
||||
}
|
||||
});
|
||||
updateQuote(el);
|
||||
window.setInterval(function () {
|
||||
if (!document.hidden) updateQuote(el);
|
||||
}, REFRESH_MS);
|
||||
});
|
||||
}
|
||||
|
||||
window.AksrtYiyan = { init: init };
|
||||
|
||||
if (window.jQuery) {
|
||||
window.jQuery(document).off('auto_fun.aksrt-yiyan').on('auto_fun.aksrt-yiyan', function () {
|
||||
init(document);
|
||||
});
|
||||
}
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init, { once: true });
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
})();
|
||||
@@ -48,9 +48,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
function resolveWidgetNumber(inputName, widgetId, fallback) {
|
||||
var inputMatch = String(inputName || '').match(/\[(\d+)\]/);
|
||||
var idMatch = String(widgetId || '').match(/-(\d+)$/);
|
||||
var number = inputMatch ? inputMatch[1] : (idMatch ? idMatch[1] : String(fallback || ''));
|
||||
return /^\d+$/.test(number) && Number(number) > 0 ? number : '';
|
||||
}
|
||||
|
||||
return {
|
||||
parseDependency: parseDependency,
|
||||
dependencyVisible: dependencyVisible,
|
||||
replaceRepeaterIndexes: replaceRepeaterIndexes
|
||||
replaceRepeaterIndexes: replaceRepeaterIndexes,
|
||||
resolveWidgetNumber: resolveWidgetNumber
|
||||
};
|
||||
});
|
||||
+80
-19
@@ -1,13 +1,15 @@
|
||||
.aksrt-widget-form {
|
||||
--aksrt-field-border: #dcdcde;
|
||||
--aksrt-field-accent: #2271b1;
|
||||
--aksrt-field-accent: #0991f5;
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
padding: 4px 0 10px;
|
||||
gap: 0;
|
||||
padding: 0 0 8px;
|
||||
}
|
||||
|
||||
.aksrt-widget-field {
|
||||
min-width: 0;
|
||||
padding: 11px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.aksrt-widget-field[hidden] {
|
||||
@@ -18,12 +20,27 @@
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
color: #0991f5;
|
||||
}
|
||||
|
||||
.customize-control-widget_form .aksrt-widget-field__label { color: inherit; }
|
||||
|
||||
.aksrt-widget-field .description {
|
||||
margin: -2px 0 7px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-widget-field--switcher {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
column-gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-widget-field--switcher .aksrt-widget-field__label { margin: 0; }
|
||||
.aksrt-widget-field--switcher .description { grid-column: 1 / -1; grid-row: 2; }
|
||||
.aksrt-widget-field--switcher > .aksrt-widget-switch { grid-column: 2; grid-row: 1; }
|
||||
|
||||
.aksrt-widget-switch {
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
@@ -70,12 +87,12 @@
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.aksrt-widget-choices label span {
|
||||
.aksrt-widget-choices label > span {
|
||||
display: block;
|
||||
padding: 5px 9px;
|
||||
padding: 5px 10px;
|
||||
border: 1px solid var(--aksrt-field-border);
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
background: #f7f8fa;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -85,6 +102,14 @@
|
||||
box-shadow: 0 0 0 1px var(--aksrt-field-accent);
|
||||
}
|
||||
|
||||
.aksrt-widget-choices label input:focus-visible + span { outline: 2px solid #72aee6; outline-offset: 2px; }
|
||||
|
||||
.aksrt-widget-choices--palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
|
||||
.aksrt-widget-choices--palette label > span { padding: 4px; text-align: center; }
|
||||
.aksrt-widget-palette-choice { display: grid; justify-items: center; gap: 3px; }
|
||||
.aksrt-widget-palette-choice i { display: block; width: 100%; height: 18px; border: 1px solid rgba(0, 0, 0, .12); border-radius: 3px; }
|
||||
.aksrt-widget-palette-choice small { font-size: 10px; line-height: 1.2; }
|
||||
|
||||
.aksrt-widget-number,
|
||||
.aksrt-widget-link,
|
||||
.aksrt-widget-background {
|
||||
@@ -130,7 +155,7 @@
|
||||
.aksrt-widget-nested {
|
||||
margin-bottom: 9px;
|
||||
border: 1px solid var(--aksrt-field-border);
|
||||
border-radius: 6px;
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
@@ -140,15 +165,42 @@
|
||||
gap: 7px;
|
||||
padding: 8px 10px;
|
||||
border-bottom: 1px solid var(--aksrt-field-border);
|
||||
background: #f6f7f7;
|
||||
background: #f9fafc;
|
||||
}
|
||||
|
||||
.aksrt-widget-repeater__bar::-webkit-details-marker { display: none; }
|
||||
.aksrt-widget-repeater__bar { list-style: none; cursor: pointer; }
|
||||
.aksrt-widget-repeater__bar::after { content: "\f140"; margin-left: auto; font: 20px/1 dashicons; color: #646970; }
|
||||
.aksrt-widget-repeater__row[open] > .aksrt-widget-repeater__bar::after { content: "\f142"; }
|
||||
.aksrt-widget-repeater__bar .dashicons { cursor: move; }
|
||||
.aksrt-widget-repeater__bar strong { flex: 1; }
|
||||
.aksrt-widget-repeater__remove:disabled { visibility: hidden; }
|
||||
.aksrt-widget-repeater__add:disabled { opacity: .55; cursor: not-allowed; }
|
||||
.aksrt-widget-repeater__fields,
|
||||
.aksrt-widget-nested__body { display: grid; gap: 12px; padding: 10px; }
|
||||
.aksrt-widget-nested > summary { padding: 9px 10px; font-weight: 600; cursor: pointer; }
|
||||
|
||||
.aksrt-widget-form input[type="text"],
|
||||
.aksrt-widget-form input[type="url"],
|
||||
.aksrt-widget-form input[type="number"],
|
||||
.aksrt-widget-form select,
|
||||
.aksrt-widget-form textarea {
|
||||
min-height: 32px;
|
||||
border-color: #d5d8dc;
|
||||
border-radius: 3px;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.aksrt-widget-form input:focus,
|
||||
.aksrt-widget-form select:focus,
|
||||
.aksrt-widget-form textarea:focus {
|
||||
border-color: #0991f5;
|
||||
box-shadow: 0 0 0 1px #0991f5;
|
||||
}
|
||||
|
||||
.aksrt-widget-form .button { min-height: 32px; line-height: 30px; border-radius: 3px; }
|
||||
.aksrt-widget-form .button-primary { background: #0991f5; border-color: #087bcf; }
|
||||
|
||||
.aksrt-widget-form-lazy {
|
||||
padding: 14px;
|
||||
border: 1px dashed #c3c4c7;
|
||||
@@ -175,20 +227,29 @@
|
||||
color: #614200;
|
||||
}
|
||||
|
||||
.aksrt-widget-transfer { margin: 16px 20px 16px 0; }
|
||||
.aksrt-widget-transfer__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
|
||||
.aksrt-widget-transfer form { display: grid; align-content: start; gap: 9px; padding: 12px; border: 1px solid #dcdcde; border-radius: 6px; }
|
||||
.aksrt-widget-transfer form h3 { margin: 0 0 3px; }
|
||||
.aksrt-widget-transfer select,
|
||||
.aksrt-widget-transfer input[type="file"] { width: 100%; }
|
||||
.aksrt-widget-transfer-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
|
||||
.aksrt-widget-transfer-toolbar .button { margin: 0; }
|
||||
.aksrt-widget-customizer-remove { margin-left: 8px; color: #b32d2e; }
|
||||
.aksrt-widget-transfer-modal[hidden] { display: none !important; }
|
||||
.aksrt-widget-transfer-modal.is-open { position: fixed; inset: 0; z-index: 1000100; display: flex; align-items: center; justify-content: center; padding: 20px; }
|
||||
.aksrt-widget-transfer-modal__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(0, 0, 0, .45); }
|
||||
.aksrt-widget-transfer-modal__dialog { position: relative; z-index: 1; box-sizing: border-box; width: min(720px, 96vw); max-height: 90vh; overflow: auto; padding: 18px 20px 16px; border: 1px solid #c3c4c7; border-radius: 6px; background: #fff; box-shadow: 0 8px 32px rgba(0, 0, 0, .14); }
|
||||
.aksrt-widget-transfer-modal__dialog h2 { margin: 0 36px 10px 0; font-size: 16px; }
|
||||
.aksrt-widget-transfer-modal__area { margin: 0 0 12px; }
|
||||
.aksrt-widget-transfer-modal__close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; background: transparent; color: #646970; font-size: 22px; cursor: pointer; }
|
||||
.aksrt-widget-transfer-modal__tabs { display: flex; gap: 6px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #dcdcde; }
|
||||
.aksrt-widget-transfer-modal__tabs .is-active { border-color: #0991f5; color: #087bcf; box-shadow: inset 0 -2px #0991f5; }
|
||||
.aksrt-widget-transfer-modal__panel form { display: grid; align-content: start; gap: 10px; }
|
||||
.aksrt-widget-transfer-modal__panel select,
|
||||
.aksrt-widget-transfer-modal__panel input[type="file"] { width: 100%; }
|
||||
.aksrt-widget-transfer__actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.aksrt-widget-template-preview-output { grid-column: 1 / -1; max-height: 520px; overflow: auto; padding: 14px; border: 1px solid #dcdcde; background: #fff; }
|
||||
.aksrt-widget-template-preview-output { max-height: 420px; overflow: auto; margin-top: 14px; padding: 14px; border: 1px solid #dcdcde; background: #fff; }
|
||||
.aksrt-widget-template-preview__area { margin-bottom: 18px; }
|
||||
.aksrt-widget-template-preview__module { margin: 10px 0; padding: 12px; border: 1px dashed #c3c4c7; border-radius: 6px; }
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.aksrt-widget-transfer__grid { grid-template-columns: 1fr; }
|
||||
.aksrt-widget-template-preview-output { grid-column: auto; }
|
||||
@media (max-width: 600px) {
|
||||
.aksrt-widget-transfer-modal.is-open { padding: 10px; }
|
||||
.aksrt-widget-transfer-modal__dialog { width: 100%; padding: 16px; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
+154
-7
@@ -23,6 +23,7 @@
|
||||
evaluateDependencies($root);
|
||||
updateWidgetTitle($root);
|
||||
updatePlacementWarning($root);
|
||||
updateRepeaterControls($root);
|
||||
}
|
||||
|
||||
/* terms 字段:以“已选标签”为唯一真源,同步隐藏输入(选择顺序)与复选框。 */
|
||||
@@ -63,17 +64,91 @@
|
||||
$hint.toggleClass('is-warning', (size === 'wide' && isSidebar) || (size === 'sidebar' && !isSidebar && area !== ''));
|
||||
}
|
||||
|
||||
function injectTransferToolbar($anchor, sidebarId) {
|
||||
if (!$anchor?.length || !sidebarId || $anchor.next('.aksrt-widget-transfer-toolbar').length) return;
|
||||
const $toolbar = $('<div class="aksrt-widget-transfer-toolbar" role="group"></div>');
|
||||
[
|
||||
['export', config.i18n?.export || '导出'],
|
||||
['import', config.i18n?.import || '导入'],
|
||||
['template', config.i18n?.template || '应用模板'],
|
||||
].forEach(([action, label]) => {
|
||||
$('<button type="button" class="button button-small"></button>')
|
||||
.text(label)
|
||||
.attr('data-aksrt-transfer-action', action)
|
||||
.attr('data-sidebar-id', sidebarId)
|
||||
.appendTo($toolbar);
|
||||
});
|
||||
$anchor.after($toolbar);
|
||||
}
|
||||
|
||||
function scanWidgetAreas() {
|
||||
$('.widgets-holder-wrap:not(#available-widgets):not(.inactive-sidebar)').each(function () {
|
||||
const $wrap = $(this);
|
||||
const $sortables = $wrap.find('.widgets-sortables').first();
|
||||
const sidebarId = String($sortables.attr('id') || '');
|
||||
if (!sidebarId) return;
|
||||
const $description = $sortables.find('.sidebar-description .description').first();
|
||||
const $anchor = $description.length ? $description : $sortables.find('.description').first();
|
||||
if ($anchor.length) injectTransferToolbar($anchor, sidebarId);
|
||||
});
|
||||
|
||||
$('.control-section-sidebar').each(function () {
|
||||
const $section = $(this);
|
||||
const sectionId = String($section.attr('id') || '');
|
||||
const prefix = 'sub-accordion-section-sidebar-widgets-';
|
||||
if (!sectionId.startsWith(prefix)) return;
|
||||
const sidebarId = sectionId.slice(prefix.length);
|
||||
const $description = $section.find('.section-meta .description').first();
|
||||
const $anchor = $description.length ? $description : $section.find('.accordion-section-title, .customize-section-title').first();
|
||||
if ($anchor.length) injectTransferToolbar($anchor, sidebarId);
|
||||
});
|
||||
|
||||
$('.customize-control-widget_form').each(function () {
|
||||
const $control = $(this);
|
||||
const $nav = $control.find('.widget-reorder-nav').first();
|
||||
if (!$nav.length || $nav.find('.aksrt-widget-customizer-remove').length) return;
|
||||
$('<button type="button" class="button-link-delete aksrt-widget-customizer-remove" aria-label="移除此小工具">移除</button>').appendTo($nav);
|
||||
});
|
||||
}
|
||||
|
||||
function openTransferModal(action, sidebarId) {
|
||||
const $modal = $('#aksrt-widget-transfer-modal');
|
||||
if (!$modal.length) return;
|
||||
const sidebars = config.sidebars || {};
|
||||
const areaName = sidebars[sidebarId] || sidebarId;
|
||||
$modal.find('.aksrt-widget-transfer-modal__area').text(areaName);
|
||||
$modal.find('input[name="sidebar"], input[name="target_sidebar"]').val(sidebarId);
|
||||
$modal.find('[data-transfer-tab]').removeClass('is-active');
|
||||
$modal.find(`[data-transfer-tab="${action}"]`).addClass('is-active');
|
||||
$modal.find('[data-transfer-panel]').prop('hidden', true);
|
||||
$modal.find(`[data-transfer-panel="${action}"]`).prop('hidden', false);
|
||||
$modal.prop('hidden', false).addClass('is-open').attr('aria-hidden', 'false');
|
||||
$modal.find('[data-transfer-panel="' + action + '"] button, [data-transfer-panel="' + action + '"] input, [data-transfer-panel="' + action + '"] select').filter(':visible').first().trigger('focus');
|
||||
}
|
||||
|
||||
function closeTransferModal() {
|
||||
$('#aksrt-widget-transfer-modal').removeClass('is-open').attr('aria-hidden', 'true').prop('hidden', true);
|
||||
}
|
||||
|
||||
function loadForm(container) {
|
||||
const $container = $(container);
|
||||
if ($container.data('loading') || $container.data('loaded')) return;
|
||||
const $widget = $container.closest('.widget, .customize-control-widget_form');
|
||||
const inputName = String($widget.find('input[name^="widget-"]').first().attr('name') || '');
|
||||
const number = core.resolveWidgetNumber(inputName, $widget.attr('id'), $container.data('widget-number'));
|
||||
// New-widget templates use __i__ until WordPress assigns a real instance number.
|
||||
if (!number) return;
|
||||
$container.data('loading', true).find('.aksrt-widget-form-lazy__status').text(config.i18n?.loading || 'Loading…');
|
||||
$.post(config.ajaxUrl, {
|
||||
action: config.action,
|
||||
nonce: config.nonce,
|
||||
id_base: $container.data('id-base'),
|
||||
widget_number: $container.data('widget-number'),
|
||||
widget_number: number,
|
||||
}).done((response) => {
|
||||
if (!response?.success || !response.data?.html) throw new Error('Invalid response');
|
||||
if (!response?.success || !response.data?.html) {
|
||||
$container.data('loading', false).find('.aksrt-widget-form-lazy__status').text(response?.data?.message || config.i18n?.error || 'Failed to load.');
|
||||
return;
|
||||
}
|
||||
const $form = $(response.data.html);
|
||||
$container.replaceWith($form);
|
||||
initForm($form);
|
||||
@@ -94,6 +169,31 @@
|
||||
if (!rowIndexes.length) return;
|
||||
this.name = core.replaceRepeaterIndexes(this.name, rowIndexes);
|
||||
});
|
||||
updateRepeaterTitles($form);
|
||||
}
|
||||
|
||||
function updateRepeaterTitles($form) {
|
||||
$form.find('.aksrt-widget-repeater__rows').each(function () {
|
||||
$(this).children('.aksrt-widget-repeater__row').each(function (index) {
|
||||
const $row = $(this);
|
||||
const $title = $row.find('.aksrt-widget-repeater__title').first();
|
||||
const prefix = String($title.data('title-prefix') || '项目');
|
||||
const $firstControl = $row.children('.aksrt-widget-repeater__fields').find('input:not([type="hidden"]), select, textarea').first();
|
||||
const value = String($firstControl.val() || '').trim();
|
||||
$title.text(prefix + (index + 1) + (value ? ':' + value : ''));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function updateRepeaterControls($root) {
|
||||
$root.filter('.aksrt-widget-repeater').add($root.find('.aksrt-widget-repeater')).each(function () {
|
||||
const $repeater = $(this);
|
||||
const count = $repeater.children('.aksrt-widget-repeater__rows').children('.aksrt-widget-repeater__row').length;
|
||||
const min = Number($repeater.data('min-items') || 0);
|
||||
const max = Number($repeater.data('max-items') || 50);
|
||||
$repeater.children('.aksrt-widget-repeater__rows').children('.aksrt-widget-repeater__row').children('.aksrt-widget-repeater__bar').children('.aksrt-widget-repeater__remove').prop('disabled', count <= min);
|
||||
$repeater.children('.aksrt-widget-repeater__add').prop('disabled', count >= max);
|
||||
});
|
||||
}
|
||||
|
||||
function fieldValue($form, id) {
|
||||
@@ -116,12 +216,29 @@
|
||||
}
|
||||
|
||||
$(document)
|
||||
.on('click', '[data-aksrt-transfer-action]', function () {
|
||||
openTransferModal(String($(this).data('aksrt-transfer-action')), String($(this).data('sidebar-id')));
|
||||
})
|
||||
.on('click', '[data-aksrt-transfer-close]', closeTransferModal)
|
||||
.on('click', '[data-transfer-tab]', function () {
|
||||
const $modal = $(this).closest('.aksrt-widget-transfer-modal');
|
||||
const panel = String($(this).data('transfer-tab'));
|
||||
$modal.find('[data-transfer-tab]').removeClass('is-active');
|
||||
$(this).addClass('is-active');
|
||||
$modal.find('[data-transfer-panel]').prop('hidden', true);
|
||||
$modal.find(`[data-transfer-panel="${panel}"]`).prop('hidden', false);
|
||||
})
|
||||
.on('click', '.aksrt-widget-customizer-remove', function (event) {
|
||||
event.preventDefault();
|
||||
$(this).closest('.customize-control-widget_form').find('.widget-control-remove').first().trigger('click');
|
||||
})
|
||||
.on('click', '.aksrt-widget-form-lazy__load', function () { loadForm($(this).closest('.aksrt-widget-form-lazy')); })
|
||||
.on('click', '.widget.open .aksrt-widget-form-lazy', function () { loadForm(this); })
|
||||
.on('click', '.widget.open .aksrt-widget-form-lazy, .customize-control-widget_form .aksrt-widget-form-lazy', function () { loadForm(this); })
|
||||
.on('change input', '.aksrt-widget-form input, .aksrt-widget-form select, .aksrt-widget-form textarea', function () {
|
||||
const $form = $(this).closest('.aksrt-widget-form');
|
||||
evaluateDependencies($form);
|
||||
updateWidgetTitle($form);
|
||||
updateRepeaterTitles($form);
|
||||
})
|
||||
.on('click', '.aksrt-widget-repeater__add', function () {
|
||||
const $repeater = $(this).closest('.aksrt-widget-repeater');
|
||||
@@ -134,11 +251,17 @@
|
||||
const $row = $(html).appendTo($rows);
|
||||
initForm($row);
|
||||
renumberRepeaters.call($rows[0]);
|
||||
updateRepeaterControls($repeater);
|
||||
})
|
||||
.on('click', '.aksrt-widget-repeater__remove', function () {
|
||||
const $rows = $(this).closest('.aksrt-widget-repeater__rows');
|
||||
.on('click', '.aksrt-widget-repeater__remove', function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const $repeater = $(this).closest('.aksrt-widget-repeater');
|
||||
const $rows = $repeater.children('.aksrt-widget-repeater__rows');
|
||||
if ($rows.children('.aksrt-widget-repeater__row').length <= Number($repeater.data('min-items') || 0)) return;
|
||||
$(this).closest('.aksrt-widget-repeater__row').remove();
|
||||
renumberRepeaters.call($rows[0]);
|
||||
updateRepeaterControls($repeater);
|
||||
})
|
||||
.on('click', '.aksrt-widget-terms__remove', function () {
|
||||
$(this).closest('.aksrt-widget-terms__chip').remove();
|
||||
@@ -150,6 +273,7 @@
|
||||
const id = String(this.value);
|
||||
const name = (option.querySelector('[data-term-name]') || option).getAttribute('data-term-name');
|
||||
if (this.checked) addTermChip(wrap, id, name || id);
|
||||
else $(wrap).find('.aksrt-widget-terms__chip').filter((_index, chip) => String($(chip).data('term-id')) === id).remove();
|
||||
syncTerms(wrap);
|
||||
})
|
||||
.on('input', '.aksrt-widget-terms__search', function () {
|
||||
@@ -186,17 +310,40 @@
|
||||
nonce: config.transferNonce,
|
||||
template: $form.find('[name="template"]').val(),
|
||||
}).done((response) => {
|
||||
if (!response?.success) throw new Error('Invalid response');
|
||||
if (!response?.success || !response.data) {
|
||||
$output.empty().append($('<p class="notice notice-error"></p>').text(response?.data?.message || config.i18n?.error || '预览加载失败,请重试。'));
|
||||
return;
|
||||
}
|
||||
$output.html(response.data.html || '<p>模板为空。</p>');
|
||||
}).fail(() => $output.html('<p class="notice notice-error">预览加载失败。</p>'));
|
||||
}).fail((xhr) => {
|
||||
const message = xhr?.responseJSON?.data?.message || config.i18n?.error || '预览加载失败,请重试。';
|
||||
$output.empty().append($('<p class="notice notice-error"></p>').text(message));
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('widget-added widget-updated', function (_event, widget) {
|
||||
$(widget).find('.aksrt-widget-form-lazy').each(function () { loadForm(this); });
|
||||
updatePlacementWarning(widget);
|
||||
scanWidgetAreas();
|
||||
});
|
||||
|
||||
if (window.wp?.customize?.bind) {
|
||||
window.wp.customize.bind('ready', function () {
|
||||
$('#customize-theme-controls').on('expanded', function (_event, section) {
|
||||
if (!section || !String(section.id || section).includes('sidebar-widgets')) return;
|
||||
window.setTimeout(function () {
|
||||
scanWidgetAreas();
|
||||
$('.customize-control-widget_form .aksrt-widget-form-lazy').each(function () { loadForm(this); });
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
scanWidgetAreas();
|
||||
$(document).on('keydown', function (event) {
|
||||
if (event.key === 'Escape') closeTransferModal();
|
||||
});
|
||||
$('.aksrt-widget-form').each(function () { initForm(this); });
|
||||
$('.widget.open .aksrt-widget-form-lazy').each(function () { loadForm(this); });
|
||||
});
|
||||
|
||||
@@ -50,16 +50,19 @@
|
||||
.aksrt-widget-search--compact button span { display: none; }
|
||||
.aksrt-widget-search--large { min-height: 58px; border-radius: 14px; }
|
||||
|
||||
.aksrt-widget-quote { position: relative; min-height: 130px; margin: 0; padding: 24px 48px 24px 25px; overflow: hidden; border-radius: var(--aksrt-widget-radius); background: linear-gradient(135deg, #6772e5, #8b5cf6); color: #fff; }
|
||||
.aksrt-widget-quote > i { opacity: .35; font-size: 26px; }
|
||||
.aksrt-widget-quote blockquote { margin: 12px 0 0; font-size: 16px; line-height: 1.8; }
|
||||
.aksrt-widget-quote button { position: absolute; right: 13px; bottom: 13px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; }
|
||||
.aksrt-widget-quote { margin: 0; padding: 12px 15px; border-radius: var(--aksrt-widget-radius); background: var(--main-bg-color, #fff); color: var(--main-color, inherit); box-shadow: 0 0 10px var(--main-shadow, rgba(116,116,116,.08)); }
|
||||
.aksrt-widget-quote .yiyan { line-height: 1.8; }
|
||||
.aksrt-widget-quote .yiyan .en { font-size: .9em; opacity: .8; }
|
||||
.aksrt-widget-quote.is-loading { opacity: .65; }
|
||||
|
||||
/* The AKSRT base stylesheet already carries Zibll's icon-card and utility rules.
|
||||
* Restore the one renamed primitive used verbatim by these two widget renderers. */
|
||||
.zib-widget { clear:both; margin-bottom:20px; padding:15px; border-radius:var(--main-radius,8px); background:var(--main-bg-color,#fff); box-shadow:0 0 10px var(--main-shadow,rgba(116,116,116,.08)); }
|
||||
.zib-widget.padding-10 { padding:10px; }
|
||||
.zib-widget.nobottom.notop { padding-top:0; padding-bottom:0; }
|
||||
.zib-widget.posts-mini-lists { padding:5px; }
|
||||
.zib-widget.posts-mini-lists .relative > .tab-nav-theme ~ .scroll-x-prev,
|
||||
.zib-widget.posts-mini-lists .relative > .tab-nav-theme ~ .scroll-x-next { top:10px; }
|
||||
|
||||
.zib-widget-wrap { padding:var(--aksrt-widget-space-top,0) var(--aksrt-widget-space-right,0) var(--aksrt-widget-space-bottom,0) var(--aksrt-widget-space-left,0); background-color:var(--aksrt-widget-bg-light,transparent); background-image:var(--aksrt-widget-bg-image-light,none); background-position:center; background-size:cover; }
|
||||
.dark-theme .zib-widget-wrap, [data-theme="dark"] .zib-widget-wrap { background-color:var(--aksrt-widget-bg-dark,var(--aksrt-widget-bg-light,transparent)); background-image:var(--aksrt-widget-bg-image-dark,var(--aksrt-widget-bg-image-light,none)); }
|
||||
@@ -151,12 +154,7 @@
|
||||
/* Zibll modern widget contracts */
|
||||
.widget-tab-post .tab-content > .tab-pane { display: none; }
|
||||
.widget-tab-post .tab-content > .tab-pane.active { display: block; }
|
||||
.widget-tab-post .list-inline { margin: 0 0 15px; padding: 0; list-style: none; }
|
||||
.widget-tab-post .list-inline > li { display: inline-block; margin: 0 15px 0 0; }
|
||||
.widget-tab-post .list-inline > li > a { color: inherit; text-decoration: none; cursor: pointer; }
|
||||
.widget-tab-post .list-inline > li.active > a { color: var(--focus-color, #f04494); }
|
||||
.widget-tab-post .tab-nav-theme > li { position: relative; padding-bottom: 5px; }
|
||||
.widget-tab-post .tab-nav-theme > li.active::before { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--focus-color, #f04494); }
|
||||
.widget-tab-post, .term-aggregation { line-height:1.42857143; }
|
||||
.widget-tab-post .post_ajax_loader { min-height: 40px; }
|
||||
/* Widget pagination mirrors the reference .ajax-next rules while staying on the REST client. */
|
||||
.theme-pagination { margin: 20px 0; }
|
||||
|
||||
@@ -74,26 +74,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
function updateQuote(figure) {
|
||||
if (figure.dataset.source !== 'api' || !config.quoteUrl) return Promise.resolve();
|
||||
var button = figure.querySelector('button');
|
||||
if (button) button.disabled = true;
|
||||
return fetch(config.quoteUrl, { credentials: 'same-origin', headers: { Accept: 'application/json' } })
|
||||
.then(function (response) { if (!response.ok) throw new Error('quote'); return response.json(); })
|
||||
.then(function (data) {
|
||||
if (data && data.text) figure.querySelector('blockquote').textContent = data.text;
|
||||
})
|
||||
.catch(function () {})
|
||||
.finally(function () { if (button) button.disabled = false; });
|
||||
}
|
||||
|
||||
function initQuote(figure) {
|
||||
if (!once(figure, 'Quote')) return;
|
||||
var button = figure.querySelector('button');
|
||||
if (button) button.addEventListener('click', function () { updateQuote(figure); });
|
||||
if (!reducedMotion && figure.dataset.source === 'api') {
|
||||
window.setInterval(function () { if (!document.hidden) updateQuote(figure); }, Math.max(5, Number(figure.dataset.interval || 30)) * 1000);
|
||||
}
|
||||
if (window.AksrtYiyan) window.AksrtYiyan.init(figure);
|
||||
}
|
||||
|
||||
function errorMarkup() {
|
||||
@@ -187,6 +170,7 @@
|
||||
Array.prototype.slice.call(container.querySelectorAll(':scope > .ajax-pag')).forEach(function (node) { node.remove(); });
|
||||
if (data.paginate_html) container.insertAdjacentHTML('beforeend', data.paginate_html);
|
||||
container.dataset.page = String(data.page || page);
|
||||
container.dataset.loaded = '1';
|
||||
anchorLoader(container);
|
||||
scan(container);
|
||||
})
|
||||
@@ -247,7 +231,7 @@
|
||||
if (!panel) return;
|
||||
panel.dataset.segment = button.dataset.segment;
|
||||
panel.setAttribute('aria-labelledby', button.id);
|
||||
loadItems(panel, 1, false);
|
||||
if (panel.dataset.loaded !== '1') loadItems(panel, 1, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user