Skip to content

Commit

Permalink
new font + new component for resource card
Browse files Browse the repository at this point in the history
  • Loading branch information
devvsakib committed Jul 30, 2024
1 parent 2492c6a commit 088a352
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/Layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ThemeProvider } from '../../context/ThemeContext';
*/
const Layout = ({ stars, children }) => {
return (
<div className='flex flex-col justify-between min-h-screen'>
<div className='flex flex-col justify-between min-h-screen font-[poppins]'>
<ThemeProvider>
<Header
notice={"Under Construction"}
Expand Down
27 changes: 27 additions & 0 deletions src/components/Resources/ResourceCard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Link } from "react-router-dom";

const ResourceCard = ({idx, resource}) => {
return <div key={idx} className="dark:bg-black rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition-shadow duration-300">
{resource.image && (
<img
src={resource.image}
alt={resource.title}
className="w-full h-40 object-cover object-center"
/>
)}
<div className="p-6">
<h3 className="text-lg font-semibold mb-2">{resource.title}</h3>
<p className="text-gray-700 mb-4">{resource.description}</p>
<Link
to={resource.link}
target="_blank"
rel="noopener noreferrer"
className="text-blue-600 hover:underline"
>
Learn More
</Link>
</div>
</div>;
};

export default ResourceCard;
17 changes: 5 additions & 12 deletions src/components/Resources/ResourceSection.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { Link } from "react-router-dom";
import ResourceCard from "./ResourceCard";

const ResourceSection = ({ title, resources }) => (
<section className="my-10">
<h2 className="text-2xl font-bold mb-4">{title}</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<section className="my-12">
<h2 className="text-3xl font-bold mb-10 text-center">{title}</h2>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-8">
{resources.map((resource, index) => (
<div key={index} className="p-4 bg-black rounded-lg shadow-md flex flex-col items-center overflow-hidden">
{resource.image && <img src={resource.image} alt={resource.title} className="mb-4 object-cover object-center w-full h-36 rounded-t-lg" />}
<h3 className="text-xl font-semibold mb-2">{resource.title}</h3>
<p className="mb-4">{resource.description}</p>
<Link to={resource.link} target="_blank" rel="noopener noreferrer" className="text-blue-500 underline">
Learn More
</Link>
</div>
<ResourceCard idx={index} resource={resource} />
))}
</div>
</section>
Expand Down

0 comments on commit 088a352

Please sign in to comment.