Skip to content

Commit 801b539

Browse files
feat: add daily cipher page with attempts tracking and solve rate display
style: update layout.css for terms and privacy sections feat: create privacy policy layout and content feat: implement terms of service layout and content
1 parent a767134 commit 801b539

8 files changed

Lines changed: 594 additions & 156 deletions

File tree

package-lock.json

Lines changed: 13 additions & 145 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import './layout.css';
2+
import '../layout.css';
33
import moment from 'moment';
44
import favicon from '$lib/assets/favicon.svg';
55
import { onMount } from 'svelte';
@@ -43,9 +43,9 @@
4343

4444
<nav class="grid grid-cols-[1fr_auto_1fr] items-center pt-4.5 px-1 pb-5.5 gap-3">
4545

46-
<div class="font-mono font-medium text-[15px] tracking-[-0.01em] justify-self-start">
46+
<a href="https://cipherhunt.io" class="font-mono font-medium text-[15px] tracking-[-0.01em] justify-self-start">
4747
<span>cipher</span><span class="text-mint">hunt</span><span class="text-muted">.io</span>
48-
</div>
48+
</a>
4949

5050
<div class="justify-self-center">
5151
<div class="inline-flex items-center gap-1.5 py-1.25 px-2.5 bg-sky/8 border-[0.5px] border-sky/22 rounded-md text-sky font-mono text-[12px] font-normal tracking-[0.04em] whitespace-nowrap">
@@ -68,6 +68,18 @@
6868

6969
<main class="flex flex-col gap-5.5">
7070
{@render children()}
71+
72+
<footer class="flex justify-between pt-4 text-[11px] text-muted">
73+
<span>
74+
cipherhunt.io &copy; {new Date().getFullYear()}. All rights reserved.
75+
</span>
76+
<span>
77+
<a href="/privacy" class="underline hover:text-mint/80">privacy policy</a>
78+
·
79+
<a href="/terms" class="underline hover:text-mint/80">terms of service</a>
80+
</span>
81+
</footer>
82+
7183
</main>
7284
</div>
7385
</div>
Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,43 @@
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}
@@ -112,7 +119,7 @@
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>
@@ -151,4 +158,31 @@
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>

src/routes/layout.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,53 @@ body {
3838
font-weight: 100 900;
3939
font-style: normal;
4040
font-display: swap;
41+
}
42+
43+
main.terms section:first-child {
44+
@apply pt-0
45+
}
46+
47+
main.terms section .content p {
48+
@apply mb-3 text-muted text-[14px] leading-[1.75];
49+
}
50+
51+
main.terms section .content p:last-child {
52+
@apply mb-0;
53+
}
54+
55+
main.terms section .content ul {
56+
@apply mt-1.5 mb-3.5 pl-0 list-none flex flex-col gap-2
57+
}
58+
59+
main.terms section .content ul li {
60+
@apply text-[14px] text-muted leading-[1.7] pl-5.5 relative
61+
}
62+
63+
main.terms section .content ul li::before {
64+
content: '';
65+
@apply absolute left-1.5 top-[0.7em] w-1.25 h-[0.5px] bg-muted/50
66+
}
67+
68+
main.terms section .content div.callout {
69+
@apply bg-mint/5 border-[0.5px] border-mint/20 border-l-2 border-l-mint rounded-r-sm py-3 px-3.5 mt-3.5 mb-1 text-[13px] text-text leading-[1.65]
70+
}
71+
72+
main.terms section .content div.callout span.label {
73+
@apply font-mono text-[10px] tracking-widest uppercase text-mint mb-1 block
74+
}
75+
76+
main.terms section .content dl {
77+
@apply mt-2 mb-1 bg-card border-[0.5px] border-border rounded-md overflow-hidden
78+
}
79+
80+
main.terms section .content dl div {
81+
@apply grid grid-cols-[140px_1fr] gap-3.5 py-2.75 px-3.5 border-[0.5px] border-border
82+
}
83+
84+
main.terms section .content dl div dt {
85+
@apply font-mono text-[12px] text-text/70 tracking-[0.02em]
86+
}
87+
88+
main.terms section .content dl div dd {
89+
@apply m-0 text-[13px] text-muted leading-[1.65]
4190
}

0 commit comments

Comments
 (0)