@mblinkov/whats-missing 20.0.32 → 20.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,4 +6,4 @@
6
6
  `;if(typeof document<"u"&&!document.getElementById("spin-keyframes")){const a=document.createElement("style");a.id="spin-keyframes",a.innerHTML=xe,document.head.appendChild(a)}const be={animation:"spin 1.4s linear infinite"},n={gmCenterScreen:{position:"relative",zIndex:1,minHeight:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",color:"#1f2937",padding:"24px 16px",boxSizing:"border-box",transform:"translateY(20px)"},gmHeadline1:{fontWeight:700,fontSize:"clamp(28px, 4vw, 40px)",lineHeight:"110%"},gmHeadline3:{fontWeight:600,fontSize:"18px",lineHeight:"130%"},gmBodyM:{fontWeight:400,fontSize:"16px",lineHeight:"140%"},gmBodyS:{fontWeight:400,fontSize:"14px",lineHeight:"140%",color:"#6b7280"},gmButton:{fontFamily:'"Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans"',fontWeight:600,fontSize:"16px",padding:"10px 16px",borderRadius:"12px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"0 6px 18px rgba(236, 76, 68, .18)",transition:"transform .06s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease"},gmButtonActive:{background:"#333",color:"#fff"},gmGameLayout:{position:"relative",width:"100%",maxWidth:"none",minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",color:"#1f2937",padding:"16px 8px",margin:"0 auto"},gmGrid:{width:"100%",maxWidth:"none",margin:"0 auto",display:"grid",gridTemplateColumns:"repeat(3, 210px)",gridAutoRows:"210px",gap:"20px",justifyContent:"center"},gmCard:{border:"1px solid #e5e7eb",borderRadius:"16px",background:"#f9f9f9",aspectRatio:"1 / 1",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",transition:"transform .2s ease, box-shadow .2s ease, border-color .2s ease"},gmCorrect:{border:"2px solid #10b981",boxShadow:"0 0 18px rgba(16,185,129,.45)",background:"#ecfdf5"},gmWrong:{border:"2px solid #ec4c44",boxShadow:"0 0 18px rgba(236,76,68,.35)",background:"#fef2f2"},gmInput:{padding:"6px 10px",borderRadius:"6px",border:"1px solid #ccc",fontSize:"16px",fontFamily:'"Geist", system-ui',width:"160px"},gmTable:{marginTop:"20px",marginBottom:"32px",borderCollapse:"collapse",width:"100%",maxWidth:"520px",tableLayout:"fixed",textAlign:"center"},gmTableCell:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},gmLogoFixed:{position:"absolute",top:"16px",left:"24px",width:"120px",zIndex:10,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"clamp(28px, 5vw, 40px)",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased"},gmHourglass:{fontSize:"42px",...be}},we=()=>{const a=document.createElement("style");a.textContent=`
7
7
  #whats-missing-root, #whats-missing-root * { box-sizing: border-box; }
8
8
  #whats-missing-root img { max-width:100%; height:auto; display:block; user-select:none; }
