fix(single): align slide and video cover heights with image cover
The image-mode cover reserves +50px for the title/breadcrumb overlay (calc(scale% + 50px)), but the slide cover wrapper was given a bare inline padding-bottom by aksrt_render_slider, permanently defeating the .cover-slide rule, and the video cover used a bare video_scale%. - aksrt_render_slider: add scale_extra so scale mode emits calc(ratio% + extra); the single cover passes 50px so all three modes share one height formula - drop the unreachable static slide fallback and function_exists guard (the helper is unconditionally loaded by inc/bootstrap.php), the always-true cover_url/ep_count conditions, and the dead --scale-ratio and inner swiper padding emitted in scale mode - remove the dead cover CSS cluster with no producer: .single-cover-slide (main.css/main.min.css/cover.css), .single-cover-slider family (components/base.css), .single-cover-slide-wrap and .single-cover__* helpers (cover.css), and initSlideCovers in misc.js - rebuild public bundles via tools/build-public-assets.mjs - add single-cover-height-contract test covering the shared formula and the dead-code removals
This commit is contained in:
1 parent
05a6b6fc54
commit
4f2d17f6ee
12 files changed
+133
-418
No files matched your search
@@ -1,108 +1,3 @@
|
||||
/* ============================================================
|
||||
* 7. 文章封面轮播
|
||||
* ============================================================ */
|
||||
.single-cover-slider {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: var(--radius-lg, 8px);
|
||||
}
|
||||
|
||||
.single-cover-slider .swiper-slide {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.single-cover-slider__img {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.single-cover-slider__overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6) 100%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.single-cover-slider__content {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 24px;
|
||||
color: #fff;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.single-cover-slider__title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 1px 3px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.single-cover-slider__meta {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
font-size: 13px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.single-cover-slider__pagination {
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
right: 16px;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.single-cover-slider__pagination .swiper-pagination-bullet {
|
||||
background: rgba(255,255,255,0.6);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.single-cover-slider__pagination .swiper-pagination-bullet-active {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.single-cover-slider__prev,
|
||||
.single-cover-slider__next {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 3;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: rgba(0,0,0,0.3);
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.single-cover-slider__prev:hover,
|
||||
.single-cover-slider__next:hover {
|
||||
background: rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.single-cover-slider__prev { left: 12px; }
|
||||
.single-cover-slider__next { right: 12px; }
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.single-cover-slider__img {
|
||||
height: 240px;
|
||||
}
|
||||
.single-cover-slider__title {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* 8. 打赏按钮
|
||||
* ============================================================ */
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
padding-bottom: calc(var(--single-cover-scale, 35%) + 50px);
|
||||
}
|
||||
|
||||
.single-cover-slide {
|
||||
padding-bottom: calc(var(--scale-height, var(--single-cover-scale, 35%)) + 50px);
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
}
|
||||
|
||||
.single-cover > .fit-cover,
|
||||
.single-cover > img {
|
||||
position: absolute;
|
||||
@@ -46,118 +41,15 @@
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Legacy overlay helpers (kept for non-legacy markup) */
|
||||
.single-cover__overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(0, 0, 0, 0) 30%,
|
||||
rgba(0, 0, 0, 0.6) 100%
|
||||
);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.single-cover__content {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 24px;
|
||||
color: #fff;
|
||||
border-radius: 0 0 var(--main-radius, var(--radius, 8px)) var(--main-radius, var(--radius, 8px));
|
||||
}
|
||||
|
||||
.single-cover__title,
|
||||
.single-cover__content .article-title {
|
||||
font-size: clamp(1.125rem, 2.5vw, 1.5rem);
|
||||
font-weight: 700;
|
||||
margin: 0 0 6px;
|
||||
line-height: 1.35;
|
||||
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.single-cover__meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
font-size: 12px;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.single-cover__meta span {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
/* ===== Video Cover ===== */
|
||||
.single-cover--video {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.single-cover--video .single-cover__video {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* ===== Slide Cover ===== */
|
||||
.single-cover--slide {
|
||||
background: var(--color-bg-2, #f5f5f5);
|
||||
}
|
||||
|
||||
.single-cover__slides {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.single-cover__slide {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
opacity: 0;
|
||||
transition: opacity 0.6s ease;
|
||||
}
|
||||
|
||||
.single-cover__slide.is-active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.single-cover__slide img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.single-cover__dots {
|
||||
position: absolute;
|
||||
bottom: 14px;
|
||||
right: 18px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.single-cover__dot {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.45);
|
||||
border: 1px solid rgba(255, 255, 255, 0.32);
|
||||
transition: background 0.3s ease, transform 0.3s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.single-cover__dot.is-active {
|
||||
background: #fff;
|
||||
transform: scale(1.12);
|
||||
}
|
||||
|
||||
/* ===== 面包屑 ===== */
|
||||
.post-breadcrumbs {
|
||||
margin-bottom: 12px;
|
||||
@@ -240,16 +132,6 @@
|
||||
margin-right: 3px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
.single-cover-slide-wrap {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: var(--main-radius, var(--radius, 8px));
|
||||
}
|
||||
.single-cover-slide-wrap .abs-center.left-bottom {
|
||||
z-index: 2;
|
||||
padding: 15px 15px 10px 15px;
|
||||
color: #fff;
|
||||
}
|
||||
.article-avatar name.flex {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in new issue
Block a user