diff --git a/app/page.tsx b/app/page.tsx index d055730..d04fdf8 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,15 +1,20 @@ -'use client' -import { AspectRatio, Card, Stack, Typography, useTheme } from '@mui/joy'; -import React, { useEffect, useRef } from 'react'; +"use client"; +import { AspectRatio, Card, Stack, Typography, useTheme } from "@mui/joy"; +import React, { useEffect, useRef } from "react"; import { Box, Button, Link } from "@mui/material"; -import { projectData } from '../data'; +import { projectData } from "../data"; import useEmblaCarousel from "embla-carousel-react"; import Autoplay from "embla-carousel-autoplay"; import { ProjectCardProps } from "../components/ProjectCard"; import Image from "next/image"; -import { NextButton, PrevButton, usePrevNextButtons } from "../components/embla/EmblaCarouselArrowButtons"; -import "./styles.css" +import { + NextButton, + PrevButton, + usePrevNextButtons, +} from "../components/embla/EmblaCarouselArrowButtons"; +import "./styles.css"; import { useMediaQuery } from "@mui/system"; +import { CustomCarousel } from "../components/carousel/CustomCarousel"; interface EventCardProp { title: string; @@ -19,199 +24,107 @@ interface EventCardProp { button: string; } -const eventContent: EventCardProp[] = [ - { - title: "Clubs Takeover", - href: "https://www.facebook.com/events/1586760535262553/", - dateTime: "12-2PM October 22nd 2024", - thumbnail: "", - button: "View event" - }, - { - title: "Techspire", - href: "https://techspire.devsoc.app/", - dateTime: "3PM November 5th 2024", - thumbnail: "", - button: "Find out more" - }, -] - export default function Home() { const scrollRef = useRef(null); - const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true, axis: 'y', duration: 45 }, [Autoplay({delay: 5000})]); + const [emblaRef, emblaApi] = useEmblaCarousel( + { loop: true, axis: "y", duration: 45 }, + [Autoplay({ delay: 5000 })] + ); const { prevBtnDisabled, nextBtnDisabled, onPrevButtonClick, - onNextButtonClick - } = usePrevNextButtons(emblaApi) - const displayProjects = projectData.filter(x => x.name !== "Chaos" && x.name !== "Jobsboard") - - useEffect(() => { - const handleScroll = (e: { deltaY: any; }) => { - if (scrollRef.current) { - // Adjust the scroll position of the div based on the window's scroll position - scrollRef.current.scrollLeft += e.deltaY; // or adjust based on scroll direction - } - }; - - window.addEventListener('wheel', handleScroll, { passive: false }); - - return () => { - window.removeEventListener('wheel', handleScroll); - }; - }, []); + onNextButtonClick, + } = usePrevNextButtons(emblaApi); + const displayProjects = projectData.filter( + (x) => x.name !== "Chaos" && x.name !== "Jobsboard" + ); return ( - + - - - UNSW's student developer society + + + UNSW's Software Development Society - + Run by devs, for devs - - - Highlights - -
-
- - -
-
-
- - - {eventContent.map((props, idx) => )} - - + - {displayProjects.map((props, idx) => )} + {displayProjects.map((props, idx) => ( + + ))}
- ) + ); } -const HighlightLinkCard: React.FC = ({ - title, - href, - dateTime, - thumbnail, - button -}) => { - let color = "#111111"; - const theme = useTheme(); - const isMdUp = useMediaQuery(theme.breakpoints.up('md')); - return ( - - - { - thumbnail && isMdUp ? {title}/ : null - } - - - {title} - - - {dateTime} - - - - { - button ? - - - : null - } - - ) -} - -const LinkCard: React.FC & { order: number }> = ({ - name, - desc, - logoUrl, - thumbnailUrl, - projectUrl, - status, - order -}) => { +const LinkCard: React.FC< + Omit & { order: number } +> = ({ name, desc, logoUrl, thumbnailUrl, projectUrl, status, order }) => { // Class 3 colors sourced from https://www.radix-ui.com/colors - const colors = ["#182449", "#0D2847", "#202248", "#351A35", "#391714", "#291F43", "#222222"] + const colors = [ + "#182449", + "#0D2847", + "#202248", + "#351A35", + "#391714", + "#291F43", + "#222222", + ]; return ( @@ -225,7 +138,7 @@ const LinkCard: React.FC & { order: number }> @@ -233,6 +146,5 @@ const LinkCard: React.FC & { order: number }> - ) -} - + ); +}; diff --git a/app/styles.css b/app/styles.css index 15677bf..8da88f6 100644 --- a/app/styles.css +++ b/app/styles.css @@ -2,7 +2,8 @@ font-family: 'IBM Plex Mono', monospace; } -.boxBackground { +/* Unused styles for old event design */ +/* .boxBackground { position: relative; } @@ -17,9 +18,9 @@ right: 0; width: 100%; height: 100%; -} +} */ -.embla { +/* .embla { overflow: hidden; } .embla__container { @@ -47,4 +48,4 @@ width: 25px; align-items: center; justify-content: center; -} \ No newline at end of file +} */ \ No newline at end of file diff --git a/components/carousel/CustomCarousel.tsx b/components/carousel/CustomCarousel.tsx new file mode 100644 index 0000000..cc080bc --- /dev/null +++ b/components/carousel/CustomCarousel.tsx @@ -0,0 +1,101 @@ +import React, { useEffect } from "react"; +import useEmblaCarousel from "embla-carousel-react"; +import Autoplay from "embla-carousel-autoplay"; +import "./embla.css"; +import { + NextButton, + PrevButton, + usePrevNextButtons, +} from "../embla/EmblaCarouselArrowButtons"; +import { Box, Typography } from "@mui/joy"; + +export function CustomCarousel() { + const [emblaRef, emblaApi] = useEmblaCarousel( + { loop: true, watchDrag: false }, + [Autoplay({ delay: 4500 })] + ); + const slides = [ + { src: "/carousel/brainstorm.png", text: "Solve Unique Problems" }, + { src: "/carousel/starlight.jpg", text: "Showcase your projects" }, + { src: "/carousel/qa_panel.jpg", text: "Industry Events" }, + { src: "/carousel/workshops.png", text: "Learn Together" }, + { src: "/carousel/together.jpg", text: "Develop Together" }, + { src: "/carousel/projects.png", text: "Our Projects" }, + { + src: "/projects/notangles/thumbnail.png", + text: "Notangles", + position: "50% 0%", + }, + { + src: "/projects/circles/thumbnail.png", + text: "Circles", + position: "50% 20%", + }, + { + src: "/carousel/unilectives.png", + text: "Unilectives", + position: "50% 0%", + }, + { + src: "/projects/structs/thumbnail.png", + text: "Structs.sh", + postion: "50% 80%", + }, + { + src: "/projects/freerooms/thumbnail.png", + text: "Freerooms", + position: "50% 20%", + }, + { src: "/carousel/applications.png", text: "Join us!" }, + ]; + + const { + prevBtnDisabled, + nextBtnDisabled, + onPrevButtonClick, + onNextButtonClick, + } = usePrevNextButtons(emblaApi); + + return ( +
+
+
+ + +
+
+
+ + {slides.map((e, index) => ( +
+ {e.src ? ( + + ) : null} + + {e.text} + +
+ ))} +
+
+
+ ); +} diff --git a/components/carousel/embla.css b/components/carousel/embla.css new file mode 100644 index 0000000..f25c803 --- /dev/null +++ b/components/carousel/embla.css @@ -0,0 +1,55 @@ +.embla { + overflow: hidden; +} +.embla__container { + display: flex; + width: 100%; +} +.embla__slide { + flex: 0 0 100%; + background-color: black; + min-width: 0; +} + +.embla__text { + position: relative; + letter-spacing: 1px; + font-weight: 600; + text-shadow: 0 2px 4px rgb(0 0 0 / 0.7); + /* -webkit-text-stroke: 4px rgb(48,48,48); */ + color: white; + display: flex; + align-items: center; + justify-content: center; + height: 100%; + z-index: 4; + user-select: none; +} + +.embla__slide img { + position: absolute; + object-fit: cover; + width: 100%; + height: 100%; + z-index: 1; + opacity: 0.65; +} + +.embla__controls { + display: flex; + flex-direction: row-reverse; +} + +.embla__buttons { + display: flex; + gap: 0.6rem; + align-items: center; +} + +.embla__button { + display: flex; + height: 25px; + width: 25px; + align-items: center; + justify-content: center; +} diff --git a/public/carousel/applications.png b/public/carousel/applications.png new file mode 100644 index 0000000..9557601 Binary files /dev/null and b/public/carousel/applications.png differ diff --git a/public/carousel/brainstorm.png b/public/carousel/brainstorm.png new file mode 100644 index 0000000..9b2110b Binary files /dev/null and b/public/carousel/brainstorm.png differ diff --git a/public/carousel/projects.png b/public/carousel/projects.png new file mode 100644 index 0000000..13c5d2b Binary files /dev/null and b/public/carousel/projects.png differ diff --git a/public/carousel/qa_panel.jpg b/public/carousel/qa_panel.jpg new file mode 100644 index 0000000..7409f12 Binary files /dev/null and b/public/carousel/qa_panel.jpg differ diff --git a/public/carousel/starlight.jpg b/public/carousel/starlight.jpg new file mode 100644 index 0000000..8c3280c Binary files /dev/null and b/public/carousel/starlight.jpg differ diff --git a/public/carousel/together.jpg b/public/carousel/together.jpg new file mode 100644 index 0000000..43139e9 Binary files /dev/null and b/public/carousel/together.jpg differ diff --git a/public/carousel/unilectives.png b/public/carousel/unilectives.png new file mode 100644 index 0000000..13fcb74 Binary files /dev/null and b/public/carousel/unilectives.png differ diff --git a/public/carousel/workshops.png b/public/carousel/workshops.png new file mode 100644 index 0000000..78a417a Binary files /dev/null and b/public/carousel/workshops.png differ