Skip to content

Commit 8c54985

Browse files
Merge pull request #113 from karannfr/prod
added faq / placeholder for prod
2 parents e8f3d0d + 193cf6d commit 8c54985

6 files changed

Lines changed: 144 additions & 14 deletions

File tree

src/app/landing/landing-mobile.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import React, { useState } from 'react';
44
import Image from 'next/image';
55
import Footer from '@/components/ui/Footer';
6+
import Accordion from '@/components/ui/Accordion';
7+
68
import { ZButton } from '@/components/ui/Buttons';
79
import { useRouter } from "next/navigation";
810
import { signIn, useSession } from 'next-auth/react';
@@ -64,15 +66,22 @@ export default function View() {
6466
Use PC or Tablet For All Features
6567
</div>
6668

67-
<ZButton
69+
<div className="text-lg sm:text-xl font-poppins font-semibold text-black mb-6">
70+
We're almost ready!
71+
<br />
72+
The website will be up as soon as the coming semester’s faculty list is available.
73+
</div>
74+
{/* <ZButton
6875
type="regular"
6976
text="Saved Timetables"
7077
color="green"
7178
onClick={loggedin ? () => router.push("/saved") : () => setShowLoginPopupSaved(true)}
72-
/>
79+
/> */}
7380
</div>
7481

7582
<div className="h-6" />
83+
84+
<Accordion />
7685

7786
<Footer type="mobile" />
7887
</div>

src/app/landing/landing.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Image from "next/image";
66
import Hero from "@/components/ui/Hero";
77
import Navbar from "@/components/ui/Navbar";
88
import Footer from "@/components/ui/Footer";
9+
import Accordion from "@/components/ui/Accordion";
910

1011
import FacultySelector from "@/components/cards/FacultySelector";
1112
import CourseCard from "@/components/cards/CourseCard";
@@ -105,12 +106,11 @@ export default function View() {
105106
unselectable="on"
106107
/>
107108
</div>
109+
<Navbar page="placeholder" />
108110

109-
<Navbar page="landing" />
111+
<Hero page="placeholder"/>
110112

111-
<Hero />
112-
113-
<div className="w-4xl mx-4 pt-12" id="start">
113+
{/* <div className="w-4xl mx-4 pt-12" id="start">
114114
<FacultySelector onConfirm={facultySelectorOnConfirm} />
115115
</div>
116116
@@ -141,7 +141,9 @@ export default function View() {
141141
draggable={false}
142142
unselectable="on"
143143
/>
144-
</div>
144+
</div> */}
145+
146+
<Accordion />
145147

146148
<Footer />
147149
</div>

src/components/ui/Accordion.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"use client;"
2+
3+
import FAQ from "./FAQ";
4+
5+
const faqList = [
6+
{
7+
question: "What is the purpose of this website?",
8+
answer:
9+
"This platform helps VIT students visualize and manage their FFCS timetables more efficiently. It simplifies the course selection process and offers tools to compare and plan schedules."
10+
},
11+
{
12+
question: "Can we share timetables?",
13+
answer:
14+
"Yes, after generating a timetable, you can share it using a unique link. This makes it easy to collaborate with friends."
15+
},
16+
{
17+
question: "How do I use the website?",
18+
answer:
19+
"Start by selecting your preferences such as course, faculty, and slot. The platform will generate all possible timetables for you. You can filter, view, and share any of them with ease."
20+
},
21+
{
22+
question: "Do I need to log in to use the platform?",
23+
answer:
24+
"No login is required. You can use all features anonymously, you only need to login in order to save your timetable."
25+
},
26+
{
27+
question: "Is this affiliated with VIT University?",
28+
answer:
29+
"No, this is an independent student-made tool created by the CodeChef-VIT to assist students during FFCS."
30+
},
31+
{
32+
question: "Will this work for all campuses?",
33+
answer:
34+
"Currently, the tool is optimized for VIT Vellore. Compatibility for other campuses may be added in future versions."
35+
}
36+
];
37+
38+
39+
40+
const Accordion = () => {
41+
return (
42+
<div className="text-black w-full max-w-6xl flex flex-col gap-8 lg:mx-16 md:mx-4 xl:mx-auto items-center my-16 sm:mt-0 sm:mb-32 font-semibold">
43+
<h1 className="font-bold text-3xl text-center">Frequently Asked Questions</h1>
44+
{faqList.map((faq, index) => (
45+
<FAQ key={index} question={faq.question} answer={faq.answer} />
46+
))}
47+
</div>
48+
);
49+
};
50+
51+
export default Accordion;

src/components/ui/FAQ.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"use client;"
2+
3+
import { ChevronDown, ChevronUp } from 'lucide-react';
4+
import { useState, useRef, useEffect } from 'react';
5+
6+
type FAQProps = {
7+
question: string;
8+
answer: string;
9+
};
10+
11+
const FAQ = ({ question, answer }: FAQProps) => {
12+
const [isOpen, setIsOpen] = useState(false);
13+
const contentRef = useRef<HTMLDivElement>(null);
14+
const [maxHeight, setMaxHeight] = useState('0px');
15+
16+
useEffect(() => {
17+
if (isOpen && contentRef.current) {
18+
setMaxHeight(`${contentRef.current.scrollHeight}px`);
19+
} else {
20+
setMaxHeight('0px');
21+
}
22+
}, [isOpen]);
23+
24+
return (
25+
<div className='w-72 sm:w-128 md:w-196 lg:w-5xl border-b flex flex-col justify-start pt-4 pb-4 rounded-xl border border-black shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] p-4 bg-white'>
26+
<div className='group flex flex-row justify-between items-center w-full cursor-pointer' onClick={() => setIsOpen(prev => !prev)}>
27+
{isOpen ? (
28+
<>
29+
<p className='font-small text-xs md:text-md lg:text-lg lg:font-semibold mr-6 text-[#438eff]'>
30+
{question}
31+
</p>
32+
<ChevronUp className='cursor-pointer text-2xl text-[#438eff]'/>
33+
</>
34+
) : (
35+
<>
36+
<p className='font-small text-xs md:text-md lg:text-lg lg:font-semibold mr-6'>
37+
{question}
38+
</p>
39+
<ChevronDown className='cursor-pointer text-2xl'/>
40+
</>
41+
)}
42+
</div>
43+
<div
44+
className="transition-all duration-500 ease-in-out overflow-hidden"
45+
style={{ maxHeight }}
46+
>
47+
<div ref={contentRef}>
48+
<p className='font-small text-xs md:text-md lg:text-lg lg:font-semibold mr-6 pt-4'>
49+
{answer}
50+
</p>
51+
</div>
52+
</div>
53+
</div>
54+
);
55+
};
56+
57+
export default FAQ;

src/components/ui/Hero.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
import Image from "next/image";
44
import { ZButton } from "../ui/Buttons";
55

6-
export default function Hero() {
6+
type NavbarProps = {
7+
page: "placeholder" | "normal";
8+
};
9+
10+
export default function Hero({page} : NavbarProps) {
711
return (
812
<div className="relative w-[1280px] h-[720px] sm:w-[640px] sm:h-[800px] md:w-[960px] md:h-[960px] lg:w-[1280px] lg:h-[720px] flex justify-center items-center font-pangolin text-black overflow-hidden">
913
<div className="absolute left-1/2 top-36 w-full transform -translate-x-1/2 flex flex-col items-center text-center">
@@ -26,6 +30,13 @@ export default function Hero() {
2630
<div className="text-xl sm:text-2xl md:text-3xl mb-8">
2731
Create Your Ideal Timetable!
2832
</div>
33+
{(page == "placeholder") &&
34+
<div className="text-lg sm:text-xl font-poppins font-semibold text-black mb-6">
35+
We're almost ready!
36+
<br />
37+
The website will be up as soon as the coming semester’s faculty list is available.
38+
</div>}
39+
{(page == "normal") &&
2940
<ZButton
3041
type="large"
3142
text="Start"
@@ -37,7 +48,7 @@ export default function Hero() {
3748
el.scrollIntoView({ behavior: "smooth" });
3849
}
3950
}}
40-
/>
51+
/>}
4152
</div>
4253

4354

src/components/ui/Navbar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useSession, signIn, signOut } from "next-auth/react";
77
import Popup from "./Popup";
88

99
type NavbarProps = {
10-
page: "landing" | "404" | "slots" | "saved" | "shared" | "mobile";
10+
page: "landing" | "404" | "slots" | "saved" | "shared" | "mobile" | "placeholder";
1111
};
1212

1313
export default function Navbar({ page }: NavbarProps) {
@@ -60,7 +60,7 @@ export default function Navbar({ page }: NavbarProps) {
6060
{/* Left Buttons */}
6161
<div style={{ display: "flex", gap: "1rem", alignItems: "center", }}>
6262

63-
{(page == "landing" || page == "404") && (
63+
{(page == "landing" || page == "404" || page == "placeholder") && (
6464
<>
6565
<CCButton />
6666
<ZButton
@@ -98,8 +98,8 @@ export default function Navbar({ page }: NavbarProps) {
9898
{/* Right Buttons */}
9999
<div style={{ display: "flex", gap: "1rem", alignItems: "center", }}>
100100

101-
{(page === "landing" || page === "404" || page == "slots" || page == "shared") &&
102-
(<ZButton
101+
{(page === "landing" || page === "404" || page == "shared") &&
102+
(<ZButton
103103
type="long"
104104
text="Saved Timetables"
105105
color="blue"
@@ -116,7 +116,7 @@ export default function Navbar({ page }: NavbarProps) {
116116
/>)
117117
}
118118

119-
{(page === "landing" || page === "404" || page == "slots" || page == "shared" || page == "saved") &&
119+
{(page === "landing" || page === "404" || page == "shared" || page == "saved") &&
120120
(((!loggedin) && (
121121
<ZButton
122122
type="long"

0 commit comments

Comments
 (0)