Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hover effect in Post cards #51

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Link } from "react-router-dom";

const Home = () => {
function Home() {
return (
<div className="max-w-screen-xl mx-auto px-4 py-8 text-white">
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 items-center">
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 items-center justify-center">
<div>
<h1 className="text-6xl font-bold mb-4">Welcome to Style Share</h1>
<p className="text-xl mb-6">
Expand All @@ -14,12 +14,13 @@ const Home = () => {
<Link to="/app/posts">Explore</Link>
</button>
</div>
{/* <div className="h-58 w-45 bg-red"></div> */}
<div className="hidden md:block">
{/* <img src={""} alt="Code" className="rounded-lg shadow-xl" /> */}
<img src={"https://img.freepik.com/free-vector/hand-drawn-web-developers_23-2148819604.jpg?w=996&t=st=1717153877~exp=1717154477~hmac=e1058df089e7d3f064f8e2a261e53f09f5aac845bf99095fcd7bf80767d31fa1"} alt="Code" className="rounded-lg shadow-lg shadow-blue-500/50 w-144" />
</div>
</div>
</div>
);
};
}

export default Home;
2 changes: 1 addition & 1 deletion frontend/src/pages/Posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const Posts = () => {
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 w-full">
{filteredPosts.map((post) => (
<div key={post.id} className="bg-gray-800 border border-gray-600 p-4 rounded">
<div key={post.id} className="bg-gray-800 border border-gray-600 p-4 rounded hover:border-blue-500 hover:-translate-y-2 transition ease-in-out">
<h2 className="text-lg font-semibold mb-2 text-white">{post.title}</h2>
<p className="text-gray-400 mb-2">{post.description.length > 100 ? `${post.description.slice(0, 100)}...` : post.description}</p>
<p className="text-gray-500">By: {post.author.username}</p>
Expand Down
Loading