PageSourceSearch

https://treningsvideoer.no/assets/_category-BLpXbpOF.js

js treningsvideoer.no collected 2026-10-08 07:01:29 UTC 7,327 bytes, 1 lines download raw bytes

1import{k as N,j as e,r as m,L as d}from"./main-CiqKJGD5.js";import{V as y}from"./VideoCard-BsvCK9pb.js";import"./format-C6qjlnZW.js";function L(){const r=N.useLoaderData();return r.kind==="category"?e.jsx(v,{category:r.category,articles:r.articles,videos:r.videos,tagsByVideo:r.tagsByVideo}):e.jsx(k,{page:r.page})}function v({category:r,articles:l,videos:a,tagsByVideo:i}){const[o,x]=m.useState([]),g=m.useMemo(()=>{const t=new Map;for(const s of a)for(const n of i[s.id]??[])t.set(n,(t.get(n)??0)+1);return Array.from(t.entries()).map(([s,n])=>({tag:s,count:n})).sort((s,n)=>n.count-s.count)},[a,i]),c=m.useMemo(()=>o.length===0?a:a.filter(t=>{const s=i[t.id]??[];return o.every(n=>s.includes(n))}),[a,i,o]),u=t=>x(s=>s.includes(t)?s.filter(n=>n!==t):[...s,t]),h=a.length+l.length;return e.jsxs("div",{children:[e.jsx("section",{className:"relative bg-hero-glow border-b border-border/60",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 pt-10 md:pt-20 pb-12 md:pb-20",children:[e.jsxs("nav",{"aria-label":"Brødsmuler",className:"text-xs sm:text-sm text-muted-foreground mb-6 flex items-center gap-2",children:[e.jsx(d,{to:"/",className:"hover:text-foreground transition-colors",children:"Forsiden"}),e.jsx("span",{"aria-hidden":!0,className:"opacity-40",children:"/"}),e.jsx(d,{to:"/kategorier",className:"hover:text-foreground transition-colors",children:"Kategorier"}),e.jsx("span",{"aria-hidden":!0,className:"opacity-40",children:"/"}),e.jsx("span",{className:"text-foreground",children:r.name})]}),e.jsxs("div",{className:"flex flex-col gap-5 md:gap-7 max-w-4xl",children:[e.jsxs("span",{className:"inline-flex items-center self-start gap-2 text-[11px] uppercase tracking-[0.18em] font-medium px-3 py-1.5 rounded-full bg-card border border-border text-muted-foreground",children:[e.jsx("span",{className:"size-1.5 rounded-full bg-accent"}),"Kategori"]}),e.jsx("h1",{className:"font-display font-bold text-4xl sm:text-5xl md:text-7xl tracking-tight text-balance leading-[1.05]",children:r.name}),r.description&&e.jsx("p",{className:"text-base sm:text-lg md:text-xl text-muted-foreground max-w-3xl text-pretty leading-relaxed",children:r.description}),h>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-1",children:[a.length>0&&e.jsxs("a",{href:"#videoer",className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-foreground text-background text-sm font-medium hover:opacity-90 transition-opacity",children:[e.jsx("span",{className:"tabular-nums font-semibold",children:a.length}),e.jsx("span",{children:a.length===1?"video":"videoer"})]}),l.length>0&&e.jsxs("a",{href:"#artikler",className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-card border border-border text-sm font-medium hover:border-foreground
1/30 transition-colors",children:[e.jsx("span",{className:"tabular-nums font-semibold",children:l.length}),e.jsx("span",{children:l.length===1?"artikkel":"artikler"})]})]})]})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 pb-24",children:[a.length>0&&e.jsxs("section",{id:"videoer",className:"pt-12 md:pt-16 scroll-mt-24",children:[e.jsx("div",{className:"flex items-end justify-between mb-6 md:mb-8",children:e.jsxs("div",{children:[e.jsx("h2",{className:"font-display font-bold text-2xl md:text-3xl tracking-tight",children:"Videoer"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Tren med ",c.length," av ",a.length," ",a.length===1?"økt":"økter"," i ",r.name.toLowerCase(),"."]})]})}),g.length>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-6 md:mb-8",children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground mr-2",children:"Muskelgrupper:"}),g.map(({tag:t,count:s})=>{const n=o.includes(t);return e.jsxs("button",{onClick:()=>u(t),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${n?"bg-foreground text-background":"bg-secondary text-foreground hover:bg-foreground hover:text-background"}`,children:[e.jsx("span",{className:"capitalize",children:t}),e.jsx("span",{className:"ml-1 opacity-60 tabular-nums",children:s})]},t)}),o.length>0&&e.jsx("button",{onClick:()=>x([]),className:"text-xs text-muted-foreground hover:text-foreground underline ml-1",children:"Nullstill"})]}),c.length>0?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-5 sm:gap-x-6 gap-y-8 md:gap-y-10",children:c.map(t=>e.jsx(y,{video:t},t.slug))}):e.jsx("p",{className:"text-muted-foreground py-12 text-center",children:"Ingen videoer matcher valgte merkelapper."})]}),l.length>0&&e.jsxs("section",{id:"artikler",className:"pt-16 md:pt-24 scroll-mt-24",children:[e.jsx("div",{className:"flex items-end justify-between mb-6 md:mb-8",children:e.jsxs("div",{children:[e.jsx("h2",{className:"font-display font-bold text-2xl md:text-3xl tracking-tight",children:"Artikler"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Faglig påfyll og inspirasjon."})]})}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5 md:gap-6",children:l.map(t=>{const s=(t.full_path??"").split("/").filter(Boolean),[n,f,b,j]=s,p=t.published_at?new Date(t.published_at):null;return e.jsxs(d,{to:"/$year/$month/$day/$slug",params:{year:n,month:f,day:b,slug:j},className:"group flex flex-col rounded-3xl overflow-hidden bg-card border border-border card-elevated",children:[t.featured_image_url?e.jsx("div",{className:"aspect-[16/10] overflow-hidden bg-secondary",children:e.jsx("img",{src:t.featured_image_url,alt:t.title,loading:"lazy",className:"w-full h-full object-cover group-hover:scale-[1.04] transition-transform duration-700 ease-out"})}):e.jsx("div",{className:"aspect-[16/10] bg-gradient-to-br from-secondary via-card to-accent/15"}),e.jsxs("div",{className:"p-5 md:p-6 flex-1 flex flex-col",children:[p&&e.jsx("time",{className:"text-[11px] uppercase tracking-[0.16em] text-muted-foreground mb-3",children:p.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric"})}),e.jsx("h3",{className:"font-display font-bold text-lg md:text-xl leading-tight group-hover:text-accent transition-colors text-balance",children:t.title}),t.excerpt&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-3 leading-relaxed",children:t.excerpt}),e.jsxs("span",{className:"mt-4 inline-flex items-center gap-1 text-sm font-medium text-foreground/80 group-hover:text-accent transition-colors",children:["Les mer",e.jsx("span",{"aria-hidden":!0,className:"transition-transform group-hover:translate-x-0.5",children:"→"})]})]})]},t.id)})})]}),a.length===0&&l.length===0&&e.jsxs("div",{className:"py-24 text-center",children:[e.jsx("p",{className:"text-muted-foreground",children:"Ingen innhold i denne kategorien ennå."}),e.jsx(d,{to:"/kategorier",className:"inline-block mt-4 text-sm font-medium text-accent hover:underline",children:"Se alle kategorier →"})]})]})]})}function k({page:r}){return e.jsxs("article",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-12 md:py-16",children:[e.jsx("h1",{className:"font-display font-bold text-4xl md:text-5xl tracking-tight mb-8 text-balance",children:r.title}),e.jsx("div",{className:"prose prose-lg max-w-none prose-headings:font-display prose-a:text-accent",dangerouslySetInnerHTML:{__html:r.content_html??""}})]})}export{L as component};

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.