File tree Expand file tree Collapse file tree 7 files changed +251
-131
lines changed Expand file tree Collapse file tree 7 files changed +251
-131
lines changed Original file line number Diff line number Diff line change 1515 "react-router" : " ^6.17.0" ,
1616 "react-router-dom" : " ^6.17.0" ,
1717 "react-scripts" : " 5.0.1" ,
18+ "react-slick" : " ^0.30.2" ,
19+ "slick-carousel" : " ^1.8.1" ,
1820 "web-vitals" : " ^2.1.4"
1921 },
2022 "scripts" : {
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ import {Games} from "./pages/Games";
55import { Activities } from "./pages/Activities" ;
66import { activities , games } from "./data/content" ;
77import { Navbar } from './components/common/Navbar' ;
8+ import "slick-carousel/slick/slick.css" ;
9+ import "slick-carousel/slick/slick-theme.css" ;
10+
811
912function App ( ) {
1013 return (
Original file line number Diff line number Diff line change @@ -10,9 +10,14 @@ const CardItem = (props) => {
1010 height : '100%' ,
1111 } ;
1212
13+ const cardStyle = {
14+ width : '500px' ,
15+ margin : '20px'
16+ } ;
17+
1318 return (
1419 < div className = "col-md-4 col-sm-6 mb-4" >
15- < div class = "card container-fluid" >
20+ < div class = "card container-fluid" style = { cardStyle } >
1621 < div className = "card-image" >
1722 < img
1823 className = "card-img-top"
Original file line number Diff line number Diff line change 11import React from 'react'
22import CardItem from '../../components/Home/CardItem'
3- // import "../../styles/pages/Home/Cards.css"
3+ import Slider from 'react-slick' ;
4+ import "../../styles/pages/Home/Cards.css"
45import Wordle from "../../assets/games/Wordle/wordlejpg.png"
56import flagGame from "../../assets/games/flag guess/flagger.png"
67import magicSquare from "../../assets/numberblocks.png"
78
89const Cards = ( ) => {
9- return (
10+ // Slick settings for the carousel
11+ const settings = {
12+ dots : true ,
13+ infinite : true ,
14+ speed : 500 ,
15+ slidesToShow : 3 , // Number of cards to show at once
16+ slidesToScroll : 1 ,
17+ responsive : [
18+ {
19+ breakpoint : 1024 ,
20+ settings : {
21+ slidesToShow : 2 ,
22+ slidesToScroll : 1 ,
23+ infinite : true ,
24+ dots : true
25+ }
26+ } ,
27+ {
28+ breakpoint : 600 ,
29+ settings : {
30+ slidesToShow : 1 ,
31+ slidesToScroll : 1 ,
32+ }
33+ }
34+ ]
35+ } ;
1036
37+ return (
1138 < div className = 'container' >
12- < div className = 'row justify-content-center' >
13-
39+ < Slider { ...settings } >
1440 < CardItem
1541 src = { Wordle }
1642 text = "Wordle Game"
@@ -59,8 +85,7 @@ const Cards = () => {
5985 label = "Search Words"
6086 path = '/activities/search-any-word'
6187 title = 'Search Words' />
62-
63- </ div >
88+ </ Slider >
6489 </ div >
6590 )
6691}
Original file line number Diff line number Diff line change 11.card-image {
2- width : 100 % ;
2+ width : 266 px ;
33 height : 35vh ;
44 display : flex;
55 justify-content : center;
66 overflow : hidden;
77 /* padding: 0 !important; */
88}
99.card-body {
10- width : 100 % ;
10+ width : 266 px ;
1111 height : 22vh ;
1212 display : flex;
1313 flex-direction : column;
You can’t perform that action at this time.
0 commit comments