diff --git a/src/components/Home/CardItem.js b/src/components/Home/CardItem.js index 4b0ec25..eb7a322 100644 --- a/src/components/Home/CardItem.js +++ b/src/components/Home/CardItem.js @@ -6,8 +6,8 @@ const CardItem = (props) => { const imageStyle = { objectFit: 'cover', - width: '100%', - height: '100%', + width: '90%', + height: '90%', }; const cardStyle = { diff --git a/src/pages/home/Cards.js b/src/pages/home/Cards.js index a021968..e452b46 100644 --- a/src/pages/home/Cards.js +++ b/src/pages/home/Cards.js @@ -1,93 +1,65 @@ -import React from 'react' -import CardItem from '../../components/Home/CardItem' -import Slider from 'react-slick'; -import "../../styles/pages/Home/Cards.css" -import Wordle from "../../assets/games/Wordle/wordlejpg.png" -import flagGame from "../../assets/games/flag guess/flagger.png" -import magicSquare from "../../assets/numberblocks.png" +import React from "react"; +import Slider from "react-slick"; +import "../../styles/pages/Home/Cards.css"; + +// ✅ this is your central data file +import { activities, games } from "../../data/content"; + +// ✅ your existing card +import CardItem from "../../components/Home/CardItem"; const Cards = () => { - // Slick settings for the carousel - const settings = { - dots: true, - infinite: true, - speed: 500, - slidesToShow: 3, // Number of cards to show at once - slidesToScroll: 1, - responsive: [ - { - breakpoint: 1024, - settings: { - slidesToShow: 2, - slidesToScroll: 1, - infinite: true, - dots: true - } - }, - { - breakpoint: 600, - settings: { - slidesToShow: 1, - slidesToScroll: 1, - } - } - ] - }; + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 3, + slidesToScroll: 1, + responsive: [ + { + breakpoint: 1024, + settings: { slidesToShow: 2, slidesToScroll: 1, dots: true }, + }, + { + breakpoint: 600, + settings: { slidesToShow: 1, slidesToScroll: 1 }, + }, + ], + }; + + // ✅ combine all games + activities from your data file + const allItems = [ + ...games.map((g) => ({ + src: g.icon, + text: g.description, + title: g.title, + path: `/games/${g.urlTerm}`, + })), + ...activities.map((a) => ({ + src: a.icon, + text: a.description, + title: a.title, + path: `/activities/${a.urlTerm}`, + })), + ]; - return ( -
- - - - - - - - - - -
- ) -} + return ( +
+ + {allItems.map((item) => ( +
+ +
+ ))} +
+
+ ); +}; -export default Cards \ No newline at end of file +export default Cards; diff --git a/src/styles/pages/Home/CardItem.css b/src/styles/pages/Home/CardItem.css index 029e8c8..eedceec 100644 --- a/src/styles/pages/Home/CardItem.css +++ b/src/styles/pages/Home/CardItem.css @@ -1,14 +1,14 @@ .card-image{ width: 266px; - height: 35vh; + height: 36vh; display: flex; justify-content: center; overflow: hidden; /* padding: 0 !important; */ } .card-body{ - width: 266px; - height: 22vh; + width: 290px; + height: 28vh; display: flex; flex-direction: column; justify-content: center; diff --git a/src/styles/pages/Home/Cards.css b/src/styles/pages/Home/Cards.css index 731c689..f2d0fcb 100644 --- a/src/styles/pages/Home/Cards.css +++ b/src/styles/pages/Home/Cards.css @@ -78,10 +78,10 @@ h1 { bottom: 0; left: 0; display: block; - width: 100%; - max-width: 100%; - height: 100%; - max-height: 100%; + width: 80%; + max-width: 50%; + height: 80%; + max-height: 50%; object-fit: cover; transition: all 0.2s linear; }