-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ Page #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
miguelaenlle
wants to merge
14
commits into
main
Choose a base branch
from
maenlle2/faq-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
FAQ Page #20
Changes from 2 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
94da967
Ran linter
miguelaenlle 0bd82e8
ran linter
miguelaenlle a1e73fa
Added cars and mobile optimization
miguelaenlle f02785e
Cleaned up file structure
miguelaenlle 2ebd190
Merge branch 'main' into maenlle2/faq-page
miguelaenlle f2cf82d
Added fonts, other changes
miguelaenlle b8934f0
Merge branch 'main' into maenlle2/faq-page
miguelaenlle a77cf26
Implemented mobile optimizations
miguelaenlle 2bebde6
Refactor into different components
miguelaenlle d16c707
Refactored into separate components
miguelaenlle 3cd4c77
Remove vite-env file
miguelaenlle 248e4fe
re-added vite-env file
miguelaenlle e999b42
Moved SVG assets to public folder (for consistency w/ registration, s…
miguelaenlle 9bd0dfb
Tweaked padding/margin
miguelaenlle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| import { Box, Circle, HStack, Text, VStack } from "@chakra-ui/react"; | ||
| import React, { useState } from "react"; | ||
|
|
||
| interface FAQItem { | ||
| question: string; | ||
| answer: string; | ||
| } | ||
|
|
||
| const faqs: FAQItem[] = [ | ||
| { | ||
| question: "What is Reflections | Projections?", | ||
| answer: | ||
| "Reflections | Projections (R|P) is the largest student-run tech conference in the Midwest, bringing together students, industry leaders, and professionals from all over the world. Join us for an exciting week of speaker talks, workshops, a career fair, and other intriguing opportunities! All of R|P is designed to allow participants to reflect upon their experiences and project towards their future." | ||
| }, | ||
| { | ||
| question: "What do I need to do before R|P?", | ||
| answer: | ||
| "It's simple: register (it's completely free!). Just like that, you're all set to attend events and retrieve free swag/merch!" | ||
| }, | ||
| { | ||
| question: "Where are R|P's events held?", | ||
| answer: | ||
| "Every event of R|P 2024 will be held in the Siebel Center for Computer Science (201 N Goodwin Ave, Urbana, IL 61801). Our calendar contains the specific room for each event." | ||
| }, | ||
| { | ||
| question: "Who can attend R|P?", | ||
| answer: | ||
| "R|P is open to everyone over the age of 18. Registering and attending R|P is open to all majors and class levels and is completely free!" | ||
| }, | ||
| { | ||
| question: "What is the pixel system?", | ||
| answer: | ||
| "The pixel system is our new way of rewarding dedicated R|P attendees with exclusive merch and prizes. Attending events throughout R|P will earn you pixels, and pixels can be redeemed for various free prizes. You can monitor your pixel status on the myRP tab after logging in on the website." | ||
| }, | ||
| { | ||
| question: "What are MechMania and PuzzleBang?", | ||
| answer: `MechMania is R|P's 24 hour AI hackathon that allows students to work in teams to build a bot that can play a new game. MechMania is open to all levels of coding and you can register at mechmania.org. PuzzleBang is both a series of puzzles during the week of R|P (Monday - Saturday) and also an escape room on Saturday. You can register at puzzlebang.com.` | ||
| } | ||
| ]; | ||
|
|
||
| export const FAQ: React.FC = () => { | ||
| const [hoveredFaqIndex, setHoveredFaqIndex] = useState<number | null>(null); | ||
|
|
||
| const handleFaqHover = (index: number | null) => { | ||
| setHoveredFaqIndex(index); | ||
| }; | ||
|
|
||
| return ( | ||
| <VStack> | ||
| <VStack spacing={0} mb={4}> | ||
| <HStack w="100%" bgColor="gray.200" p={2} justifyContent={"center"}> | ||
| <Text fontSize="2xl" fontWeight="bold" fontStyle={"italic"}> | ||
| FAQ | ||
| </Text> | ||
| </HStack> | ||
| <HStack> | ||
| {faqs.map((_, index) => { | ||
| return ( | ||
| <StopLight | ||
| key={`stop-light-${index}`} | ||
| hovered={hoveredFaqIndex === index} | ||
| /> | ||
| ); | ||
| })} | ||
| </HStack> | ||
| </VStack> | ||
| <VStack maxW="1000px" w="100%" mx="auto" spacing={4}> | ||
| {faqs.map((faqItem, index) => ( | ||
| <FAQItem | ||
| key={`faq-item-${index}`} | ||
| index={index} | ||
| faqItem={faqItem} | ||
| onFaqHover={handleFaqHover} | ||
| /> | ||
| ))} | ||
| </VStack> | ||
| </VStack> | ||
| ); | ||
| }; | ||
|
|
||
| const StopLight: React.FC<{ | ||
| hovered: boolean; | ||
| }> = ({ hovered }) => { | ||
| return ( | ||
| <VStack p={2} bgColor="gray.200"> | ||
| <Circle | ||
| size={5} | ||
| bgColor={hovered ? "gray.800" : "gray.500"} | ||
| transition={"all 0.1s ease-in"} | ||
| /> | ||
| <Circle | ||
| size={5} | ||
| bgColor={hovered ? "gray.800" : "gray.500"} | ||
| transition={"all 0.1s ease-in"} | ||
| /> | ||
| </VStack> | ||
| ); | ||
| }; | ||
|
|
||
| const FAQItem: React.FC<{ | ||
| index: number; | ||
| faqItem: FAQItem; | ||
| onFaqHover: (index: number | null) => void; | ||
| }> = ({ index, faqItem: { question, answer }, onFaqHover }) => { | ||
| const [isHovered, setIsHovered] = useState(false); | ||
|
|
||
| return ( | ||
| <Box | ||
| position={"relative"} | ||
| display="flex" | ||
| alignItems={"center"} | ||
| justifyContent={"flex-start"} | ||
| bgColor="gray.200" | ||
| w="100%" | ||
| maxW="1000px" | ||
| h={"fit-content"} | ||
| p={4} | ||
| borderRadius={"lg"} | ||
| onMouseEnter={() => { | ||
| setIsHovered(true); | ||
| onFaqHover(index); | ||
| }} | ||
| onMouseLeave={() => { | ||
| setIsHovered(false); | ||
| onFaqHover(null); | ||
| }} | ||
| transition={"height 0.3s ease-in-out"} | ||
| > | ||
| <Box | ||
| w={28} | ||
| bgColor="gray.400" | ||
| position="absolute" | ||
| top={-1} | ||
| left={isHovered ? "90%" : -1} | ||
| // right={isHovered ? -1 : undefined} | ||
miguelaenlle marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| borderRadius="lg" | ||
| h={16} | ||
| transition={"left 0.3s ease-in-out"} | ||
| ></Box> | ||
| <Text | ||
| fontWeight="bold" | ||
| ml={isHovered ? 0 : 24} | ||
| pl={2} | ||
| pr={isHovered ? 28 : 0} | ||
| transition={"all 0.3s ease-in-out"} | ||
| > | ||
| {isHovered ? answer : question} | ||
| </Text> | ||
| </Box> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| import { FAQ } from "@/components/Home/FAQ"; | ||
|
|
||
| export default function Home() { | ||
| return ( | ||
| <> | ||
| <p>Reflections | Projections 2025</p> | ||
| <FAQ /> | ||
| </> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.