Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions frontend/src/app/(public)/donors/parallax.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,24 @@ export default function Parallax() {
How You Can Help
</h2>
</div>
{parallaxSections.map((section, index) => (
<div
key={section.number}
id={`step-${section.number}`}
className={`flex items-start md:h-screen md:items-center ${
index < parallaxSections.length - 1 ? "pb-[250px] md:pb-0" : "pb-[62px] md:pb-0"
}`}
>
<div className="box-border w-full px-[30px] md:px-0 md:pr-[17.85%] md:pl-[43.32%]">
<h1 className="flex items-baseline gap-[0.25em] pb-[10px] font-['Ethic_New'] text-[48px] leading-[110%] font-light text-white md:text-[64px]">
<span className="shrink-0">{section.number}.</span>
<span className="min-w-0 flex-1">
{section.title1} <i>{section.title2}</i>
</span>
</h1>
<p className="text-white font-['DM_Sans'] text-[16px] md:text-[24px] font-medium leading-[150%] tracking-[-0.48px]">
{section.content}
</p>
<div className="flex flex-col gap-[250px] pt-0 pb-[120px] md:gap-[500px] md:py-[500px]">
{parallaxSections.map((section) => (
<div key={section.number} id={`step-${section.number}`} className="flex items-start">
<div className="box-border w-full px-[30px] md:px-0 md:pr-[17.85%]">
{" "}
<h1 className="flex items-baseline gap-[0.25em] pb-[10px] font-['Ethic_New'] text-[48px] leading-[110%] font-light text-white md:text-[64px]">
<span className="shrink-0">{section.number}.</span>
<span className="min-w-0 flex-1">
{section.title1} <i>{section.title2}</i>
</span>
</h1>
<p className="text-white font-['DM_Sans'] text-[16px] md:text-[24px] font-medium leading-[150%] tracking-[-0.48px]">
{section.content}
</p>
</div>
</div>
</div>
))}
))}
</div>
</Background>
);
}
20 changes: 14 additions & 6 deletions frontend/src/app/(public)/donors/parallax_background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const Background = ({ children, className = "" }: BackgroundProps) => {
const titleRef = useRef<HTMLDivElement>(null);
const [isLocked, setIsLocked] = useState(false);
const [lockedTop, setLockedTop] = useState(0);
const desktopLayoutVars = {
"--donors-title-width": "clamp(300px, 32vw, 460px)",
"--donors-column-gap": "160px",
} as React.CSSProperties;

useEffect(() => {
const step5Element = document.getElementById("step-5");
Expand All @@ -21,7 +25,7 @@ const Background = ({ children, className = "" }: BackgroundProps) => {
if (!step5Title) return;

const step5Rect = step5Title.getBoundingClientRect();
const titleOffset = 200;
const titleOffset = 320;

if (step5Rect.top <= titleOffset && !isLocked) {
const containerRect = containerRef.current!.getBoundingClientRect();
Expand All @@ -46,28 +50,32 @@ const Background = ({ children, className = "" }: BackgroundProps) => {
return (
<div
ref={containerRef}
style={desktopLayoutVars}
className={`relative w-full md:bg-[linear-gradient(0deg,rgba(0,0,0,0.60)_0%,rgba(0,0,0,0.60)_100%),url('/imgs/donors.webp')] md:bg-cover md:bg-center md:bg-fixed md:bg-no-repeat ${className}`}
>
<div className="pointer-events-none sticky top-0 z-0 -mb-[100vh] h-screen bg-[linear-gradient(0deg,rgba(0,0,0,0.60)_0%,rgba(0,0,0,0.60)_100%),url('/imgs/donors.webp')] bg-no-repeat [background-position:54%_top] [background-size:auto_100%] md:hidden" />
<div
className="hidden md:block"
style={{
position: isLocked ? "absolute" : "sticky",
top: isLocked ? lockedTop : 0,
top: isLocked ? lockedTop : 200,
height: isLocked ? "auto" : "0",
zIndex: 10,
}}
>
<div
ref={titleRef}
className="pointer-events-none select-none flex text-white text-center font-dm-sans text-[48px] font-medium leading-[150%] tracking-[-0.96px] pt-[200px] pl-[100px]"
className="pointer-events-none select-none flex pl-[100px] pt-[200px] text-white font-dm-sans text-[48px] font-medium leading-[150%] tracking-[-0.96px]"
>
<span>How You Can Help</span>
<span className="block whitespace-normal" style={{ width: "var(--donors-title-width)" }}>
How You Can Help
</span>
</div>
</div>

{/* Content */}
<div className="relative z-20">{children}</div>
<div className="relative z-20 md:pl-[calc(100px+var(--donors-title-width)+var(--donors-column-gap))] md:pr-[100px]">
{children}
</div>
</div>
);
};
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/app/(public)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { Analytics } from "@vercel/analytics/next";
import { Geist, Geist_Mono } from "next/font/google";

import type { Metadata } from "next";

import "./globals.css";

Expand Down
93 changes: 54 additions & 39 deletions frontend/src/app/(public)/members/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,47 +65,62 @@ export default async function Members() {
</div>
</div>
{/* Mission Epic */}
<div className="relative flex w-full flex-col items-center gap-[50px] overflow-hidden border-t border-[#F4F4F4] px-[30px] pt-[50px] pb-[0px] md:flex-row md:content-end md:px-[100px] md:py-[50px]">
<div className="relative order-2 flex h-[330px] w-[340px] max-w-full flex-col md:static md:order-1 md:h-auto md:min-h-[700px] md:w-auto md:max-w-none md:flex-4">
<div className="absolute left-[75px] top-[0px] z-10 h-[82px] w-[123px] flex-shrink-0 flex-grow-0 overflow-hidden rounded-[16px] md:left-[80px] md:top-[40px] md:ml-8 md:h-[193px] md:w-[291px]">
<Image
src="/imgs/members_mission_1.webp"
alt="People Working Together"
fill
className="object-cover object-center"
priority
/>
</div>
<div className="absolute left-[0px] top-[45px] z-0 h-[207px] w-[270px] flex-shrink-0 flex-grow-0 overflow-hidden rounded-[16px] bg-[#172447] md:top-[145px] md:h-[491px] md:w-[643px]">
<Image
src="/imgs/members_mission_4.jpg"
alt="People Walking at Sunset"
fill
className="object-cover object-center"
priority
/>
<div className="absolute inset-0 rounded-[16px] bg-[#172447] opacity-100 mix-blend-color pointer-events-none" />
</div>
<div className="absolute left-[220px] top-[65px] z-20 m-0 h-[151px] w-[120px] flex-shrink-0 flex-grow-0 overflow-hidden rounded-[16px] p-0 md:left-[500px] md:right-auto md:top-[200px] md:h-[358px] md:w-[285px]">
<Image
src="/imgs/members_mission_2.jpg"
alt="Pen and Notebook on Table"
fill
className="object-cover object-center"
priority
/>
</div>
<div className="absolute bottom-0 left-[165px] top-[195px] z-10 m-0 h-[73px] w-[81px] overflow-hidden rounded-[16px] p-0 md:bottom-auto md:left-[360px] md:top-[530px] md:h-[173px] md:w-[192px]">
<Image
src="/imgs/members_mission_3.jpg"
alt="Pen and Napkin on Table"
fill
className="object-cover object-center"
priority
/>
<div className="relative flex w-full flex-col items-center gap-[50px] overflow-hidden border-t border-[#F4F4F4] px-[30px] pt-[50px] pb-[0px] md:flex-row md:items-center md:justify-start md:gap-[165px] md:px-[100px] md:py-[50px]">
<div className="relative order-2 flex h-[330px] w-[340px] max-w-full flex-col overflow-visible md:order-1 md:ml-[-115px] md:w-[var(--collage-width)] md:h-[calc(var(--collage-width)*703/785)] md:[--collage-width:min(785px,54vw)] md:flex-none md:self-center">
<div
className="relative origin-top-left overflow-visible"
style={{
width: "785px",
height: "703px",
transform: "scale(calc(var(--collage-width) / 785px))",
transformOrigin: "top left",
}}
>
<div
className="mission-inner-wrapper absolute inset-0 origin-top-left"
style={{ transformOrigin: "top left" }}
>
<div className="absolute left-[75px] top-[0px] z-10 h-[82px] w-[123px] flex-shrink-0 flex-grow-0 overflow-hidden rounded-[16px] md:left-[80px] md:top-[40px] md:ml-8 md:h-[193px] md:w-[291px]">
<Image
src="/imgs/members_mission_1.webp"
alt="People Working Together"
fill
className="object-cover object-center"
priority
/>
</div>
<div className="absolute left-[0px] top-[45px] z-0 h-[207px] w-[270px] flex-shrink-0 flex-grow-0 overflow-hidden rounded-[16px] bg-[#172447] md:top-[145px] md:h-[491px] md:w-[643px]">
<Image
src="/imgs/members_mission_4.jpg"
alt="People Walking at Sunset"
fill
className="object-cover object-center"
priority
/>
<div className="absolute inset-0 rounded-[16px] bg-[#172447] opacity-100 mix-blend-color pointer-events-none" />
</div>
<div className="absolute left-[220px] top-[65px] z-20 m-0 h-[151px] w-[120px] flex-shrink-0 flex-grow-0 overflow-hidden rounded-[16px] p-0 md:left-[500px] md:right-auto md:top-[200px] md:h-[358px] md:w-[285px]">
<Image
src="/imgs/members_mission_2.jpg"
alt="Pen and Notebook on Table"
fill
className="object-cover object-center"
priority
/>
</div>
<div className="absolute bottom-0 left-[165px] top-[195px] z-10 m-0 h-[73px] w-[81px] overflow-hidden rounded-[16px] p-0 md:bottom-auto md:left-[360px] md:top-[530px] md:h-[173px] md:w-[192px]">
<Image
src="/imgs/members_mission_3.jpg"
alt="Pen and Napkin on Table"
fill
className="object-cover object-center"
priority
/>
</div>
</div>
</div>
</div>
<div className="order-1 flex flex-col items-start gap-[20px] md:order-2 md:flex-3">
<div className="order-1 flex min-w-0 flex-col items-start gap-[20px] md:order-2 md:flex-1">
<h2 className="font-dm-sans text-[28px] leading-[150%] font-medium tracking-[-0.56px] text-[#172447] md:text-[48px] md:font-normal md:tracking-[-0.96px]">
Our Mission
</h2>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/CountrySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const CountrySection: React.FC<CountrySectionProps> = ({ id, countryName,
const memberCount = members.length;

const containerRef = useRef<HTMLDivElement | null>(null);
const [containerWidth, setContainerWidth] = useState<number>(0);
const [_containerWidth, setContainerWidth] = useState<number>(0);
const [membersPerRow, setMembersPerRow] = useState<number>(0);

useEffect(() => {
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/components/services-section/ImageDeck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import { DEFAULT_SERVICES } from "./types";

type ImageDeckProps = {
activeID: string;
scale?: number;
};

const NATURAL_WIDTH = 600;
const NATURAL_HEIGHT = 658;

const POSITION_CONFIGS = [
{ width: 501, height: 658, rotation: 0, hasOverlay: false, zIndex: 4, bottom: 0, opacity: 1 }, // Front
{ width: 418, height: 530, rotation: -3.86, hasOverlay: true, zIndex: 3, bottom: 80, opacity: 1 }, // Second
{ width: 501, height: 658, rotation: 0, hasOverlay: false, zIndex: 4, bottom: 0, opacity: 1 },
{ width: 418, height: 530, rotation: -3.86, hasOverlay: true, zIndex: 3, bottom: 80, opacity: 1 },
{
width: 340,
height: 470,
Expand All @@ -23,7 +24,7 @@ const POSITION_CONFIGS = [
zIndex: 2,
bottom: 110,
opacity: 1,
}, // Third
},
{
width: 340,
height: 470,
Expand All @@ -32,12 +33,12 @@ const POSITION_CONFIGS = [
zIndex: 1,
bottom: 110,
opacity: 0,
}, // Fourth (fades and shrinks away)
},
];

const POSITION_LEFT = [120, 95, 55, 55];

export const ImageDeck = ({ activeID }: ImageDeckProps) => {
export const ImageDeck = ({ activeID, scale: _scale = 1 }: ImageDeckProps) => {
const activeIndex = DEFAULT_SERVICES.findIndex((service) => service.id === activeID);
const wrapperRef = useRef<HTMLDivElement>(null);
const [scale, setScale] = useState(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ServiceAccordianItem } from "./ServiceAccordianItem";
import { DEFAULT_SERVICES } from "./types";

type ServiceAccordianProps = {
activeID: string; //The expanded Item's String
activeID: string;
onServiceChange: (id: string) => void;
};

Expand Down
22 changes: 21 additions & 1 deletion frontend/src/components/services-section/ServicesSection.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
"use client";

import React, { useState } from "react";
import React, { useEffect, useRef, useState } from "react";

import { ImageDeck } from "./ImageDeck";
import { ServiceAccordian } from "./ServiceAccordian";

export const ServicesSection = () => {
const [activeID, setActiveID] = useState("Microloans");
const containerRef = useRef<HTMLDivElement>(null);
const [_scale, setScale] = useState(1);

useEffect(() => {
const calculate = () => {
if (!containerRef.current) return;
const containerWidth = containerRef.current.offsetWidth;
const accordionWidth = 647;
const gap = 50;
const deckNaturalWidth = 600;
const available = containerWidth - accordionWidth - gap;
const newScale = Math.min(1, Math.max(0.4, available / deckNaturalWidth));
setScale(newScale);
};

calculate();
const observer = new ResizeObserver(calculate);
if (containerRef.current) observer.observe(containerRef.current);
return () => observer.disconnect();
}, []);

return (
<section className="w-full bg-white px-[30px] py-[50px] md:px-[100px]">
Expand Down
Loading