Skip to content

Commit

Permalink
Merge pull request #7 from TEDxNTUA/main-page-bug
Browse files Browse the repository at this point in the history
change navbar, responsivity, height of one page elements, totally new…
  • Loading branch information
GiannisTsagkaropoulos authored Mar 4, 2024
2 parents deed440 + de01805 commit 0d10b83
Show file tree
Hide file tree
Showing 15 changed files with 278 additions and 104 deletions.
2 changes: 1 addition & 1 deletion src/app/about/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function AboutPage() {
return (
<section>
{/* <AlternateColumnScroll /> */}
<WhatIsTed />
{/* <WhatIsTed /> */}
<AboutTEDxNTUA />

{/* <div className="h-[15vh]"></div> */}
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function RootLayout({ children }) {
<ScrollTopButton />
</div>
<Navbar />
<div className="mt-[5rem]"></div>
<div className="mt-[65px]"></div>
{children}
</body>
</html>
Expand Down
56 changes: 39 additions & 17 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,58 @@
import FirstScroll from "@/components/MainPage/1stScroll";
import SecondScroll from "@/components/MainPage/2ndScroll";

import TEDxInNumbers from "@/components/TEDInNumbers/TEDxInNumbers";
// import TEDxInNumbers from "@/components/TEDInNumbers/TEDxInNumbers";
import Timeline from "@/components/TimelineComponent/Timeline";
import NewFooter from "@/components/Footer/NewFooter";
import ScrollTopButton from "@/components/ScrollTopButton";

function HomePage() {
return (
<main>
<div
{/* <div
id="main-scroll-container"
// className="overflow overflow-y-scroll snap-y snap-mandatory h-[calc(100vh-4.1rem)] md:h-[calc(100vh-5rem)]"
className="h-[calc(100vh-4.1rem)] md:h-[calc(100vh-5rem)]"
>
{/* <div className="snap-start"> */}
<div>
<FirstScroll />
// 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 className="snap-start h-[calc(100vh-4.1rem)] md:h-[calc(100vh-5rem)]"> */}
<div className="h-[calc(100vh-4.1rem)] md:h-[calc(100vh-5rem)]">
<SecondScroll />
<div className="bg-black pt-6">
<TEDxInNumbers />
</div> */}
<FirstScroll />
<SecondScroll />

<div className="2024 relative mt-12">
<div className="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
</h2>
<p className="text-xl text-white bg-black mx-auto">
Stay pos<span className="text-our-red">TED</span>. More coming
soon!
</p>
</div>
</div>
</div>
<Timeline />
{/* <div className="snap-start"> */}
<div>
<NewFooter />
</div>
</div>
{/* <div className="snap-start"> */}
<div>
<NewFooter />
</div>
{/* </div> */}
<ScrollTopButton isHomePage={true} />
</main>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/About/AboutTEDx.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function AboutTEDx() {
backgroundImage: `url('/about/BG.png')`,
backgroundSize: "cover", // Optional: adjust as needed
}}
className="h-[calc(100vh-4.1rem)] md:h-[calc(100vh-5rem)] w-full relative flex flex-col justify-center"
className="h-[calc(100vh-65px)] w-full relative flex flex-col justify-center"
>
<div className="w-[55vw] md:w-[45vw] lg:w-[35vw] mx-auto lg:mx-0 lg:ml-[57vw]">
<h2 className="text-3xl md:text-5xl text-white font-black text-center">
Expand Down
2 changes: 1 addition & 1 deletion src/components/About/AboutTed.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function AboutTED() {
// backgroundImage: `url('BG.png.jpeg')`,
backgroundSize: "cover", // Optional: adjust as needed
}}
className="h-[calc(100vh-4.1rem)] md:h-[calc(100vh-5rem)] w-full relative flex flex-col justify-center"
className="h-[calc(100vh-65px)] w-full relative flex flex-col justify-center"
>
<div className="w-[55vw] md:w-[45vw] lg:w-[35vw] mx-auto lg:mx-0 lg:ml-[12vw]">
<h2 className="text-3xl md:text-5xl text-white font-black text-center">
Expand Down
2 changes: 1 addition & 1 deletion src/components/About/AboutTednTedx.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function AboutTednTedx() {
}}
>
<div className="text-white flex flex-col lg:flex-row lg:justify-between gap-[4rem] lg:gap-[1rem] text-justify lg:text-left lg:w-[80%] mx-auto">
<div className="left-col lg:width-[54%] w-[80%] lg:max-w-[40rem] mx-auto">
<div className="left-col lg:width-[54%] w-[80%] lg:max-w-[50rem] mx-auto">
<div className="title-wrapper mb-[2rem] text-[1rem] leading-[1.875rem]">
<h2 className="text-[2.25rem] leading-[2.25rem] lg:text-[4.25rem] lg:leading-[4.25rem] 4xl:text-[6.25rem] 4xl:leading-[6.25rem] font-bold">
About <span className="text-our-red">TED</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/About/AboutTedxNtua.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classes from "./AboutTedx.module.css";
function AboutTEDxNTUA() {
return (
<div
className="w-[100%] py-28"
className="h-[calc(100vh-65px)] flex flex-col justify-center"
style={{
// backgroundImage: `url('/about/about4b.jpeg')`,
backgroundImage: `url('/about/BG.png')`,
Expand Down
2 changes: 1 addition & 1 deletion src/components/About/WhatIsTed.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function WhatIsTed() {
return (
<div>
{/* <div
className="desktop-title lg:table hidden w-[100%] h-[calc(100vh-4.1rem)] md:h-[calc(100vh-5rem) text-center"
className="desktop-title lg:table hidden w-[100%] h-[calc(100vh-65px)] md:h-[calc(100vh-5rem) text-center"
style={{
backgroundImage: `url('/about/BG.png')`,
Expand Down
83 changes: 83 additions & 0 deletions src/components/ColumnScroll/Test 2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
"use client";
import React, { useEffect, useRef } from "react";
import {
LocomotiveScrollProvider,
useLocomotiveScroll,
} from "react-locomotive-scroll";
import "locomotive-scroll/dist/locomotive-scroll.css";

function AlternateColumnScroll() {
const containerRef = useRef(null);

useEffect(() => {
return () => {};
}, []);

return (
<LocomotiveScrollProvider
options={{
smooth: true,
}}
containerRef={containerRef}
>
<main
className="px-12 bg-blue-500 flex h-[125vh] w-[80vw] md:w-[90vw] lg:w-[80vw] mx-auto overflow-hidden rounded relative"
data-scroll-container
ref={containerRef}
>
<div className="relative z-10 flex pt-[5vh] pb-[15vh] mx-6 h-screen flex-col-reverse">
<Column num={1} />
</div>
<div
className="relative z-10 flex pt-[5vh] pb-[15vh] mx-6 "
data-scroll-section
>
<Column isCenter={true} num={2} />
</div>
<div className="relative z-10 flex pt-[5vh] pb-[15vh] mx-6 h-screen flex-col-reverse ">
<Column num={3} />
</div>
<div
className="relative z-10 flex pt-[5vh] pb-[15vh] mx-6 "
data-scroll-section
>
<Column isCenter={true} num={5} />
</div>
</main>
</LocomotiveScrollProvider>
);
}

export default AlternateColumnScroll;

function Column({ isCenter, num }) {
const { scroll } = useLocomotiveScroll();
const columnRef = useRef(null);

useEffect(() => {
if (scroll && !isCenter) {
scroll.on("scroll", (obj) => {
columnRef.current.style.transform = `translateY(${obj.scroll.y}px)`;
});
}

return () => {};
}, [scroll]);

return (
<div ref={columnRef}>
<div className="relative block will-change-transform">
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((i, idx) => (
<div className="m-0 relative z-10" key={idx}>
<div className="relative overflow-hidden rounded-xl cursor-pointer mt-[8vh] mx-[1vw] ">
<img
className="w-full h-full"
src={`./columnPhotos/column${i}.jpeg`}
/>
</div>
</div>
))}
</div>
</div>
);
}
53 changes: 45 additions & 8 deletions src/components/MainPage/1stScroll.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,72 @@
import Image from "next/image";
// import Image from "next/image";

function FirstScroll() {
return (
<section className="bg-black h-[calc(100vh-5rem)]">
<div className="w-[100%] h-auto relative flex flex-col-reverse items-end md:flex-none">
<section>
{/* justify-around */}
<div className="mobile-tablet 1st-scroll h-[calc(100vh-65px)] flex flex-col justify-around lg:hidden">
<div className="flex flex-col px-8 lg:bg-none my-16 mx-auto justify-center items-center">
<h1 className="text-3xl md:text-4xl lg:text-5xl xl:text-6xl font-extrabold text-white leading-tight text-center w-[80%] md:w-[70%] mx-auto">
<span className="text-our-red">WELCOME</span> TO THE TED
<span className="text-our-red">x</span>NTUA
</h1>
{/* <Image */}
<img
className="pt-4 w-[50%] mx-auto md:mx-0 md:w-[40%] lg:w-[80%]"
src="./homepage/archive.png"
width={300}
height={300}
alt="archive"
priority="true"
/>
</div>
{/* <Image */}
<img
className="w-auto lg:h-[95vh]"
className="w-[100%] h-auto mx-auto"
src="./homepage/starting-page1.png"
width={800}
height={800}
alt="archive"
// priority={true}
priority="true"
/>
<div className="flex flex-col px-8 md:w-[30%] md:absolute md:top-[25%] md:left-[10%] md:justify-start md:bg-none my-16 md:my-0 mx-auto">
<h1 className="text-2xl md:text-4xl lg:text-5xl xl:text-6xl font-extrabold text-white leading-tight text-center md:text-left px-16 md:px-0">
</div>

<div
className="destkop 1st-scroll h-[calc(100vh-65px)] hidden lg:grid grid-cols-2 justify-center items-center max-w-[100rem] mx-auto"
style={{
// backgroundImage: `url('/about/about4a.jpeg')`,
backgroundImage: `url('./homepage/starting-page.png')`,
// backgroundImage: `url('BG.png.jpeg')`,
backgroundSize: "cover", // Optional: adjust as needed
}}
>
<div className="flex flex-col gap-4 px-16 lg:bg-none my-16 mx-auto justify-center items-center max-w-[50rem]">
<h1 className="lg:text-4xl xl:text-5xl font-extrabold text-white leading-tight text-center mx-auto">
<span className="text-our-red">WELCOME</span> TO THE TED
<span className="text-our-red">x</span>NTUA
</h1>

{/* <Image */}
<img
className="pt-4 object-left w-[30%] mx-auto md:mx-0 md:w-[60%] lg:w-[80%]"
className="w-[70%] mx-auto"
src="./homepage/archive.png"
width={300}
height={300}
alt="archive"
priority="true"
/>
</div>
{/* <Image */}
<div></div>
{/* <img
className="w-auto max-h-[calc(100vh-65px)] mx-auto"
src="./homepage/starting-page.png"
width={800}
height={800}
alt="archive"
// priority={true}
priority="true"
/> */}
</div>
</section>
);
Expand Down
Loading

0 comments on commit 0d10b83

Please sign in to comment.