Skip to content

Commit c789db0

Browse files
authored
Merge pull request samqin123#50 from OuOumm/main
refactor(components): 优化卡片组件并更新运行时配置
2 parents 247a156 + e567ee7 commit c789db0

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@
8080
"**/*.{json,css,scss,md,webmanifest}": [
8181
"prettier -w"
8282
]
83-
}
83+
},
84+
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
8485
}

src/app/douban/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function DoubanPageClient() {
189189
) : (
190190
<>
191191
{/* 内容网格 */}
192-
<div className='grid grid-cols-3 gap-x-2 gap-y-12 px-0 sm:px-2 sm:grid-cols-[repeat(auto-fit,minmax(160px,1fr))] sm:gap-x-8 sm:gap-y-20 sm:px-4'>
192+
<div className='grid grid-cols-3 gap-x-2 gap-y-12 px-0 sm:px-2 sm:grid-cols-[repeat(auto-fit,minmax(160px,1fr))] sm:gap-x-8 sm:gap-y-20'>
193193
{loading
194194
? // 显示骨架屏
195195
skeletonData.map((index) => (

src/components/AggregateCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ const AggregateCard: React.FC<AggregateCardProps> = ({
134134
src={first.poster}
135135
alt={first.title}
136136
fill
137-
loading='lazy'
138137
className={`object-cover transition-transform duration-500 cubic-bezier(0.4,0,0.2,1) group-hover:scale-110
139138
${
140139
isLoaded

src/components/DemoCard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const DemoCard = ({ id, title, poster, rate, type }: DemoCardProps) => {
5858

5959
return (
6060
<div
61-
className='group relative w-full rounded-lg bg-transparent flex flex-col cursor-pointer transition-all duration-300 ease-in-out'
61+
className='group relative w-full rounded-lg bg-transparen flex flex-col cursor-pointer transition-all duration-300 ease-in-out'
6262
onClick={handleClick}
6363
>
6464
{/* 海报图片区域 */}
@@ -72,7 +72,6 @@ const DemoCard = ({ id, title, poster, rate, type }: DemoCardProps) => {
7272
alt={title}
7373
fill
7474
ref={imgRef}
75-
loading='lazy'
7675
className={`object-cover transition-transform duration-500 cubic-bezier(0.4,0,0.2,1) group-hover:scale-110
7776
${
7877
isLoaded

src/components/DoubanCardSkeleton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import { ImagePlaceholder } from '@/components/ImagePlaceholder';
2+
13
const DoubanCardSkeleton = () => {
24
return (
35
<div className='w-full'>
46
<div className='group relative w-full rounded-lg bg-transparent shadow-none flex flex-col'>
5-
{/* 海报骨架 - 2:3 比例 */}
6-
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-gray-200 animate-pulse dark:bg-gray-800'>
7-
<div className='absolute inset-0 bg-gray-300 dark:bg-gray-700'></div>
8-
</div>
7+
{/* 图片占位符 - 骨架屏效果 */}
8+
<ImagePlaceholder aspectRatio='aspect-[2/3]' />
99

1010
{/* 信息层骨架 */}
1111
<div className='absolute top-[calc(100%+0.5rem)] left-0 right-0'>

src/components/VideoCard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export default function VideoCard({
158158
)}${year ? `&year=${year}` : ''}${from ? `&from=${from}` : ''}`}
159159
>
160160
<div
161-
className={`group relative w-full rounded-lg bg-transparent flex flex-col cursor-pointer transition-all duration-300 ease-in-out ${
161+
className={`group relative w-full rounded-lg bg-transparent/0 flex flex-col cursor-pointer transition-all duration-300 ease-in-out ${
162162
isDeleting ? 'opacity-0 scale-90' : ''
163163
}`}
164164
>
@@ -171,7 +171,6 @@ export default function VideoCard({
171171
src={poster}
172172
alt={title}
173173
fill
174-
loading='lazy'
175174
className={`object-cover transition-transform duration-500 cubic-bezier(0.4,0,0.2,1) group-hover:scale-110
176175
${
177176
isLoaded

0 commit comments

Comments
 (0)