PageSourceSearch

https://www.mahmutelipek.com/assets/ProjectDetail-Dp4yLohu.js

js mahmutelipek.com collected 2026-10-08 10:33:34 UTC 7,752 bytes, 31 lines download raw bytes

1import{u as k,r as o,g as n,a as z,s as E,S as j,j as e,L as x,m as f,F as N,C as I,b as $,c as _}from"./index-Dku8bPN6.js";function F(i){return(i??"").split(",").map(c=>c.trim()).filter(Boolean)}function D(i){const t=(i.content_blocks?.find(d=>d.type==="text"&&d.value?.trim())?.value??i.content_body??"").replace(/^#+\s*.*$/gm," ").replace(/\s+/g," ").trim(),p=`${i.title}: ${i.roles?.join(", ")||"a project"} by ${j}.`;if(!t)return p;if(t.length<=155)return t;const l=t.slice(0,155);return`${l.slice(0,Math.max(l.lastIndexOf(" "),100))}…`}function b(i){return i.length<=1?i.join(""):`${i.slice(0,-1).join(", ")} and ${i[i.length-1]}`}const P=I,T=3;function S({title:i,children:c}){return e.jsxs("section",{className:"rails",style:{paddingTop:"66px",flex:"1 0 auto"},children:[e.jsx("style",{children:`
2        .page-message { font-size: 14px; line-height: 22px; letter-spacing: -0.09px; color: #d4d4d4; }
3        .page-message h1 { font-size: clamp(1.5rem, 5vw, 1.75rem); line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; color: #fff; margin-bottom: 0.5rem; }
4        .page-message p { margin: 0; font-size: inherit; }
5        .page-message p + p { margin-top: 0.75rem; }
6        .page-message strong { font-weight: 550; color: #fff; }
7        .page-message .muted { color: var(--text-secondary); }
8        @media (max-width: 740px) { .page-message { font-size: 15px; line-height: 23px; } }
9      `}),e.jsx("div",{className:"frame page-message",children:e.jsxs("div",{style:{padding:"var(--pad)"},children:[i&&e.jsx("h1",{children:i}),c]})}),e.jsx("div",{className:"hatch"})]})}function A(){const{slug:i}=k(),c=i?!!n.projectDetails[i]:!1,[t,p]=o.useState(i&&n.projectDetails[i]||null),[l,d]=o.useState(!c),[h,u]=o.useState(null),[m,v]=o.useState(null);o.useEffect(()=>{if(window.scrollTo(0,0),!i)return;const s=!!n.projectDetails[i];d(!s),s&&p(n.projectDetails[i])},[i]),o.useEffect(()=>{async function s(){if(!i)return;let a=n.projectsList;if(!a||a.length===0){const{data:r}=await _.from("projects").select("title, slug, sort_order").neq("is_visible",!1).order("sort_order",{ascending:!0});r&&(a=r,n.projectsList=r)}if(a&&a.length>0){const r=a.findIndex(g=>g.slug===i);r!==-1?(u(r>0?a[r-1]:null),v(r<a.length-1?a[r+1]:null)):(u(null),v(null))}}s()},[i]),o.useEffect(()=>{async function s(){if(!i||n.projectDetails[i])return;const{data:a,error:r}=await _.from("projects").select("*").eq("slug",i).neq("is_visible",!1).maybeSingle();r&&console.error("Error fetching project:",r),a&&(p(a),n.projectDetails[i]=a),d(!1)}s()},[i]);const w=F(t?.industries),y=new Set((t?.content_blocks??[]).filter(s=>s.type==="image").slice(0,T).map(s=>s.id));return z(t?{title:`${t.title} | ${j}`,description:D(t),image:t.cover_image_url?E(t.cover_image_url):void 0,path:`/works/${t.slug}`}:!t&&!l?{title:`Project not found | ${j}`,noindex:!0}:{}),l?e.jsx(S,{children:e.jsx("p",{className:"muted",children:"Loading…"})}):!t&&!l?e.jsxs(S,{title:"Project not found",children:[e.jsx("p",{children:"This project doesn't exist or has been removed."}),e.jsx("p",{children:e.jsx(x,{to:"/#projects",className:"ulink",children:e.jsx("strong",{children:"See all projects"})})})]}):e.jsx(e.Fragment,{children:t&&!l&&e.jsxs(f.article,{className:"rails",initial:{opacity:0}
9,animate:{opacity:1},transition:{duration:.8},style:{paddingTop:"66px",minHeight:"100vh",color:"#ffffff"},children:[e.jsx("style",{children:`
10            .detail { font-size: 14px; line-height: 22px; letter-spacing: -0.09px; color: #d4d4d4; }
11            .detail h1 { font-size: clamp(1.5rem, 5vw, 1.75rem); line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; color: #fff; overflow-wrap: anywhere; }
12            .detail h3 { font-size: 15px; line-height: 22px; font-weight: 600; color: #fff; margin-bottom: 0.5rem; overflow-wrap: anywhere; }
13            .detail p { font-size: inherit; margin: 0; overflow-wrap: anywhere; }
14            .detail p + p { margin-top: 0.75rem; }
15            .detail .meta { margin-top: 0.5rem; }
16            .detail strong { font-weight: 550; color: #fff; }
17            .detail-media { width: 100%; background: #0a0a0a; overflow: hidden; border-radius: 12px; }
18            .detail-pager { display: grid; grid-template-columns: 1fr 1fr; }
19            .detail-pager a { display: block; padding: var(--pad); transition: background-color 0.2s ease; }
20            .detail-pager a:hover { background: rgba(255, 255, 255, 0.04); }
21            .detail-pager .next { text-align: right; border-left: 1px solid var(--line); }
22            .detail-pager .pager-label { font-size: 12px; line-height: 16px; color: var(--text-secondary); margin-bottom: 4px; }
23            .detail-pager .pager-title { font-size: 15px; font-weight: 500; color: #fff; overflow-wrap: anywhere; }
24            @media (max-width: 740px) {
25              .detail { font-size: 15px; line-height: 23px; }
26              .detail h3 { line-height: 23px; }
27              .detail-pager .pager-label { font-size: 13px; }
28            }
29          `}),e.jsx("div",{className:"frame detail",children:e.jsxs("div",{style:{padding:"var(--pad)"},children:[e.jsx("h1",{children:t.title}),e.jsxs("p",{className:"meta",children:[w.length>0&&e.jsxs(e.Fragment,{children:["A ",e.jsx("strong",{children:b(w)})," project."," "]}),(t.roles?.length>0||t.date)&&(t.roles?.length>0?e.jsxs(e.Fragment,{children:["I worked on it as ",e.jsx("strong",{children:b(t.roles)}),t.date&&e.jsxs(e.Fragment,{children:[" ","in ",e.jsx("strong",{children:t.date})]}),"."," "]}):e.jsxs(e.Fragment,{children:["Completed in ",e.jsx("strong",{children:t.date}),"."," "]})),t.link&&e.jsxs(e.Fragment,{children:["See it live at"," ",e.jsx("a",{className:"ulink",href:t.link.startsWith("http")?t.link:`https://${t.link}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx("strong",{children:t.link.replace(/^https?:\/\//,"").split("/")[0].replace(/^www\./,"")})}),"."]})]})]})}),e.jsx("div",{className:"hatch"}),e.jsx("div",{className:"frame detail",children:e.jsx("div",{style:{padding:"var(--pad)",display:"flex",flexDirection:"column",gap:"var(--pad)"},children:t.content_blocks&&t.content_blocks.length>0?t.content_blocks.map(s=>e.jsx("div",{children:s.type==="text"?e.jsxs("div",{children:[s.title&&e.jsx("h3",{children:s.title}),s.value.split(`
30`).filter(a=>a.trim().length>0).map((a,r)=>e.jsx("p",{children:a},r))]}):s.type==="image"?e.jsx(f.div,{initial:y.has(s.id)?!1:{y:24,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{duration:.6,ease:"easeOut"},children:e.jsx(N,{className:"detail-media",src:s.value,alt:"Project visual",sizes:P,priority:y.has(s.id)})}):e.jsx(f.div,{initial:{y:24,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{duration:.6,ease:"easeOut"},children:e.jsx($,{className:"detail-media",src:s.value})})},s.id)):e.jsxs(e.Fragment,{children:[t.content_body&&e.jsx("div",{children:t.content_body.split(`
31`).filter(s=>s.trim().length>0).map((s,a)=>{const r=s.startsWith("#"),g=s.replace(/^#+\s*/,"");return r?e.jsx("h3",{style:{marginTop:a===0?0:"1.5rem"},children:g},a):e.jsx("p",{children:g},a)})}),t.cover_image_url&&e.jsx(N,{className:"detail-media",src:t.cover_image_url,alt:t.title,sizes:P,priority:!0})]})})}),e.jsx("div",{className:"hatch"}),e.jsx("div",{className:"frame detail",children:e.jsxs("div",{className:"detail-pager",children:[h?e.jsxs(x,{to:`/works/${h.slug}`,children:[e.jsx("div",{className:"pager-label",children:"Previous"}),e.jsx("div",{className:"pager-title",children:h.title})]}):e.jsx("div",{}),m?e.jsxs(x,{to:`/works/${m.slug}`,className:"next",children:[e.jsx("div",{className:"pager-label",children:"Next"}),e.jsx("div",{className:"pager-title",children:m.title})]}):e.jsx("div",{className:"next"})]})})]})})}export{A as ProjectDetail};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.