Skip to content

Commit

Permalink
Merge pull request #11 from TEDxNTUA/bug-fixing-giannis
Browse files Browse the repository at this point in the history
Fix timeline bug, add 2025 year
  • Loading branch information
GiannisTsagkaropoulos authored Jan 10, 2025
2 parents c006476 + 289d93d commit 553f155
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 82 deletions.
8 changes: 8 additions & 0 deletions data/previousEvents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export const PREVIOUSEVENTS = [
// {
// id: "synelixis",
// year: "2025",
// link: "",
// source: "synelixis.png",
// logo: "synelixis-logo.png",
// paragraph: "",
// },
{
id: "ephemeral",
year: "2024",
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function RootLayout({ children }) {
return (
<html lang="en">
<body className="bg-black font-[Helvetica]">
<ModalWrapper />
{/* <ModalWrapper /> */}
<div>
<ScrollTopButton />
</div>
Expand Down
84 changes: 60 additions & 24 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,94 @@ import SecondScroll from "@/components/MainPage/2ndScroll";

// import TEDxInNumbers from "@/components/TEDInNumbers/TEDxInNumbers";
import Timeline from "@/components/TimelineComponent/Timeline";
import NewTimeline from "@/components/NewTimeline/NewTimeline";
import NewFooter from "@/components/Footer/NewFooter";
import ScrollTopButton from "@/components/ScrollTopButton";
import { PREVIOUSEVENTS } from "../../data/previousEvents";
import YearLine from "@/components/NewTimeline/YearLine";
import TimelineEvent from "@/components/NewTimeline/TimelineEvent";

function HomePage() {
return (
<main>
{/* <div
id="main-scroll-container"
// className="overflow overflow-y-scroll snap-y snap-mandatory h-[calc(100vh-65px)] "
> */}
{/* <div className="snap-start"> */}
{/* <div className="h-[calc(100vh-65px)] ">
<FirstScroll />
</div>
{/* <div className="snap-start h-[calc(100vh-65px)] "> *
<div className="h-[calc(100vh-65px)] ">
<SecondScroll />
<div className="bg-black pt-6">
<TEDxInNumbers />
</div>
</div> */}
<FirstScroll />
<SecondScroll />

<div className="2024 relative mt-12">
{/* <div className="2024 NEW YEAR hidden lg:block w-[80%] mx-auto max-w-[100rem] border-l-8 lg:border-our-red py-16">
{/* <div className="2024 relative mt-12">
<div className="2024 NEW YEAR hidden lg:block w-[80%] mx-auto max-w-[100rem] border-l-8 lg:border-our-red py-16">
<div className="flex flex-row gap-8 w-[80%] h-8 mx-auto left-0 top-0 right-[23px] 2xl:right-[22px] max-w-[100rem] absolute">
<div className="h-8 w-8 rounded-full border-[3.5px] bg-our-red border-our-red" />
<div className="absolute top-[-15px] left-[100px] flex flex-col">
<h2
className="text-white font-bold text-5xl xl:text-6xl italic tracking-tighter leading-4 lg:leading-none"
// style={{ y, zIndex: 1 }}
>
2024
2025
</h2>
<p className="text-xl text-white bg-black mx-auto">
Stay pos<span className="text-our-red">TED</span>. More coming
Stay upda<span className="text-our-red">TED</span>. More coming
soon!
</p>
</div>
</div>
</div> */}
</div>x
<Timeline />
</div> */}

{/* <Timeline /> */}
<div className="max-w-7xl mx-auto">
{/* <div className="relative flex flex-col w-full mx-auto lg:bg-yellow-500 xl:bg-lime-600 2xl:bg-blue-200 bg-[rgba(200,200,200,0.2)]"> */}
<div className="relative flex flex-col w-full mx-auto ">
{/* Timeline appears in screens of size XL */}
<div id="line-div" className="hidden xl:block">
<YearLine numberOfYears={9} />
</div>

<div className="hidden xl:block">
<div className="ml-[100px] w-[90%] top-[-20px] absolute flex items-center">
<div className="text-center text-white w-1/6">
<div className="text-4xl font-bold">2025</div>
<p className=" text-white bg-black mx-auto">
Stay upda<span className="text-our-red">TED</span>. More
coming soon!
</p>
</div>
</div>
</div>

<div className="xl:hidden mb-[200px]">
<div className="flex flex-col text-center text-white">
<div className="text-4xl font-bold">2025</div>
<p className=" text-white bg-black mx-auto">
Stay upda<span className="text-our-red">TED</span>. More coming
soon!
</p>
</div>
</div>

{/* When timeline appears */}
<div className="xl:ml-[100px] xl:w-[90%]">
{/* Render Timeline Events */}
{PREVIOUSEVENTS.map((TedEvent, index) => (
<TimelineEvent
key={TedEvent.id}
TedEvent={TedEvent}
index={index}
/>
))}
</div>
</div>
</div>
{/* <div className="snap-start"> */}

{/* <div className="max-w-7xl mx-auto">
<NewTimeline events={PREVIOUSEVENTS} />
</div> */}
<div>
<NewFooter />
</div>
{/* </div> */}
</main>
);
}
{
}

export default HomePage;
2 changes: 1 addition & 1 deletion src/components/MainPage/2ndScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Image from "next/image";

function SecondScroll() {
return (
<section>
<section className="mb-[100px]">
<div className="mobile-tablet 2nd-scroll h-[calc(100vh-65px)] lg:hidden flex flex-col justify-end">
<div className="flex flex-col justify-between gap-8 md:gap-16 items-center w-[85%] mx-auto my-auto">
<div className="title col-span-1 flex flex-col gap-4">
Expand Down
33 changes: 33 additions & 0 deletions src/components/NewTimeline/NewTimeline.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";
import TimelineEvent from "./TimelineEvent";
import YearLine from "./YearLine";

const Timeline = ({ events }) => {
return (
<div className="relative flex flex-col w-full mx-auto">
<YearLine numberOfYears={9} />

<div
// className="relative flex items-center place-content-center w-full h-[600px] border-[rgba(255,255,255,0.2)] border-8"
className="ml-[10%] w-[90%] top-[-20px] absolute flex items-center mb-12"
>
<div className="w-1/6 text-center text-white">
<div className="text-4xl font-bold">2025</div>
<p className=" text-white bg-black mx-auto">
Stay upda<span className="text-our-red">TED</span>. More coming
soon!
</p>
</div>
</div>

<div className="ml-[10%] w-[90%] ">
{/* Render Timeline Events */}
{events.map((TedEvent, index) => (
<TimelineEvent key={TedEvent.id} TedEvent={TedEvent} index={index} />
))}
</div>
</div>
);
};

export default Timeline;
59 changes: 59 additions & 0 deletions src/components/NewTimeline/TimelineEvent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react";

const TimelineEvent = ({ TedEvent }) => {
const { link, logo, source, year, paragraph, index } = TedEvent; // Index added for bullet alignment
const isHoverable = Boolean(link); // Check if the link exists

return (
<div
// className="relative flex items-center place-content-center w-full h-[600px] border-[rgba(255,255,255,0.2)] border-8"
className="relative flex flex-col xl:flex-row gap-8 xl:gap-0 items-center h-[600px] "
style={{
top: `${index * 600}px`, // Align with the bullet position
}}
>
{/* Year Column */}

{/* <div className="text-4xl font-bold">2025</div> */}

{/* <div className="w-2/6"> */}
<div className="xl:w-1/6">
{/* <div className="w-1/6 text-center text-4xl font-bold text-white mb-4 bg-[rgba(255,255,255,0.2)]"> */}
<div className="text-center text-white text-4xl font-bold ">{year}</div>
</div>

{/* Image Column */}
<div className="xl:w-3/6 flex justify-center">
{link ? (
<a
href={link}
target="_blank"
rel="noopener noreferrer"
className="hover:cursor-pointer"
>
<img
src={`./previousEvents/${source}`}
alt={`${year} event`}
className="w-full max-w-xs rounded-lg border border-[#eb002733] hover:border-[#eb0027] transition duration-200 object-fill"
/>
</a>
) : (
<img
src={`./previousEvents/${source}`}
alt={`${year} event`}
className="w-full max-w-xs rounded-lg border border-[#eb002733] object-fill"
/>
)}
</div>

{/* Description Column */}
<div className="hidden xl:block w-2/6">
<div className="text-gray-300 text-md leading-relaxed pl-6">
{paragraph}
</div>
</div>
</div>
);
};

export default TimelineEvent;
21 changes: 21 additions & 0 deletions src/components/NewTimeline/YearLine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function YearLine({ numberOfYears }) {
return (
// Vertical Line Bullets
<div className="absolute left-10 w-1 bg-red-500 h-full">
<div className="absolute left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-4 h-4 bg-red-500 rounded-full"></div>

{/* Render Bullets */}
{Array.from({ length: numberOfYears }).map((_, index) => (
<div
key={index}
className="absolute left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-4 h-4 bg-red-500 rounded-full"
style={{
top: `${292 + index * 600}px`, // Start at 50vh, then increment by 100vh
}}
></div>
))}
</div>
);
}

export default YearLine;
58 changes: 2 additions & 56 deletions src/components/TimelineComponent/Photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,14 @@ export default function Photo({ TedEvent }) {

console.log(TedEvent.link);
return (
// <main className="h-[50vh] grid grid-cols-3 justify-center items-center snap-center bg-emerald-500">
// <div className="grid grid-cols-1 justify-center items-center">
// <h2
// className="mx-auto text-white font-bold text-[8xl] tracking-tighter leading-5 absolute bg-blue-500"
// style={{ y, zIndex: 1 }}
// >
// {TedEvent.year}
// </h2>
// <img
// src={`./eventLogos/${TedEvent.logo}`}
// className="absolute w-[10rem] h-[50px]"
// style={{ y, zIndex: 1 }}
// />
// </div>
// {/* <div ref={Imageref} className=""> */}
// <img
// ref={Imageref}
// className="border-[2px] border-[#eb002733] hover:border-our-red rounded-md w-[100%] h-[100%] object-cover"
// src={`./previousEvents/${TedEvent.source}`}
// alt="Previous ted event"
// />
// {/* </div> */}
// <p
// className=" text-white font-bold text-[5xl] tracking-tighter leading-5 text-justify w-[28vw] bg-blue-500"
// style={{ y, right: "7vw", zIndex: 1 }}
// >
// {TedEvent.paragraph}
// </p>
// </main>
// <div className="snap-start">
<div>
<div className="timeline-grid grid grid-cols-1 lg:grid-cols-5 xl:grid-cols-3 text-center justify-between lg:justify-center lg:items-center h-[70vh] lg:h-[calc(100vh-65px)] w-[100%] md:w-[80%] mx-auto lg:border-l-8 lg:border-our-red max-w-[100rem]">
{/* <div className="hidden lg:fixed lg:flex h-[100vh] w-2 self-stretch bg-our-red opacity-100 left-[9.3%]"></div> */}
<div className="flex flex-row justify-center content-center place-items-center text-white lg:bg-transparent self-center">
<div className="hidden lg:flex w-[80%] h-8 mx-auto left-0 right-[23px] 2xl:right-[22px] max-w-[100rem] absolute">
<div className="h-8 w-8 rounded-full border-[3.5px] bg-our-red border-our-red" />
</div>

<h2
className="text-white font-bold text-5xl xl:text-6xl italic tracking-tighter leading-4 lg:leading-none mx-auto"
// style={{ y, zIndex: 1 }}
>
<h2 className="text-white font-bold text-5xl xl:text-6xl italic tracking-tighter leading-4 lg:leading-none mx-auto">
{TedEvent.year}
</h2>
{/* <Image */}
Expand All @@ -62,19 +28,8 @@ export default function Photo({ TedEvent }) {
height={300}
src={`./eventLogos/${TedEvent.logo}`}
className="mx-auto w-[10rem] h-[10vh] hidden"
// style={{ y, zIndex: 1 }}
/>
</div>
{/* <div className="xl:mr-[5vw] self-start lg:self-center lg:col-span-2 xl:col-span-1">
<img
width={300}
height={300}
ref={Imageref}
className="border-[2px] border-[#eb002733] rounded-md mx-auto w-[60%] xl:w-full object-fill" //hover:border-our-red
src={`./previousEvents/${TedEvent.source}`}
alt="Previous ted event"
/>
</div> */}
<div className="xl:mr-[5vw] self-start lg:self-center lg:col-span-2 xl:col-span-1">
{TedEvent.link !== "" ? (
<a
Expand Down Expand Up @@ -104,16 +59,7 @@ export default function Photo({ TedEvent }) {
)}
</div>

{/* <img
src={`./eventLogos/${TedEvent.logo}`}
className="mx-auto w-[15vw] h-[5vh] xl:hidden"
// style={{ y, zIndex: 1 }}
/> */}

<p
className="hidden lg:block text-white text-base 2xl:text-lg leading-6 text-justify col-span-2 xl:col-span-1 tracking-wide w-[95%] mx-auto"
// style={{ y, right: "7vw", zIndex: 1 }}
>
<p className="hidden lg:block text-white text-base 2xl:text-lg leading-6 text-justify col-span-2 xl:col-span-1 tracking-wide w-[95%] mx-auto">
{TedEvent.paragraph}
</p>
</div>
Expand Down

0 comments on commit 553f155

Please sign in to comment.