Skip to content

Commit

Permalink
Merging new FAQ Component into Main (#50)
Browse files Browse the repository at this point in the history
* Hero Section (#27)

* set up initial template

* added navbar to hero section

* responsive hero section

* Basic About is done

* About is added

* created cursor component with wand image (#30)

* "created cursor component with wang image
 with '#' will be ignored, and an empty message aborts the commit.

* Created Simple About Section (#31)

* Hero Section (#27)

* set up initial template

* added navbar to hero section

* responsive hero section

* Basic About is done

* Merge from Dev (#33)

* Hero Section (#27)

* set up initial template

* added navbar to hero section

* responsive hero section

* Basic About is done

* About is added

* fixed cursor selection bugs and added a trail

* Fixed missing component import for FAQ

* added comment in luge.js

---------

Co-authored-by: Kevin Monisit <monisitkevin@gmail.com>

* Basic Sections (#32)

* completed basic generic sections

* Formatting with prettier

* added some colors and additional divider

* moved text divider half way up to previous section

---------

Co-authored-by: Kevin Monisit <monisitkevin@gmail.com>

* Fire Animation (#45)

* Merging from Dev (#35)

* Hero Section (#27)

* set up initial template

* added navbar to hero section

* responsive hero section

* Basic About is done

* About is added

* created cursor component with wand image (#30)

* "created cursor component with wang image
 with '#' will be ignored, and an empty message aborts the commit.

* Created Simple About Section (#31)

* Hero Section (#27)

* set up initial template

* added navbar to hero section

* responsive hero section

* Basic About is done

* Merge from Dev (#33)

* Hero Section (#27)

* set up initial template

* added navbar to hero section

* responsive hero section

* Basic About is done

* About is added

* fixed cursor selection bugs and added a trail

* Fixed missing component import for FAQ

* added comment in luge.js

---------

Co-authored-by: Kevin Monisit <monisitkevin@gmail.com>

* Basic Sections (#32)

* completed basic generic sections

* Formatting with prettier

* added some colors and additional divider

* moved text divider half way up to previous section

---------

Co-authored-by: Kevin Monisit <monisitkevin@gmail.com>

---------

Co-authored-by: poojakedia <67982568+poojakedia@users.noreply.github.com>
Co-authored-by: Shivam Kajaria <57373405+bhivam@users.noreply.github.com>

* Fire Animation

* Fire Animation

* Animating fire-animation

* Animating fire-animation

* Fire-Animation

* Fire-Animation
Fire Animation.

* Fire Animation

* deleted webp in favor of png, fixed safari stuttering animation

---------

Co-authored-by: Kevin Monisit <monisitkevin@gmail.com>
Co-authored-by: poojakedia <67982568+poojakedia@users.noreply.github.com>
Co-authored-by: Shivam Kajaria <57373405+bhivam@users.noreply.github.com>

* New FAQ (#47)

* Accordian Style FAQ Unstyled
Finished up accordian style FAQ without any styling applied
yet. Changed the FAQ constants to include the question as well
as answer.

* Styled FAQ and Made Responsive
Created responsive FAQ using breakpoints and styled accordian.

* Fixed Typo
Accordian -> Accordion

---------

Co-authored-by: poojakedia <67982568+poojakedia@users.noreply.github.com>
Co-authored-by: Shivam Kajaria <57373405+bhivam@users.noreply.github.com>
Co-authored-by: dchaudhari0811 <136735426+dchaudhari0811@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 4, 2024
1 parent 5bda5ea commit 4cf4c79
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 95 deletions.
56 changes: 56 additions & 0 deletions app/(landing)/sections/FAQ/Accordian.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { useState } from 'react';

type propType = {
question: string;
answer: string;
};

export default function Accordion(props: propType) {
const [accordionOpen, setAccordionOpen] = useState(false);

return (
<div>
<button
onClick={() => setAccordionOpen(!accordionOpen)}
className="flex w-full justify-between items-center pt-5"
>
<span className="text-3xl text-orange-100 text-left font-bold">{props.question}</span>
<svg
className="ml-8 shrink-0 fill-orange-100"
width="16"
height="16"
xmlns="http://www.w3.org/2000/svg"
>
<rect
y="7"
width="16"
height="2"
rx="1"
className={`origin-center transform transition duration-200 ease-out ${
accordionOpen && '!rotate-180'
}`}
/>
<rect
y="7"
width="16"
height="2"
rx="1"
className={`origin-center rotate-90 transform transition duration-200 ease-out ${
accordionOpen && '!rotate-180'
}`}
/>
</svg>
</button>
<div
className={`pb-3 grid overflow-hidden text-sm text-orange-100 transition-all duration-300 ease-in-out ${
accordionOpen
? 'grid-rows-[1fr] opacity-100'
: 'grid-rows-[0fr] opacity-0'
}`}
>
<div className="overflow-hidden text-left text-lg">{props.answer}</div>
</div>
<hr />
</div>
);
}
56 changes: 56 additions & 0 deletions app/(landing)/sections/FAQ/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { useState } from 'react';

type propType = {
question: string;
answer: string;
};

export default function Accordion(props: propType) {
const [accordionOpen, setAccordionOpen] = useState(false);

return (
<div>
<button
onClick={() => setAccordionOpen(!accordionOpen)}
className="flex w-full justify-between items-center pt-5"
>
<span className="text-3xl text-orange-100 text-left font-bold">{props.question}</span>
<svg
className="ml-8 shrink-0 fill-orange-100"
width="16"
height="16"
xmlns="http://www.w3.org/2000/svg"
>
<rect
y="7"
width="16"
height="2"
rx="1"
className={`origin-center transform transition duration-200 ease-out ${
accordionOpen && '!rotate-180'
}`}
/>
<rect
y="7"
width="16"
height="2"
rx="1"
className={`origin-center rotate-90 transform transition duration-200 ease-out ${
accordionOpen && '!rotate-180'
}`}
/>
</svg>
</button>
<div
className={`pb-3 grid overflow-hidden text-sm text-orange-100 transition-all duration-300 ease-in-out ${
accordionOpen
? 'grid-rows-[1fr] opacity-100'
: 'grid-rows-[0fr] opacity-0'
}`}
>
<div className="overflow-hidden text-left text-lg">{props.answer}</div>
</div>
<hr />
</div>
);
}
93 changes: 11 additions & 82 deletions app/(landing)/sections/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
@@ -1,87 +1,18 @@
'use client';

import React from 'react';
import { Disclosure } from '@headlessui/react';
import { GoChevronDown } from 'react-icons/go';
import { hackRUFAQ } from '@/app/lib/constants';

/**
* TODO: make it so that only one question can be open at a time.
*/

function Question(props: { question: string; answer: string }) {
const { question, answer } = props;
return (
<Disclosure>
{({ open }) => (
<div className="hover:bg-f23-mediumGreen flex flex-col rounded-t-lg border-b-2 border-b-white">
<Disclosure.Button
className="text-md text-textSubtitle flex
w-full justify-between p-4 text-left
focus:outline-none focus-visible:ring
focus-visible:ring-opacity-75"
>
<span>{question}</span>
<GoChevronDown
className={`${
open ? 'rotate-180 transform' : ''
} text-text h-5 w-5`}
/>
</Disclosure.Button>
<Disclosure.Panel className="w-full px-4 pb-2 pt-4 text-sm text-white">
{answer}
</Disclosure.Panel>
</div>
)}
</Disclosure>
);
}
import Accordian from './Accordion';

function QuestionContainer() {
const {
whatIsHackRUAnswer,
whatIsApplicationAnswer,
winAnythingAnswer,
maskMandateAnswer,
moreQuestionsAnswer,
whoCanComeAnswer,
newAnswer,
costAnswer,
workWithOthersAnswer,
} = hackRUFAQ;

return (
<div className="ml-22 z-40 pt-16">
<div className="transparent-black-background max-w-3xl rounded-2xl p-10 sm:grid sm:grid-cols-2">
<div>
<Question question="What is HackRU?" answer={whatIsHackRUAnswer} />
<Question
question="What is the application process like?"
answer={whatIsApplicationAnswer}
/>
<Question question="Can I win anything?" answer={winAnythingAnswer} />
<Question
question="Will there be a mask mandate?"
answer={maskMandateAnswer}
/>
<Question
question="I have more questions!"
answer={moreQuestionsAnswer}
/>
</div>
<div>
<Question question="Who can come?" answer={whoCanComeAnswer} />
<Question question="I'm new. What should I do? " answer={newAnswer} />
<Question
question="How much does it cost to attend?"
answer={costAnswer}
/>
<Question
question="Can I work with others?"
answer={workWithOthersAnswer}
/>
</div>
</div>
<div className="w-full">
{Object.keys(hackRUFAQ).map((question: string, i: number) => (
<Accordian
key={i}
question={question}
answer={Object.values(hackRUFAQ)[i]}
/>
))}
</div>
);
}
Expand All @@ -90,11 +21,9 @@ export default function FAQ() {
return (
<div
id="FAQ"
className="relative flex h-fit
min-h-[600px] w-full flex-col
items-center justify-start overflow-visible"
className="relative flex w-full flex-col items-center justify-start overflow-visible"
>
<div className="relative flex h-full w-full max-w-7xl flex-col items-center pb-[24rem]">
<div className="relative flex w-full px-[10vw] xl:px-[15vw] flex-col items-center pb-[10rem]">
<QuestionContainer />
</div>
</div>
Expand Down
21 changes: 10 additions & 11 deletions app/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
export const hackRUFAQ = {
whatIsHackRUAnswer: `HackRU is a 24-hour hackathon at Rutgers University. We welcome hundreds of students to join us in building
'What is HackRU?': `HackRU is a 24-hour hackathon at Rutgers University. We welcome hundreds of students to join us in building
awesome software and hardware projects. Industry experts and mentors come from all over the country to create
an environment that fosters an atmosphere of learning through teck talks and one-on-one guidance.
We encourage beginner and advanced hackers alike to challenge themselves and expand their skills.`,

whatIsApplicationAnswer: `HackRU will be back in person this Fall 2023! We will be accepting anywhere between 300-500 hackers based on
'What is the application process like?': `HackRU will be back in person this Fall 2023! We will be accepting anywhere between 300-500 hackers based on
when you register for the event. After you register, you'll get a notification 1-2 weeks before the hackathon whether we have accepted you or
not to the hackathon. You will then have to let us know if you plan on coming or not and then you're all set!`,

winAnythingAnswer:
'Can I win anything?':
"Yes! We'll release more information about prizes as the event draws near.",

maskMandateAnswer:
'Will there be a mask mandate?':
'No, HackRU will not have a mask mandate but it is encouraged throughout the duration of the event.',

moreQuestionsAnswer:
"Reach out to us at info@hackru.org! We'll be happy to answer.",

whoCanComeAnswer: `HackRU welcomes undergraduate and graduate students of all majors, backgrounds, and skill level to come create. Additionally, high
'Who can come?': `HackRU welcomes undergraduate and graduate students of all majors, backgrounds, and skill level to come create. Additionally, high
school students who will be 18 by HackRU are allowed to register. Unfortunately, if you are under 18, you will not be able to attend.`,

newAnswer: `That's great! We'd love to have you at HackRU. Throughout the weekend, there will be workshops to get your feet wet,
"I'm new. What should I do?": `That's great! We'd love to have you at HackRU. Throughout the weekend, there will be workshops to get your feet wet,
project ideas for you to try out, and mentors to guide you through the process.`,

costAnswer:
'How much does it cost to attend?':
'Like the best things in life, HackRU is completely free to attend!',

workWithOthersAnswer: `Hackers can(and are encouraged to) work in teams of up to 4 humans max. The knowledge you gain from teammates is
'Can I work with others?': `Hackers can(and are encouraged to) work in teams of up to 4 humans max. The knowledge you gain from teammates is
invaluable, along with the opportunity to build lifetime friendships - you might leave with a new best friend! We will be having a team-building exercise
after opening ceremonies for people who are looking for teammates.`,
'I have more questions!':
"Reach out to us at info@hackru.org! We'll be happy to answer.",
};
12 changes: 10 additions & 2 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@ const config: Config = {
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
screens: {
xx: '0px',
xs: '320px',
sm: '576px',
md: '768px',
lg: '1024px',
xl: '1280px',
},
extend: {
gridTemplateColumns: {
'13': 'repeat(13, minmax(0, 1fr))',
},
colors: {
blue: {
100: '#203437',
200: '#1B1F23'
},
orange: {
100: '#FFB464'
100: '#FFB464',
200: '#1B1F23'
}
},
},
Expand Down

0 comments on commit 4cf4c79

Please sign in to comment.