"use client"; import { motion, MotionValue, useScroll, useTransform } from "motion/react"; import Link from "next/link"; import { useRef } from "react"; const collaborators = { aotearoa: Array.from({ length: 16 }).map((x, i) => `Organisation ${i}`), international: Array.from({ length: 8 }).map((x, i) => `Organisation ${i}`), }; export default function Collboaration() { const containerRef = useRef(null); const { scrollYProgress } = useScroll({ target: containerRef, offset: ["start end", "end end"], }); const titleOpacity = useTransform(scrollYProgress, [0.15, 0.25], [0, 1]); const titleY = useTransform(scrollYProgress, [0.15, 0.25], [-40, 0]); const aotearoaOpacity = useTransform( scrollYProgress, [0.25, 0.3, 0.6, 0.7], [0, 1, 1, 0] ); const aotearoaY = useTransform( scrollYProgress, [0.25, 0.3, 0.6, 0.7], [20, 0, 0, -20] ); const internationalOpacity = useTransform( scrollYProgress, [0.6, 0.7], [0, 1] ); const internationalY = useTransform(scrollYProgress, [0.6, 0.7], [20, 0]); const n = [collaborators.aotearoa.length, collaborators.international.length]; return ( We have worked with … Aotearoa International {collaborators.aotearoa.map((org, i) => ( ))} {collaborators.international.map((org, i) => ( ))} Want to collaborate? Get in touch > ); } const Collaborator = ({ name, progress, range, }: { name: string; progress: MotionValue; range: [number, number, number, number]; }) => { const opacity = useTransform(progress, range, [0, 1, 1, 0]); return ( {name} ); };
Get in touch >