PageSourceSearch

https://macapp.supply/assets/categories-mfQzZDgt.js

js macapp.supply collected 2026-10-08 00:23:58 UTC 9,566 bytes, 1 lines download raw bytes

1import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{i as n}from"./useRouter-Dxp5njYH.js";import{t as r}from"./link-DXFd9eLX.js";import{t as i}from"./useQuery-CRexpz3x.js";import{I as a,v as o}from"./index-CjD9AHg_.js";import{a as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g}from"./sheet--W5iHfPl.js";import{t as _}from"./img-n3MMNLJf.js";import{t as v}from"./SiteFooter-CeNcitjF.js";import{t as y}from"./RevealOnScroll-BybFNrB4.js";var b=e(n()),x=t();function S(e){return e.toLowerCase().trim().replace(/&/g,`and`).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function C({name:e,apps:t}){let n=t.slice(0,3),i=t.length;return(0,x.jsx)(r,{to:`/category/$slug`,params:{slug:S(e)},className:`group relative block`,"aria-label":`${e} — ${i} apps`,children:(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(`div`,{className:`absolute -top-3 left-5 h-6 w-24 rounded-t-xl bg-secondary border border-border border-b-0 transition-transform duration-300 group-hover:-translate-y-0.5`}),(0,x.jsxs)(`div`,{className:`relative aspect-[4/3] w-full overflow-hidden rounded-2xl rounded-tl-xl border border-border bg-gradient-to-br from-secondary/80 to-secondary transition-shadow duration-300 group-hover:shadow-xl`,children:[(0,x.jsx)(`div`,{className:`absolute inset-x-0 top-[42%] flex -translate-y-1/2 items-center justify-center`,children:(0,x.jsxs)(`div`,{className:`relative h-24 w-24`,children:[n.map((e,t)=>{let n=[{base:`-rotate-[14deg] -translate-x-10 -translate-y-1`,hover:`group-hover:-translate-x-16 group-hover:-rotate-[20deg] group-hover:-translate-y-2`,z:`z-10`},{base:`rotate-0 translate-y-1`,hover:`group-hover:-translate-y-2`,z:`z-20`},{base:`rotate-[14deg] translate-x-10 -translate-y-1`,hover:`group-hover:translate-x-16 group-hover:rotate-[20deg] group-hover:-translate-y-2`,z:`z-10`}][t];return(0,x.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center transition-all duration-500 ease-out ${n.z}`,children:(0,x.jsx)(`div`,{className:`transition-all duration-500 ease-out ${n.base} ${n.hover}`,children:e.icon_image_url?(0,x.jsx)(`img`,{loading:`lazy`,decoding:`async`,src:_(e.icon_image_url,192),alt:``,className:`h-20 w-20 rounded-2xl bg-white object-cover shadow-xl ring-1 ring-black/5`}):(0,x.jsx)(`div`,{className:`flex h-20 w-20 items-center justify-center rounded-2xl bg-foreground
1/90 text-2xl font-semibold text-background shadow-xl ring-1 ring-black/5`,children:e.name.slice(0,1)})})},e.id)}),n.length===0&&(0,x.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-4xl text-muted-foreground/50`,children:`◇`})]})}),(0,x.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 flex flex-col items-center px-4 pb-5 text-center`,children:[(0,x.jsx)(`h3`,{className:`text-[17px] font-semibold tracking-tight text-foreground`,children:e}),(0,x.jsxs)(`span`,{className:`mt-1 text-[13px] text-muted-foreground`,children:[i,` `,i===1?`app`:`apps`]})]})]})]})})}function w(){let{data:e,isLoading:t}=i({queryKey:[`published-apps`],queryFn:()=>o(),staleTime:10*6e4,gcTime:30*6e4,refetchOnWindowFocus:!1}),n=e?.apps??[],_=(0,b.useMemo)(()=>{let e=new Map;for(let t of n){let n=t.category||`Uncategorized`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return Array.from(e.entries()).map(([e,t])=>({name:e,apps:t})).sort((e,t)=>t.apps.length-e.apps.length)},[n]),[S,w]=(0,b.useState)(!1),[T,E]=(0,b.useState)(!1),[D,O]=(0,b.useState)(!1);(0,b.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),w(e=>!e))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let k=(0,b.useMemo)(()=>n.map(e=>({id:e.id,name:e.name,tagline:e.tagline,category:e.category,iconImage:e.icon_image_url,websiteUrl:e.website_url,featured:e.featured,createdAt:e.created_at})),[n]);return(0,x.jsx)(`div`,{className:`min-h-screen bg-background font-sans text-foreground antialiased`,children:(0,x.jsxs)(`div`,{className:`mx-auto w-full max-w-[1400px] px-5 md:px-10`,children:[(0,x.jsxs)(`header`,{className:`flex items-center justify-between gap-4 pt-6 md:pt-8`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,x.jsxs)(r,{to:`/`,className:`flex items-center gap-1.5 text-[15px] font-semibold tracking-tight`,children:[(0,x.jsx)(`span`,{children:`Macapp`}),(0,x.jsx)(a,{className:`h-7 w-7 rounded-[6px]`}),(0,x.jsx)(`span`,{children:`Supply`})]}),(0,x.jsxs)(`nav`,{className:`hidden items-center gap-1 text-sm md:flex`,children:[(0,x.jsx)(r,{to:`/`,className:`rounded-full px-3.5 py-2 text-muted-foreground transition hover:text-foreground`,children:`Apps`}),(0,x.jsx)(r,{to:`/categories`,className:`rounded-full px-3.5 py-2 text-foreground`,children:`Categories`}),(0,x.jsx)(r,{to:`/icons`,className:`rounded-full px-3.5 py-2 text-muted-foreground transition hover:text-foreground`,children:`Icons`})]})]}),(0,x.jsxs)(`div`,{className:`hidden items-center gap-2 text-sm md:flex`,children:[(0,x.jsx)(s,{}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>O(!0),className:`rounded-full px-3.5 py-2 text-muted-foreground transition hover:text-foreground`,children:`Subscribe`}),(0,x.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:(0,x.jsxs)(r,{to:`/sponsor`,className:`inline-flex items-center gap-1.5 rounded-full px-3.5 py-2 text-muted-foreground transition hover:text-foreground`,children:[(0,x.jsx)(l,{className:`h-4 w-4`}),`Sponsor`]})}),(0,x.jsxs)(`button`,{type:`button`,onClick:()=>w(!0),className:`flex items-center gap-1.5 rounded-full border border-border bg-secondary/60 px-3 py-1.5 text-xs text-muted-foreground transition hover:bg-secondary hover:text-foreground`,"aria-label":`Search apps`,children:[(0,x.jsx)(p,{className:`h-3.5 w-3.5`}),(0,x.jsx)(`span`,{children:`Search`}),(0,x.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground/80 rounded border border-border bg-background px-1 py-0.5`,children:`⌘K`})]}),(0,x.jsx)(r,{to:`/submit`,className:`rounded-full bg-foreground px-4 py-2 text-sm font-medium text-background transition hover:opacity-90`,children:`Submit an app`})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2 md:hidden`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:()=>w(!0),className:`flex h-9 w-9 items-center justify-center rounded-full border border-border bg-background text-muted-foreground`,"aria-label":`Search apps`,children:(0,x.jsx)(p,{className:`h-4 w-4`})}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>E(!0),className:`flex h-9 w-9 items-center justify-center rounded-full border border-border bg-background text-muted-foreground`,"aria-label":`Open menu`,children:(0,x.jsx)(u,{className:`h-4 w-4`})})]})]}),(0,x.jsx)(h,{open:S,onOpenChange:w,apps:k}),(0,x.jsx)(f,{open:D,onOpenChange:O}),(0,x.jsx)(g,{open:T,onOpenChange:E,children:(0,x.jsxs)(d,{side:`right`,className:`w-[80vw] max-w-sm p-6`,children:[(0,x.jsx)(m,{children:(0,x.jsx)(c,{className:`text-left text-base font-semibold`,children:`Menu`})}),(0,x.jsx)(`div`,{className:`mt-4`,children:(0,x.jsx)(s,{})}),(0,x.jsxs)(`nav`,{className:`mt-6 flex flex-col gap-1 text-sm`,children:[(0,x.jsx)(r,{to:`/`,onClick:()=>E(!1),className:`rounded-lg px-3 py-2.5 text-foreground transition hover:bg-secondary`,children:`Apps`}),(0,x.jsx)(r,{to:`/categories`,onClick:()=>E(!1),className:`rounded-lg px-3 py-2.5 text-foreground transition hover:bg-secondary`,children:`Categories`}),(0,x.jsx)(r,{to:`/icons`,onClick:()=>E(!1),className:`rounded-lg px-3 py-2.5 text-foreground transition hover:bg-secondary`,children:`Icons`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>{E(!1),O(!0)},className:`rounded-lg px-3 py-2.5 text-left text-foreground transition hover:bg-secondary`,children:`Subscribe`}),(0,x.jsx)(`div`,{className:`flex items-center justify-between rounded-lg px-3 py-2.5 text-foreground transition hover:bg-secondary`,children:(0,x.jsxs)(r,{to:`/sponsor`,onClick:()=>E(!1),className:`inline-flex items-center gap-1.5 text-foreground transition`,children:[(0,x.jsx)(l,{className:`h-4 w-4`}),`Sponsor`]})}),(0,x.jsx)(r,{to:`/contact`,onClick:()=>E(!1),className:`rounded-lg px-3 py-2.5 text-foreground transition hover:bg-secondary`,children:`Contact`}),(0,x.jsx)(r,{to:`/submit`,onClick:()=>E(!1),className:`mt-3 inline-flex items-center justify-center rounded-full bg-foreground px-4 py-2.5 text-sm font-medium text-background transition hover:opacity-90`,children:`Submit an app`})]})]})}),(0,x.jsxs)(`section`,{className:`pt-12 pb-12 md:pt-20 md:pb-16`,children:[(0,x.jsxs)(`h1`,{className:`max-w-4xl font-display text-[42px] font-bold leading-[1.05] tracking-[-0.035em] md:text-[68px]`,children:[`Browse by `,(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`category`}),`.`]}),(0,x.jsx)(`p`,{className:`mt-6 max-w-xl text-[15px] leading-relaxed text-muted-foreground md:text-[16
1px]`,children:`Every macOS app on the shelf, sorted into neat little folders — pick one to browse inside.`})]}),t?(0,x.jsx)(`section`,{className:`grid grid-cols-1 gap-x-6 gap-y-12 pb-24 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`,children:Array.from({length:8}).map((e,t)=>(0,x.jsxs)(`div`,{className:`animate-pulse`,children:[(0,x.jsx)(`div`,{className:`aspect-[4/3] rounded-2xl bg-secondary`}),(0,x.jsx)(`div`,{className:`mt-4 h-4 w-32 rounded bg-secondary`})]},t))}):(0,x.jsx)(`section`,{className:`grid grid-cols-1 gap-x-6 gap-y-12 pb-24 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`,children:_.map((e,t)=>(0,x.jsx)(y,{delay:t%4*50,children:(0,x.jsx)(C,{name:e.name,apps:e.apps})},e.name))}),(0,x.jsx)(v,{})]})})}export{w as component,S as slugifyCategory};

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.