Skip to content

Commit

Permalink
feat: recruitCard 스켈레톤 이미지 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tteokbokki-master committed Nov 11, 2024
1 parent 6f5fc0c commit 24f9876
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/pages/recruit/RecruitCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function RecruitCard({

return (
<RecruitContainer>
<CompanyImg alt="companyImg" src={imageUrl} />
{imageUrl ? <CompanyImg alt="companyImg" src={imageUrl} /> : <SkeletonImg />}
<Info_Div>
<Info_p>
<p>{koreanTitle}</p>
Expand Down Expand Up @@ -125,7 +125,7 @@ const CompanyImg = styled.img<React.ImgHTMLAttributes<HTMLImageElement>>`
border-radius: 20px;
object-fit: cover;
display: ${(props) => (props.src ? 'block' : 'none')};
@media (max-width: 768px) {
height: 300px;
}
Expand Down Expand Up @@ -189,3 +189,28 @@ const CustomBtn = styled(Button)<{ background?: string; color?: string; width?:
width: ${(props) => props.width || '160px'};
}
`;

const SkeletonImg = styled.div`
width: 100%;
height: 380px;
border-radius: 20px;
background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
background-size: 300% 100%;
animation: shimmer 5s infinite linear;
@media (max-width: 768px) {
height: 300px;
}
@media (max-width: 480px) {
height: 220px;
}
@keyframes shimmer {
0% {
background-position: -300% 0;
}
100% {
background-position: 300% 0;
}
}
`;

0 comments on commit 24f9876

Please sign in to comment.