PageSourceSearch

https://snappilot.ai/assets/js/Blog-SoW3Lr-2.js

js snappilot.ai collected 2026-10-05 12:39:31 UTC 10,707 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-DeaCpvuz.js";import{u as L,h as V,r as d}from"./react-vendor-BwON9l4R.js";import{s as G,B as o,X as v}from"./index-Kz-5MvZ9.js";import{C as N,b as M,c as H,d as O,a as U}from"./card-B7gy2v7u.js";import{H as Y}from"./Helmet-BJfcPi6K.js";import{u as q}from"./usePagePreload-CINHSMaq.js";import{S as P,a as A,b as F,c as T,d as j}from"./select-BEfq-KiM.js";import{B as p}from"./badge-Dht8Lt2r.js";import{F as X}from"./filter-BdbKwUVE.js";import{C as w}from"./calendar-BpG5PemG.js";import{A as E}from"./arrow-right-0AN5CZaS.js";import{C as J,a as K}from"./chevron-right-Dp4t2JdI.js";import"./supabase-vendor-eEOYocAC.js";import"./query-vendor-DsJQQYkK.js";import"./style-cartoon-3d-BPyJ4vVt.js";import"./chevron-down-DWhBuuk_.js";import"./check-CIuB_zKM.js";const y=6,Q=["AI Video Creation","TikTok Growth","YouTube Shorts","Instagram Reels","Content Automation","Social Media Strategy","Faceless Content","Video Marketing","Monetization","Creator Tips"],ue=()=>{const b=L(),[f,C]=V(),[m,I]=d.useState([]),[R,B]=d.useState(!0),a=parseInt(f.get("page")||"1"),i=f.get("category")||"all",n=f.get("month")||"all";q("blog"),d.useEffect(()=>{D()},[]);const D=async()=>{try{const{data:s,error:t}=await G.from("blog_posts").select("*").eq("status","published").order("published_at",{ascending:!1});if(t)throw t;I(s||[])}catch(s){console.error("Error fetching blog posts:",s)}finally{B(!1)}},$=d.useMemo(()=>{const s=new Set(m.flatMap(t=>t.tags||[]));return Q.filter(t=>s.has(t))},[m]),S=d.useMemo(()=>{const s=new Map;return m.forEach(t=>{const l=new Date(t.published_at),u=`${l.getFullYear()}-${String(l.getMonth()+1).padStart(2,"0")}`,z=l.toLocaleDateString("en-US",{year:"numeric",month:"long"});s.set(u,z)}),Array.from(s.entries()).sort((t,l)=>l[0].localeCompare(t[0]))},[m]),h=d.useMemo(()=>m.filter(s=>{if(i!=="all"&&!s.tags?.includes(i))return!1;if(n!=="all"){const t=new Date(s.published_at);if(`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}`!==n)return!1}return!0}),[m,i,n]),x=Math.ceil(h.length/y),r=d.useMemo(()=>{const s=(a-1)*y;return h.slice(s,s+y)},[h,a]),c=s=>{const t=new URLSearchParams(f);Object.entries(s).forEach(([l,u])=>{u==="all"||u==="1"?t.delete(l):t.set(l,u)}),s.page||t.delete("page"),C(t)},_=()=>{C(new URLSearchParams)},g=i!=="all"||n!=="all",k=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return e.jsxs(e.Fragment,{children:[e.jsxs(Y,{children:[e.jsx("title",{children:"Blog - SnapPilot.ai | AI Video Creation Insights & Tips"}),e.jsx("meta",{name:"description",content:"Discover the latest tips, guides, and insights on AI-powered video creation, YouTube Shorts, TikTok automation, and content creator productivity."})]}),e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"relative bg-black text-white pt-32 pb-16 md:pt-44 md:pb-20 overflow-hidden",children:[e.jsxs("div",{className:"absolute inset-0 opacity-30",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-600/20 via-blue-600/20 to-cyan-600/20 animate-[pulse_8s_ease-in-out_infinite]"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-tl from-pink-600/20 via-purple-600/20 to-blue-600/20 animate-[pulse_10s_ease-in-out_infinite]"})]}),e.jsx("div",{className:"container relative z-10 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[e.jsx("h1",{className:"text-4xl md:text-6xl font-bold mb-6 [text-shadow:0_0_30px_rgba(255,255,255,0.3),0_0_60px_rgba(147,197,253,0.2)]",children:"Blog"}),e.jsx("p",{className:"text-lg md:text-xl text-gray-300 leading-relaxed max-w-2xl mx-auto",children:"Insights, tips, and strategies for mastering AI-powered video creation and growing your content empire"})]})})]}),e.jsx("section",{className:"bg-muted/30 border-b border-border/50 sticky top-16 md:top-20 z-40 backdrop-blur-md",children:e.jsxs("div",{className:"container mx-auto px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(X,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:"Filter:"})]}),e.jsxs(P,{value:i,onValueChange:s=>c({category:s}),children:[e.jsx(A,{className:"w-[180px] bg-background",children:e.jsx(F,{placeholder:"All Categories"})}),e.jsxs(T,{children:[e.jsx(j,{value:"all",children:"All Categories"}),$.map(s=>e.jsx(j,{value:s,children:s},s))]})]}),e.jsxs(P,{value:n,onValueChange:s=>c({month:s}),children:[e.jsx(A,{className:"w-[180px] bg-background",children:e.jsx(F,{placeholder:"All Months"})}),e.jsxs(T,{children:[e.jsx(j,{value:"all",children:"All Months"}),S.map(([s,t])=>e.jsx(j,{value:s,children:t},s))]})]}),g&&e.jsxs(o,{variant:"ghost",size:"sm",onClick:_,className:"text-muted-foreground hover:text-foreground",children:[e.jsx(v,{className:"w-4 h-4 mr-1"}),"Clear filters"]}),e.jsxs("div",{className:"ml-auto text-sm text-muted-foreground",children:[h.length," ",h.length===1?"post":"posts"]})]}),g&&e.jsxs("div",{className:"flex flex-wrap gap-2 mt-3",children:[i!=="all"&&e.jsxs(p,{variant:"secondary",className:"gap-1",children:["Category: ",i,e.jsx("button",{onClick:()=>c({category:"all"}),className:"ml-1 hover:text-destructive",children:e.jsx(v,{className:"w-3 h-3"})})]}),n!=="all"&&e.jsxs(p,{variant:"secondary",className:"gap-1",children:["Month: ",S.find(([s])=>s===n)?.[1],e.jsx("button",{onClick:()=>c({month:"all"}),className:"ml-1 hover:text-destructive",children:e.jsx(v,{className:"w-3 h-3"})})]})]})]})}),e.jsx("section",{className:"py-12 md:py-16 bg-background",children:e.jsx("div",{className:"container mx-auto px-4",children:R?e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 lg:gap-8",children:[1,2,3,4,5,6].map(s=>e.jsxs(N,{className:"animate-pulse overflow-hidden",children:[e.jsx("div",{className:"aspect-[16/10] bg-muted"}),e.jsxs(M,{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/3"}),e.jsx("div",{className:"h-6 bg-muted rounded w-3/4"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-full"}),e.jsx("div",{className:"h-4 bg-muted rounded w-2/3"})]})]})]},s))}):r.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-4",children:e.jsx(w,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("p",{className:"text-muted-foreground text-lg mb-2",children:g?"No posts match your filters":"No blog posts yet"}
1),e.jsx("p",{className:"text-muted-foreground/70 text-sm mb-6",children:g?"Try adjusting your filters to see more posts":"Check back soon for new content!"}),g?e.jsx(o,{onClick:_,variant:"outline",children:"Clear Filters"}):e.jsx(o,{onClick:()=>b("/"),children:"Return to Home"})]}):e.jsxs(e.Fragment,{children:[a===1&&r.length>0&&e.jsx("div",{className:"mb-12",children:e.jsx(N,{className:"group hover:shadow-xl transition-all cursor-pointer overflow-hidden border-2 border-transparent hover:border-primary/20",onClick:()=>b(`/blog/${r[0].slug}`),children:e.jsxs("div",{className:"grid lg:grid-cols-2 gap-0",children:[e.jsxs("div",{className:"aspect-[16/10] lg:aspect-auto lg:min-h-[320px] overflow-hidden relative",children:[r[0].featured_image_url?e.jsx("img",{src:r[0].featured_image_url,alt:`${r[0].title} - Featured blog image`,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-purple-500/30 via-blue-500/30 to-cyan-500/30"}),e.jsx(p,{className:"absolute top-4 left-4 bg-primary text-primary-foreground",children:"Featured"})]}),e.jsxs("div",{className:"p-6 lg:p-8 flex flex-col justify-center",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-3",children:[e.jsx(w,{className:"w-4 h-4"}),k(r[0].published_at)]}),e.jsx("h2",{className:"text-2xl lg:text-3xl font-bold mb-4 group-hover:text-primary transition-colors line-clamp-2",children:r[0].title}),e.jsx("p",{className:"text-muted-foreground mb-6 line-clamp-3 text-base lg:text-lg",children:r[0].excerpt}),r[0].tags?.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-6",children:r[0].tags.slice(0,3).map(s=>e.jsx(p,{variant:"secondary",className:"text-xs",children:s},s))}),e.jsxs(o,{className:"w-fit gap-2 group-hover:gap-3 transition-all bg-cta text-black hover:bg-cta/90 font-bold",children:["Read Article",e.jsx(E,{className:"w-4 h-4"})]})]})]})})}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 lg:gap-8",children:(a===1?r.slice(1):r).map(s=>e.jsxs(N,{className:"group hover:shadow-lg transition-all cursor-pointer overflow-hidden flex flex-col",onClick:()=>b(`/blog/${s.slug}`),children:[e.jsx("div",{className:"aspect-[16/10] overflow-hidden relative",children:s.featured_image_url?e.jsx("img",{src:s.featured_image_url,alt:`${s.title} - Featured blog image`,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-purple-500/30 via-blue-500/30 to-cyan-500/30"})}),e.jsxs(M,{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-2",children:[e.jsx(w,{className:"w-4 h-4"}),k(s.published_at)]}),e.jsx(H,{className:"group-hover:text-primary transition-colors line-clamp-2 text-lg",children:s.title}),e.jsx(O,{className:"line-clamp-2 mt-2",children:s.excerpt}),s.tags?.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:s.tags.slice(0,2).map(t=>e.jsx(p,{variant:"outline",className:"text-xs font-normal",children:t},t))})]}),e.jsx(U,{className:"pt-0",children:e.jsxs(o,{className:"w-full gap-2 group-hover:gap-3 transition-all bg-cta text-black hover:bg-cta/90 font-bold",children:["Read More",e.jsx(E,{className:"w-4 h-4"})]})})]},s.id))}),x>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-12",children:[e.jsx(o,{variant:"outline",size:"icon",onClick:()=>c({page:String(a-1)}),disabled:a===1,children:e.jsx(J,{className:"w-4 h-4"})}),e.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:x},(s,t)=>t+1).map(s=>{const t=s===1||s===x||Math.abs(s-a)<=1,l=s===2&&a>3||s===x-1&&a<x-2;return!t&&!l?null:l&&!t?e.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},s):e.jsx(o,{variant:a===s?"default":"outline",size:"icon",onClick:()=>c({page:String(s)}),className:a===s?"bg-primary":"",children:s},s)})}),e.jsx(o,{variant:"outline",size:"icon",onClick:()=>c({page:String(a+1)}),disabled:a===x,children:e.jsx(K,{className:"w-4 h-4"})})]})]})})})]})]})};export{ue as default};

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.