PageSourceSearch

https://karpeles.com/assets/ManuscriptDetectivePage-C-d5TQrq.js

js karpeles.com collected 2026-10-02 11:48:05 UTC 8,759 bytes, 1 lines download raw bytes

1import{j as e}from"./index-ypIK7kjN.js";import{a as n}from"./redux-vendor-BfV9BRyV.js";import{d as $}from"./games-CN0AgIzC.js";import{f as V}from"./formatYear-neliVyQR.js";import{u as P}from"./react-vendor-DKynGxiw.js";const H="_detectiveGameContainer_11ly5_1",Y="_gameBackBtn_11ly5_7",z="_detectiveHeader_11ly5_24",W="_detectiveStats_11ly5_41",K="_detectiveStat_11ly5_41",X="_statLabel_11ly5_55",q="_statValue_11ly5_60",J="_detectiveStartScreen_11ly5_66",Q="_detectiveScoring_11ly5_91",Z="_detectiveGameScreen_11ly5_102",ee="_clueArea_11ly5_106",te="_clueList_11ly5_120",se="_clueItem_11ly5_124",ce="_detectiveImageContainer_11ly5_150",ne="_clueImage_11ly5_158",ae="_blurred_11ly5_166",ie="_detectiveAnswerArea_11ly5_170",le="_detectiveOptions_11ly5_184",re="_detectiveOption_11ly5_184",oe="_selected_11ly5_207",de="_correct_11ly5_212",ue="_incorrect_11ly5_217",me="_detectiveOptionTitle_11ly5_222",ve="_detectiveFeedbackScreen_11ly5_228",he="_detectiveFeedbackContent_11ly5_241",xe="_detectiveFeedbackImage_11ly5_258",_e="_detectiveFeedbackStats_11ly5_269",je="_btnInfo_11ly5_279",pe="_detectiveGameoverScreen_11ly5_308",be="_detectiveGameoverContent_11ly5_321",ye="_detectiveFinalStats_11ly5_337",t={detectiveGameContainer:H,gameBackBtn:Y,detectiveHeader:z,detectiveStats:W,detectiveStat:K,statLabel:X,statValue:q,detectiveStartScreen:J,detectiveScoring:Q,detectiveGameScreen:Z,clueArea:ee,clueList:te,clueItem:se,detectiveImageContainer:ce,clueImage:ne,blurred:ae,detectiveAnswerArea:ie,detectiveOptions:le,detectiveOption:re,selected:oe,correct:de,incorrect:ue,detectiveOptionTitle:me,detectiveFeedbackScreen:ve,detectiveFeedbackContent:he,detectiveFeedbackImage:xe,detectiveFeedbackStats:_e,btnInfo:je,detectiveGameoverScreen:pe,detectiveGameoverContent:be,detectiveFinalStats:ye},x=7,A=[700,600,500,400,300,200,100],Se=[30,25,20,15,10,5,0],ge=(l,r)=>l||r||"",Ce=l=>[...l].sort(()=>Math.random()-.5);function Fe(){const l=P(),[r,p]=n.useState(1),[v,b]=n.useState(0),[a,y]=n.useState(0),[c,O]=n.useState(null),[S,L]=n.useState([]),[g,C]=n.useState(null),[o,_]=n.useState(null),[N,M]=n.useState(!1),[R,u]=n.useState(!1),[T,f]=n.useState(!1),B=n.useMemo(()=>{if(!c)return[];const s=c.description||"No description available";return[{label:"Clue 1: Category",value:c.category||"Unknown"},{label:"Clue 2: Era/Year",value:V(c.year)||"Unknown"},{label:"Clue 3: Name",value:c.name||"Unknown"},{label:"Clue 4: Partial Description",value:`${s.substring(0,100)}...`},{label:"Clue 5: Extended Description",value:`${s.substring(0,200)}...`},{label:"Clue 6: Longer Description",value:`${s.substring(0,350)}...`},{label:"Clue 7: Full Description",value:s}]},[c]),h=n.useMemo(()=>ge(c?.web_address,c?.L_web_address),[c]),k=()=>{a>=x||y(s=>Math.min(s+1,x))},G=async()=>{const s=await $(4),[i,...m]=s,d=Ce([i,...m]);O(i||null),L(d),C(null),_(null),y(0),k()},I=async()=>{p(1),b(0),f(!1),u(!1),M(!0),await G()},F=s=>{if(!c||g!==null)return;if(C(s),S[s]?.title===c.title){const d=A[Math.max(0,a-1)]||0;b(j=>j+d),_("correct"),setTimeout(()=>u(!0),500)}else _("incorrect"),setTimeout(()=>u(!0),500)},E=async()=>{p(s=>s+1),u(!1),await G()},D=()=>{u(!1),f(!0)},U=r>0?Math.round(v/r):0;return e.jsxs("section",{className:t.detectiveGameContainer,children:[e.jsx("button",{type:"button",className:t.gameBackBtn,onClick:()=>l("/games"),children:"← Back to Games"}),e.jsxs("div",{className:t.detectiveHeader,children:[e.jsx("h1",{children:"Manuscript Detective"}),e.jsx("p",{children:"Watch the image become clearer with each of 7 clues - guess early for maximum points!"}),e.jsxs("div",{className:t.detectiveStats,children:[e.jsxs("div",{className:t.detectiveStat,children:[e.jsx("span",{className:t.statLabel,children:"Round:"}),e.jsx("span",{className:t.statValue,children:r})]}),e.jsxs("div",{className:t.detectiveStat,children:[e.jsx("span",{className:t.statLabel,children:"Score:"}),e.jsx("span",{className:t.statValue,children:v})]}),e.jsxs("div",{className:t.detectiveStat,children:[e.jsx("span",{className:t.statLabel,children:"Clues Used:"}),e.jsx("span",{className:t.statValue,children:a})]})]})]}),!N&&e.jsxs("div",{className:t.detectiveStartScreen,children:[e.jsx("h2",{children:"Ready to become a manuscript detective?"}),e.jsx("p",{children:"With each clue, you'll get new text information AND the manuscript image becomes clearer!"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Clue 1: Category + Very blurred image"}),e.jsx("li",{children:"Clue 2: Era/Year + Less blurred image"}),e.jsx("li",{children:"Clue 3: Name (who/what it's about) + Clearer image"}),e.jsx("li",{children:"Clue 4: Partial description + Even clearer image"}),e.jsx("li",{children:"Clue 5: Extended description + More detail visible"}),e.jsx("li",{children:"Clue 6: Longer description + Almost clear"}),e.jsx("li",{children:"Clue 7: Full description + Completely clear image"})]}),e.jsx("p",{children:"The fewer clues you use, the more points you earn!"}),e.jsxs("div",{className:t.detectiveScoring,children:[e.jsx("strong",{children:"Scoring:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Guess after 1 clue: 700 points"}),e.jsx("li",{children:"Guess after 2 clues: 600 points"}),e.jsx("li",{children:"Guess after 3 clues: 500 points"}),e.jsx("li",{children:"Guess after 4 clues: 400 points"}),e.jsx("li",{children:"Guess after 5 clues: 300 points"}),e.jsx("li",{children:"Guess after 6 clues: 200 points"}),e.jsx("li",{children:"Guess after 7 clues: 100 points"})]})]}),e.jsx("button",{type:"button",className:"btn-primary",onClick:I,children:"Start Game"})]}),N&&e.jsxs("div",{className:t.detectiveGameScreen,children:[e.jsxs("div",{className:t.clueArea,children:[e.jsx("h2",{children:"Clues"}),e.jsxs("div",{className:t.clueList,children:[h&&e.jsx("div",{className:t.detectiveImageContainer,children:e.jsx("img",{loading:"lazy",decoding:"async",className:`${t.clueImage} ${t.blurred}`,src:h,alt:"Manuscript image",style:{filter:`blur(${Se[Math.max(0,a-1)]}px)`}})}),B.slice(0,a).map(s=>e.jsxs("div",{className:t.clueItem,children:[e.jsx("strong",{children:s.label}),e.jsx("div",{children:s.value})]},s.label))]}),e.jsx("button",{type:"button",className:"btn-secondary",style:{marginTop:20},onClick:k,disabled:a>=x,children:a>=x?"All Clues Revealed":"Reveal Next Clue"})]}),e.jsxs("div",{className:t.detectiveAnswerArea,children:[e.jsx("h2",{children:"Which manuscript is it?"}),e.jsx("div",{className:t.detectiveOptions,children:S.map((s,i)=>{const m=g===i,d=c?.title===s.title,j=[t.detectiveOption,m?t.selected:"",o&&d?t.correct:"",o&&m&&!d?t.incorrect:""].filter(
1Boolean).join(" ");return e.jsx("div",{className:j,role:"button",tabIndex:0,onClick:()=>F(i),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&F(i)},children:e.jsx("div",{className:t.detectiveOptionTitle,children:s.title})},`${s.title}-${i}`)})})]})]}),R&&c&&e.jsx("div",{className:t.detectiveFeedbackScreen,children:e.jsxs("div",{className:t.detectiveFeedbackContent,children:[e.jsx("h2",{className:o==="correct"?t.correct:t.incorrect,children:o==="correct"?"Correct! 🎉":"Incorrect"}),e.jsx("div",{className:t.detectiveFeedbackImage,children:h&&e.jsx("img",{loading:"lazy",decoding:"async",src:h,alt:c.title||"Manuscript"})}),e.jsx("p",{children:o==="correct"?"You identified the manuscript correctly!":`The correct answer was: ${c.title}`}),e.jsxs("div",{className:t.detectiveFeedbackStats,children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Points Earned:"})," ",o==="correct"?A[a-1]:0]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Clues Used:"})," ",a," / 7"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Total Score:"})," ",v]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Round:"})," ",r]})]}),e.jsx("button",{type:"button",className:t.btnInfo,style:{marginBottom:15},onClick:()=>l("/research",{state:{title:c.title}}),children:"📖 More About This Document"}),e.jsxs("div",{style:{marginTop:10},children:[e.jsx("button",{type:"button",className:"btn-primary",onClick:E,children:"Next Round"}),e.jsx("button",{type:"button",className:"btn-secondary",onClick:D,children:"End Game"})]})]})}),T&&e.jsx("div",{className:t.detectiveGameoverScreen,children:e.jsxs("div",{className:t.detectiveGameoverContent,children:[e.jsx("h2",{children:"Game Over!"}),e.jsxs("div",{className:t.detectiveFinalStats,children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Total Rounds:"})," ",r]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Final Score:"})," ",v]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Average Score per Round:"})," ",U]})]}),e.jsx("button",{type:"button",className:"btn-primary",onClick:I,children:"Play Again"}),e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>l("/games"),children:"Back to Games"})]})})]})}export{Fe as ManuscriptDetectivePage};

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.