-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.js
260 lines (239 loc) · 9.07 KB
/
page.js
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
"use client";
import { MoveUpRight } from "lucide-react";
import { easeIn, motion, useInView } from "framer-motion";
import Tile from "@/components/Tile";
import { useScramble } from "use-scramble";
import { useEffect, useRef, useState } from "react";
import { MdArrowOutward } from "react-icons/md";
import { clubs } from "@/data/clubData"; // Import the club data
import HeroVideoDialog from "@/components/magicui/hero-video-dialog";
export default function Home() {
const { ref } = useScramble({
// text: 'Computer & Networking Council',
text: ""Code is like humor. When you have to explain it, it's bad."",
speed: 0.4,
tick: 2,
step: 2,
scramble: 10,
seed: 5,
});
const animateref = useRef(null);
const animateInView = useInView(ref, { once: true });
return (
<div className="z-[2] relative">
<Gradients />
<BackgroundGrid />
<div className="absolute overflow-hidden min-h-screen lg:p-24 top-0 left-0 w-full ">
<div className="flex min-h-[80vh] pointer-events-none flex-col items-center justify-center">
<Wrapper>
<motion.p
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6 }}
className="text-white bg-white/20 px-3 py-1 drop-shadow-lg font-thin text-xs md:text-sm lg:text-md shadow-lg rounded-full backdrop-blur-lg font-bold"
>
IISER Bhopal
</motion.p>
</Wrapper>
<Wrapper>
<motion.h1
initial={{ opacity: 0, y: 100 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.4, delay: 0.2 }}
className="text-5xl lg:text-8xl text-center font-bold bg-gradient-to-tr from-[#2F80ED] to-[#2D9EE0] text-transparent bg-clip-text drop-shadow-lg lg:p-4"
>
Computer and <br />
Networking Council
</motion.h1>
</Wrapper>
<Wrapper>
<motion.p
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 0.4 }}
className="text-xs text-center mt-6 lg:text-lg bg-gradient-to-t italic from-white via-white/90 to-white/60 text-transparent bg-clip-text"
ref={ref}
/>
</Wrapper>
</div>
<Ethos />
<VideoPlayer />
<div
id="clubs"
className="w-full pointer-events-auto relative p-6 lg:p-12 mt-24 ">
<h1 className="text-5xl md:text-6xl font-semibold text-[#2F80ED] flex items-center gap-4">
Clubs Under Us
</h1>
{clubs.map((club, index) => (
<Clubs
key={index}
clubName={club.clubName}
clubMotto={club.clubMotto}
clubCoordinators={club.clubCoordinators}
clubAbstract={club.clubAbstract}
clubLink={club.clubLink}
clubLogo={club.clubLogo}
/>
))}
</div>
</div>
</div>
);
}
// from-[#44A6CA]
export const Wrapper = ({ children }) => {
return <div className="overflow-hidden">{children}</div>;
};
export const BackgroundGrid = () => {
const [tiles, setTiles] = useState([]);
useEffect(() => {
const generateRandomTiles = () => {
return Array.from({ length: 30 * 15 }, () => Math.random() < 0.06); // 6% chance to be glitchy
};
setTiles(generateRandomTiles());
const intervalId = setInterval(() => {
setTiles(generateRandomTiles());
}, 1500);
return () => clearInterval(intervalId);
}, []);
return (
<section className="w-full grid grid-cols-20 z-[0] min-h-screen ">
{tiles.map((isGlitchy, index) => (
<Tile key={index} isGlitchy={isGlitchy} />
))}
</section>
);
};
export const Gradients = () => {
return (
<div>
<div className="pointer-events-none top-24 z-[0] bg-blue-700 w-[500px] h-[400px] blur-[20rem] absolute" />
<div className="bg-gradient-to-br from-[#2f80ed] z-[0] pointer-events-none to-[#2f80ed] right-0 -top-24 w-[500px] h-[500px] blur-[1400px] absolute" />
<div className="absolute inset-x-0 m-auto h-80 max-w-lg bg-gradient-to-tr from-blue-400 via-blue-900 to-cyan-600 z-[0] blur-[118px]" />
{/* <div className="bg-gradient-to-r from-[#091Eee] z-[0] pointer-events-none to-[#2D9EE0] right-24 bottom-24 w-[500px] h-[500px] blur-[1200px] absolute" /> */}
</div>
);
};
const Ethos = () => {
const ref = useRef(null);
const isInView = useInView(ref, { once: true });
return (
<motion.div
ref={ref}
initial={{ opacity: 0.4 }}
animate={{ opacity: isInView ? 1 : 0, y: isInView ? 0 : 100 }}
transition={{ duration: 0.5 }}
className="px-6 z-[10] lg:px-12 grid lg:grid-cols-2 grid-cols-1 mt-48 w-full justify-between "
>
<h1 className="text-4xl mb-6 text-[#2F80ED]">Our Ethos</h1>
<p className="col-span-1 text-neutral-300">
"At CNC we are committed to building a professional team to work in
favour of IISERB's interests. We thrive to make IISERB self
dependent and work for its betterment. We are the backbone of majority
of councils/clubs at IISERB. Our core members ensure that events taking
place on campus are conducted smoothly and provide the neceesary
resources to designated teams for proper organisation of any
event."
</p>
</motion.div>
);
};
const Overlay = () => {
return (
<div className="absolute pointer-events-none z-[10] inset-0 top-0 left-0 flex items-center justify-center bg-black/40 w-full min-h-screen [mask-image:radial-gradient(ellipse_at_center,transparent_50%,black)]"></div>
);
};
const Clubs = ({
clubName,
clubMotto,
clubCoordinators,
clubAbstract,
clubLink,
clubLogo,
}) => {
const ref = useRef(null);
const isInView = useInView(ref, { once: true });
return (
<motion.div
ref={ref}
initial={{ opacity: 0.4 }}
animate={{ opacity: isInView ? 1 : 0, x: isInView ? 0 : 100 }}
transition={{ duration: 0.5 }}
className="py-12 z-[999] grid mt-12 pointer-events-auto grid-cols-1 md:grid-cols-3 justify-between"
>
{/* Club Logo */}
<img
src={clubLogo}
alt={`${clubName} Logo`}
className=" mx-auto h-[200px] pointer-events-auto object-cover my-auto"
/>
<div className=" md:px-12 col-span-2">
<div className="w-fit hoverText overflow-hidden h-[45px] md:h-[60px] ">
<h1
className={`text-3xl md:text-5xl font-semibold bg-gradient-to-t from-blue-100 py-1 to-white text-transparent bg-clip-text w-fit `}
style={{ "--clubName": `'${clubMotto}'` }}
>
{clubName}
</h1>
</div>
<h3 className="text-sm md:text-lg text-neutral-300 flex gap-2 items-center ">
<p className="text-blue-400 ">Coordinators:</p> {clubCoordinators}
</h3>
{/* Club Abstract */}
<p className="text-xs md:text-lg mt-2 md:mt-6 font-thin text-neutral-400">
{clubAbstract}
</p>
{/* Know More Button */}
<a
href={`${clubLink}`}
target="_blank"
rel="noopener noreferrer"
>
<motion.button
whileTap={{ scale: 0.9 }}
whileHover={{ scale: 1.1 }}
className="pointer-events-auto group bg-gradient-to-br from-blue-500 to-blue-600 px-4 py-2 active:bg-red-500 z-[99] text-white items-center overflow-hidden font-medium gap-2 rounded-xl flex mt-8"
>
Know More
<MdArrowOutward
className="group-hover:translate-x-6 group-hover:-translate-y-6 transition duration-500"
size={20}
/>
</motion.button>
</a>
</div>
</motion.div>
);
};
const VideoPlayer = () => {
const ref = useRef(null);
const isInView = useInView(ref, { once: true });
return (
<motion.div
ref={ref}
initial={{ opacity: 0.4 }}
animate={{
opacity: isInView ? 1 : 0,
y: isInView ? 0 : 100,
scale: isInView ? 1 : 0.7,
}}
transition={{ duration: 0.5 }}
className="w-full flex relative items-center flex-col justify-center p-12"
>
<div className="absolute h-[200px] w-[200px] bg-blue-500 top-24 blur-[200px] rounded-full" />
<p className=" mb-2 mt-24 text-[9px] md:text-sm text-center lg:text-md text-blue-400 bg-white/20 rounded-full p-1 md:p-2 px-4 backdrop-blur-[10px] ">
We Organize Tomorrow’s Tech Innovations Today
</p>
<h1 className="text-5xl lg:text-7xl text-center font-semibold mb-12 bg-gradient-to-t from-blue-200 to-white text-transparent bg-clip-text p-3">
Armageddon Techfest
</h1>
<HeroVideoDialog
className="border-none"
animationStyle="from-center"
videoSrc="https://www.youtube.com/embed/y4kRHvOr5wU?si=QYeWChb7VOO42Lyv"
thumbnailSrc="https://i3.ytimg.com/vi/y4kRHvOr5wU/maxresdefault.jpg"
thumbnailAlt="Arma Trailer"
/>
</motion.div>
);
};