Skip to content

Commit

Permalink
Add animatin
Browse files Browse the repository at this point in the history
  • Loading branch information
ertrzyiks committed Oct 15, 2023
1 parent 403d721 commit 13abc13
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
30 changes: 20 additions & 10 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,29 @@
}
}

/* body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
} */

.text-gradient {
background: #2E90DB;
background: linear-gradient(to right, #2E90DB 0%, #CF13C2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

.animation {
animation-timeline: view(block -300px 100%);
animation-name: hide;
animation-fill-mode: both;
animation-duration: 1ms; /* Firefox requires this to apply the animation */
animation-timing-function: linear;
}

@keyframes hide {
from {
opacity: 1;
transform: translateY(0);
}

to {
opacity: 0;
transform: translateY(-100px);
}
}
2 changes: 1 addition & 1 deletion src/components/recipe-list-item/recipe-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {

export function RecipeListItem({ href, title, coverImage }: Props) {
return (
<Link className='group flex flex-col w-full border h-full' href={href}>
<Link className='group flex flex-col w-full border h-full animation' href={href}>
<div className="overflow-hidden">
<Image src={coverImage} width={400} height={300} className='scale-100 group-hover:scale-105 group-focus:scale-105 group-active:scale-125 group-active:duration-75 transition-transform ease-in aspect-cover object-cover w-full' alt={`Photo of ${title}`} />
</div>
Expand Down

0 comments on commit 13abc13

Please sign in to comment.