speakid-hangman 1.0.7 → 1.0.8
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.
package/dist/logo.svg
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="401" height="69" viewBox="0 0 401 69" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M28.0968 68.2857C23.4573 68.2857 19.1312 67.5647 15.1187 66.1227C11.1688 64.6807 7.84589 62.3922 5.14995 59.2574C2.51671 56.1226 0.855254 52.0787 0.165594 47.1257H13.8961C14.4604 49.2574 15.4948 50.9815 16.9996 52.2981C18.5043 53.5521 20.2911 54.4612 22.3601 55.0254C24.4918 55.5897 26.7175 55.8718 29.0372 55.8718C30.7927 55.8718 32.5169 55.6524 34.2097 55.2135C35.9025 54.7746 37.2818 54.0223 38.3476 52.9564C39.4762 51.8906 40.0404 50.4486 40.0404 48.6304C40.0404 47.2511 39.727 46.1226 39.1 45.2448C38.5357 44.3671 37.6893 43.6774 36.5608 43.1758C35.495 42.6116 34.1783 42.11 32.6109 41.6711C31.2943 41.2949 29.915 40.9815 28.473 40.7307C27.0937 40.4799 25.7143 40.1664 24.335 39.7902C23.0184 39.414 21.7331 38.9752 20.4792 38.4736C18.0967 37.8466 15.8083 37.0943 13.614 36.2165C11.4196 35.2761 9.476 34.1162 7.7832 32.7369C6.0904 31.2949 4.74243 29.508 3.73928 27.3764C2.79884 25.2447 2.32862 22.6741 2.32862 19.6647C2.32862 16.4045 2.86154 13.6459 3.92737 11.3888C5.05591 9.13173 6.52927 7.28219 8.34746 5.84018C10.2284 4.33546 12.2973 3.17558 14.5544 2.36053C16.8742 1.54548 19.1939 0.981211 21.5137 0.66773C23.8335 0.354248 26.0278 0.197508 28.0968 0.197508C32.4228 0.197508 36.31 0.949863 39.7583 2.45457C43.2066 3.95928 46.0279 6.21635 48.2223 9.22578C50.4167 12.2352 51.6706 16.0283 51.9841 20.6052H38.9119C38.6611 18.7243 37.9715 17.1882 36.8429 15.997C35.7144 14.8057 34.2724 13.928 32.5169 13.3637C30.8241 12.7995 28.9119 12.5173 26.7802 12.5173C25.4009 12.5173 24.0529 12.6427 22.7363 12.8935C21.4196 13.1443 20.2284 13.5518 19.1626 14.1161C18.1594 14.6177 17.3444 15.3073 16.7174 16.1851C16.1532 17.0628 15.871 18.1287 15.871 19.3826C15.871 20.6365 16.2158 21.7337 16.9055 22.6741C17.5952 23.5519 18.5983 24.3356 19.9149 25.0252C21.2943 25.6522 22.893 26.2478 24.7112 26.8121C26.5921 27.4391 28.567 27.9406 30.636 28.3168C32.705 28.693 34.6799 29.1945 36.5608 29.8215C38.9433 30.4485 41.169 31.2008 43.238 32.0786C45.3069 32.8936 47.1251 33.9595 48.6925 35.2761C50.2599 36.53 51.4825 38.1601 52.3603 40.1664C53.238 42.11 53.6769 44.5238 53.6769 47.4078C53.6769 51.2323 52.9559 54.4925 51.5139 57.1884C50.1345 59.8217 48.2223 61.9534 45.7772 63.5835C43.3947 65.2136 40.6674 66.4048 37.5953 67.1572C34.5232 67.9095 31.357 68.2857 28.0968 68.2857ZM65.071 67.5333V0.949865H91.0272C96.1056 0.949865 100.526 1.73357 104.288 3.30097C108.112 4.80568 111.059 7.25084 113.128 10.6364C115.197 13.9593 116.231 18.4108 116.231 23.9908C116.231 29.1945 115.071 33.5519 112.752 37.0629C110.494 40.5739 107.391 43.2072 103.441 44.9627C99.4912 46.6555 95.0084 47.5019 89.9927 47.5019H78.5193V67.5333H65.071ZM78.5193 35.4642H89.8047C93.8172 35.4642 96.9834 34.5237 99.3031 32.6428C101.686 30.6993 102.877 27.7839 102.877 23.8967C102.877 20.4484 101.874 17.8465 99.8674 16.091C97.9238 14.3355 94.789 13.4578 90.463 13.4578H78.5193V35.4642ZM126.512 67.5333V0.949865H174.475V13.4578H139.96V28.5049H169.584V40.5426H139.96V55.1195H174.475V67.5333H126.512ZM177.963 67.5333L203.92 0.949865H218.967L244.641 67.5333H230.158L226.02 56.154H196.584L192.446 67.5333H177.963ZM200.91 44.0222H221.788L211.443 15.2446L200.91 44.0222ZM251.782 67.5333V0.949865H265.231V28.5989H274.635L291.939 0.949865H307.363L285.92 33.3012L307.363 67.5333H291.563L275.199 41.0128H265.231V67.5333H251.782Z" fill="black"/>
|
|
3
|
+
<path d="M314.968 67.5333V0.949865H328.417V67.5333H314.968ZM342.52 67.5333V0.949865H367.63C374.59 0.949865 380.514 2.26649 385.405 4.89973C390.358 7.53298 394.12 11.3261 396.69 16.2791C399.323 21.2321 400.64 27.2823 400.64 34.4297C400.64 41.4517 399.355 47.4392 396.784 52.3922C394.276 57.2825 390.577 61.0443 385.687 63.6775C380.797 66.2481 374.809 67.5333 367.724 67.5333H342.52ZM355.969 55.1195H367.63C372.27 55.1195 376 54.2417 378.822 52.4862C381.643 50.7307 383.712 48.2856 385.029 45.1508C386.345 42.0159 387.003 38.4109 387.003 34.3356C387.003 30.3858 386.345 26.8434 385.029 23.7086C383.775 20.5111 381.706 18.0033 378.822 16.1851C376 14.3669 372.176 13.4578 367.348 13.4578H355.969V55.1195Z" fill="#F04F4F"/>
|
|
4
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("react"),i={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",fontFamily:'"Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',background:"transparent"},gmHeadline1:{fontWeight:600,fontSize:"clamp(30px, 4vw, 32px)",lineHeight:"110%",marginBottom:"24px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmHeadline3:{fontWeight:500,fontSize:"clamp(16px, 2vw, 24px)",lineHeight:"110%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyL:{fontWeight:400,fontSize:"18px",lineHeight:"120%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyM:{fontWeight:400,fontSize:"clamp(14px, 1.5vw, 16px)",lineHeight:"120%",marginBottom:"8px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyS:{fontWeight:400,fontSize:"clamp(12px, 1.5vw, 14px)",lineHeight:"120%",color:"#6b7280",marginBottom:"8px",fontFamily:'"Onest", system-ui, sans-serif'},gmButton:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:400,fontSize:"16px",lineHeight:"100%",padding:"10px 16px",borderRadius:"8px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"none",transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease",margin:"4px"},gmButtonSecondary:{background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",boxShadow:"none"},gmButtonGroup:{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center",marginBottom:"24px"},gmWordDisplay:{fontSize:"clamp(20px, 5vw, 28px)",fontWeight:500,letterSpacing:"6px",margin:"32px 0",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmGuessedLetters:{fontSize:"clamp(12px, 1.5vw, 16px)",color:"#6b7280",marginTop:"16px",minHeight:"24px",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmStatusWin:{color:"#10b981",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmStatusLose:{color:"#ec4c44",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmInfoBox:{background:"#f9f9f9",border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px",marginBottom:"24px",maxWidth:"500px",width:"100%",boxShadow:"none"},gmLogoFixed:{position:"absolute",top:"16px",left:"16px",width:"auto",zIndex:30,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"28px",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",display:"block"}};function Te({mistakes:s,maxMistakes:U,size:D=200}){const d=D,u=D*1.25,b=Math.max(3,D/100),z=10*(d/200),x=240*(u/250),f=150*(d/200),y=80*(d/200),q=20*(u/250),G=240*(u/250),w=80*(d/200),Q=20*(u/250),v=150*(d/200),W=150*(d/200),$=20*(u/250),C=50*(u/250),j=150*(d/200),H=70*(u/250),_=20*(d/200),F=150*(d/200),K=90*(u/250),Y=150*(u/250),h=150*(d/200),L=110*(u/250),p=130*(d/200),A=130*(u/250),J=150*(d/200),R=110*(u/250),ge=170*(d/200),T=130*(u/250),ee=150*(d/200),N=150*(u/250),g=130*(d/200),te=190*(u/250),I=150*(d/200),ne=150*(u/250),m=170*(d/200),oe=190*(u/250),k=s===0||s<=U*.5?"#1f2937":s<=U*.75?"#f59e0b":"#ec4c44";return t.jsxs("svg",{width:d,height:u,viewBox:"0 0 200 250",style:{display:"block",margin:"0 auto",overflow:"visible",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},children:[s>0&&t.jsx("line",{x1:z,y1:x,x2:f,y2:x,stroke:k,strokeWidth:b}),s>1&&t.jsx("line",{x1:y,y1:q,x2:y,y2:G,stroke:k,strokeWidth:b}),s>2&&t.jsx("line",{x1:w,y1:Q,x2:v,y2:Q,stroke:k,strokeWidth:b}),s>3&&t.jsx("line",{x1:W,y1:$,x2:W,y2:C,stroke:k,strokeWidth:b}),s>4&&t.jsx("circle",{cx:j,cy:H,r:_,stroke:k,fill:"none",strokeWidth:b}),s>5&&t.jsx("line",{x1:F,y1:K,x2:F,y2:Y,stroke:k,strokeWidth:b}),s>6&&t.jsx("line",{x1:h,y1:L,x2:p,y2:A,stroke:k,strokeWidth:b}),s>7&&t.jsx("line",{x1:J,y1:R,x2:ge,y2:T,stroke:k,strokeWidth:b}),s>8&&t.jsx("line",{x1:ee,y1:N,x2:g,y2:te,stroke:k,strokeWidth:b}),s>9&&t.jsx("line",{x1:I,y1:ne,x2:m,y2:oe,stroke:k,strokeWidth:b})]})}function de({gameCubeSize:s=400,screenHeight:U=800,screenWidth:D=800,logoUrl:d,showLogo:u=!0,baseURL:b}={}){const z={Professions:["teacher","doctor","nurse","driver","police","firefighter","cook","waiter","farmer","builder","singer","actor","dentist","pilot","vet","artist","cleaner","student","baker","mechanic"],Family:["mother","father","sister","brother","grandmother","grandfather","aunt","uncle","cousin","baby","parents","children","wife","husband","son","daughter","family","twins","relatives"],"Farm animals":["cow","pig","horse","sheep","goat","duck","chicken","rooster","turkey","goose","rabbit","mouse","donkey","bee","hen","lamb","bull","pony"],Food:["apple","banana","bread","cheese","milk","egg","rice","soup","fish","meat","potato","carrot","tomato","cucumber","butter","cake","salad","pasta","pizza","juice"],Hobbies:["reading","drawing","painting","dancing","singing","cooking","swimming","fishing","running","cycling","skating","writing","camping","photography","hiking","games"],Christmas:["tree","present","gift","santa","snow","snowman","bell","star","lights","card","cookies","elf","sleigh","reindeer","candle","stocking"],Halloween:["pumpkin","costume","candy","ghost","witch","spider","bat","skeleton","mask","monster","mummy","cat","broom","zombie","trick","treat","candle","night","party"],Sport:["football","basketball","tennis","swimming","running","baseball","skiing","skating","volleyball","hockey","golf","boxing","cycling","rugby","karate","yoga","surfing","climbing","dancing","gym","chess"],"Body parts":["head","hair","eyes","ears","nose","mouth","teeth","tongue","neck","shoulder","arm","hand","finger","leg","knee","foot","toe","back","stomach","heart","legs","nails","chin","beard"],"School subjects":["math","english","history","geography","art","music","science","biology","chemistry","physics","pe","literature","drama","design","economics"],Animals:["cat","dog","rabbit","elephant","lion","tiger","monkey","bear","fox","wolf","giraffe","zebra","crocodile","dolphin","whale","shark","frog","parrot","mouse","penguin","deer","lizard","turtle","snake"],Countries:["russia","canada","china","japan","france","germany","italy","spain","brazil","india","australia","america","england","korea","mexico","egypt","turkey","vietnam","norway","finland","thailand","georgia","kazakhstan"],Clothes:["shirt","dress","skirt","trousers","jeans","coat","jacket","sweater","socks","shoes","boots","hat","scarf","gloves","shorts","cap","belt","tie","uniform","pants","underwear"],Traveling:["ticket","luggage","suitcase","airport","flight","passport","visa","map","guide","hotel","reservation","bus","train","taxi","tourist","sightseeing","backpack","journey","adventure","beach","tour","souvenir"],Environment:["tree","forest","air","water","pollution","recycle","nature","clean","waste","plastic","energy","animal","climate","earth","ocean","river","planet","save","green","environment","litter","organic"],Space:["planet","star","sun","moon","astronaut","rocket","space","galaxy","universe","telescope","comet","asteroid","orbit","gravity","alien","spaceship","mars","satellite","sky","eclipse"],Devices:["computer","laptop","phone","tablet","tv","keyboard","mouse","printer","camera","headphones","charger","screen","watch","microphone","speaker","console","router","battery","cable","remote"]},[x,f]=a.useState("lobby"),[y,q]=a.useState(""),[G]=a.useState("Normal"),[w,Q]=a.useState(0),[v,W]=a.useState(1),[$,C]=a.useState(""),[j,H]=a.useState([]),[_,F]=a.useState(0),[K,Y]=a.useState(0),[h,L]=a.useState(null),[p,A]=a.useState(null),[J,R]=a.useState(1),[ge,T]=a.useState([]),ee=G==="Easy"?8:G==="Normal"?6:4,N=b||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman`:"/cloud/speakid/games/hangman"),[g,te]=a.useState(!1),[I,ne]=a.useState(!1),[m,oe]=a.useState(!1),[M,k]=a.useState(!1),l=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.8:1,r=M?.9:1,c=n*r;return{headline1:g?Math.max(24,Math.min(30,30*e*c)):Math.max(28,Math.min(32,32*e*r)),headline2:Math.max(20,Math.min(28,24*e*c)),headline3:g?Math.max(14,Math.min(18,16*e*c)):Math.max(20,Math.min(26,24*e*c)),bodyL:Math.max(14,Math.min(20,18*e*c)),bodyM:g?Math.max(12,Math.min(16,14*e*c)):Math.max(14,Math.min(18,16*e*c)),bodyS:g?Math.max(10,Math.min(14,12*e*c)):Math.max(12,Math.min(16,14*e*c)),wordDisplay:Math.max(18,Math.min(32,26*e*c)),button:Math.max(12,Math.min(18,16*e*c))}},[g,p,s,m,M]),ue=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.65:1,r=M?.85:1;return I?Math.max(8,Math.min(12,10*e)):Math.max(12,Math.min(24,16*e))*n*r},[I,p,s,m,M]),o=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.65:1,r=M?.85:1;return I?Math.max(3,Math.min(6,5*e)):Math.max(4,Math.min(12,8*e))*n*r},[I,p,s,m,M]),S=a.useMemo(()=>{const e=(p||s||1e3)/400,n=M?.9:1;return Math.max(6,Math.min(10,8*e*n))},[p,s,M]),xe=(e,n)=>e.split("").every(r=>n.includes(r)),fe=(e,n)=>e.split("").map(r=>n.includes(r)?r:"_").join(" "),ye=e=>"abcdefghijklmnopqrstuvwxyz".split("").filter(r=>!e.includes(r)),P=(e,n=[])=>{var Z;if(!e||!z[e]){const B=Object.keys(z)[0];return((Z=z[B])==null?void 0:Z[0])||""}const r=z[e];if(!r||r.length===0)return"";const c=r.filter(B=>!n.includes(B)),E=c.length>0?c:r;if(E.length===0)return"";let X;if(typeof crypto<"u"&&crypto.getRandomValues){const B=new Uint32Array(1);crypto.getRandomValues(B);const le=B[0]/4294967295;X=Math.floor(le*E.length)}else X=Math.floor(Math.random()*E.length);return E[X]},be=()=>{if(!y)return;T([]);const e=P(y,[]);if(!e){f("category");return}C(e),T([e]),H([]),F(0),W(1),Y(0),L(null),f("game")},re=a.useCallback(e=>{if(x!=="game"||h!==null)return;const n=e.toLowerCase();/^[a-z]$/.test(n)&&(H(r=>r.includes(n)?r:[...r,n]),C(r=>(r&&!r.includes(n)&&F(c=>c+1),r)))},[x,h]),se=a.useCallback(e=>{re(e.key)},[re]);a.useEffect(()=>{if(x==="game")return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[x,se]);const ke=$?fe($,j):"",pe=$?xe($,j):!1,me=_>=10,we=ye(j),ie=a.useCallback(()=>{if(!y||v>=w){f("result");return}W(e=>e+1),T(e=>{const n=P(y,e);return n?(C(n),[...e,n]):e}),H([]),F(0),L(null)},[y,v,w]);a.useEffect(()=>{if(pe&&h===null){L("win"),Y(n=>n+1);const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}if(me&&h===null){L("lose");const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}},[pe,me,h,ie]);const Me=()=>{if(!y||v>=w){f("result");return}W(e=>e+1),T(e=>{const n=P(y,e);return n?(C(n),[...e,n]):e}),H([]),F(0),L(null)};a.useEffect(()=>{const e=()=>{const n=window.innerWidth,r=window.innerHeight,c=n<768||n===926&&r===428||n===932&&r===430,E=r<700,X=n/r>1.8,Z=n===1024&&r===600,B=c&&n>r,le=n>=1200&&n<=1400;if(te(c),ne(Z),oe(B),k(le),c)A(null),R(1);else if(E)A(null),R(1);else{const je=n-80,Fe=r-80,he=Math.min(je,Fe);let ce;s&&s>=320?ce=Math.min(s,he):ce=Math.min(1e3,he*.9);const Le=Math.max(400,Math.min(1200,ce));A(Le),R(X?.85:1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[s]);const V=`
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("react"),i={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",fontFamily:'"Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',background:"transparent"},gmHeadline1:{fontWeight:600,fontSize:"clamp(30px, 4vw, 32px)",lineHeight:"110%",marginBottom:"24px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmHeadline3:{fontWeight:500,fontSize:"clamp(16px, 2vw, 24px)",lineHeight:"110%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyL:{fontWeight:400,fontSize:"18px",lineHeight:"120%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyM:{fontWeight:400,fontSize:"clamp(14px, 1.5vw, 16px)",lineHeight:"120%",marginBottom:"8px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyS:{fontWeight:400,fontSize:"clamp(12px, 1.5vw, 14px)",lineHeight:"120%",color:"#6b7280",marginBottom:"8px",fontFamily:'"Onest", system-ui, sans-serif'},gmButton:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:400,fontSize:"16px",lineHeight:"100%",padding:"10px 16px",borderRadius:"8px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"none",transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease",margin:"4px"},gmButtonSecondary:{background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",boxShadow:"none"},gmButtonGroup:{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center",marginBottom:"24px"},gmWordDisplay:{fontSize:"clamp(20px, 5vw, 28px)",fontWeight:500,letterSpacing:"6px",margin:"32px 0",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmGuessedLetters:{fontSize:"clamp(12px, 1.5vw, 16px)",color:"#6b7280",marginTop:"16px",minHeight:"24px",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmStatusWin:{color:"#10b981",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmStatusLose:{color:"#ec4c44",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmInfoBox:{background:"#f9f9f9",border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px",marginBottom:"24px",maxWidth:"500px",width:"100%",boxShadow:"none"},gmLogoFixed:{position:"absolute",top:"24px",left:"24px",width:"auto",zIndex:30,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"28px",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",display:"block"}};function Te({mistakes:s,maxMistakes:U,size:D=200}){const d=D,u=D*1.25,b=Math.max(3,D/100),z=10*(d/200),x=240*(u/250),f=150*(d/200),y=80*(d/200),q=20*(u/250),G=240*(u/250),w=80*(d/200),Q=20*(u/250),v=150*(d/200),W=150*(d/200),$=20*(u/250),C=50*(u/250),j=150*(d/200),H=70*(u/250),_=20*(d/200),F=150*(d/200),K=90*(u/250),Y=150*(u/250),h=150*(d/200),L=110*(u/250),p=130*(d/200),A=130*(u/250),J=150*(d/200),R=110*(u/250),ge=170*(d/200),T=130*(u/250),ee=150*(d/200),N=150*(u/250),g=130*(d/200),te=190*(u/250),I=150*(d/200),ne=150*(u/250),m=170*(d/200),oe=190*(u/250),k=s===0||s<=U*.5?"#1f2937":s<=U*.75?"#f59e0b":"#ec4c44";return t.jsxs("svg",{width:d,height:u,viewBox:"0 0 200 250",style:{display:"block",margin:"0 auto",overflow:"visible",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},children:[s>0&&t.jsx("line",{x1:z,y1:x,x2:f,y2:x,stroke:k,strokeWidth:b}),s>1&&t.jsx("line",{x1:y,y1:q,x2:y,y2:G,stroke:k,strokeWidth:b}),s>2&&t.jsx("line",{x1:w,y1:Q,x2:v,y2:Q,stroke:k,strokeWidth:b}),s>3&&t.jsx("line",{x1:W,y1:$,x2:W,y2:C,stroke:k,strokeWidth:b}),s>4&&t.jsx("circle",{cx:j,cy:H,r:_,stroke:k,fill:"none",strokeWidth:b}),s>5&&t.jsx("line",{x1:F,y1:K,x2:F,y2:Y,stroke:k,strokeWidth:b}),s>6&&t.jsx("line",{x1:h,y1:L,x2:p,y2:A,stroke:k,strokeWidth:b}),s>7&&t.jsx("line",{x1:J,y1:R,x2:ge,y2:T,stroke:k,strokeWidth:b}),s>8&&t.jsx("line",{x1:ee,y1:N,x2:g,y2:te,stroke:k,strokeWidth:b}),s>9&&t.jsx("line",{x1:I,y1:ne,x2:m,y2:oe,stroke:k,strokeWidth:b})]})}function de({gameCubeSize:s=400,screenHeight:U=800,screenWidth:D=800,logoUrl:d,showLogo:u=!0,baseURL:b}={}){const z={Professions:["teacher","doctor","nurse","driver","police","firefighter","cook","waiter","farmer","builder","singer","actor","dentist","pilot","vet","artist","cleaner","student","baker","mechanic"],Family:["mother","father","sister","brother","grandmother","grandfather","aunt","uncle","cousin","baby","parents","children","wife","husband","son","daughter","family","twins","relatives"],"Farm animals":["cow","pig","horse","sheep","goat","duck","chicken","rooster","turkey","goose","rabbit","mouse","donkey","bee","hen","lamb","bull","pony"],Food:["apple","banana","bread","cheese","milk","egg","rice","soup","fish","meat","potato","carrot","tomato","cucumber","butter","cake","salad","pasta","pizza","juice"],Hobbies:["reading","drawing","painting","dancing","singing","cooking","swimming","fishing","running","cycling","skating","writing","camping","photography","hiking","games"],Christmas:["tree","present","gift","santa","snow","snowman","bell","star","lights","card","cookies","elf","sleigh","reindeer","candle","stocking"],Halloween:["pumpkin","costume","candy","ghost","witch","spider","bat","skeleton","mask","monster","mummy","cat","broom","zombie","trick","treat","candle","night","party"],Sport:["football","basketball","tennis","swimming","running","baseball","skiing","skating","volleyball","hockey","golf","boxing","cycling","rugby","karate","yoga","surfing","climbing","dancing","gym","chess"],"Body parts":["head","hair","eyes","ears","nose","mouth","teeth","tongue","neck","shoulder","arm","hand","finger","leg","knee","foot","toe","back","stomach","heart","legs","nails","chin","beard"],"School subjects":["math","english","history","geography","art","music","science","biology","chemistry","physics","pe","literature","drama","design","economics"],Animals:["cat","dog","rabbit","elephant","lion","tiger","monkey","bear","fox","wolf","giraffe","zebra","crocodile","dolphin","whale","shark","frog","parrot","mouse","penguin","deer","lizard","turtle","snake"],Countries:["russia","canada","china","japan","france","germany","italy","spain","brazil","india","australia","america","england","korea","mexico","egypt","turkey","vietnam","norway","finland","thailand","georgia","kazakhstan"],Clothes:["shirt","dress","skirt","trousers","jeans","coat","jacket","sweater","socks","shoes","boots","hat","scarf","gloves","shorts","cap","belt","tie","uniform","pants","underwear"],Traveling:["ticket","luggage","suitcase","airport","flight","passport","visa","map","guide","hotel","reservation","bus","train","taxi","tourist","sightseeing","backpack","journey","adventure","beach","tour","souvenir"],Environment:["tree","forest","air","water","pollution","recycle","nature","clean","waste","plastic","energy","animal","climate","earth","ocean","river","planet","save","green","environment","litter","organic"],Space:["planet","star","sun","moon","astronaut","rocket","space","galaxy","universe","telescope","comet","asteroid","orbit","gravity","alien","spaceship","mars","satellite","sky","eclipse"],Devices:["computer","laptop","phone","tablet","tv","keyboard","mouse","printer","camera","headphones","charger","screen","watch","microphone","speaker","console","router","battery","cable","remote"]},[x,f]=a.useState("lobby"),[y,q]=a.useState(""),[G]=a.useState("Normal"),[w,Q]=a.useState(0),[v,W]=a.useState(1),[$,C]=a.useState(""),[j,H]=a.useState([]),[_,F]=a.useState(0),[K,Y]=a.useState(0),[h,L]=a.useState(null),[p,A]=a.useState(null),[J,R]=a.useState(1),[ge,T]=a.useState([]),ee=G==="Easy"?8:G==="Normal"?6:4,N=b||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman`:"/cloud/speakid/games/hangman"),[g,te]=a.useState(!1),[I,ne]=a.useState(!1),[m,oe]=a.useState(!1),[M,k]=a.useState(!1),l=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.8:1,r=M?.9:1,c=n*r;return{headline1:g?Math.max(24,Math.min(30,30*e*c)):Math.max(28,Math.min(32,32*e*r)),headline2:Math.max(20,Math.min(28,24*e*c)),headline3:g?Math.max(14,Math.min(18,16*e*c)):Math.max(20,Math.min(26,24*e*c)),bodyL:Math.max(14,Math.min(20,18*e*c)),bodyM:g?Math.max(12,Math.min(16,14*e*c)):Math.max(14,Math.min(18,16*e*c)),bodyS:g?Math.max(10,Math.min(14,12*e*c)):Math.max(12,Math.min(16,14*e*c)),wordDisplay:Math.max(18,Math.min(32,26*e*c)),button:Math.max(12,Math.min(18,16*e*c))}},[g,p,s,m,M]),ue=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.65:1,r=M?.85:1;return I?Math.max(8,Math.min(12,10*e)):Math.max(12,Math.min(24,16*e))*n*r},[I,p,s,m,M]),o=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.65:1,r=M?.85:1;return I?Math.max(3,Math.min(6,5*e)):Math.max(4,Math.min(12,8*e))*n*r},[I,p,s,m,M]),S=a.useMemo(()=>{const e=(p||s||1e3)/400,n=M?.9:1;return Math.max(6,Math.min(10,8*e*n))},[p,s,M]),xe=(e,n)=>e.split("").every(r=>n.includes(r)),fe=(e,n)=>e.split("").map(r=>n.includes(r)?r:"_").join(" "),ye=e=>"abcdefghijklmnopqrstuvwxyz".split("").filter(r=>!e.includes(r)),P=(e,n=[])=>{var Z;if(!e||!z[e]){const B=Object.keys(z)[0];return((Z=z[B])==null?void 0:Z[0])||""}const r=z[e];if(!r||r.length===0)return"";const c=r.filter(B=>!n.includes(B)),E=c.length>0?c:r;if(E.length===0)return"";let X;if(typeof crypto<"u"&&crypto.getRandomValues){const B=new Uint32Array(1);crypto.getRandomValues(B);const le=B[0]/4294967295;X=Math.floor(le*E.length)}else X=Math.floor(Math.random()*E.length);return E[X]},be=()=>{if(!y)return;T([]);const e=P(y,[]);if(!e){f("category");return}C(e),T([e]),H([]),F(0),W(1),Y(0),L(null),f("game")},re=a.useCallback(e=>{if(x!=="game"||h!==null)return;const n=e.toLowerCase();/^[a-z]$/.test(n)&&(H(r=>r.includes(n)?r:[...r,n]),C(r=>(r&&!r.includes(n)&&F(c=>c+1),r)))},[x,h]),se=a.useCallback(e=>{re(e.key)},[re]);a.useEffect(()=>{if(x==="game")return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[x,se]);const ke=$?fe($,j):"",pe=$?xe($,j):!1,me=_>=10,we=ye(j),ie=a.useCallback(()=>{if(!y||v>=w){f("result");return}W(e=>e+1),T(e=>{const n=P(y,e);return n?(C(n),[...e,n]):e}),H([]),F(0),L(null)},[y,v,w]);a.useEffect(()=>{if(pe&&h===null){L("win"),Y(n=>n+1);const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}if(me&&h===null){L("lose");const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}},[pe,me,h,ie]);const Me=()=>{if(!y||v>=w){f("result");return}W(e=>e+1),T(e=>{const n=P(y,e);return n?(C(n),[...e,n]):e}),H([]),F(0),L(null)};a.useEffect(()=>{const e=()=>{const n=window.innerWidth,r=window.innerHeight,c=n<768||n===926&&r===428||n===932&&r===430,E=r<700,X=n/r>1.8,Z=n===1024&&r===600,B=c&&n>r,le=n>=1200&&n<=1400;if(te(c),ne(Z),oe(B),k(le),c)A(null),R(1);else if(E)A(null),R(1);else{const je=n-80,Fe=r-80,he=Math.min(je,Fe);let ce;s&&s>=320?ce=Math.min(s,he):ce=Math.min(1e3,he*.9);const Le=Math.max(400,Math.min(1200,ce));A(Le),R(X?.85:1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[s]);const V=`
|
|
2
2
|
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0.2;">
|
|
3
3
|
<!-- Каракули мелками и фломастерами -->
|
|
4
4
|
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
<path d="M 35% 85% Q 37% 83%, 39% 85% T 43% 85% T 47% 85%"
|
|
43
43
|
fill="none" stroke="#FF4500" stroke-width="3.5" stroke-linecap="round"/>
|
|
44
44
|
</svg>
|
|
45
|
-
`,Se=!g&&typeof window<"u"&&window.innerWidth>=768&&window.innerWidth<1024,ae=!g&&u&&(x!=="game"||Se),$e={...i.gmCenterScreen,width:"100%",height:"100%",padding:`${ue}px`,paddingTop:ae?"60px":`${ue}px`,overflow:M?"hidden":"auto",position:"relative",boxSizing:"border-box",background:"transparent"},O=a.useMemo(()=>{const e=window.innerWidth,n=window.innerHeight;if(g&&e>n||n<700||!ae)return null;const r=d||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman/logo`:"/cloud/speakid/games/hangman/logo");return t.jsx("div",{style:i.gmLogoFixed,children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:`${r}.svg`,type:"image/svg+xml"}),t.jsx("img",{src:`${r}.png`,alt:"SPEAKID Logo",style:i.gmLogoImg,loading:"lazy"})]})})},[g,ae,d,x]),ve=()=>x==="lobby"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:"HANGMAN"}),t.jsxs("button",{onClick:()=>f("category"),style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*3}px`,borderRadius:`${S*1.5}px`,position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#ec4c44",color:"#ffffff",border:"none",cursor:"pointer",transition:"background 0.2s ease, transform 0.1s ease",boxShadow:"0 2px 8px rgba(236, 76, 68, 0.2)",minWidth:"120px"},onMouseEnter:e=>{e.currentTarget.style.background="#d43a32",e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(236, 76, 68, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="#ec4c44",e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(236, 76, 68, 0.2)"},onMouseDown:e=>{e.currentTarget.style.transform="translateY(0)"},children:[t.jsx("svg",{width:`${l.button*1.3}px`,height:`${l.button*1.3}px`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",marginRight:`${o}px`},children:t.jsx("path",{d:"M8 5V19L19 12L8 5Z",fill:"#ffffff",stroke:"none"})}),t.jsx("span",{style:{fontWeight:500},children:"PLAY"})]}),t.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",pointerEvents:"none",zIndex:0},children:[t.jsx("img",{src:`${N}/sun.png`,alt:"Sun",style:{position:"absolute",left:g?"-10%":"5%",top:"20%",width:"auto",height:g?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((p||s||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}}),t.jsx("img",{src:`${N}/character.png`,alt:"Hangman character",style:{position:"absolute",right:g?"5%":"10%",bottom:"10%",width:"auto",height:g?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((p||s||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}})]})]}):x==="category"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"52px",left:"16px",zIndex:10},children:"←"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,marginTop:`${o*4}px`,position:"relative",zIndex:1},children:Object.keys(z).map(e=>t.jsx("button",{onClick:()=>{q(e),f("rounds")},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${S*2}px`,margin:`${o/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="rounds"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("button",{onClick:()=>f("category"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"52px",left:"16px",zIndex:10},children:"←"}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*2}px`,position:"relative",zIndex:1},children:"Choose rounds"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:[1,3,5].map(e=>t.jsx("button",{onClick:()=>{Q(e),be()},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${S*2}px`,margin:`${o/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="game"?t.jsxs(t.Fragment,{children:[O,!m&&t.jsx("div",{dangerouslySetInnerHTML:{__html:V}})," ",t.jsxs("div",{style:{...i.gmInfoBox,padding:`${m?o*.6:o*.8}px`,marginBottom:`${m?o*.3:o*.5}px`,maxWidth:`${(p||s)*.9}px`},children:[t.jsxs("h3",{style:{...i.gmHeadline3,fontSize:`${l.headline3}px`,marginBottom:`${o*.5}px`},children:["Category: ",y]}),t.jsxs("p",{style:{...i.gmBodyM,fontSize:`${l.bodyM}px`,marginBottom:"0px"},children:["Round ",v," of ",w]})]}),$&&t.jsxs("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginTop:`${m?o*.3:o*.5}px`,marginBottom:`${m?o*.5:o}px`},children:["I am thinking of a word that is ",t.jsx("strong",{children:$.length})," letters long"]}),t.jsx("div",{style:{margin:`${m?o*.5:o}px 0`,display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx(Te,{mistakes:_,maxMistakes:ee,size:I?Math.max(80,Math.min(110,(p||s)*.16)):g?m?Math.max(70,Math.min(120,Math.min(window.innerWidth*.25,window.innerHeight*.15))):Math.max(100,Math.min(150,Math.min(window.innerWidth*.3,window.innerHeight*.2))):Math.max(100,Math.min(150,(p||s)*.2))})}),t.jsx("div",{style:{...i.gmWordDisplay,fontSize:`${Math.max(16,Math.min(24,l.wordDisplay*.9))}px`,margin:`${m?o*.5:o}px 0`,letterSpacing:`${o*.8}px`,minHeight:`${Math.max(16,Math.min(24,l.wordDisplay*.9))*1.2}px`},children:ke||"Loading..."}),t.jsxs("div",{style:{...i.gmInfoBox,padding:`${m?o*.6:o}px`,marginTop:`${m?o*.5:o}px`,marginBottom:`${m?o*.5:o}px`,maxWidth:`${(p||s)*.95}px`},children:[t.jsx("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginBottom:`${o}px`,fontWeight:500},children:"Available letters:"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:`${o/3}px`,justifyContent:"center",fontSize:`${Math.max(9,Math.min(12,l.bodyS*.75))}px`,fontFamily:'"Onest", system-ui, sans-serif'},children:we.map(e=>t.jsx("button",{onClick:()=>re(e),disabled:h!==null,onMouseEnter:n=>{h===null&&(n.currentTarget.style.backgroundColor="#e5e7eb",n.currentTarget.style.cursor="pointer")},onMouseLeave:n=>{h===null&&(n.currentTarget.style.backgroundColor="#f9f9f9",n.currentTarget.style.cursor="pointer")},style:{padding:`${o/4}px ${o/3}px`,borderRadius:`${S*.5}px`,background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",minWidth:`${Math.max(o*1.5,(p||s)*.04)}px`,textAlign:"center",display:"inline-block",cursor:h===null?"pointer":"default",fontFamily:'"Onest", system-ui, sans-serif',fontSize:`${Math.max(9,Math.min(12,l.bodyS*.75))}px`,transition:"background-color 0.2s ease"},children:e},e))})]}),j.length>0&&t.jsx("div",{style:{...i.gmGuessedLetters,fontSize:`${Math.max(10,Math.min(12,l.bodyS*.85))}px`,marginTop:`${o*.5}px`,marginBottom:"2px"},children:t.jsxs("span",{style:{color:"#6b7280"},children:["Guessed letters: ",t.jsx("strong",{children:j.join(", ")})]})}),h==="win"&&t.jsx("div",{style:{...i.gmStatusWin,fontSize:`${l.bodyL}px`,margin:"2px 0"},children:"🎉 You won this round!"}),h==="lose"&&t.jsxs("div",{style:{...i.gmStatusLose,fontSize:`${l.bodyL}px`,margin:"2px 0"},children:["The hangman is complete! The word was: ",t.jsx("strong",{children:$})]}),h!==null&&v<w&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:Me,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${Math.max(11,Math.min(14,l.button*.85))}px`,padding:`${o*.6}px ${o*1.2}px`,borderRadius:`${S}px`},children:"NEXT"})}),h!==null&&v>=w&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:()=>f("result"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`},children:"View results"})}),h===null&&j.length===0&&t.jsx("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginTop:`${o}px`,marginBottom:`${o}px`},children:"Type a letter on your keyboard"})]}):x==="result"?t.jsxs(t.Fragment,{children:[O,t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*2}px`},children:"🎊 Game Finished!"}),t.jsxs("p",{style:{...i.gmBodyL,fontSize:`${l.bodyL}px`,marginBottom:`${o*2}px`},children:["You guessed ",t.jsx("strong",{children:K})," out of ",t.jsx("strong",{children:w})," words correctly."]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:`${o}px`,alignItems:"center"},children:[t.jsx("button",{onClick:()=>{if(!y||w===0){f("lobby");return}T([]);const e=P(y,[]);e&&(C(e),T([e]),H([]),F(0),W(1),Y(0),L(null),f("game"))},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Play again"}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Exit"})]})]}):null;return t.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"transparent",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:t.jsx("div",{style:{width:g?"100%":p||s||1e3,height:g?"100%":p||s||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:g?0:"20px",background:"#ffffff",boxShadow:g?"none":"0 0 40px rgba(0,0,0,0.1)",margin:g?"0 auto":"unset",position:"relative",transform:`scale(${J})`},children:t.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{style:$e,children:ve()})})})})}exports.Game=de;exports.HangmanLobbyGame=de;exports.default=de;
|
|
45
|
+
`,Se=!g&&typeof window<"u"&&window.innerWidth>=768&&window.innerWidth<1024,ae=!g&&u&&(x!=="game"||Se),$e={...i.gmCenterScreen,width:"100%",height:"100%",padding:`${ue}px`,paddingTop:ae?"80px":`${ue}px`,overflow:M?"hidden":"auto",position:"relative",boxSizing:"border-box",background:"transparent"},O=a.useMemo(()=>{const e=window.innerWidth,n=window.innerHeight;if(g&&e>n||n<700||!ae)return null;const r=d||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman/logo`:"/cloud/speakid/games/hangman/logo");return t.jsx("div",{style:i.gmLogoFixed,children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:`${r}.svg`,type:"image/svg+xml"}),t.jsx("img",{src:`${r}.png`,alt:"SPEAKID Logo",style:i.gmLogoImg,loading:"lazy"})]})})},[g,ae,d,x]),ve=()=>x==="lobby"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:"HANGMAN"}),t.jsxs("button",{onClick:()=>f("category"),style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*3}px`,borderRadius:`${S*1.5}px`,position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#ec4c44",color:"#ffffff",border:"none",cursor:"pointer",transition:"background 0.2s ease, transform 0.1s ease",boxShadow:"0 2px 8px rgba(236, 76, 68, 0.2)",minWidth:"120px"},onMouseEnter:e=>{e.currentTarget.style.background="#d43a32",e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(236, 76, 68, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="#ec4c44",e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(236, 76, 68, 0.2)"},onMouseDown:e=>{e.currentTarget.style.transform="translateY(0)"},children:[t.jsx("svg",{width:`${l.button*1.3}px`,height:`${l.button*1.3}px`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",marginRight:`${o}px`},children:t.jsx("path",{d:"M8 5V19L19 12L8 5Z",fill:"#ffffff",stroke:"none"})}),t.jsx("span",{style:{fontWeight:500},children:"PLAY"})]}),t.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",pointerEvents:"none",zIndex:0},children:[t.jsx("img",{src:`${N}/sun.png`,alt:"Sun",style:{position:"absolute",left:g?"-10%":"5%",top:"20%",width:"auto",height:g?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((p||s||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}}),t.jsx("img",{src:`${N}/character.png`,alt:"Hangman character",style:{position:"absolute",right:g?"5%":"10%",bottom:"10%",width:"auto",height:g?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((p||s||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}})]})]}):x==="category"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"60px",left:"24px",zIndex:10},children:"←"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,marginTop:`${o*4}px`,position:"relative",zIndex:1},children:Object.keys(z).map(e=>t.jsx("button",{onClick:()=>{q(e),f("rounds")},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${S*2}px`,margin:`${o/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="rounds"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("button",{onClick:()=>f("category"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"60px",left:"24px",zIndex:10},children:"←"}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*2}px`,position:"relative",zIndex:1},children:"Choose rounds"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:[1,3,5].map(e=>t.jsx("button",{onClick:()=>{Q(e),be()},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${S*2}px`,margin:`${o/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="game"?t.jsxs(t.Fragment,{children:[O,!m&&t.jsx("div",{dangerouslySetInnerHTML:{__html:V}})," ",t.jsxs("div",{style:{...i.gmInfoBox,padding:`${m?o*.6:o*.8}px`,marginBottom:`${m?o*.3:o*.5}px`,maxWidth:`${(p||s)*.9}px`},children:[t.jsxs("h3",{style:{...i.gmHeadline3,fontSize:`${l.headline3}px`,marginBottom:`${o*.5}px`},children:["Category: ",y]}),t.jsxs("p",{style:{...i.gmBodyM,fontSize:`${l.bodyM}px`,marginBottom:"0px"},children:["Round ",v," of ",w]})]}),$&&t.jsxs("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginTop:`${m?o*.3:o*.5}px`,marginBottom:`${m?o*.5:o}px`},children:["I am thinking of a word that is ",t.jsx("strong",{children:$.length})," letters long"]}),t.jsx("div",{style:{margin:`${m?o*.5:o}px 0`,display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx(Te,{mistakes:_,maxMistakes:ee,size:I?Math.max(80,Math.min(110,(p||s)*.16)):g?m?Math.max(70,Math.min(120,Math.min(window.innerWidth*.25,window.innerHeight*.15))):Math.max(100,Math.min(150,Math.min(window.innerWidth*.3,window.innerHeight*.2))):Math.max(100,Math.min(150,(p||s)*.2))})}),t.jsx("div",{style:{...i.gmWordDisplay,fontSize:`${Math.max(16,Math.min(24,l.wordDisplay*.9))}px`,margin:`${m?o*.5:o}px 0`,letterSpacing:`${o*.8}px`,minHeight:`${Math.max(16,Math.min(24,l.wordDisplay*.9))*1.2}px`},children:ke||"Loading..."}),t.jsxs("div",{style:{...i.gmInfoBox,padding:`${m?o*.6:o}px`,marginTop:`${m?o*.5:o}px`,marginBottom:`${m?o*.5:o}px`,maxWidth:`${(p||s)*.95}px`},children:[t.jsx("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginBottom:`${o}px`,fontWeight:500},children:"Available letters:"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:`${o/3}px`,justifyContent:"center",fontSize:`${Math.max(9,Math.min(12,l.bodyS*.75))}px`,fontFamily:'"Onest", system-ui, sans-serif'},children:we.map(e=>t.jsx("button",{onClick:()=>re(e),disabled:h!==null,onMouseEnter:n=>{h===null&&(n.currentTarget.style.backgroundColor="#e5e7eb",n.currentTarget.style.cursor="pointer")},onMouseLeave:n=>{h===null&&(n.currentTarget.style.backgroundColor="#f9f9f9",n.currentTarget.style.cursor="pointer")},style:{padding:`${o/4}px ${o/3}px`,borderRadius:`${S*.5}px`,background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",minWidth:`${Math.max(o*1.5,(p||s)*.04)}px`,textAlign:"center",display:"inline-block",cursor:h===null?"pointer":"default",fontFamily:'"Onest", system-ui, sans-serif',fontSize:`${Math.max(9,Math.min(12,l.bodyS*.75))}px`,transition:"background-color 0.2s ease"},children:e},e))})]}),j.length>0&&t.jsx("div",{style:{...i.gmGuessedLetters,fontSize:`${Math.max(10,Math.min(12,l.bodyS*.85))}px`,marginTop:`${o*.5}px`,marginBottom:"2px"},children:t.jsxs("span",{style:{color:"#6b7280"},children:["Guessed letters: ",t.jsx("strong",{children:j.join(", ")})]})}),h==="win"&&t.jsx("div",{style:{...i.gmStatusWin,fontSize:`${l.bodyL}px`,margin:"2px 0"},children:"🎉 You won this round!"}),h==="lose"&&t.jsxs("div",{style:{...i.gmStatusLose,fontSize:`${l.bodyL}px`,margin:"2px 0"},children:["The hangman is complete! The word was: ",t.jsx("strong",{children:$})]}),h!==null&&v<w&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:Me,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${Math.max(11,Math.min(14,l.button*.85))}px`,padding:`${o*.6}px ${o*1.2}px`,borderRadius:`${S}px`},children:"NEXT"})}),h!==null&&v>=w&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:()=>f("result"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`},children:"View results"})}),h===null&&j.length===0&&t.jsx("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginTop:`${o}px`,marginBottom:`${o}px`},children:"Type a letter on your keyboard"})]}):x==="result"?t.jsxs(t.Fragment,{children:[O,t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*2}px`},children:"🎊 Game Finished!"}),t.jsxs("p",{style:{...i.gmBodyL,fontSize:`${l.bodyL}px`,marginBottom:`${o*2}px`},children:["You guessed ",t.jsx("strong",{children:K})," out of ",t.jsx("strong",{children:w})," words correctly."]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:`${o}px`,alignItems:"center"},children:[t.jsx("button",{onClick:()=>{if(!y||w===0){f("lobby");return}T([]);const e=P(y,[]);e&&(C(e),T([e]),H([]),F(0),W(1),Y(0),L(null),f("game"))},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Play again"}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Exit"})]})]}):null;return t.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"transparent",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:t.jsx("div",{style:{width:g?"100%":p||s||1e3,height:g?"100%":p||s||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:g?0:"20px",background:"#ffffff",boxShadow:g?"none":"0 0 40px rgba(0,0,0,0.1)",margin:g?"0 auto":"unset",position:"relative",transform:`scale(${J})`},children:t.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{style:$e,children:ve()})})})})}exports.Game=de;exports.HangmanLobbyGame=de;exports.default=de;
|
|
46
46
|
//# sourceMappingURL=speakid-hangman.cjs.js.map
|