fix(hero): align header slider title/search stack with zibll

Put hero main title/subtitle in search before_html (document flow),
move the search overlay outside the swiper as a sibling, and reset
search/slide-text positioning to zibll tops so title and search no
longer overlap.
This commit is contained in:
kate522 committed 2026-07-17 23:00:33 +08:00
1 parent e7ccc4f069
commit 397231ca75
12 files changed
+476 -439

No files matched your search

+44 -59
View File
@@ -1,19 +1,17 @@
/* ============================================================
* AKSRT Header Slider — v5.0 Zibll-Aligned
* AKSRT Header Slider — v6.0 Zibll-Aligned
*
* 三层架构:
* - Layer 1: Swiper 全宽轮播背景
* - Layer 2: 搜索覆盖模块
* - Layer 3: 图标卡片网格覆盖
* Three layers:
* - Layer 1: Swiper full-bleed background
* - Layer 2: Search overlay (before_html + form + after_html)
* - Layer 3: Icon cards (negative margin)
*
* 对标 zibll 的 new-swiper 体系:
* - CSS 变量高度控制 (--pc-height / --m-height)
* - data-* 属性驱动配置
* - 缩略图分页器、视差、懒加载
* Title/subtitle for the hero live in .header-slider-search-more.before
* (document flow with the search form). .slide-text is decorative only.
* ============================================================ */
/* ============================================================
* .new-swiper 基础样式(对标 zibll)
* .new-swiper base (zibll)
* ============================================================ */
.aksrt-slider-wrapper {
position: relative;
@@ -45,7 +43,7 @@
object-fit: cover;
}
/* 懒加载预加载器 */
/* Lazy preloader */
.new-swiper .swiper-lazy-preloader {
position: absolute;
top: 50%;
@@ -53,7 +51,7 @@
width: 42px;
height: 42px;
margin: -21px 0 0 -21px;
border: 3px solid rgba(255,255,255,0.3);
border: 3px solid rgba(255, 255, 255, 0.3);
border-top-color: #fff;
border-radius: 50%;
animation: aksrt-swiper-spin 0.8s linear infinite;
@@ -64,7 +62,6 @@
to { transform: rotate(360deg); }
}
/* 懒加载图片 */
.new-swiper .swiper-lazy {
opacity: 0;
transition: opacity 0.3s;
@@ -75,7 +72,6 @@
opacity: 1;
}
/* 缩略图分页器 */
.new-swiper .pagination-thumbnail-item {
width: 60px;
height: 40px;
@@ -99,60 +95,52 @@
border-color: #fff;
}
/* 视差层 */
.new-swiper [data-swiper-parallax] {
transition: none;
}
/* 比例高度模式 */
.new-swiper.scale-height .swiper-wrapper {
height: 0;
padding-bottom: var(--scale-ratio, 45%);
}
/* 幻灯片文字覆盖层 */
/* zibll .slide-text / .s-desc */
/* ============================================================
* Slide text — decorative layer (zibll .s-desc / .slide-text)
* Main hero title is NOT here; it is search before_html.
* ============================================================ */
.aksrt-slide-text,
.s-desc,
.slide-text {
position: absolute;
color: #fff;
z-index: 2;
text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}
.aksrt-slide-text,
.slide-text:not(.s-desc) {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: calc(100% - 32px);
max-width: 920px;
text-align: center;
background: unset;
bottom: unset;
}
.s-desc {
bottom: 0;
left: 0;
top: auto;
transform: none;
width: 100%;
padding: 1.8em 2.5em;
background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), transparent);
border-radius: 0 0 var(--main-radius, 8px) var(--main-radius, 8px);
width: 100%;
font-size: 16px;
text-align: left;
text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
z-index: 1;
border-radius: 0 0 var(--main-radius, 8px) var(--main-radius, 8px);
}
/* zibll: .slide-text unsets bottom bar, uses abs-center placement */
.aksrt-slide-text,
.slide-text:not(.s-desc) {
background: unset;
bottom: unset;
--text-size-pc: 20px;
font-size: var(--text-size-pc);
opacity: 1;
transition: opacity 1s;
}
.aksrt-slide-text__title,
.slide-title {
font-family: var(--font-ui);
font-size: clamp(1.5rem, 3.2vw, 2.25rem);
font-size: inherit;
font-weight: 600;
margin: 0 0 12px;
line-height: 1.25;
margin: 0;
line-height: 1.35;
text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}
@@ -164,9 +152,9 @@
.aksrt-slide-text__desc,
.slide-desc {
font-size: clamp(0.9rem, 1.4vw, 1.125rem);
margin: 0;
line-height: 1.6;
margin: 0.6em 0 0;
line-height: 1.5;
font-size: 60%;
color: rgba(255, 255, 255, 0.95);
text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}
@@ -177,7 +165,6 @@
--m-height: 100%;
width: 100%;
height: auto;
/* Prefer aspect-ratio so global border-box cannot collapse the box. */
aspect-ratio: 5 / 2;
padding-bottom: 0;
}
@@ -196,29 +183,29 @@
position: absolute;
}
/* 移动端高度 */
@media (max-width: 767px) {
.new-swiper .swiper-wrapper {
height: var(--m-height);
}
.slide-text:not(.s-desc) {
--text-size-m: 13px;
font-size: var(--text-size-m);
}
}
/* ============================================================
* Container — 三层叠加的父容器
* Container
* ============================================================ */
.header-slider-container,
.header-components-container {
position: relative;
isolation: isolate; /* 创建独立堆叠上下文,内部 z-index 不外泄 */
isolation: isolate;
width: 100%;
margin-bottom: 24px;
margin-bottom: 20px;
}
/* ============================================================
* Device Visibility for Hero/Banner slides
* ============================================================ */
/* PC-only slides: hidden on mobile */
/* Device visibility for hero/banner slides */
@media (max-width: 767.98px) {
.hero-slide--pc-only,
.banner-slide--pc-only {
@@ -226,11 +213,9 @@
}
}
/* Mobile-only slides: hidden on PC */
@media (min-width: 768px) {
.hero-slide--mobile-only,
.banner-slide--mobile-only {
display: none !important;
}
}