9
- `,document.head.appendChild(a)},je=(a,m)=>{const r=Array.from({length:a.length+1},()=>Array(m.length+1).fill(0));for(let i=0;i<=a.length;i++)r[i][0]=i;for(let i=0;i<=m.length;i++)r[0][i]=i;for(let i=1;i<=a.length;i++)for(let u=1;u<=m.length;u++)r[i][u]=a[i-1]===m[u-1]?r[i-1][u-1]:Math.min(r[i-1][u-1],r[i][u-1],r[i-1][u])+1;return r[a.length][m.length]};function Se(a,m={minDesktopWidth:1200,forceResize:!1}){const r=s.useRef(null),i=m.minDesktopWidth??1200,u=!!m.forceResize;s.useLayoutEffect(()=>{if(typeof window>"u"||!a||!a.current)return;const d=a.current,R=()=>{try{const l=document.body,j=getComputedStyle(l),b=parseFloat(l.style&&l.style.zoom||"");if(b&&!isNaN(b)&&b>0)return b;const S=parseFloat(j.zoom||"");if(S&&!isNaN(S)&&S>0)return S;const g=document.createElement("div");g.style.position="absolute",g.style.left="0",g.style.top="0",g.style.width="100px",g.style.height="1px",g.style.visibility="hidden",document.documentElement.appendChild(g);const k=g.getBoundingClientRect();if(document.documentElement.removeChild(g),k&&k.width>0){const p=k.width/100;if(!isNaN(p)&&p>0)return p}}catch{}return 1},I=()=>{if(i&&window.innerWidth<i){y();return}const l=R();if(!l||l===1){y();return}r.current||(r.current={transform:d.style.transform||null,transformOrigin:d.style.transformOrigin||null,width:d.style.width||null,height:d.style.height||null,willChange:d.style.willChange||null});const j=1/l;u&&(d.style.width=`${l*100}%`,d.style.height=`${l*100}%`),d.style.transformOrigin="50% 50%",d.style.transform=`scale(${j})`,d.style.willChange="transform"},y=()=>{if(!r.current)return;const l=r.current;d.style.transform=l.transform??"",d.style.transformOrigin=l.transformOrigin??"",d.style.width=l.width??"",d.style.height=l.height??"",d.style.willChange=l.willChange??"",r.current=null};let C=0;const x=()=>{cancelAnimationFrame(C),C=requestAnimationFrame(I)},T=new MutationObserver(l=>{for(const j of l)if(j.type==="attributes"&&(j.attributeName==="style"||j.attributeName==="class")){x();break}});return T.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),window.addEventListener("resize",x),x(),()=>{cancelAnimationFrame(C),T.disconnect(),window.removeEventListener("resize",x),y()}},[a,i,u])}function ve({gameCubeSize:a,screenHeight:m,screenWidth:r}){const i=s.useRef(null),u=s.useRef(null),[d,R]=s.useState(null);Se(i,{minDesktopWidth:1024,forceResize:!1});const I=s.useMemo(()=>{const e=a??Math.min(r??1e3,m??1e3),o=r??(typeof window<"u"?window.innerWidth:1e3);return e<600&&o>768?600:o<=768?Math.min(e,o-20):e},[a,r,m]);s.useEffect(()=>(we(),()=>{document.body.style.overflow=""}),[]);const[y,C]=s.useState(null),[x,T]=s.useState([]),[l,j]=s.useState(4),[b,S]=s.useState(!1),[g,k]=s.useState(1),[p,ie]=s.useState(null),[w,H]=s.useState("ready"),[U,V]=s.useState(3),[E,A]=s.useState(10),[W,Z]=s.useState(20),[re,F]=s.useState(0),[B,G]=s.useState(!1),[L,_]=s.useState(""),[z,$]=s.useState(!1),[N,K]=s.useState(!1),[J,M]=s.useState(null),[ae,O]=s.useState([]),[le,Q]=s.useState([]),[h,de]=s.useState(!1);s.useEffect(()=>{if(typeof window>"u")return;const e=()=>{const o=r??window.innerWidth,c=window.matchMedia&&window.matchMedia("(pointer: coarse)").matches;de(o<=768||c)};return e(),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[r]),s.useLayoutEffect(()=>{const e=u.current;if(!e||typeof window>"u")return;let o=null;try{o=new ResizeObserver(c=>{for(const f of c){const v=f.contentRect;R(Math.round(Math.min(v.width,v.height)))}}),o.observe(e),R(Math.round(Math.min(e.clientWidth,e.clientHeight)))}catch{R(Math.round(Math.min(e.clientWidth,e.clientHeight)))}return()=>o?.disconnect()},[h]);const X=e=>[...e].sort(()=>Math.random()-.5).slice(0,6),ee=()=>{if(!y)return;const e=X(P[y]);T(e),S(!0),G(!1),k(1),F(0),O([]),Q([]),te(e,[],!0)},te=(e=x,o=le,c=!1)=>{const f=X(e.length?e:P[y]);let v=Math.floor(Math.random()*f.length),q=f[v].name,se=0;for(;o.includes(q)&&se<20;)v=Math.floor(Math.random()*f.length),q=f[v].name,se++;T(f),ie(v),Q([...o,q]),$(!1),_(""),Z(20),M(null),c?(H("ready"),V(3),A(10)):(H("memorize"),A(10))};s.useEffect(()=>{if(!(!b||B||z)){if(w==="ready")if(U<=0)H("memorize");else{const e=setTimeout(()=>V(o=>o-1),1e3);return()=>clearTimeout(e)}if(w==="memorize")if(E<=0)H("guess");else{const e=setTimeout(()=>A(o=>o-1),1e3);return()=>clearTimeout(e)}if(w==="guess"){if(W<=0){$(!0),M("wrong");const o=x[p].name;O(c=>[...c,{round:g,answer:L,correct:o,result:"wrong"}]);return}const e=setTimeout(()=>Z(o=>o-1),1e3);return()=>clearTimeout(e)}}},[w,U,E,W,b,B,z,x,p,g,L]);const ce=()=>{if(p===null||N)return;const e=x[p].name,o=L.toLowerCase().trim();let c="wrong";o===e?(F(f=>f+1),M("correct"),c="correct"):je(o,e)===1?(F(f=>f+.5),M("almost"),c="almost"):(M("wrong"),c="wrong"),O(f=>[...f,{round:g,answer:o,correct:e,result:c}]),K(!0),setTimeout(()=>{K(!1),$(!0)},600)},me=()=>g<l?(k(e=>e+1),te()):G(!0),ue=()=>{S(!1),G(!1),C(null)},ge=s.useMemo(()=>t.jsx("div",{style:{...n.gmLogoFixed,position:"absolute",top:16,left:16,zIndex:30},children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:window.origin+"/cloud/speakid/games/whatsmissing/logo.svg",type:"image/svg+xml"}),t.jsx("img",{src:window.origin+"/cloud/speakid/games/whatsmissing/logo.png",alt:"SPEAKID Logo",style:n.gmLogoImg,loading:"lazy"})]})}),[]),ne=1200,oe=700,D=s.useMemo(()=>{const e=r??(typeof window<"u"?window.innerWidth:ne),o=m??(typeof window<"u"?window.innerHeight:oe),c=Math.min(e/ne,o/oe);return Math.min(1.15,Math.max(.92,c))},[r,m,h]);return t.jsx("div",{ref:i,style:{position:"fixed",inset:0,display:"flex",justifyContent:"center",alignItems:"center",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",overflow:"hidden",zIndex:1},children:t.jsx("div",{ref:u,style:{width:h?"100%":`${I}px`,height:h?"100%":`${I}px`,borderRadius:h?0:"20px",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",position:"relative",overflow:"hidden",boxShadow:h?"none":"0 0 40px rgba(0,0,0,0.08)",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsxs("div",{id:"whats-missing-root",style:{transform:`scale(${D})`,transformOrigin:"center center",transition:"transform 0.2s ease-out",width:`${100/D}%`,height:`${100/D}%`,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[!h&&ge,!y&&!b&&t.jsxs("div",{style:n.gmCenterScreen,children:[t.jsx("h1",{style:n.gmHeadline1,children:"WHAT'S MISSING?"}),t.jsx("p",{style:n.gmBodyM,children:"Select a theme:"}),t.jsx("div",{style:{display:"flex",gap:16},children:["animals","food","toys"].map(e=>t.jsx("button",{style:n.gmButton,onClick:()=>C(e),children:e==="animals"?"🐶 Animals":e==="food"?"🍎 Food":"🧸 Toys"},e))}),t.jsxs("div",{style:{marginTop:24},children:[t.jsx("p",{style:n.gmBodyS,children:"Choose number of rounds:"}),t.jsx("div",{style:{display:"flex",gap:12,marginTop:8},children:[3,4,5].map(e=>t.jsx("button",{style:{...n.gmButton,...l===e?n.gmButtonActive:{}},onClick:()=>j(e),children:e},e))})]})]}),y&&!b&&t.jsxs("div",{style:n.gmCenterScreen,children:[t.jsxs("h1",{style:n.gmHeadline1,children:["Theme selected: ",y]}),t.jsxs("p",{style:n.gmBodyM,children:["Rounds: ",l]}),t.jsx("button",{style:n.gmButton,onClick:ee,children:"▶ Start game"})]}),B&&t.jsxs("div",{style:n.gmCenterScreen,children:[t.jsx("h1",{style:n.gmHeadline1,children:"Results"}),t.jsxs("h2",{style:n.gmHeadline3,children:["Your score: ",re," / ",l]}),t.jsx("p",{style:{...n.gmBodyM,color:"#10b981",marginTop:12},children:"Yahoo! You did it! 🍬✨"}),t.jsxs("table",{style:n.gmTable,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Round"}),t.jsx("th",{children:"Your Answer"}),t.jsx("th",{children:"Correct"}),t.jsx("th",{children:"Result"})]})}),t.jsx("tbody",{children:ae.map((e,o)=>t.jsxs("tr",{children:[t.jsx("td",{style:n.gmTableCell,children:e.round}),t.jsx("td",{style:n.gmTableCell,children:e.answer||"—"}),t.jsx("td",{style:n.gmTableCell,children:e.correct}),t.jsx("td",{style:n.gmTableCell,children:e.result==="correct"?"✔ Correct":e.result==="almost"?"◐ Almost (0.5)":"✘ Wrong"})]},o))})]}),t.jsxs("div",{style:{display:"flex",gap:12,marginTop:24},children:[t.jsx("button",{style:n.gmButton,onClick:ee,children:"🔁 Play again"}),t.jsx("button",{style:n.gmButton,onClick:ue,children:"⬅️ Choose theme"})]})]}),b&&!B&&t.jsxs("div",{style:n.gmGameLayout,children:[t.jsxs("div",{style:{minHeight:160,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[w==="ready"&&t.jsxs(t.Fragment,{children:[t.jsx("h1",{style:{...n.gmHeadline1,color:"#ec4c44"},children:"GET READY"}),t.jsx("div",{style:n.gmHourglass,children:"⏳"})]}),w==="memorize"&&t.jsxs("p",{style:{...n.gmBodyM,color:"#10b981"},children:["MEMORIZE (",E,")"]}),w==="guess"&&!z&&t.jsxs("p",{style:n.gmBodyM,children:["⏳ Time left: ",W,"s"]})]}),w!=="ready"&&t.jsx("div",{style:{...n.gmGrid,display:"grid",gridTemplateColumns:`repeat(${h?2:3}, 1fr)`,gridTemplateRows:`repeat(${h?3:2}, 1fr)`,gap:h?12:20,justifyContent:"center",alignContent:"center",padding:h?8:16,width:"100%",height:"100%",maxWidth:h?"100%":600,maxHeight:h?"100%":400,boxSizing:"border-box"},children:x.map((e,o)=>{const c=p===o&&w==="guess"&&!z;return t.jsx("div",{style:{...n.gmCard,width:"100%",height:"100%",...J==="correct"&&p===o?n.gmCorrect:{},...J==="wrong"&&p===o?n.gmWrong:{}},children:!c&&t.jsx("img",{src:e.src,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})},o)})}),t.jsxs("div",{style:{marginTop:16,height:80},children:[w==="guess"&&!z&&t.jsxs("div",{children:[t.jsx("input",{type:"text",placeholder:"Type the missing word",value:L,onChange:e=>_(e.target.value),style:n.gmInput}),t.jsx("button",{style:{...n.gmButton,marginLeft:8},onClick:ce,disabled:N,children:N?"...":"Check"})]}),z&&t.jsx("button",{type:"button",style:n.gmButton,onClick:me,children:"Next round"})]})]})]})})})}exports.Game=ve;exports.themes=P;
9
+ `,document.head.appendChild(a)},je=(a,m)=>{const r=Array.from({length:a.length+1},()=>Array(m.length+1).fill(0));for(let i=0;i<=a.length;i++)r[i][0]=i;for(let i=0;i<=m.length;i++)r[0][i]=i;for(let i=1;i<=a.length;i++)for(let u=1;u<=m.length;u++)r[i][u]=a[i-1]===m[u-1]?r[i-1][u-1]:Math.min(r[i-1][u-1],r[i][u-1],r[i-1][u])+1;return r[a.length][m.length]};function Se(a,m={minDesktopWidth:1200,forceResize:!1}){const r=s.useRef(null),i=m.minDesktopWidth??1200,u=!!m.forceResize;s.useLayoutEffect(()=>{if(typeof window>"u"||!a||!a.current)return;const d=a.current,R=()=>{try{const l=document.body,j=getComputedStyle(l),b=parseFloat(l.style&&l.style.zoom||"");if(b&&!isNaN(b)&&b>0)return b;const S=parseFloat(j.zoom||"");if(S&&!isNaN(S)&&S>0)return S;const g=document.createElement("div");g.style.position="absolute",g.style.left="0",g.style.top="0",g.style.width="100px",g.style.height="1px",g.style.visibility="hidden",document.documentElement.appendChild(g);const k=g.getBoundingClientRect();if(document.documentElement.removeChild(g),k&&k.width>0){const p=k.width/100;if(!isNaN(p)&&p>0)return p}}catch{}return 1},I=()=>{if(i&&window.innerWidth<i){y();return}const l=R();if(!l||l===1){y();return}r.current||(r.current={transform:d.style.transform||null,transformOrigin:d.style.transformOrigin||null,width:d.style.width||null,height:d.style.height||null,willChange:d.style.willChange||null});const j=1/l;u&&(d.style.width=`${l*100}%`,d.style.height=`${l*100}%`),d.style.transformOrigin="50% 50%",d.style.transform=`scale(${j})`,d.style.willChange="transform"},y=()=>{if(!r.current)return;const l=r.current;d.style.transform=l.transform??"",d.style.transformOrigin=l.transformOrigin??"",d.style.width=l.width??"",d.style.height=l.height??"",d.style.willChange=l.willChange??"",r.current=null};let C=0;const x=()=>{cancelAnimationFrame(C),C=requestAnimationFrame(I)},T=new MutationObserver(l=>{for(const j of l)if(j.type==="attributes"&&(j.attributeName==="style"||j.attributeName==="class")){x();break}});return T.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),window.addEventListener("resize",x),x(),()=>{cancelAnimationFrame(C),T.disconnect(),window.removeEventListener("resize",x),y()}},[a,i,u])}function ve({gameCubeSize:a,screenHeight:m,screenWidth:r}){const i=s.useRef(null),u=s.useRef(null),[d,R]=s.useState(null);Se(i,{minDesktopWidth:1024,forceResize:!1});const I=s.useMemo(()=>{const e=a??Math.min(r??1e3,m??1e3),o=r??(typeof window<"u"?window.innerWidth:1e3);return e<600&&o>768?600:o<=768?Math.min(e,o-20):e},[a,r,m]);s.useEffect(()=>(we(),()=>{document.body.style.overflow=""}),[]);const[y,C]=s.useState(null),[x,T]=s.useState([]),[l,j]=s.useState(4),[b,S]=s.useState(!1),[g,k]=s.useState(1),[p,ie]=s.useState(null),[w,H]=s.useState("ready"),[U,V]=s.useState(3),[E,A]=s.useState(10),[W,Z]=s.useState(20),[re,F]=s.useState(0),[B,G]=s.useState(!1),[L,_]=s.useState(""),[z,$]=s.useState(!1),[N,K]=s.useState(!1),[J,M]=s.useState(null),[ae,O]=s.useState([]),[le,Q]=s.useState([]),[h,de]=s.useState(!1);s.useEffect(()=>{if(typeof window>"u")return;const e=()=>{const o=r??window.innerWidth,c=window.matchMedia&&window.matchMedia("(pointer: coarse)").matches;de(o<=768||c)};return e(),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[r]),s.useLayoutEffect(()=>{const e=u.current;if(!e||typeof window>"u")return;let o=null;try{o=new ResizeObserver(c=>{for(const f of c){const v=f.contentRect;R(Math.round(Math.min(v.width,v.height)))}}),o.observe(e),R(Math.round(Math.min(e.clientWidth,e.clientHeight)))}catch{R(Math.round(Math.min(e.clientWidth,e.clientHeight)))}return()=>o?.disconnect()},[h]);const X=e=>[...e].sort(()=>Math.random()-.5).slice(0,6),ee=()=>{if(!y)return;const e=X(P[y]);T(e),S(!0),G(!1),k(1),F(0),O([]),Q([]),te(e,[],!0)},te=(e=x,o=le,c=!1)=>{const f=X(e.length?e:P[y]);let v=Math.floor(Math.random()*f.length),q=f[v].name,se=0;for(;o.includes(q)&&se<20;)v=Math.floor(Math.random()*f.length),q=f[v].name,se++;T(f),ie(v),Q([...o,q]),$(!1),_(""),Z(20),M(null),c?(H("ready"),V(3),A(10)):(H("memorize"),A(10))};s.useEffect(()=>{if(!(!b||B||z)){if(w==="ready")if(U<=0)H("memorize");else{const e=setTimeout(()=>V(o=>o-1),1e3);return()=>clearTimeout(e)}if(w==="memorize")if(E<=0)H("guess");else{const e=setTimeout(()=>A(o=>o-1),1e3);return()=>clearTimeout(e)}if(w==="guess"){if(W<=0){$(!0),M("wrong");const o=x[p].name;O(c=>[...c,{round:g,answer:L,correct:o,result:"wrong"}]);return}const e=setTimeout(()=>Z(o=>o-1),1e3);return()=>clearTimeout(e)}}},[w,U,E,W,b,B,z,x,p,g,L]);const ce=()=>{if(p===null||N)return;const e=x[p].name,o=L.toLowerCase().trim();let c="wrong";o===e?(F(f=>f+1),M("correct"),c="correct"):je(o,e)===1?(F(f=>f+.5),M("almost"),c="almost"):(M("wrong"),c="wrong"),O(f=>[...f,{round:g,answer:o,correct:e,result:c}]),K(!0),setTimeout(()=>{K(!1),$(!0)},600)},me=()=>g<l?(k(e=>e+1),te()):G(!0),ue=()=>{S(!1),G(!1),C(null)},ge=s.useMemo(()=>t.jsx("div",{style:{...n.gmLogoFixed,position:"absolute",top:16,left:16,zIndex:30},children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:window.origin+"/cloud/speakid/games/whatsmissing/logo.svg",type:"image/svg+xml"}),t.jsx("img",{src:window.origin+"/cloud/speakid/games/whatsmissing/logo.png",alt:"SPEAKID Logo",style:n.gmLogoImg,loading:"lazy"})]})}),[]),ne=1200,oe=700,D=s.useMemo(()=>{const e=r??(typeof window<"u"?window.innerWidth:ne),o=m??(typeof window<"u"?window.innerHeight:oe),c=Math.min(e/ne,o/oe);return Math.min(1.35,Math.max(1,c))},[r,m,h]);return t.jsx("div",{ref:i,style:{position:"fixed",inset:0,display:"flex",justifyContent:"center",alignItems:"center",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",overflow:"hidden",zIndex:1},children:t.jsx("div",{ref:u,style:{width:h?"100%":`${I}px`,height:h?"100%":`${I}px`,borderRadius:h?0:"20px",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",position:"relative",overflow:"hidden",boxShadow:h?"none":"0 0 40px rgba(0,0,0,0.08)",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsxs("div",{id:"whats-missing-root",style:{transform:`scale(${D})`,transformOrigin:"center center",transition:"transform 0.2s ease-out",width:`${100/D}%`,height:`${100/D}%`,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[!h&&ge,!y&&!b&&t.jsxs("div",{style:n.gmCenterScreen,children:[t.jsx("h1",{style:n.gmHeadline1,children:"WHAT'S MISSING?"}),t.jsx("p",{style:n.gmBodyM,children:"Select a theme:"}),t.jsx("div",{style:{display:"flex",gap:16},children:["animals","food","toys"].map(e=>t.jsx("button",{style:n.gmButton,onClick:()=>C(e),children:e==="animals"?"🐶 Animals":e==="food"?"🍎 Food":"🧸 Toys"},e))}),t.jsxs("div",{style:{marginTop:24},children:[t.jsx("p",{style:n.gmBodyS,children:"Choose number of rounds:"}),t.jsx("div",{style:{display:"flex",gap:12,marginTop:8},children:[3,4,5].map(e=>t.jsx("button",{style:{...n.gmButton,...l===e?n.gmButtonActive:{}},onClick:()=>j(e),children:e},e))})]})]}),y&&!b&&t.jsxs("div",{style:n.gmCenterScreen,children:[t.jsxs("h1",{style:n.gmHeadline1,children:["Theme selected: ",y]}),t.jsxs("p",{style:n.gmBodyM,children:["Rounds: ",l]}),t.jsx("button",{style:n.gmButton,onClick:ee,children:"▶ Start game"})]}),B&&t.jsxs("div",{style:n.gmCenterScreen,children:[t.jsx("h1",{style:n.gmHeadline1,children:"Results"}),t.jsxs("h2",{style:n.gmHeadline3,children:["Your score: ",re," / ",l]}),t.jsx("p",{style:{...n.gmBodyM,color:"#10b981",marginTop:12},children:"Yahoo! You did it! 🍬✨"}),t.jsxs("table",{style:n.gmTable,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Round"}),t.jsx("th",{children:"Your Answer"}),t.jsx("th",{children:"Correct"}),t.jsx("th",{children:"Result"})]})}),t.jsx("tbody",{children:ae.map((e,o)=>t.jsxs("tr",{children:[t.jsx("td",{style:n.gmTableCell,children:e.round}),t.jsx("td",{style:n.gmTableCell,children:e.answer||"—"}),t.jsx("td",{style:n.gmTableCell,children:e.correct}),t.jsx("td",{style:n.gmTableCell,children:e.result==="correct"?"✔ Correct":e.result==="almost"?"◐ Almost (0.5)":"✘ Wrong"})]},o))})]}),t.jsxs("div",{style:{display:"flex",gap:12,marginTop:24},children:[t.jsx("button",{style:n.gmButton,onClick:ee,children:"🔁 Play again"}),t.jsx("button",{style:n.gmButton,onClick:ue,children:"⬅️ Choose theme"})]})]}),b&&!B&&t.jsxs("div",{style:n.gmGameLayout,children:[t.jsxs("div",{style:{minHeight:160,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[w==="ready"&&t.jsxs(t.Fragment,{children:[t.jsx("h1",{style:{...n.gmHeadline1,color:"#ec4c44"},children:"GET READY"}),t.jsx("div",{style:n.gmHourglass,children:"⏳"})]}),w==="memorize"&&t.jsxs("p",{style:{...n.gmBodyM,color:"#10b981"},children:["MEMORIZE (",E,")"]}),w==="guess"&&!z&&t.jsxs("p",{style:n.gmBodyM,children:["⏳ Time left: ",W,"s"]})]}),w!=="ready"&&t.jsx("div",{style:{...n.gmGrid,display:"grid",gridTemplateColumns:`repeat(${h?2:3}, 1fr)`,gridTemplateRows:`repeat(${h?3:2}, 1fr)`,gap:h?12:20,justifyContent:"center",alignContent:"center",padding:h?8:16,width:"100%",height:"100%",maxWidth:h?"100%":600,maxHeight:h?"100%":400,boxSizing:"border-box"},children:x.map((e,o)=>{const c=p===o&&w==="guess"&&!z;return t.jsx("div",{style:{...n.gmCard,width:"100%",height:"100%",...J==="correct"&&p===o?n.gmCorrect:{},...J==="wrong"&&p===o?n.gmWrong:{}},children:!c&&t.jsx("img",{src:e.src,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})},o)})}),t.jsxs("div",{style:{marginTop:16,height:80},children:[w==="guess"&&!z&&t.jsxs("div",{children:[t.jsx("input",{type:"text",placeholder:"Type the missing word",value:L,onChange:e=>_(e.target.value),style:n.gmInput}),t.jsx("button",{style:{...n.gmButton,marginLeft:8},onClick:ce,disabled:N,children:N?"...":"Check"})]}),z&&t.jsx("button",{type:"button",style:n.gmButton,onClick:me,children:"Next round"})]})]})]})})})}exports.Game=ve;exports.themes=P;
@@ -426,7 +426,7 @@ function Be({
426
426
  []
427
427
  ), re = 1200, se = 700, q = P(() => {
428
428
  const e = r ?? (typeof window < "u" ? window.innerWidth : re), o = u ?? (typeof window < "u" ? window.innerHeight : se), m = Math.min(e / re, o / se);
429
- return Math.min(1.15, Math.max(0.92, m));
429
+ return Math.min(1.35, Math.max(1, m));
430
430
  }, [r, u, f]);
431
431
  return /* @__PURE__ */ n(
432
432
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mblinkov/whats-missing",
3
- "version": "20.0.32",
3
+ "version": "20.0.33",
4
4
  "main": "dist/whats-missing.umd.js",
5
5
  "module": "dist/whats-missing.es.js",
6
6
  "types": "dist/index.d.ts",
package/src/Game.tsx CHANGED
@@ -376,8 +376,8 @@ export default function Game({
376
376
  const effectiveWidth = screenWidth ?? (typeof window !== "undefined" ? window.innerWidth : baseWidth);
377
377
  const effectiveHeight = screenHeight ?? (typeof window !== "undefined" ? window.innerHeight : baseHeight);
378
378
  const rawScale = Math.min(effectiveWidth / baseWidth, effectiveHeight / baseHeight);
379
- // мягкие границы роста/сжатия
380
- return Math.min(1.15, Math.max(0.92, rawScale));
379
+ // мягкие границы роста/сжатия - увеличен верхний лимит для лучшего заполнения экрана
380
+ return Math.min(1.35, Math.max(1.0, rawScale));
381
381
  }, [screenWidth, screenHeight, isMobile]);
382
382
 
383
383
  return (