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是视频时,只显示单个视频 +