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:
@@ -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