44
55 let todaysCipherId = 142 ;
66 let todaysCipher = ' WKH RQOB WKLQJ ZH KDYH WRIHDU LV IHDU LWVHOI WKH RQOB WKLQJ ZH KDYH WRIHDU LV IHDU LWVHOI WKH RQOB WKLQJ ZH KDYH WRIHDU LV IHDU LWVHOI'
7-
87 let todaysSolvedCount = 847 ;
98 let todaysStuckCount = 412 ;
109
1110 let todaysSolveRate = todaysSolvedCount > 0 ? ((todaysSolvedCount / (todaysSolvedCount + todaysStuckCount )) * 100 ).toFixed (0 ) : ' 0'
1211
1312 let attempts = [
14- { attempted: true , answer: ' the quick brown fox jumps over the lazy dog' , correct: false },
15- { attempted: true , answer: ' we have nothing to fear but fear itself' , correct: false },
1613 { attempted: false , answer: ' ' , correct: false },
1714 { attempted: false , answer: ' ' , correct: false },
1815 { attempted: false , answer: ' ' , correct: false },
19- { attempted: false , answer: ' ' , correct: false }
16+ { attempted: false , answer: ' ' , correct: false },
17+ { attempted: false , answer: ' ' , correct: false },
18+ { attempted: false , answer: ' ' , correct: false },
2019 ]
2120
21+ let answer: string = $state (' ' );
22+
23+ $effect (() => {
24+ answer = answer .toLowerCase ();
25+ });
26+
2227 </script >
2328
2429{#snippet attempt (num : number = 0 , attempted : boolean = false , anwser : string = " " , correct : boolean = false )}
2530 <div class ="flex items-center gap-2 border-[0.5px] {attempted ? ' bg-card border-border' : ' border-dashed border-white/8' } rounded-md px-2.25 py-3.5 h-10.5" >
2631 <div class =" font-mono text-[10px] text-muted tracking-widest opacity-70 shrink-0" >
2732 {num .toString ().padStart (2 , ' 0' )}
2833 </div >
29- <div class ="flex-[1_1_0%] font-mono text-[13px] {correct ? ' text-text' : ' text-muted' } whitespace-nowrap overflow-hidden text-ellipsis tracking-[0.02em]" >
30- {anwser }
31- </div >
3234 {#if attempted }
35+ <div class ="flex-[1_1_0%] font-mono text-[13px] {correct ? ' text-text' : ' text-muted' } whitespace-nowrap overflow-hidden text-ellipsis tracking-[0.02em]" >
36+ {anwser }
37+ </div >
3338 <div class ="shrink-0 inline-flex items-center gap-1.25 text-[11px] font-medium py-1 px-2.25 rounded-md border-[0.5px] {correct ? ' bg-mint/18 border-mint/36 text-mint' : ' bg-white/3 border-border text-muted' } font-sans tracking-[0.02em]" >
3439 <span >{correct ? ' ✓' : ' ✗' }</span >
3540 <span >{correct ? ' correct' : ' wrong' }</span >
3641 </div >
42+ {:else }
43+ <div class =" flex-[1_1_0%] h-px bg-[repeating-linear-gradient(90deg,rgba(255,255,255,0.08)_0px,rgba(255,255,255,0.08)_4px,transparent_4px,transparent_8px)]" ></div >
3744 {/if }
3845 </div >
3946{/ snippet }
112119</div >
113120
114121
115- <div class =" flex flex-col gap-2 bg-surface border-[0.5px] border-border rounded-md px-4 pt-4 pb-4.5" >
122+ <section class =" flex flex-col gap-2 bg-surface border-[0.5px] border-border rounded-md px-4 pt-4 pb-4.5" >
116123
117124 <div class =" text-[11px] tracking-widest uppercase text-muted font-medium pt-px px-0.5 pb-1" >
118125 <span >Attempts</span >
151158
152159 </div >
153160
161+ </section >
162+
163+ <div class =" flex flex-col gap-1.5" >
164+
165+ <div class =" flex items-center gap-2 bg-card border border-border-strong rounded-md py-1.5 px-1.5 pl-3.5" >
166+ <input bind:value ={answer } type =" text" name =" answer" id =" answer" class =" flex-[1_1_0%] min-w-0 appearance-none outline-none bg-transparent py-2 font-mono text-[14px] text-text tracking-[0.02em]" placeholder =" Type your answer here..." >
167+ <button class ="appearance-none border-[0.5px] rounded-md py-2 px-3.5 font-mono text-[12px] font-medium tracking-[0.03em] inline-flex items-center gap-1.5 transition-colors whitespace-nowrap {answer ? ' cursor-pointer border-mint/36 bg-mint/16 text-mint' : ' cursor-default bg-transparent border-border text-muted' }" >
168+ <span >
169+ submit
170+ </span >
171+ <svg width =" 12" height =" 12" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 1.5" stroke-linecap =" round" stroke-linejoin =" round" style =" display: block; flex-shrink: 0;" data-om-id =" jsx:/https:/cf29dfbe-6a21-46d5-bcff-383c3e39d5bb.claudeusercontent.com/v1/design/projects/cf29dfbe-6a21-46d5-bcff-383c3e39d5bb/serve/app.jsx:335:9:3" ><path d =" M5 12h14M13 6l6 6-6 6" data-om-id =" jsx:/https:/cf29dfbe-6a21-46d5-bcff-383c3e39d5bb.claudeusercontent.com/v1/design/projects/cf29dfbe-6a21-46d5-bcff-383c3e39d5bb/serve/app.jsx:1994:62:5" ></path ></svg >
172+ </button >
173+ </div >
174+
175+ <div class =" flex justify-between items-center px-0.5" >
176+ <div class =" text-[11px] text-muted" >
177+ <span >
178+ Press Enter to submit · max 10 words
179+ </span >
180+ </div >
181+ <div class =" font-mono text-[10px] tracking-[0.04em] text-muted opacity-50 whitespace-nowrap transition-colors" >
182+ <span >
183+ {answer .length ? answer .trim ().split (' ' ).length : ' 0' }/10 words
184+ </span >
185+ </div >
186+ </div >
187+
154188</div >
0 commit comments