Files
adnexus/assets/OurWork-BdPbLxwH.js
2026-09-20 08:53:09 -07:00

2 lines
7.1 KiB
JavaScript

import{r as s,j as e}from"./ui-SA1K2VdO.js";import{F as S}from"./index-BBRaFEzF.js";import{B as $}from"./button-DN-hGit_.js";import{v as I,V as L,q as z,A as C,t as P,c as R}from"./utils-BOogt4zp.js";import{L as V}from"./vendor-khT4bKqW.js";import{S as F}from"./ScrollReveal-C8Hi82o-.js";import{G as B}from"./GlobalMuteButton-BJwg7Gs3.js";import{c as O}from"./caseStudies-3naBYam0.js";const Y=({title:l,youtubeId:a,description:d,index:t,projectId:i,thumbnailUrl:u})=>{const n=s.useRef(null),[f,h]=s.useState(!1),[p,x]=s.useState(!1),[g,r]=s.useState(!0),[m,c]=s.useState(!1);s.useEffect(()=>{const o=new IntersectionObserver(M=>{M.forEach(E=>{E.isIntersecting?(h(!0),c(!0)):c(!1)})},{threshold:.6});return n.current&&o.observe(n.current),()=>{n.current&&o.unobserve(n.current)}},[]);const j=o=>`https://www.youtube.com/embed/${o}?autoplay=${m||p?1:0}&mute=${g?1:0}&loop=1&playlist=${o}&controls=0&showinfo=0&rel=0&modestbranding=1&iv_load_policy=3&fs=0&color=white&disablekb=1&enablejsapi=1`,y=()=>{x(!0),c(!0)},b=()=>{x(!1),window.matchMedia("(hover: hover)").matches&&c(!1)},w=()=>u||{damon:"/images/damon/damon-1.jpg","damon-motorcycles":"/images/damon/damon-1.jpg",bellabeat:"/images/bellabeat/bella-1.jpg","cover-build":"/images/cover/cover.jpg","casper-blockchain":"/images/casper/casper-1.jpg","myle-tap":"/images/myle/myle-1.jpg","unikoin-gold":"/images/unikrn/unikrn-1.jpg",trillerfest:"/images/triller/Migos-poster.jpg"}[i]||(a?"https://img.youtube.com/vi/"+a+"/maxresdefault.jpg":"/placeholder.svg");s.useEffect(()=>{if(typeof window<"u"){window.globalMuteState===void 0&&(window.globalMuteState=!0),r(window.globalMuteState);const o=()=>{r(window.globalMuteState)};return window.addEventListener("globalMuteChange",o),()=>{window.removeEventListener("globalMuteChange",o)}}},[]);const v=o=>{o.preventDefault(),o.stopPropagation(),typeof window<"u"&&(window.globalMuteState=!window.globalMuteState,window.dispatchEvent(new Event("globalMuteChange"))),r(!g)};return e.jsx("div",{ref:n,className:`video-container rounded-xl overflow-hidden h-full ${f?"animate-scale-up":"opacity-0"}`,style:{animationDelay:`${t*.1}s`},children:e.jsxs("div",{className:"flex flex-col h-full",onMouseEnter:y,onMouseLeave:b,children:[e.jsxs("div",{className:"relative w-full h-[360px] overflow-hidden",children:[e.jsx("div",{className:`absolute inset-0 z-10 transition-opacity duration-300 ${p?"opacity-0":"opacity-100"}`,style:{backgroundImage:`url(${w()})`,backgroundSize:"cover",backgroundPosition:"center",height:"100%",width:"100%",objectFit:"cover"},children:e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity duration-300 hover:bg-black/40",children:e.jsx("div",{className:"w-16 h-16 flex items-center justify-center rounded-full bg-white/10 backdrop-blur-md",children:e.jsx(I,{className:"text-white",size:30})})})}),e.jsx("div",{className:`w-full h-full transition-opacity duration-300 ${p?"opacity-100":"opacity-0"}`,children:e.jsx("iframe",{className:"w-full h-full object-cover",src:j(a),title:l,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,loading:"lazy"})}),e.jsx("button",{onClick:v,className:`absolute top-4 right-4 p-2 rounded-full bg-black/50 text-white z-30 transition-all duration-300 ${p?"opacity-100":"opacity-0"} border ${g?"border-gray-400":"border-white"}`,children:g?e.jsxs("div",{className:"relative",children:[e.jsx(L,{size:20,className:"text-gray-400"}),e.jsx("div",{className:"absolute top-1/2 left-1/2 w-0.5 h-7 bg-gray-400 -rotate-45 -translate-x-1/2 -translate-y-1/2"})]}):e.jsx(z,{size:20,className:"text-white"})})]}),e.jsx("div",{className:"p-8 pt-8 pb-8 bg-gray-900 flex-shrink-0 h-[220px]",children:e.jsxs("div",{className:"text-left flex flex-col h-full",children:[e.jsxs("div",{className:"mb-auto",children:[e.jsx("h2",{className:"text-white text-2xl md:text-3xl font-bold uppercase tracking-tight mb-4",children:l}),d&&e.jsx("p",{className:"text-white/90 text-base md:text-lg font-medium mb-4 max-w-md font-inter line-clamp-2",children:d})]}),e.jsx("div",{className:"mb-4",children:e.jsx(V,{to:`/case-study/${i}`,children:e.jsxs($,{className:"bg-gray-700 hover:bg-gray-800 text-white font-medium rounded-full px-6 py-2 transition-all duration-300 inline-flex items-center gap-1",children:["Explore ",e.jsx(C,{className:"h-4 w-4"})]})})})]})})]})})};function k(...l){return P(R(l))}const H=({className:l,children:a})=>e.jsx("div",{className:k("grid grid-cols-1 md:grid-cols-2 auto-rows-[minmax(400px,1fr)] gap-4 md:gap-6",l),children:a}),U=({className:l,size:a="medium",children:d})=>e.jsx("div",{className:k("overflow-hidden rounded-xl relative",{"md:col-span-1 row-span-1":a==="small","md:col-span-1 md:row-span-1":a==="medium","md:col-span-2 md:row-span-1":a==="large"},l),children:d}),N=({children:l,speed:a=.1,className:d=""})=>{const[t,i]=s.useState(0),u=s.useRef(null),[n,f]=s.useState(0),[h,p]=s.useState(0),[x,g]=s.useState(!1);return s.useEffect(()=>{const r=u.current;if(!r)return;const m=()=>{const c=r.getBoundingClientRect();f(c.top+window.scrollY),p(c.height)};return m(),window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]),s.useEffect(()=>{const r=()=>{if(!u.current)return;const m=window.innerHeight,c=window.scrollY+m/2,b=(n+h/2-c)*a;i(b);const w=n+h,v=window.scrollY<w&&window.scrollY+m>n;g(v)};return window.addEventListener("scroll",r),r(),()=>{window.removeEventListener("scroll",r)}},[a,n,h]),e.jsx("div",{ref:u,className:`relative ${d}`,style:{transform:`translateY(${t}px)`,opacity:x?1:0,transition:"opacity 0.5s ease-out"},children:l})},X=()=>{const l=t=>{if(!t)return"";const i=t.match(/embed\/([^?]+)/);return i?i[1]:""},a=t=>["trillerfest","damon-motorcycles"].includes(t)?"large":"medium",d=Object.values(O).map(t=>({id:t.id==="damon-motorcycles"?"damon":t.id,title:t.title,youtubeId:l(t.videoUrl),description:t.subtitle,size:a(t.id),className:"h-full"}));return s.useEffect(()=>(document.body.classList.add("dark"),()=>{document.body.classList.remove("dark")}),[]),e.jsx(F,{children:e.jsxs("div",{className:"min-h-screen bg-black text-white",children:[e.jsx(B,{}),e.jsxs("main",{className:"pt-24",children:[e.jsx("header",{className:"pt-16 md:pt-24 pb-12 container mx-auto px-6",children:e.jsxs(N,{speed:.1,children:[e.jsx("h1",{className:"text-6xl md:text-9xl font-black tracking-tighter uppercase leading-none mb-12 pt-12 text-white text-center md:text-left",children:"OUR WORK"}),e.jsx("p",{className:"text-white/80 text-lg md:text-xl max-w-2xl mx-auto md:mx-0",children:"Showcasing our most impactful digital campaigns and creative work."})]})}),e.jsx("section",{id:"gallery",className:"py-8 md:py-16 bg-gradient-to-b from-black via-black/95 to-black/90",children:e.jsx("div",{className:"container-custom",children:e.jsx(H,{className:"max-w-7xl mx-auto gap-6 md:gap-8",children:d.map((t,i)=>e.jsx(N,{speed:t.id==="cover-build"?0:.03*(i%3+1),className:"h-full",children:e.jsx(U,{size:t.size,className:t.className,children:e.jsx(Y,{title:t.title,youtubeId:t.youtubeId,description:t.description,index:i,projectId:t.id==="damon"?"damon-motorcycles":t.id,thumbnailUrl:t.thumbnailUrl})})},t.id))})})})]}),e.jsx(S,{})]})})};export{X as default};