PageSourceSearch

https://www.trigvia.com/assets/ScrollAnimationSection-mEaCBl3Q.js

js trigvia.com collected 2026-10-02 01:47:10 UTC 9,290 bytes, 1 lines download raw bytes

1import{r as n,j as t}from"./vendor-BOMg6hjx.js";import{c as p}from"./index-CR3UJNpN.js";import"./supabase-DY-_YUt1.js";import"./framer-S7s_uWFR.js";const h=4,$=7.6,U=5.2,Y=1/75,J=[{text:"Smart Suggestion",subtitle:"TrigVia understands what you highlighted and recommends the best action instantly, so you can move from reading to doing without context switching.",start:0},{text:"Summarise",subtitle:"Turn long passages, articles, and notes into concise key takeaways you can review quickly, share with your team, or save for later.",start:.35},{text:"Answer Popup",subtitle:"Preview AI-generated output right on the current page, compare options in context, and pick the best result without opening new tabs.",start:.75},{text:"Explain",subtitle:"Break complex text into clear, structured explanations that help you understand technical or dense content faster and with more confidence.",start:1.4},{text:"Reply",subtitle:"Generate context-aware replies for messages and comments in your preferred tone, then refine and send in seconds instead of rewriting manually.",start:2},{text:"Email",subtitle:"Convert selected text into polished email drafts with clear structure and intent, ready for follow-ups, outreach, and professional communication.",start:2.6},{text:"Post",subtitle:"Transform highlights into social-ready post drafts with concise messaging and strong hooks, helping you publish faster with consistent quality.",start:3.2}];function D(r){return Math.min(1,Math.max(0,r))}function Q(r,v){let b=r[0];for(const x of r)if(v>=x.start)b=x;else break;return b}function te({videoSrc:r="/landing-animation.mp4",overlays:v=J,className:b}){const x=n.useRef(null),S=n.useRef(null),T=n.useRef(0),g=n.useRef(!1),[y,A]=n.useState(!1),[u,O]=n.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 767px)").matches:!1),[i,k]=n.useState(()=>{if(typeof window>"u")return r;try{return window.matchMedia("(max-width: 767px)").matches?null:r}catch{return r}}),[P,F]=n.useState(h),[m,C]=n.useState(!1),[o,V]=n.useState(!1),[H,N]=n.useState(!1),[L,G]=n.useState(0);n.useEffect(()=>{if(typeof window>"u")return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");A(e.matches);const a=s=>A(s.matches);return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[]),n.useEffect(()=>{if(typeof window>"u")return;const e=window.matchMedia("(max-width: 767px)"),a=s=>O(s.matches);return O(e.matches),e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[]),n.useEffect(()=>{!u&&!i&&k(r)},[u,i,r]),n.useEffect(()=>{if(i)return;if(!window.matchMedia("(max-width: 767px)").matches){k(r);return}let a=!1;const s=()=>{a||k(r)};let l;if(typeof window.requestIdleCallback=="function"){const c=window.requestIdleCallback(s,{timeout:2800});l=()=>window.cancelIdleCallback(c)}else{const c=window.setTimeout(s,1800);l=()=>window.clearTimeout(c)}const f=()=>{s(),window.removeEventListener("scroll",f)};return window.addEventListener("scroll",f,{passive:!0}),()=>{a=!0,l==null||l(),window.removeEventListener("scroll",f)}},[i,r]);const M=n.useRef(!1);n.useEffect(()=>{if(!i){M.current=!0;return}M.current&&(g.current=!1,M.current=!1)},[i]),n.useEffect(()=>{if(m||o||!i){N(!1);return}const e=window.setTimeout(()=>{N(!0)},2200);return()=>window.clearTimeout(e)},[m,o,i]),n.useEffect(()=>{const e=S.current;if(!e||o||!i||g.current)return;const a=async()=>{if(!g.current){e.muted=!0,e.playsInline=!0,e.setAttribute("playsinline","true"),e.setAttribute("webkit-playsinline","true");try{await e.play(),await new Promise(l=>{requestAnimationFrame(()=>requestAnimationFrame(()=>l()))}),e.pause(),e.currentTime===0&&(e.currentTime=.001),g.current=!0,C(!0),N(!1)}catch{}}},s=()=>{a()};return e.addEventListener("loadeddata",s),e.addEventListener("canplay",s),a(),()=>{e.removeEventListener("loadeddata",s),e.removeEventListener("canplay",s)}},[o,i]),n.useEffect(()=>{if(typeof window>"u"||y)return;let e=0,a=0,s=0;const l=()=>{const c=x.current;if(!c)return;const w=c.getBoundingClientRect(),d=w.height-window.innerHeight;d<=0||(e=D(-w.top/d))},f=()=>{const c=e-a;Math.abs(c)>1e-4?a+=c*.15:a=e;const w=D(a);G(w);const d=S.current;if(d&&!o&&(d.readyState>=2||m)){const q=d.duration&&!Number.isNaN(d.duration)&&d.duration>0?Math.min(d.duration,h):h,R=Math.min(Math.max(0,w*q),Math.max(0,q-.033));if(Math.abs(R-T.current)>=Y)try{d.currentTime=R,T.current=R}catch{}}s=requestAnimationFrame(f)};return window.addEventListener("scroll",l,{passive:!0}),l(),s=requestAnimationFrame(f),()=>{window.removeEventListener("scroll",l),cancelAnimationFrame(s)}},[y,m,o]);const z=m&&!o&&P>0?Math.min(P,h):h,_=L*z,E=n.useMemo(()=>Q(v,_),[_,v]),[j,B]=n.useState(E),[K,I]=n.useState("opacity-100 translate-y-0 scale-100");return n.useEffect(()=>{if(E.text!==j.text){I("opacity-0 translate-y-4 scale-95 transition-all duration-200 ease-out");const e=window.setTimeout(()=>{B(E),I("opacity-100 translate-y-0 scale-100 transition-all duration-200 ease-out")},200);return()=>window.clearTimeout(e)}},[E,j]),t.jsx("div",{ref:x,className:p("relative w-full overflow-x-clip",y&&"min-h-[100svh]",b),style:y?void 0:{minHeight:`${(u?U:$)*100}svh`},children:t.jsx("section",{"aria-label":"Product demonstration",className:"sticky top-0 z-0 flex h-[100svh] min-h-[100dvh] w-full items-stretch overflow-hidden",children:t.jsxs("div",{className:"relative h-full min-h-[100svh] w-full bg-bg-primary",children:[o?null:t.jsxs("div",{className:p("absolute left-0 right-0 mx-auto h-[36svh] w-[90vw] max-w-[90vw] overflow-hidden rounded-2xl border border-white/10 bg-black/30 shadow-header","to
1p-[calc(31%-18svh)]","md:inset-0 md:top-0 md:mx-0 md:h-full md:w-full md:max-w-none md:rounded-none md:border-0 md:bg-transparent md:shadow-none"),children:[i?t.jsx("video",{ref:S,className:p("pointer-events-none absolute inset-0 h-full w-full object-center brightness-[0.8]",u?"object-contain":"object-cover"),style:u?void 0:{transform:"scale(1.12)",transformOrigin:"center center"},src:i,muted:!0,playsInline:!0,preload:u?"none":"metadata",onLoadedMetadata:e=>{const a=e.currentTarget,s=a.duration;s&&!Number.isNaN(s)&&s>0&&F(Math.min(s,h)),C(!0);try{a.readyState>=2&&a.currentTime===0&&(a.currentTime=.001)}catch{}},onError:()=>{V(!0),N(!1)}}):t.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-br from-[#1a0f2e]/90 via-black/50 to-[#0a0a0a]","aria-hidden":!0}),H&&!m&&!o&&i?t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/35 text-center",children:t.jsx("span",{className:"px-4 text-xs font-medium text-white/85 md:text-sm",children:"Loading demo video..."})}):null]}),o?t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4 bg-gradient-to-br from-[#1a0f2e] via-[#2a1a4a] to-[#0a0a0a] p-8 text-center","aria-hidden":!0,children:[t.jsx("div",{className:"h-24 w-24 rounded-full border-2 border-accent/40"}),t.jsx("div",{className:"h-10 w-40 rounded-full border border-white/20 bg-white/5"}),t.jsxs("p",{className:"max-w-md text-sm text-white/60",children:["Add"," ",t.jsx("code",{className:"font-mono text-accent/90",children:"public/landing-animation.mp4"})," ","for the full-screen demo."]})]}):null,t.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-b from-black/15 via-transparent to-black/30","aria-hidden":!0}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col items-center justify-end px-5 pb-44 md:justify-center md:px-10 md:pb-0",children:t.jsx("div",{className:"w-full max-w-5xl text-center lg:max-w-6xl",children:t.jsx("div",{className:"relative mx-auto w-full",children:t.jsx("div",{className:"relative flex min-h-[8rem] items-center justify-center px-4 py-6 sm:min-h-[10rem] sm:px-6 sm:py-9 md:min-h-[13rem] md:px-10 md:py-11 lg:min-h-[15rem] lg:px-12 lg:py-12",children:t.jsxs("div",{className:p("flex flex-col items-center gap-2 px-3 text-center",u?"relative mx-auto max-w-[22rem]":"absolute left-0 right-0",K),style:u?void 0:{transform:"translateY(-50%)"},children:[t.jsx("span",{className:p("font-display font-semibold leading-[1.12] tracking-tight text-white [text-shadow:0_4px_36px_rgba(0,0,0,0.5)]","text-2xl sm:text-3xl md:text-4xl lg:text-5xl xl:text-6xl"),children:j.text}),t.jsx("span",{className:"max-w-3xl text-sm font-medium leading-relaxed text-white/80 md:text-base",children:j.subtitle})]})})})})}),t.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 z-10 px-6 pb-[max(1.25rem,env(safe-area-inset-bottom))] pt-8 md:px-10 md:pb-8",children:t.jsxs("div",{className:"mx-auto max-w-xl",role:"progressbar","aria-label":"Demo playback","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(L*100),children:[t.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-white/20",children:t.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-[#b366ff] to-[#9370db] transition-[width] duration-75 ease-out",style:{width:`${L*100}%`}})}),t.jsxs("p",{className:"mt-3 text-center text-xs text-white/65 md:text-sm",children:["Scroll ",t.jsx("span",{className:"text-white/90",children:"down"})," to play forward,"," ",t.jsx("span",{className:"text-white/90",children:"up"})," to rewind.",o?" (No video — timeline uses a 4s pacing.)":null]})]})})]})})})}export{te as ScrollAnimationSection};

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.