1
1
import clsx from "clsx" ;
2
2
import React from "react" ;
3
+ import style from "./index.module.css" ;
3
4
import useDocusaurusContext from "@docusaurus/useDocusaurusContext" ;
4
5
import Layout from "@theme/Layout" ;
5
6
import Heading from "@theme/Heading" ;
6
- import styles from "./index.module.css" ;
7
- // import Features from "../components/HomePage/Features";
8
- // import Courses from "../components/HomePage/Courses";
9
- // import { featuresData, coursesData } from "../database/home";
10
7
import Head from "@docusaurus/Head" ;
11
8
import Header from "../components/HomePage/Header" ;
12
9
import Tweet from "../components/Tweet" ;
13
- import Tweets , { type TweetItem } from "../data/tweets" ;
10
+ import Tweets from "../data/tweets" ;
14
11
import { motion } from "framer-motion" ;
15
12
import ResourcesSection from "../components/HomePage/ResourcesSection" ;
16
13
import ScrollTopToButton from "../components/Buttons/bottom/ScrollTopToButton" ;
17
14
import ScrollBottomToTop from "../components/Buttons/top/ScrollBottomToTop" ;
15
+ import 'swiper/css' ;
16
+ import 'swiper/css/navigation' ;
17
+ import 'swiper/css/pagination' ;
18
+ import { Swiper , SwiperSlide } from 'swiper/react' ;
19
+ import { Navigation , Pagination , Autoplay } from 'swiper/modules' ;
18
20
19
21
function TweetsSection ( ) {
20
22
const tweetColumns = [ [ ] , [ ] , [ ] ] ;
@@ -23,7 +25,7 @@ function TweetsSection() {
23
25
) ;
24
26
25
27
return (
26
- < div className = { clsx ( styles . section , styles . sectionAlt ) } >
28
+ < div className = { clsx ( style . section , style . sectionAlt ) } >
27
29
< div className = "tweets-container" >
28
30
< motion . div
29
31
initial = { { opacity : 0 , x : - 10 } }
@@ -35,35 +37,47 @@ function TweetsSection() {
35
37
stiffness : 100 ,
36
38
delay : 0.3 ,
37
39
} }
38
- className = { styles . home__divider }
40
+ className = { style . home__divider }
39
41
>
40
42
< Heading as = "h2" className = { clsx ( "text--center" ) } >
41
43
Loved by many Users
42
44
</ Heading >
43
45
</ motion . div >
44
- < div className = { clsx ( "row" , styles . tweetsSection ) } >
45
- { tweetColumns . map ( ( tweetItems , i ) => (
46
- < motion . div
47
- initial = { { opacity : 0 , y : - 10 } }
48
- whileInView = { { opacity : 1 , y : 0 } }
49
- viewport = { { once : true } }
50
- transition = { {
51
- duration : 1 ,
52
- type : "spring" ,
53
- stiffness : 100 ,
54
- delay : 0.3 ,
55
- } }
56
- className = "col col--4"
57
- key = { i }
58
- >
59
- { tweetItems . map ( ( tweet ) => (
60
- < div className = { styles . tweetContainer } key = { tweet . url } >
61
- < Tweet { ...tweet } key = { tweet . url } />
46
+ < Swiper
47
+ slidesPerView = { 1 }
48
+ spaceBetween = { 30 }
49
+ autoplay = { { delay : 2000 } }
50
+ loop = { true }
51
+ pagination = { { clickable : true } }
52
+ breakpoints = { {
53
+ 640 : {
54
+ slidesPerView : 2 ,
55
+ spaceBetween : 20 ,
56
+ } ,
57
+ 768 : {
58
+ slidesPerView : 3 ,
59
+ spaceBetween : 40 ,
60
+ } ,
61
+ 1024 : {
62
+ slidesPerView : 3 ,
63
+ spaceBetween : 50 ,
64
+ } ,
65
+ } }
66
+ modules = { [ Navigation , Pagination , Autoplay ] }
67
+ className = { style . tweetsSwiper }
68
+ >
69
+ { tweetColumns . map ( ( tweetItems , columnIndex ) =>
70
+ tweetItems . map ( ( tweet , tweetIndex ) => (
71
+ < SwiperSlide key = { `${ columnIndex } -${ tweetIndex } ` } >
72
+ < div className = { clsx ( style . tweetContainer ) } >
73
+ < div className = { clsx ( style . tweetContent ) } >
74
+ < Tweet { ...tweet } />
75
+ </ div >
62
76
</ div >
63
- ) ) }
64
- </ motion . div >
65
- ) ) }
66
- </ div >
77
+ </ SwiperSlide >
78
+ ) )
79
+ ) }
80
+ </ Swiper >
67
81
</ div >
68
82
</ div >
69
83
) ;
@@ -81,7 +95,7 @@ export default function Home() {
81
95
< script
82
96
async
83
97
src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5832817025080991"
84
- crossorigin = "anonymous"
98
+ crossOrigin = "anonymous"
85
99
> </ script >
86
100
< script
87
101
async
@@ -90,70 +104,12 @@ export default function Home() {
90
104
> </ script >
91
105
< meta name = "google-adsense-account" content = "ca-pub-5832817025080991" />
92
106
</ Head >
93
- < main className = { styles . main__home } >
94
- < div className = { styles . home__header } >
107
+ < main className = { style . main__home } >
108
+ < div className = { style . home__header } >
95
109
< Header />
96
110
</ div >
97
111
98
- < hr className = { styles . home__hr } />
99
-
100
- { /* <motion.div
101
- initial={{ opacity: 0, x: -10 }}
102
- whileInView={{ opacity: 1, x: 0 }}
103
- viewport={{ once: true }}
104
- transition={{
105
- duration: 1,
106
- type: "spring",
107
- stiffness: 100,
108
- delay: 0.3,
109
- }}
110
- className={styles.home__divider}
111
- >
112
- <Heading as="h2">Courses Available</Heading>
113
- </motion.div>
114
-
115
- <motion.div
116
- initial={{ opacity: 0, y: -10 }}
117
- whileInView={{ opacity: 1, y: 0 }}
118
- viewport={{ once: true }}
119
- transition={{
120
- duration: 1,
121
- type: "spring",
122
- stiffness: 100,
123
- delay: 0.3,
124
- }}
125
- >
126
- <Courses courses={coursesData} />
127
- </motion.div>
128
-
129
- <motion.div
130
- initial={{ opacity: 0, x: -10 }}
131
- whileInView={{ opacity: 1, x: 0 }}
132
- viewport={{ once: true }}
133
- transition={{
134
- duration: 1,
135
- type: "spring",
136
- stiffness: 100,
137
- delay: 0.3,
138
- }}
139
- className={styles.home__divider}
140
- >
141
- <Heading as="h2">Features of {siteConfig.title}</Heading>
142
- </motion.div>
143
-
144
- <motion.div
145
- initial={{ opacity: 0, y: -10 }}
146
- whileInView={{ opacity: 1, y: 0 }}
147
- viewport={{ once: true }}
148
- transition={{
149
- duration: 1,
150
- type: "spring",
151
- stiffness: 100,
152
- delay: 0.3,
153
- }}
154
- >
155
- <Features features={featuresData} />
156
- </motion.div> */ }
112
+ < hr className = { style . home__hr } />
157
113
158
114
< div >
159
115
< ResourcesSection />
@@ -162,7 +118,7 @@ export default function Home() {
162
118
< TweetsSection />
163
119
164
120
< ScrollTopToButton />
165
- < ScrollBottomToTop />
121
+ < ScrollBottomToTop />
166
122
</ main >
167
123
</ Layout >
168
124
) ;
0 commit comments