From 8326d4c6f3e78c74ed2d644b9e83da9324c78275 Mon Sep 17 00:00:00 2001 From: imeepos Date: Thu, 4 Sep 2025 21:44:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TemplateCard/index.css | 20 +++++++++++++++----- src/components/TemplateCard/index.tsx | 6 +++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/components/TemplateCard/index.css b/src/components/TemplateCard/index.css index 9ff53e5..86292cc 100644 --- a/src/components/TemplateCard/index.css +++ b/src/components/TemplateCard/index.css @@ -171,11 +171,21 @@ backface-visibility: hidden; } -/* 确保video的poster填满整个容器 */ -.single-video[poster] { - background-size: cover !important; - background-position: center !important; - background-repeat: no-repeat !important; +/* 自定义视频封面 */ +.video-poster { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + object-fit: cover; + border-radius: 32rpx; +} + +.single-video { + position: relative; + z-index: 2; } /* 视频样式 */ diff --git a/src/components/TemplateCard/index.tsx b/src/components/TemplateCard/index.tsx index 68ef425..47aad0f 100644 --- a/src/components/TemplateCard/index.tsx +++ b/src/components/TemplateCard/index.tsx @@ -83,10 +83,14 @@ export default function TemplateCard({ template, onClick }: TemplateCardProps) { {isOutputVideo ? ( // 当output是视频时,只显示单个视频 +