-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSolutions.tsx
187 lines (175 loc) · 5.37 KB
/
Solutions.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
"use client";
import {
ArrowBackIos,
ArrowForwardIos,
NavigateNext,
} from "@mui/icons-material";
import "swiper/css";
import "swiper/css/pagination";
import "swiper/css/free-mode";
import { useMediaQuery } from "@mui/material";
import { styles } from "../style";
import { Button } from "@material-tailwind/react";
import { motion, useInView, useAnimation } from "framer-motion";
import { useEffect, useRef } from "react";
import StarCards from "../components/StarCards";
import { features } from "../constants";
const Solutions = () => {
const smallScreenSize = useMediaQuery("(min-width:1260px)");
const headerScrollRef = useRef(null);
const cardsSwiperScrollRef = useRef(null);
const bottomScrollRef = useRef(null);
const isHeaderInView = useInView(headerScrollRef);
const isCardsSwiperInView = useInView(cardsSwiperScrollRef);
const isBottomInView = useInView(bottomScrollRef);
const mainControls = useAnimation();
const secondaryControls = useAnimation();
const tertiaryControls = useAnimation();
useEffect(() => {
isHeaderInView
? mainControls.start("visible")
: mainControls.start("hidden");
isCardsSwiperInView
? secondaryControls.start("visible")
: secondaryControls.start("hidden");
isBottomInView
? tertiaryControls.start("visible")
: tertiaryControls.start("hidden");
}, [
isHeaderInView,
isCardsSwiperInView,
isBottomInView,
mainControls,
secondaryControls,
tertiaryControls,
]);
return (
<section
className={`${styles.paddingX} px-4 py-16 mx-auto sm:max-w-xl md:max-w-full lg:w-full md:px-24 lg:px-8 lg:py-20 space-y-16 bg-black`}
>
<motion.div
ref={headerScrollRef}
viewport={{ root: headerScrollRef }}
variants={{
hidden: {
opacity: 0,
y: 75,
transition: {
type: "spring",
duration: 1.25,
},
},
visible: {
opacity: 1,
y: 0,
transition: {
type: "spring",
duration: 1.25,
},
},
}}
initial="hidden"
animate={mainControls}
className="flex flex-wrap items-center justify-between"
>
<div className="w-full py-20 md:mx-auto sm:mx-auto max-w-4xl">
<h2 className={`${styles.heroHeadText} white-text-grad text-center `}>
We have a solution for it
</h2>
<p
className={`${styles.sectionSubText} text-center text-xl leading-7 text-[#6e6e73]`}
>
With full integrated Next.js and Gatby.js truly anyone can find a
solutions by using ReacType.
</p>
</div>
</motion.div>
<div
ref={cardsSwiperScrollRef}
className="flex items-center justify-center flex-col h-[600px] bg-black [mask-image:linear-gradient(to_right,transparent,white_20%,white_80%,transparent)]"
>
<motion.div
viewport={{ root: cardsSwiperScrollRef }}
variants={{
hidden: {
opacity: 0,
y: 75,
transition: {
type: "spring",
duration: 4.75,
},
},
visible: {
opacity: 1,
y: 0,
transition: {
type: "spring",
duration: 1.75,
},
},
}}
initial="hidden"
animate={secondaryControls}
className="swiper-section-container"
>
<h1>
<div className="flex justify-center">
<div className="grid items-center justift-center max-w-7xl lg:grid-cols-3 sm:grid-cols-1 m-auto">
{features.map((data, index) => (
<StarCards
key={index}
header={data.header}
content={data.content}
/>
))}
</div>
</div>
</h1>
</motion.div>
</div>
<div ref={bottomScrollRef}>
<motion.div
viewport={{ root: bottomScrollRef }}
variants={{
hidden: {
opacity: 0,
y: 75,
transition: {
type: "spring",
duration: 1.75,
},
},
visible: {
opacity: 1,
y: 0,
transition: {
type: "spring",
duration: 1.75,
},
},
}}
initial="hidden"
animate={tertiaryControls}
>
<div className="flex flex-wrap items-center justify-between">
<div className="w-full lg:w-2/5 py-20 md:mx-auto sm:mx-auto max-w-3xl">
<h2 className="lg:text-[44px] tracking-tight text-[#86868b] sm:text-6xl">
Take a closer look.
</h2>
</div>
<div className="mr-auto">
<a
href="http://reactype.us-east-1.elasticbeanstalk.com/#/login"
className="text-[#2997ff] text-[19px] hover:underline"
>
Try Here{" "}
<NavigateNext sx={{ color: "#2997ff", fontSize: "25px" }} />
</a>
</div>
</div>
</motion.div>
</div>
</section>
);
};
export default Solutions;