PageSourceSearch

https://vitaapps.dev/assets/CountdownTimer-2Ibi7SzX.js

js vitaapps.dev collected 2026-09-24 15:01:14 UTC 34,857 bytes, 3 lines download raw bytes

1import{u as Se,n as Te,j as e,S as Ce,N as De,z as $e}from"./index-376A2J5H.js";import{r as n}from"./vendor-react-0R6VX6ld.js";import Me from"./Footer-gF2jTve3.js";import{i as te,n as de,o as ge,p as P,q as ze,H as Z,d as me,r as Fe,s as He,t as pe,u as Ee,v as Re,w as Pe,m as Ie,x as se,y as Le}from"./index-zMxkKZQp.js";import{Q as Ye}from"./index-YpOyM6-i.js";import{c as xe}from"./index-eD7lYc4e.js";import{A as $,m}from"./vendor-framer-JqHIcSWX.js";import"./vendor-three-dec0Z_i3.js";import"./vendor-icons-LlCGcXb-.js";import"./index-v2SWm-nz.js";const h={purple:{name:"Violet",gradient:"from-purple-600 via-violet-600 to-indigo-600",glow:"purple-500",text:"text-purple-400",border:"border-purple-500/30",bg:"bg-purple-500/10"},gold:{name:"Gold",gradient:"from-amber-500 via-yellow-500 to-orange-500",glow:"amber-500",text:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10"},pink:{name:"Pink",gradient:"from-pink-500 via-rose-500 to-fuchsia-500",glow:"pink-500",text:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10"},blue:{name:"Ocean",gradient:"from-blue-500 via-cyan-500 to-teal-500",glow:"blue-500",text:"text-blue-400",border:"border-blue-500/30",bg:"bg-blue-500/10"},green:{name:"Nature",gradient:"from-green-500 via-emerald-500 to-teal-500",glow:"green-500",text:"text-green-400",border:"border-green-500/30",bg:"bg-green-500/10"},red:{name:"Ruby",gradient:"from-red-500 via-rose-600 to-red-700",glow:"red-500",text:"text-red-400",border:"border-red-500/30",bg:"bg-red-500/10"},cyan:{name:"Cyan",gradient:"from-cyan-400 via-cyan-500 to-blue-500",glow:"cyan-500",text:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10"},orange:{name:"Sunset",gradient:"from-orange-500 via-red-500 to-pink-500",glow:"orange-500",text:"text-orange-400",border:"border-orange-500/30",bg:"bg-orange-500/10"},indigo:{name:"Indigo",gradient:"from-indigo-500 via-blue-600 to-purple-600",glow:"indigo-500",text:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10"},rose:{name:"Rose",gradient:"from-rose-400 via-pink-500 to-rose-600",glow:"rose-500",text:"text-rose-400",border:"border-rose-500/30",bg:"bg-rose-500/10"},slate:{name:"Minimal",gradient:"from-slate-400 via-gray-500 to-slate-600",glow:"slate-500",text:"text-slate-400",border:"border-slate-500/30",bg:"bg-slate-500/10"},teal:{name:"Teal",gradient:"from-teal-400 via-teal-500 to-emerald-500",glow:"teal-500",text:"text-teal-400",border:"border-teal-500/30",bg:"bg-teal-500/10"}},Oe=[{id:"newyear",icon:"🎆",titleKey:"newYear",getDate:()=>{const t=new Date;return`${t.getMonth()>=11?t.getFullYear()+1:t.getFullYear()}-01-01T00:00`},theme:"gold"},{id:"christmas",icon:"🎄",titleKey:"christmas",getDate:()=>{const t=new Date;return`${t.getMonth()===11&&t.getDate()>25?t.getFullYear()+1:t.getFullYear()}-12-25T00:00`},theme:"green"},{id:"birthday",icon:"🎂",titleKey:"birthday",getDate:()=>"",theme:"pink"},{id:"wedding",icon:"💒",titleKey:"wedding",getDate:()=>"",theme:"purple"},{id:"vacation",icon:"✈️",titleKey:"vacation",getDate:()=>"",theme:"blue"},{id:"custom",icon:"⏱️",titleKey:"custom",getDate:()=>"",theme:"purple"}],Ae=({value:t,onChange:c,minDate:d})=>{const[l,a]=n.useState(!1),[r,x]=n.useState(()=>t?new Date(t):new Date),g=n.useRef(null);n.useEffect(()=>{const b=f=>{g.current&&!g.current.contains(f.target)&&a(!1)};return l&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[l]);const o=t?new Date(t):null,N=o?o.getHours():12,k=o?o.getMinutes():0,E=d||new Date;E.setHours(0,0,0,0);const F=["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],v=["Mo","Di","Mi","Do","Fr","Sa","So"],D=(b,f)=>new Date(b,f+1,0).getDate(),C=(b,f)=>{const w=new Date(b,f,1).getDay();return w===0?6:w-1},_=b=>{const f=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(b).padStart(2,"0")}T${String(N).padStart(2,"0")}:${String(k).padStart(2,"0")}`;c(f),a(!1)},u=(b,f)=>{const w=o||(()=>{const M=new Date;return M.setDate(M.getDate()+1),M})(),T=`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}-${String(w.getDate()).padStart(2,"0")}T${String(b).padStart(2,"0")}
1:${String(f).padStart(2,"0")}`;c(T)},I=D(r.getFullYear(),r.getMonth()),Y=C(r.getFullYear(),r.getMonth()),L=b=>{const f=new Date(r.getFullYear(),r.getMonth(),b);return f.setHours(0,0,0,0),f<E},S=()=>o?`${o.getDate()}. ${F[o.getMonth()]} ${o.getFullYear()}`:"Datum wählen...";return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"relative",ref:g,children:[e.jsxs("button",{type:"button",onClick:()=>a(!l),className:"w-full bg-black/30 border border-white/10 rounded-lg px-3 py-2.5 text-left text-white hover:border-purple-500/50 focus:border-purple-500 focus:outline-none transition-all flex items-center justify-between text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"text-purple-400",size:16}),e.jsx("span",{className:o?"text-white":"text-gray-500",children:S()})]}),e.jsx(se,{className:`text-gray-400 transition-transform ${l?"rotate-90":""}`,size:16})]}),e.jsx($,{children:l&&e.jsxs(m.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full mt-1 left-0 right-0 bg-gray-900 border border-white/10 rounded-lg p-3 z-30 shadow-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("button",{type:"button",onClick:()=>x(new Date(r.getFullYear(),r.getMonth()-1,1)),className:"p-1 hover:bg-white/10 rounded transition-colors",children:e.jsx(Le,{className:"text-white",size:14})}),e.jsxs("span",{className:"text-white text-xs font-medium",children:[F[r.getMonth()]," ",r.getFullYear()]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>x(new Date(r.getFullYear(),r.getMonth()+1,1)),className:"p-1 hover:bg-white/10 rounded transition-colors",children:e.jsx(se,{className:"text-white",size:14})}),e.jsx("button",{type:"button",onClick:()=>a(!1),className:"p-1 hover:bg-white/10 rounded transition-colors ml-1",children:e.jsx(P,{className:"text-gray-400",size:14})})]})]}),e.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:v.map(b=>e.jsx("div",{className:"text-center text-[10px] text-gray-500 font-medium py-0.5",children:b},b))}),e.jsxs("div",{className:"grid grid-cols-7 gap-0.5",children:[Array.from({length:Y}).map((b,f)=>e.jsx("div",{className:"w-7 h-7"},`empty-${f}`)),Array.from({length:I}).map((b,f)=>{const w=f+1,T=o&&o.getDate()===w&&o.getMonth()===r.getMonth()&&o.getFullYear()===r.getFullYear(),M=L(w),O=new Date().getDate()===w&&new Date().getMonth()===r.getMonth()&&new Date().getFullYear()===r.getFullYear();return e.jsx("button",{type:"button",disabled:M,onClick:()=>_(w),className:`w-7 h-7 rounded text-xs font-medium transition-all flex items-center justify-center
2                        ${T?"bg-purple-500 text-white":M?"text-gray-600 cursor-not-allowed":O?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"text-white hover:bg-white/10"}`,children:w},w)})]})]})})]}),e.jsx(Ve,{hour:N,minute:k,onChange:u})]})},ue=({values:t,selected:c,onChange:d,label:l})=>{const a=n.useRef(null),r=n.useRef(!1),x=n.useRef(null),g=40,N=g*5,k=t.indexOf(c);n.useEffect(()=>{a.current&&k>=0&&(r.current=!0,a.current.scrollTop=k*g,setTimeout(()=>{r.current=!1},100))},[k]);const E=()=>{r.current||(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{if(a.current){const v=a.current.scrollTop,D=Math.round(v/g),C=Math.max(0,Math.min(t.length-1,D));t[C]!==c&&d(t[C]),r.current=!0,a.current.scrollTo({top:C*g,behavior:"smooth"}),setTimeout(()=>{r.current=!1},150)}},80))}
2,F=v=>{const D=t.indexOf(v);a.current&&D>=0&&(r.current=!0,a.current.scrollTo({top:D*g,behavior:"smooth"}),d(v),setTimeout(()=>{r.current=!1},200))};return e.jsxs("div",{className:"flex-1 min-w-[60px]",children:[e.jsx("div",{className:"text-[10px] text-gray-500 text-center mb-1",children:l}),e.jsxs("div",{className:"relative",style:{height:N},children:[e.jsx("div",{className:"absolute left-0 right-0 bg-purple-500/20 border-y border-purple-500/30 pointer-events-none z-10",style:{top:g*2,height:g}}),e.jsx("div",{className:"absolute inset-x-0 top-0 h-12 bg-gradient-to-b from-gray-900 to-transparent pointer-events-none z-20"}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-gray-900 to-transparent pointer-events-none z-20"}),e.jsxs("div",{ref:a,onScroll:E,className:"h-full overflow-y-auto scrollbar-none",children:[e.jsx("div",{style:{height:g*2}}),t.map(v=>e.jsx("div",{onClick:()=>F(v),className:`flex items-center justify-center cursor-pointer transition-all text-lg
3                ${c===v?"text-white font-semibold scale-110":"text-gray-500 hover:text-gray-300"}`,style:{height:g},children:String(v).padStart(2,"0")},v)),e.jsx("div",{style:{height:g*2}})]})]})]})},Ve=({hour:t,minute:c,onChange:d})=>{const[l,a]=n.useState(!1),r=n.useRef(null);n.useEffect(()=>{const o=N=>{r.current&&!r.current.contains(N.target)&&a(!1)};return l&&document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[l]);const x=Array.from({length:24},(o,N)=>N),g=Array.from({length:60},(o,N)=>N);return e.jsxs("div",{className:"relative",ref:r,children:[e.jsxs("button",{type:"button",onClick:()=>a(!l),className:"w-full bg-black/30 border border-white/10 rounded-lg px-3 py-2.5 text-left text-white hover:border-purple-500/50 focus:border-purple-500 focus:outline-none transition-all flex items-center justify-between text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{className:"text-purple-400",size:16}),e.jsxs("span",{className:"text-white",children:[String(t).padStart(2,"0"),":",String(c).padStart(2,"0")," Uhr"]})]}),e.jsx(se,{className:`text-gray-400 transition-transform ${l?"rotate-90":""}`,size:16})]}),e.jsx($,{children:l&&e.jsxs(m.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full mt-1 left-0 right-0 bg-gray-900 border border-white/10 rounded-lg p-3 z-30 shadow-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-white text-xs font-medium",children:"Zeit wählen"}),e.jsx("button",{type:"button",onClick:()=>a(!1),className:"p-1 hover:bg-white/10 rounded transition-colors",children:e.jsx(P,{className:"text-gray-400",size:14})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ue,{values:x,selected:t,onChange:o=>d(o,c),label:"Stunde"}),e.jsx("div",{className:"text-gray-500 text-lg font-light",children:":"}),e.jsx(ue,{values:g,selected:c,onChange:o=>d(t,o),label:"Minute"})]})]})})]})},U={normal:{digit:"w-12 h-16 sm:w-16 sm:h-20 md:w-20 md:h-24",text:"text-3xl sm:text-4xl md:text-5xl",label:"text-xs sm:text-sm",gap:"gap-1 sm:gap-2",separator:"w-2 h-2 sm:w-3 sm:h-3",title:"text-2xl md:text-4xl"},large:{digit:"w-16 h-20 sm:w-24 sm:h-32 md:w-28 md:h-36",text:"text-4xl sm:text-5xl md:text-6xl",label:"text-sm sm:text-base",gap:"gap-2 sm:gap-3",separator:"w-3 h-3 sm:w-4 sm:h-4",title:"text-4xl md:text-6xl"},xlarge:{digit:"w-20 h-28 sm:w-32 sm:h-44 md:w-40 md:h-52",text:"text-5xl sm:text-7xl md:text-8xl",label:"text-base sm:text-lg md:text-xl",gap:"gap-2 sm:gap-4",separator:"w-4 h-4 sm:w-5 sm:h-5",title:"text-5xl md:text-7xl lg:text-8xl"}},he=({digit:t,prevDigit:c,theme:d,size:l="normal"})=>{const a=t!==c,r=h[d],x=U[l];return e.jsxs("div",{className:`relative ${x.digit} perspective-1000`,children:[e.jsxs("div",{className:`absolute inset-0 rounded-lg bg-gradient-to-b from-gray-800 to-gray-900 border ${r.border} shadow-lg overflow-hidden`,children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-1/2 bg-gradient-to-b from-gray-700/50 to-transparent flex items-end justify-center overflow-hidden",children:e.jsx("span",{className:`${x.text} font-bold text-white translate-y-1/2`,children:t})}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-gray-800/50 to-transparent flex items-start justify-center overflow-hidden",children:e.jsx("span",{className:`${x.text} font-bold text-white -translate-y-1/2`,children:t})}),e.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-black/50"})]}),e.jsx($,{mode:"popLayout",children:a&&e.jsxs(e.Fragment,{children:[e.jsx(m.div,{initial:{rotateX:0},animate:{rotateX:-90},exit:{rotateX:-90},transition:{duration:.3,ease:"easeIn"},style:{transformOrigin:"bottom",backfaceVisibility:"hidden"}
3,className:`absolute inset-x-0 top-0 h-1/2 rounded-t-lg bg-gradient-to-b from-gray-700 to-gray-800 border-t border-x ${r.border} flex items-end justify-center overflow-hidden`,children:e.jsx("span",{className:`${x.text} font-bold text-white translate-y-1/2`,children:c})},`top-${c}`),e.jsx(m.div,{initial:{rotateX:90},animate:{rotateX:0},transition:{duration:.3,ease:"easeOut",delay:.3},style:{transformOrigin:"top",backfaceVisibility:"hidden"},className:`absolute inset-x-0 bottom-0 h-1/2 rounded-b-lg bg-gradient-to-t from-gray-800 to-gray-700 border-b border-x ${r.border} flex items-start justify-center overflow-hidden`,children:e.jsx("span",{className:`${x.text} font-bold text-white -translate-y-1/2`,children:t})},`bottom-${t}`)]})}),e.jsx("div",{className:`absolute -inset-1 bg-${r.glow}/20 rounded-xl blur-xl opacity-50 -z-10`})]})},K=({value:t,prevValue:c,label:d,theme:l,size:a="normal"})=>{const r=t.toString().padStart(2,"0").split(""),x=c.toString().padStart(2,"0").split(""),g=U[a];return e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs("div",{className:`flex ${g.gap}`,children:[e.jsx(he,{digit:r[0],prevDigit:x[0],theme:l,size:a}),e.jsx(he,{digit:r[1],prevDigit:x[1],theme:l,size:a})]}),e.jsx("span",{className:`${g.label} font-medium uppercase tracking-wider ${h[l].text}`,children:d})]})},ee=({theme:t,size:c="normal"})=>{const d=U[c];return e.jsxs("div",{className:"flex flex-col gap-3 px-1 sm:px-2",children:[e.jsx(m.div,{animate:{opacity:[1,.3,1]},transition:{duration:1,repeat:1/0},className:`${d.separator} rounded-full bg-gradient-to-r ${h[t].gradient}`}),e.jsx(m.div,{animate:{opacity:[.3,1,.3]},transition:{duration:1,repeat:1/0},className:`${d.separator} rounded-full bg-gradient-to-r ${h[t].gradient}`})]})},Ke=({theme:t})=>{const c=t==="gold"?["#fbbf24","#f59e0b","#d97706","#ffffff"]:t==="pink"?["#ec4899","#f472b6","#f9a8d4","#ffffff"]:["#8b5cf6","#a78bfa","#c4b5fd","#ffffff"];return e.jsx("div",{className:"fixed inset-0 pointer-events-none z-50 overflow-hidden",children:[...Array(100)].map((d,l)=>e.jsx(m.div,{initial:{x:Math.random()*window.innerWidth,y:-20,rotate:0,scale:Math.random()*.5+.5},animate:{y:window.innerHeight+20,rotate:Math.random()*720-360,x:`calc(${Math.random()*100}vw + ${Math.random()*200-100}px)`},transition:{duration:Math.random()*3+2,delay:Math.random()*2,ease:"linear"},style:{position:"absolute",width:Math.random()*10+5,height:Math.random()*10+5,backgroundColor:c[Math.floor(Math.random()*c.length)],borderRadius:Math.random()>.5?"50%":"0"}},l))})},Ue=({countdown:t,onClose:c,t:d})=>{const[l,a]=n.useState(!1),r=`${window.location.origin}/countdown-timer?title=${encodeURIComponent(t.title)}&date=${encodeURIComponent(t.targetDate)}&theme=${t.theme}`,x=()=>{navigator.clipboard.writeText(r),a(!0),setTimeout(()=>a(!1),2e3)},g=async()=>{if(navigator.share)try{await navigator.share({title:t.title,text:d("countdownTimer.shareText"),url:r})}catch{}};return e.jsx(m.div,{initial:{opacity:0}
3,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",onClick:c,children:e.jsxs(m.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-tertiary border border-white/10 rounded-2xl p-6 max-w-md w-full",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h3",{className:"text-xl font-bold text-white",children:d("countdownTimer.share")}),e.jsx("button",{onClick:c,className:"text-gray-400 hover:text-white",children:e.jsx(P,{size:24})})]}),e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("div",{className:"bg-white p-4 rounded-xl",children:e.jsx(Ye,{value:r,size:180})})}),e.jsxs("div",{className:"flex gap-2 mb-4",children:[e.jsx("input",{type:"text",value:r,readOnly:!0,className:"flex-1 bg-black/30 border border-white/10 rounded-lg px-4 py-2 text-white text-sm"}),e.jsx("button",{onClick:x,className:`px-4 py-2 rounded-lg font-medium transition-all ${l?"bg-green-500 text-white":"bg-purple-500 text-white hover:bg-purple-600"}`,children:l?e.jsx(ge,{}):d("countdownTimer.copy")})]}),"share"in navigator&&e.jsxs("button",{onClick:g,className:"w-full py-3 bg-gradient-to-r from-purple-600 to-violet-600 text-white font-medium rounded-lg hover:shadow-lg hover:shadow-purple-500/25 transition-all flex items-center justify-center gap-2",children:[e.jsx(pe,{}),d("countdownTimer.shareNative")]})]})})},st=()=>{const{t,language:c}=Se(),[d,l]=n.useState([]),[a,r]=n.useState(null),[x,g]=n.useState({days:0,hours:0,minutes:0,seconds:0,total:0}),o=n.useRef({days:0,hours:0,minutes:0,seconds:0,total:0}),[N,k]=n.useState(!1),[E,F]=n.useState(!1),[v,D]=n.useState(!1),[C,_]=n.useState(!0),[u,I]=n.useState(!1),[Y,L]=n.useState(!1),[S,b]=n.useState("large"),[f,w]=n.useState(!0),T=n.useRef(null),[M,O]=n.useState(!1),[be,X]=n.useState(!1),[H,R]=n.useState(""),[A,J]=n.useState(""),[q,ae]=n.useState("purple"),[re,ne]=n.useState(null),G=n.useRef(null),Q=n.useRef(null);n.useEffect(()=>{const s=new URLSearchParams(window.location.search),i=s.get("title"),y=s.get("date"),j=s.get("theme"),oe=i&&y,le=localStorage.getItem("vitaapps-countdowns");if(le){const z=JSON.parse(le);l(z),!oe&&z.length>0&&r(z[0])}if(oe){const z={id:"shared-"+Date.now().toString(36),title:i,targetDate:y,theme:j&&j in h?j:"purple",createdAt:Date.now()};r(z),l(B=>B.some(ce=>ce.title===z.title&&ce.targetDate===z.targetDate)?B:[...B,z]),window.history.replaceState({},"","/countdown-timer")}},[]),n.useEffect(()=>{d.length>0&&localStorage.setItem("vitaapps-countdowns",JSON.stringify(d))},[d]);const W=n.useCallback(s=>{const i=new Date(s).getTime(),y=Date.now(),j=i-y;return j<=0?{days:0,hours:0,minutes:0,seconds:0,total:0}:{days:Math.floor(j/(1e3*60*60*24)),hours:Math.floor(j/(1e3*60*60)%24),minutes:Math.floor(j/1e3/60%60),seconds:Math.floor(j/1e3%60),total:j}},[]);n.useEffect(()=>{if(!a)return;const s=setInterval(()=>{const y=W(a.targetDate);g(j=>(o.current=j,j.total>0&&y.total===0&&(O(!0),C&&Q.current&&Q.current.play(),setTimeout(()=>O(!1),5e3)),y))},1e3),i=W(a.targetDate);return g(i),o.current=i,()=>clearInterval(s)},[a,W,C]);const ie=()=>{!document.fullscreenElement&&G.current?(G.current.requestFullscreen(),I(!0)):document.fullscreenElement&&(document.exitFullscreen(),I(!1))},V=n.useCallback(()=>{w(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{w(!1)},5e3)},[]);n.useEffect(()=>{const s=()=>{const i=!!document.fullscreenElement;I(i),i?V():(w(!0),T.current&&clearTimeout(T.current))};return document.addEventListener("fullscreenchange",s),()=>{document.removeEventListener("fullscreenchange",s),T.current&&clearTimeout(T.current)}},[V]);const fe=()=>{if(!H||!A)return;const s={id:Date.now().toString(36)+Math.random().toString(36).substr(2),title:H,targetDate:A,theme:q,createdAt:Date.now()};l(i=>[...i,s]),r(s),k(!1),R(""),J(""),ne(null)},we=s=>{if(l(i=>i.filter(y=>y.id!==s)),(a==null?void 0:a.id)===s){const i=d.filter(y=>y.id!==s);r(i.length>0?i[0]:null)}},ye=s=>{ne(s.id),ae(s.theme),R(t(`countdownTimer.presets.${s.titleKey}`));const i=s.getDate();i&&J(i)},je=()=>{if(!a||!H)return;const s={...a,title:H};l(i=>i.map(y=>y.id===a.id?s:y)),r(s),X(!1),R("")},ve=s=>{if(!a)return;const i={...a,theme:s};l(y=>y.map(j=>j.id===a.id?i:j)),r(i)},p=(a==null?void 0:a.theme)||"purple",Ne=$e("Countdown Timer",c==="de"?"Kostenloser Countdown-Timer für Events und Termine. Erstellen Sie mehrere Countdowns mit verschiedenen Designs.":"Free countdown timer for events and deadlines. Create multiple countdowns with different themes.","/tools/countdown"),ke=Te([{name:"Home",url:"/"},{name:"Tools",url:"/tools"},{name:"Countdown Timer",url:"/tools/countdown"}]);return e.jsxs("div",{ref:G,className:"bg-primary min-h-screen",children:[e.jsx(Ce,{title:"Countdown Timer",description:c==="de"?"Kostenloser Countdown-Timer für Events und Termine. Erstellen Sie mehrere Countdowns mit verschiedenen Designs.":"Free countdown timer for events and deadlines. Create multiple countdowns with different themes.",url:"/tools/countdown",structuredData:[Ne,ke]}),!u&&e.jsx(De,{}),e.jsx($,{children:M&&e.jsx(Ke,{theme:p})}),e.jsx("audio",{ref:Q,src:"/sounds/celebration.mp3",preload:"auto"}),e.jsxs("div",{className:`relative ${u?"min-h-screen flex items-center justify-center":"pt-24 pb-20"}`,onMouseMove:u?V:void 0,onClick:u?V:void 0,children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx(m.div,{animate:{scale:[1,1.2,1],opacity:[.3,.5,.3]},transition:{duration:8,repeat:1/0},className:`absolute top-1/4 left-1/4 w-96 h-96 bg-${h[p].glow}/20 rounded-full blur-3xl`}),e.jsx(m.div,{animate:{scale:[1.2,1,1.2],opacity:[.2,.4,.2]},transition:{duration:10,repeat:1/0},className:`absolute bottom-1/4 right-1/4 w-96 h-96 bg-${h[p].glow}/20 rounded-full blur-3xl`})]}),e.jsxs("div",{className:"container mx-auto px-4 relative z-10",children:[!u&&e.jsxs(m.div,{initial:{opacity:0,y:20}
3,animate:{opacity:1,y:0},className:"text-center mb-12",children:[e.jsxs(m.div,{initial:{scale:0},animate:{scale:1},className:`inline-flex items-center gap-2 ${h[p].bg} border ${h[p].border} rounded-full px-4 py-2 mb-4`,children:[e.jsx(te,{className:h[p].text}),e.jsx("span",{className:`${h[p].text} text-sm font-medium`,children:t("countdownTimer.badge")})]}),e.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-white mb-4",children:t("countdownTimer.title")}),e.jsx("p",{className:"text-secondary max-w-xl mx-auto",children:t("countdownTimer.subtitle")})]}),!a&&e.jsxs(m.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"max-w-md mx-auto text-center py-20",children:[e.jsx("div",{className:"w-24 h-24 mx-auto mb-6 rounded-full bg-purple-500/20 flex items-center justify-center",children:e.jsx(te,{className:"text-purple-400",size:48})}),e.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:t("countdownTimer.empty.title")}),e.jsx("p",{className:"text-secondary mb-8",children:t("countdownTimer.empty.description")}),e.jsxs("button",{onClick:()=>k(!0),className:"px-6 py-3 bg-gradient-to-r from-purple-600 to-violet-600 text-white font-medium rounded-full hover:shadow-lg hover:shadow-purple-500/25 transition-all flex items-center gap-2 mx-auto",children:[e.jsx(de,{}),t("countdownTimer.createFirst")]})]}),a&&e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx($,{children:(!u||!Y)&&e.jsxs(m.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"text-center mb-8",children:[!u&&be?e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("input",{type:"text",value:H,onChange:s=>R(s.target.value),className:"bg-black/30 border border-white/10 rounded-lg px-4 py-2 text-2xl text-white text-center",autoFocus:!0}),e.jsx("button",{onClick:je,className:"p-2 bg-green-500 rounded-lg text-white",children:e.jsx(ge,{})}),e.jsx("button",{onClick:()=>X(!1),className:"p-2 bg-red-500 rounded-lg text-white",children:e.jsx(P,{})})]}):u?e.jsx("h2",{className:`${U[S].title} font-bold text-white cursor-pointer transition-all`,onClick:()=>L(!0),title:t("countdownTimer.clickToHide"),children:a.title}):e.jsxs("button",{onClick:()=>{R(a.title),X(!0)},className:"group inline-flex items-center gap-2",children:[e.jsx("h2",{className:"text-2xl md:text-4xl font-bold text-white",children:a.title}),e.jsx(ze,{className:"text-gray-500 opacity-0 group-hover:opacity-100 transition-opacity"})]}),!u&&e.jsx("p",{className:"text-secondary mt-2",children:new Date(a.targetDate).toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})}),e.jsxs(m.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},className:"flex justify-center items-center gap-2 sm:gap-4 mb-8",children:[e.jsx(K,{value:x.days,prevValue:o.current.days,label:t("countdownTimer.days"),theme:p,size:u?S:"normal"}),e.jsx(ee,{theme:p,size:u?S:"normal"}),e.jsx(K,{value:x.hours,prevValue:o.current.hours,label:t("countdownTimer.hours"),theme:p,size:u?S:"normal"}),e.jsx(ee,{theme:p,size:u?S:"normal"}),e.jsx(K,{value:x.minutes,prevValue:o.current.minutes,label:t("countdownTimer.minutes"),theme:p,size:u?S:"normal"}),e.jsx(ee,{theme:p,size:u?S:"normal"}),e.jsx(K,{value:x.seconds,prevValue:o.current.seconds,label:t("countdownTimer.seconds"),theme:p,size:u?S:"normal"})]}),e.jsx($,{children:x.total===0&&e.jsxs(m.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},className:"text-center mb-8",children:[e.jsx(m.div,{animate:{scale:[1,1.1,1]},transition:{duration:.5,repeat:1/0},className:"inline-block",children:e.jsx(Z,{className:"text-6xl text-yellow-400 mx-auto mb-4"})}),e.jsx("h3",{className:"text-3xl font-bold text-white",children:t("countdownTimer.celebration")})]})}),!u&&e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 mb-8",children:[e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>D(!v),className:`p-3 ${h[p].bg} border ${h[p].border} rounded-xl text-white hover:bg-white/10 transition-all`,children:e.jsx(me,{size:20})}),e.jsx($,{children:v&&e.jsx(m.div,{initial:{opacity:0,y:10}
3,animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute top-full mt-2 left-0 bg-tertiary border border-white/10 rounded-xl p-3 flex gap-2 z-20",children:Object.entries(h).map(([s,i])=>e.jsx("button",{onClick:()=>{ve(s),D(!1)},className:`w-8 h-8 rounded-full bg-gradient-to-br ${i.gradient} ${p===s?"ring-2 ring-white ring-offset-2 ring-offset-gray-900":""}`,title:i.name},s))})})]}),e.jsx("button",{onClick:()=>_(!C),className:`p-3 ${h[p].bg} border ${h[p].border} rounded-xl text-white hover:bg-white/10 transition-all`,children:C?e.jsx(Fe,{size:20}):e.jsx(He,{size:20})}),e.jsx("button",{onClick:()=>F(!0),className:`p-3 ${h[p].bg} border ${h[p].border} rounded-xl text-white hover:bg-white/10 transition-all`,children:e.jsx(pe,{size:20})}),e.jsx("button",{onClick:ie,className:`p-3 ${h[p].bg} border ${h[p].border} rounded-xl text-white hover:bg-white/10 transition-all`,children:e.jsx(Ee,{size:20})}),e.jsx("button",{onClick:()=>k(!0),className:`p-3 bg-gradient-to-r ${h[p].gradient} rounded-xl text-white hover:shadow-lg transition-all`,children:e.jsx(de,{size:20})})]}),u&&e.jsxs(m.div,{initial:{opacity:1},animate:{opacity:f?1:0},transition:{duration:.3},className:"pointer-events-none",children:[e.jsx("div",{className:"fixed bottom-6 left-6 flex gap-2 z-50 pointer-events-auto",children:["normal","large","xlarge"].map(s=>e.jsx("button",{onClick:i=>{i.stopPropagation(),b(s)},className:`px-3 py-2 rounded-full text-xs font-medium transition-all ${S===s?"bg-white/20 text-white border border-white/30":"bg-black/50 text-white/50 border border-white/10 hover:text-white hover:bg-black/70"}`,children:s==="normal"?"S":s==="large"?"M":"L"},s))}),e.jsx("button",{onClick:s=>{s.stopPropagation(),ie(),L(!1)},className:"fixed bottom-6 right-6 p-3 bg-black/50 backdrop-blur-sm border border-white/10 rounded-full text-white/50 hover:text-white hover:bg-black/70 transition-all z-50 pointer-events-auto",children:e.jsx(P,{size:20})})]}),u&&Y&&e.jsx(m.button,{initial:{opacity:0}
3,animate:{opacity:f?1:0},transition:{duration:.3},onClick:()=>L(!1),className:"fixed top-6 left-1/2 -translate-x-1/2 px-4 py-2 bg-black/50 backdrop-blur-sm border border-white/10 rounded-full text-white/50 hover:text-white hover:bg-black/70 transition-all text-sm z-50",children:a.title}),!u&&d.length>1&&e.jsxs("div",{className:"mt-12",children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-4 text-center",children:t("countdownTimer.allCountdowns")}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(s=>e.jsx(m.div,{whileHover:{scale:1.02},className:`p-4 rounded-xl border cursor-pointer transition-all ${(a==null?void 0:a.id)===s.id?`${h[s.theme].border} bg-white/5`:"bg-tertiary border-white/10 hover:border-white/20"}`,onClick:()=>r(s),children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-3 h-3 rounded-full bg-gradient-to-br ${h[s.theme].gradient} mt-1.5 flex-shrink-0`}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-white",children:s.title}),e.jsx("p",{className:"text-sm text-gray-400",children:new Date(s.targetDate).toLocaleDateString()})]})]}),e.jsx("button",{onClick:i=>{i.stopPropagation(),we(s.id)},className:"p-1 text-gray-500 hover:text-red-400 transition-colors",children:e.jsx(Re,{size:16})})]})},s.id))})]}),!u&&e.jsx(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"mt-12",children:e.jsx("a",{href:"https://apps.apple.com/de/app/vita-habit-tracker/id6752308462",target:"_blank",rel:"noopener noreferrer",className:"block p-5 rounded-2xl bg-gradient-to-r from-purple-500/10 via-violet-500/10 to-indigo-500/10 border border-purple-500/20 hover:border-purple-400/40 transition-all group",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:"/assets/apps/vita+.png",alt:"Vita+",className:"w-14 h-14 rounded-xl shadow-lg group-hover:scale-110 transition-transform"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"text-white font-semibold flex items-center gap-2 mb-1",children:[t("countdownTimer.appPromo.title"),e.jsx(Z,{className:"text-purple-400",size:14})]}),e.jsx("p",{className:"text-gray-400 text-sm",children:t("countdownTimer.appPromo.description")})]}),e.jsxs("div",{className:"hidden sm:flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-white rounded-lg group-hover:scale-105 transition-transform shadow",children:[e.jsx(xe,{className:"text-black",size:14}),e.jsx("span",{className:"text-black text-xs font-semibold",children:"App Store"})]}),e.jsx("span",{className:"text-purple-400 text-xs",children:t("countdownTimer.appPromo.free")})]})]})})})]})]})]}),e.jsx($,{children:N&&e.jsx(m.div,{initial:{opacity:0}
3,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",onClick:()=>k(!1),children:e.jsxs(m.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-tertiary border border-white/10 rounded-2xl p-6 max-w-lg w-full max-h-[90vh] overflow-y-auto",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h3",{className:"text-xl font-bold text-white",children:t("countdownTimer.create.title")}),e.jsx("button",{onClick:()=>k(!1),className:"text-gray-400 hover:text-white",children:e.jsx(P,{size:24})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:[e.jsx(Pe,{className:"inline mr-2"}),t("countdownTimer.create.presets")]}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:Oe.map(s=>e.jsxs("button",{onClick:()=>ye(s),className:`p-3 rounded-xl border text-center transition-all ${re===s.id?`${h[s.theme].border} bg-white/5`:"bg-black/30 border-white/10 hover:border-white/20"}`,children:[e.jsx("span",{className:"text-2xl block mb-1",children:s.icon}),e.jsx("span",{className:`text-xs ${re===s.id?"text-white":"text-gray-300"}`,children:t(`countdownTimer.presets.${s.titleKey}`)})]},s.id))})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t("countdownTimer.create.name")}),e.jsx("input",{type:"text",value:H,onChange:s=>R(s.target.value),placeholder:t("countdownTimer.create.namePlaceholder"),className:"w-full bg-black/30 border border-white/10 rounded-lg px-4 py-3 text-white placeholder-gray-500 focus:border-purple-500 focus:outline-none"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:t("countdownTimer.create.date")}),e.jsx(Ae,{value:A,onChange:J,minDate:new Date})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:[e.jsx(me,{className:"inline mr-2"}),t("countdownTimer.create.theme")]}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:Object.entries(h).map(([s,i])=>e.jsxs("button",{onClick:()=>ae(s),className:"group flex flex-col items-center gap-1.5 p-2 rounded-xl transition-all hover:bg-white/5",title:i.name,children:[e.jsx("div",{className:`w-8 h-8 rounded-full bg-gradient-to-br ${i.gradient} transition-all ${q===s?"ring-2 ring-white ring-offset-2 ring-offset-gray-900 scale-110":"group-hover:scale-105"}`}),e.jsx("span",{className:`text-[10px] transition-colors ${q===s?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:i.name})]},s))})]}),e.jsx("button",{onClick:fe,disabled:!H||!A,className:"w-full py-3 bg-gradient-to-r from-purple-600 to-violet-600 text-white font-medium rounded-lg hover:shadow-lg hover:shadow-purple-500/25 transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:t("countdownTimer.create.button")})]})})}),e.jsx($,{children:E&&a&&e.jsx(Ue,{countdown:a,onClose:()=>F(!1),t})}),!u&&e.jsx(Me,{}),!u&&e.jsx(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"fixed bottom-4 right-4 z-40",children:e.jsxs("a",{href:"https://apps.apple.com/de/app/vita-habit-tracker/id6752308462",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 bg-black/80 backdrop-blur-sm border border-white/10 rounded-xl p-3 hover:border-purple-500/50 transition-all group",children:[e.jsx("img",{src:"/assets/apps/vita+.png",alt:"Vita+",className:"w-12 h-12 rounded-xl shadow-lg group-hover:scale-105 transition-transform"}),e.jsxs("div",{className:"pr-2",children:[e.jsxs("p",{className:"text-xs text-gray-400 flex items-center gap-1",children:[t("countdownTimer.promo.badge")," ",e.jsx(Z,{className:"text-purple-400",size:12})]}),e.jsx("p",{className:"text-sm text-white font-medium group-hover:text-purple-400 transition-colors",children:t("countdownTimer.promo.text")})]}),e.jsx("div",{className:"flex items-center gap-1 px-2 py-1 bg-white/10 rounded-lg",children:e.jsx(xe,{className:"text-white",size:14})})]})})]})};export{st 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.