Files
adnexus/assets/CaseStudy-Bza9hxXE.js
2026-09-20 08:53:09 -07:00

2 lines
8.7 KiB
JavaScript

import{r as h,j as e}from"./ui-SA1K2VdO.js";import{F as w}from"./index-BBRaFEzF.js";import{G as y}from"./GlobalMuteButton-BJwg7Gs3.js";import{V as k,q as I,y as S,e as f,G as p,ad as L,I as z,i as E,j as M}from"./utils-BOogt4zp.js";import{c as u}from"./caseStudies-3naBYam0.js";import{S as V}from"./ScrollReveal-C8Hi82o-.js";import{d as P,N as $,L as b}from"./vendor-khT4bKqW.js";const U=({videoId:i,className:n=""})=>{const[a,o]=h.useState(!0),m=`video_mute_state_${i}`;h.useEffect(()=>{const r=localStorage.getItem(m);r!==null&&o(r==="true")},[m]);const s=r=>{r.preventDefault(),r.stopPropagation();const d=!a;o(d),localStorage.setItem(m,d.toString()),document.querySelectorAll("iframe").forEach(x=>{if(x.src&&x.src.includes("youtube.com/embed")){const t=new URL(x.src);d?t.searchParams.set("mute","1"):t.searchParams.set("mute","0"),x.src=t.toString()}})};return e.jsx("button",{onClick:s,className:`absolute z-20 p-2 rounded-full bg-black/50 text-white transition-all duration-300 hover:bg-black/70 border ${a?"border-gray-400":"border-white"} ${n}`,"aria-label":a?"Unmute":"Mute",children:a?e.jsxs("div",{className:"relative",children:[e.jsx(k,{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(I,{size:20,className:"text-white"})})};function B(i,n=2){const a=Object.keys(u).filter(s=>s!==i);return C([...a]).slice(0,n).map(s=>{const r=u[s],d=r.images&&r.images.length>0?r.images[0]:F(s);return{id:r.id,title:r.title,subtitle:r.subtitle,imageUrl:d,route:`/case-study/${r.id}`}})}function C(i){const n=[...i];for(let a=n.length-1;a>0;a--){const o=Math.floor(Math.random()*(a+1));[n[a],n[o]]=[n[o],n[a]]}return n}function F(i){return{"damon-motorcycles":"/images/damon/damon-1.jpg",bellabeat:"/images/bellabeat/bella-1.jpg","cover-build":"/images/cover/cover-1.png","casper-blockchain":"/images/casper/casper-1.jpg","myle-tap":"/images/myle/myle-1.jpg","unikoin-gold":"/images/unikrn/unikrn-1.jpg",trillerfest:"/images/triller/triller-1.jpg"}[i]||"/placeholder.svg"}const W=()=>{const{id:i}=P(),[n,a]=h.useState(!1),[o,m]=h.useState({});if(!i||!u[i])return e.jsx($,{to:"/our-work",replace:!0});const s=u[i],r=B(i,3);h.useEffect(()=>{document.body.classList.add("dark");const t=()=>{const c=localStorage.getItem("bannerShown"),g=localStorage.getItem("bannerExpiry");if(localStorage.getItem("discountUsed")==="true"){a(!1);return}if(c==="true"&&g){const v=parseInt(g,10),N=new Date().getTime();a(v>N)}else a(!1)},l=c=>{a(c.detail.visible)};return window.addEventListener("bannerVisibilityChanged",l),t(),()=>{document.body.classList.remove("dark"),window.removeEventListener("bannerVisibilityChanged",l)}},[]);const d=t=>{console.error(`Failed to load image ${t+1} for ${s.title}`),m(l=>({...l,[t]:!0}))},j=()=>{if(!s.socialLinks||!s.socialLinks.links||s.socialLinks.links.length===0)return null;const t=l=>{const c=l.toLowerCase();return c.includes("web")||c.includes("site")?e.jsx(p,{size:20,className:"text-white"}):c.includes("linkedin")?e.jsx(L,{size:20,className:"text-white"}):c.includes("instagram")?e.jsx(z,{size:20,className:"text-white"}):c.includes("facebook")?e.jsx(E,{size:20,className:"text-white"}):c.includes("twitter")?e.jsx(M,{size:20,className:"text-white"}):e.jsx(p,{size:20,className:"text-white"})};return e.jsx("div",{className:"flex gap-4 mb-12",children:s.socialLinks.links.map((l,c)=>e.jsx("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full bg-white/10 flex items-center justify-center hover:bg-white/20 transition-colors",children:t(l.platform)},c))})},x=()=>i==="casper-blockchain"?"md:w-[49%]":"md:w-[70%]";return e.jsx(V,{children:e.jsxs("div",{className:"min-h-screen bg-black text-white",children:[e.jsx(y,{}),e.jsxs("main",{className:`${n?"pt-36":"pt-32"}`,children:[e.jsxs("div",{className:"relative w-full h-[35vh] md:h-[49vh] overflow-hidden flex justify-center pt-12 mb-8",children:[e.jsx("div",{className:`w-full ${x()} h-full`,children:s.videoUrl?e.jsx("iframe",{className:"w-full h-full object-cover",src:s.videoUrl,title:s.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,frameBorder:"0"}):s.images&&s.images.length>0?e.jsx("img",{src:s.images[0],alt:s.title,className:"w-full h-full object-cover"}):null}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black to-transparent"}),s.videoId&&e.jsx(U,{videoId:s.videoId,className:"bottom-6 right-6 z-30"})]}),e.jsxs("div",{className:"container-custom py-16",children:[e.jsxs(b,{to:"/our-work",className:"inline-flex items-center text-white/70 hover:text-white mb-8 transition-colors",children:[e.jsx(S,{className:"mr-2 h-4 w-4"}),"Back to all projects"]}),e.jsx("h1",{className:"text-4xl md:text-6xl font-bold mb-6",children:s.title}),e.jsx("p",{className:"text-xl md:text-2xl text-white/80 mb-6",children:s.subtitle}),j(),e.jsxs("div",{className:"grid md:grid-cols-2 gap-12 mb-16",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Overview"}),s.overview.map((t,l)=>e.jsx("p",{className:"text-lg text-white/80 mb-4",children:t},`overview-${l}`))]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Services"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.services.map(t=>e.jsx("span",{className:"bg-white/10 px-3 py-1 rounded-full text-sm",children:t},t))})]})]}),s.images&&s.images.length>1&&e.jsxs("div",{className:"mb-16",children:[e.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Gallery"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:s.images.slice(0,3).map((t,l)=>e.jsx("div",{className:"rounded-lg overflow-hidden bg-gray-800 relative min-h-[16rem]",children:o[l]?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-500",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm",children:"Image could not be loaded"}),e.jsx("p",{className:"text-xs mt-2 px-4 break-all",children:t})]})}):e.jsx("img",{src:t,alt:`${s.title} - Image ${l+1}`,className:"w-full h-64 object-cover hover:scale-105 transition-transform duration-300",onError:()=>d(l),loading:"lazy"})},l))})]}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-8 mb-16",children:[e.jsxs("div",{className:"bg-white/5 p-6 rounded-lg",children:[e.jsx("h2",{className:"text-xl font-bold mb-3",children:"Challenge"}),e.jsx("p",{className:"text-white/80",children:s.challenge[0]})]}),e.jsxs("div",{className:"bg-white/5 p-6 rounded-lg",children:[e.jsx("h2",{className:"text-xl font-bold mb-3",children:"Solution"}),e.jsx("p",{className:"text-white/80",children:s.solution[0]})]}),e.jsxs("div",{className:"bg-white/5 p-6 rounded-lg",children:[e.jsx("h2",{className:"text-xl font-bold mb-3",children:"Results"}),e.jsx("ul",{className:"text-white/80 space-y-2",children:s.results.slice(0,3).map((t,l)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2 text-accent",children:"•"}),e.jsx("span",{children:t})]},l))})]})]}),s.testimonial&&e.jsxs("div",{className:"mb-16 bg-black text-white p-8 md:p-12 rounded-lg border border-white/10",children:[e.jsxs("blockquote",{className:"text-xl md:text-2xl italic mb-6",children:['"',s.testimonial.quote,'"']}),e.jsxs("p",{className:"font-bold",children:["- ",s.testimonial.author,", ",s.testimonial.role]})]}),r&&r.length>0&&e.jsxs("div",{className:"mt-20",children:[e.jsx("h2",{className:"text-2xl font-bold mb-6",children:"More Projects"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:r.map((t,l)=>e.jsx(b,{to:t.route,className:"group",children:e.jsxs("div",{className:"relative overflow-hidden rounded-lg h-64",children:[e.jsx("img",{src:t.imageUrl,alt:t.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 to-transparent"}),e.jsxs("div",{className:"absolute bottom-0 left-0 p-6",children:[e.jsx("h3",{className:"text-lg font-bold mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-white/70",children:t.subtitle}),e.jsxs("span",{className:"mt-2 text-accent flex items-center text-sm opacity-0 group-hover:opacity-100 transition-opacity",children:["View Project",e.jsx(f,{size:14,className:"ml-1"})]})]})]})},l))})]}),e.jsxs("div",{className:"text-center mt-40 mb-20",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-10",children:s.ctaTitle||"Want to create something amazing?"}),e.jsxs(b,{to:"/contact",className:"bg-accent hover:bg-accent/90 text-black py-3 px-6 rounded-full inline-flex items-center transition-all",children:["Let's Talk",e.jsx(f,{size:18,className:"ml-2"})]})]})]})]}),e.jsx(w,{})]})})};export{W as default};